.families-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px clamp(18px, 4vw, 56px) 80px;
}

.families-hero {
  max-width: 780px;
  margin-bottom: 28px;
}

.families-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.02;
}

.families-hero p:last-child {
  color: var(--muted);
  font-size: 17px;
}

.families-panel,
.family-catalog {
  background: var(--white);
  border: 1px solid rgba(22, 32, 42, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.families-panel {
  padding: 18px;
}

.family-auth-actions {
  justify-content: flex-start;
  margin-top: 16px;
}

.families-toolbar,
.family-catalog-header {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.families-toolbar {
  margin-bottom: 16px;
}

.families-toolbar strong {
  color: var(--muted);
  white-space: nowrap;
}

.families-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 10px;
}

.family-tile {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 76px;
  padding: 10px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.family-tile:hover,
.family-tile.active {
  border-color: var(--blue);
  background: #f0f7fc;
}

.family-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  background: #edf3f8;
  color: var(--blue);
  font-weight: 900;
  font-size: 13px;
}

.family-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.family-name {
  display: block;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 900;
}

.family-tile .family-promo-badge {
  min-height: 18px;
  margin-bottom: 4px;
  padding: 0 6px;
  font-size: 8px;
  line-height: 1.1;
  white-space: normal;
}

.family-total {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.family-limit-note {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px dashed #cbd7e2;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.family-catalog {
  margin-top: 22px;
  padding: 18px;
}

.family-catalog-header {
  margin-bottom: 16px;
}

.family-catalog-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 112px;
  gap: 10px;
  align-items: end;
}

.family-catalog-tools label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.family-catalog-tools select {
  min-height: 52px;
  font-weight: 900;
}

.family-pagination {
  border-top: 0;
  border-bottom: 1px solid #e4e9ef;
}

.family-pagination:last-child {
  border-top: 1px solid #e4e9ef;
  border-bottom: 0;
}

.pagination-gap {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  color: var(--muted);
  font-weight: 900;
}

.family-catalog-header h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
}

.family-catalog .catalog-preview {
  margin-top: 0;
  box-shadow: none;
}

.family-catalog .catalog-preview table {
  min-width: 920px;
  table-layout: fixed;
}

.family-catalog .catalog-preview th,
.family-catalog .catalog-preview td {
  padding: 8px 10px;
  font-size: 13px;
  vertical-align: middle;
}

.family-catalog .catalog-preview th:nth-child(1),
.family-catalog .catalog-preview td:nth-child(1) {
  width: 64px;
}

.family-catalog .catalog-preview th:nth-child(2),
.family-catalog .catalog-preview td:nth-child(2) {
  width: 130px;
}

.family-catalog .catalog-preview th:nth-child(3),
.family-catalog .catalog-preview td:nth-child(3) {
  width: 130px;
}

.family-catalog .catalog-preview th:nth-child(5),
.family-catalog .catalog-preview td:nth-child(5) {
  width: 110px;
}

.family-catalog .catalog-preview th:nth-child(6),
.family-catalog .catalog-preview td:nth-child(6) {
  width: 160px;
}

.family-catalog .catalog-preview th:nth-child(7),
.family-catalog .catalog-preview td:nth-child(7) {
  width: 78px;
  text-align: center;
}

.family-catalog .article-photo {
  width: 42px;
  height: 42px;
  font-size: 11px;
}

.family-catalog .product-designation {
  font-size: 12px;
  line-height: 1.15;
}

.family-catalog .price-ht strong {
  font-size: 17px;
}

.family-catalog .price-ht span {
  font-size: 11px;
}

.family-catalog .discount-price {
  gap: 4px;
}

.family-catalog .price-stack {
  display: inline-grid;
  gap: 5px;
  align-items: start;
}

.family-catalog .quantity-offer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-height: 20px;
  margin-top: 5px;
  padding: 0 7px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #e5332d, #ff7a18);
  box-shadow: 0 8px 18px rgba(229, 51, 45, 0.18);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.family-catalog .price-drop-badge {
  background: linear-gradient(135deg, #087b86, #18c7d1);
  box-shadow: 0 8px 20px rgba(24, 199, 209, 0.24);
}

.family-catalog .quantity-down-arrow {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  color: #ffffff;
  background: #d92525;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.family-catalog .quantity-flame {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  font-size: 13px;
  line-height: 1;
}

.family-catalog .quantity-saving {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 999px;
  color: #08724f;
  background: rgba(225, 249, 241, 0.95);
  font-size: 9px;
  font-weight: 900;
}

.family-catalog .quantity-offer-detail {
  display: grid;
  width: fit-content;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 122, 24, 0.35);
  border-radius: 8px;
  color: #8f2b00;
  background: #fff3e4;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
}

.family-catalog .price-drop-detail {
  border-color: rgba(24, 199, 209, 0.5);
  color: #005f68;
  background: linear-gradient(180deg, #f0feff, #ffffff);
}

.family-catalog .price-drop-detail strong {
  color: #005f68;
}

.family-catalog .quantity-price-arrow {
  color: #d92525;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
}

.family-catalog .quantity-offer-detail .price-ht {
  color: #c5271f;
}

.family-catalog .quantity-offer-detail .price-ht strong {
  font-size: 15px;
}

.family-catalog .quantity-offer-final .price-ht strong {
  font-size: 17px;
}

.family-catalog .price-drop-detail .quantity-offer-final .price-ht {
  color: #007f72;
}

.family-catalog .price-drop-detail .quantity-offer-final .price-ht strong {
  font-size: 22px;
}

.family-catalog .quantity-offer-old {
  color: var(--red);
}

.family-catalog .quantity-offer-old .price-ht {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: #000000;
}

.family-catalog .quantity-offer-old .price-ht strong {
  font-size: 12px;
}

.family-catalog .quantity-offer-old .price-ht span {
  font-size: 9px;
}

.family-catalog .promotion-label {
  min-height: 20px;
  padding: 0 7px;
  font-size: 10px;
  margin-bottom: 3px;
}

.family-order-button {
  width: 36px;
  height: 32px;
}

.family-order-button svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 720px) {
  .families-toolbar,
  .family-catalog-header,
  .family-catalog-tools {
    grid-template-columns: 1fr;
  }
}
