/* ——— Catalog hero: светлый, крупная типографика ——— */
.catalog-hero {
  background: #fff;
  color: var(--text);
  padding: 56px 22px 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.catalog-hero-compact { padding: 40px 22px 32px; }
.catalog-hero-compact h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 10px; font-weight: 600; letter-spacing: -0.03em; }
.catalog-hero-compact p { font-size: 17px; color: var(--text-2); letter-spacing: -0.022em; }
.catalog-hero h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 600; line-height: 1.08; margin-bottom: 12px; letter-spacing: -0.04em; }
.catalog-hero p { font-size: 19px; color: var(--text-2); max-width: 640px; margin: 0 auto; line-height: 1.42; }

.scenario-banner { max-width: var(--page-max); margin: 0 auto; padding: 24px 22px 0; }
.scenario-banner-inner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--bg);
  border: none;
}
.scenario-banner-icon { font-size: 28px; line-height: 1; }
.scenario-banner-title { font-size: 19px; font-weight: 600; color: var(--text); margin-bottom: 6px; letter-spacing: -0.02em; }
.scenario-banner-text { font-size: 15px; line-height: 1.47; color: var(--text-2); }

.catalog-size-banner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 16px 22px 0;
}
.catalog-size-banner__inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f5f9ff 0%, #fff 70%);
  border: 1px solid rgba(0, 113, 227, 0.12);
}
.catalog-size-banner__icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.catalog-size-banner__copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.45;
}
.catalog-size-banner__copy strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.catalog-section-banner {
  grid-column: 1 / -1;
  min-height: 120px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid rgba(15, 23, 42, 0.06);
  margin: 4px 0 8px;
}

.catalog-section-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 120px;
  padding: 22px 28px;
}

.catalog-section-banner__copy {
  min-width: 0;
}

.catalog-section-banner__title {
  margin: 0 0 6px;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
}

.catalog-section-banner__subtitle {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-2);
  max-width: 720px;
}

.catalog-section-banner__count {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
}

.catalog-section-banner__link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.catalog-section-banner__link:hover {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.18);
  transform: translateY(-1px);
}

.catalog-section-banner--centurion {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.catalog-section-banner--delta {
  background: linear-gradient(135deg, #f8fafc 0%, #ecfeff 100%);
}

.catalog-section-banner--agat {
  background: linear-gradient(135deg, #f8fafc 0%, #f0fdf4 100%);
}

.catalog-section-banner--hidden {
  background: linear-gradient(135deg, #f8fafc 0%, #faf5ff 100%);
}

.catalog-section-banner--smart_lock {
  background: linear-gradient(135deg, #f8fafc 0%, #fff7ed 100%);
}

.catalog-section-banner--mylock {
  background: linear-gradient(135deg, #f8fafc 0%, #fff7ed 100%);
}

.catalog-section-banner--smart_electronics {
  background: linear-gradient(135deg, #f8fafc 0%, #f5f3ff 100%);
}

.catalog-section-banner--entrance_group {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
}

/* ——— Filters: минимальный toolbar ——— */
.filters-section {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 22px;
  position: sticky;
  top: var(--site-header-h, 52px);
  z-index: 90;
  max-height: 120px;
}

.filters-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 10px 0;
  min-height: 44px;
}

.brand-tabs-compact {
  display: flex;
  flex: 1;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.brand-tabs-compact::-webkit-scrollbar { display: none; }

.brand-pill {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--bg);
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.brand-pill:hover { color: var(--text); background: #EBEBED; }
.brand-pill.active { background: var(--text); color: #fff; }

.filters-toolbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.btn-filters-toggle {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
}
.btn-filters-toggle:hover { background: #EBEBED; }
.btn-filters-toggle.has-active,
.btn-filters-toggle[aria-expanded="true"] { background: var(--text); color: #fff; }

.sort-select {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  max-width: 140px;
  font-family: var(--font);
}

.active-chips-bar {
  display: none;
  align-items: center;
  gap: 8px;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 0 8px;
}
.active-chips-bar.has-chips { display: flex; }
.active-chips-row { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.active-chip:hover { background: #EBEBED; }

.btn-reset-inline {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

.filters-panel {
  display: none;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--site-header-h, 52px) + 52px);
  width: min(var(--page-max), calc(100vw - 32px));
  max-height: min(220px, 40vh);
  overflow-y: auto;
  padding: 16px 20px;
  background: #fff;
  border: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
}
.filters-panel.open { display: block; }

.filter-compact-group { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.filter-compact-label {
  width: 80px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  padding-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.filter-compact-group .chips-row { padding: 0; margin: 0; flex: 1; flex-wrap: wrap; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  background: var(--bg);
  user-select: none;
  transition: all .15s;
}
.chip:hover { color: var(--text); background: #EBEBED; }
.chip.active { background: var(--text); color: #fff; }
.filter-count { font-size: 10px; opacity: 0.75; }

.filters-panel-footer { display: none; gap: 8px; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--border); }
.btn-apply-filters { background: var(--accent); color: #fff; border: none; border-radius: var(--radius-pill); flex: 1; padding: 12px; font-weight: 500; cursor: pointer; }
.btn-reset-filters { background: var(--bg); border: none; border-radius: var(--radius-pill); flex: 1; padding: 12px; color: var(--text-2); cursor: pointer; }

.filters-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 180; }
.filters-backdrop.open { display: block; }
.mobile-only { display: none; }

.results-bar {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 16px 22px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.results-bar .count { font-size: 14px; color: var(--text-2); font-weight: 400; }

.empty-state { text-align: center; padding: 96px 22px; display: none; }
.empty-state h3 { font-size: 24px; font-weight: 600; color: var(--text); margin-bottom: 8px; letter-spacing: -0.03em; }

/* ——— Product grid ——— */
.catalog-grid {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 8px 22px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.door-card {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  transition: transform .3s ease;
  cursor: pointer;
  border: none;
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}
.door-card:hover { transform: translateY(-4px); box-shadow: none; }

.card-img-wrap {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius);
  height: 320px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  margin-bottom: 16px;
}

.card-img-pair {
  display: flex;
  flex-direction: row;
  flex: 1;
  gap: 4px;
  padding: 16px 16px 8px;
  min-width: 0;
}
.card-img-side { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.card-img-frame { flex: 1; width: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
/* RC20: fill the fixed-height image container and contain (no crop, centered).
   width/height 100% lets small source images scale up to the same visual size
   as large ones, while object-fit: contain preserves aspect ratio. */
.card-door-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform .4s ease;
}
.card-img-label { font-size: 10px; color: var(--text-3); text-align: center; margin-top: 6px; flex-shrink: 0; }
.card-img-single { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 20px; }
.card-img-single .card-door-img { width: 100%; height: 100%; }
.card-img-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: var(--bg); color: var(--text-3); font-size: 14px; }
.door-card:hover .card-door-img:not(.is-placeholder) { transform: scale(1.04); }

.card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
}
.card-badge.termo { color: #0F766E; }
.card-badge.special { color: #6D28D9; }
.card-badge.entrance-group { color: #0F766E; }
.card-badge.hidden-door { color: #6D28D9; }
.card-badge.smart-lock { color: #B45309; }
.card-badge.sale { background: #FF3B30; color: #fff; top: 14px; left: auto; right: 14px; }
.card-badge.clearance {
  background: #FF9500;
  color: #fff;
  top: 14px;
  left: auto;
  right: 14px;
  font-weight: 700;
}
.price-hint.clearance-hint { color: #C2410C; font-weight: 600; }

.link-entrance-groups {
  display: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}
@media (min-width: 900px) { .link-entrance-groups { display: inline-flex; } }

.card-body {
  padding: 0 4px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.card-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 132px;
}
.card-series { font-size: 12px; font-weight: 400; color: var(--text-2); margin-bottom: 4px; letter-spacing: -0.01em; flex-shrink: 0; }
.card-name {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
  min-height: 3.6em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.card-meta {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 0;
  line-height: 1.4;
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  padding-top: 12px;
  flex-shrink: 0;
}
.card-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.price-main { font-size: 21px; font-weight: 600; letter-spacing: -0.03em; }
.price-hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
  margin-top: 6px;
  max-width: 280px;
  min-height: 2.8em;
}
.price-hint:empty {
  visibility: hidden;
}
.price-variants { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.price-old { font-size: 14px; color: var(--text-3); text-decoration: line-through; }
.price-save { font-size: 13px; color: var(--green); font-weight: 500; }

.btn-card {
  display: inline-block;
  margin-top: 12px;
  width: auto;
  background: transparent;
  color: var(--accent);
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 400;
  text-align: left;
}

/* скрыть старые таблицы если остались в DOM */
.card-desc, .card-specs { display: none !important; }

.catalog-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 16px;
  max-width: 1200px;
  margin: 0 auto;
}
.catalog-section-tab {
  border: 1px solid var(--border, #e5e7eb);
  background: #fff;
  color: var(--text, #111827);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.catalog-section-tab.active {
  background: var(--accent, #1f6b45);
  border-color: var(--accent, #1f6b45);
  color: #fff;
}
.catalog-section-tab--link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.catalog-section-tab--link:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.optima-collection-bar {
  max-width: 1200px;
  margin: 0 auto 12px;
  padding: 0 24px;
}
.optima-collection-bar .filter-compact-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted, #6b7280);
}
.chips-optima-collection {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* RC18B: бар поставщика для скрытых дверей (AXEL / PRO DESIGN) */
.hidden-brand-bar {
  max-width: 1200px;
  margin: 0 auto 12px;
  padding: 0 24px;
}
.hidden-brand-bar .filter-compact-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted, #6b7280);
}
.chips-hidden-brand {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-hidden-brand {
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border-color, #e5e7eb);
  background: var(--bg-card, #fff);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #374151);
  transition: all 0.15s ease;
  user-select: none;
}
.chip-hidden-brand:hover {
  border-color: var(--accent-color, #2563eb);
  color: var(--accent-color, #2563eb);
}
.chip-hidden-brand.active {
  background: var(--accent-color, #2563eb);
  border-color: var(--accent-color, #2563eb);
  color: #fff;
}

@media (max-width: 768px) {
  .catalog-section-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 0 16px 12px;
    max-width: none;
  }
  .catalog-section-tabs::-webkit-scrollbar { display: none; }

  .catalog-section-tab,
  .catalog-section-tab--link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Нижняя строка: бренды + фильтры + сортировка — один горизонтальный scroll */
  .filters-section {
    max-height: none;
    padding: 0;
    overflow: visible;
  }

  .filters-toolbar {
    max-width: none;
    margin: 0;
    padding: 8px 16px 10px;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    align-items: center;
    min-height: 0;
  }
  .filters-toolbar::-webkit-scrollbar { display: none; }

  .brand-tabs-compact {
    flex: 0 0 auto;
    min-width: auto;
    overflow: visible;
    flex-wrap: nowrap;
  }

  .brand-pill {
    flex: 0 0 auto;
  }

  .filters-toolbar-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .btn-filters-toggle,
  .sort-select {
    flex: 0 0 auto;
  }

  .sort-select {
    max-width: none;
    width: auto;
  }

  .active-chips-bar {
    padding: 0 16px 8px;
  }
}

/* Skeleton loader — visible until first catalog paint */
.catalog-grid--loading {
  min-height: 420px;
}
.catalog-skeleton {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0;
  animation: catalog-skeleton-pulse 1.2s ease-in-out infinite;
}
.catalog-skeleton-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: linear-gradient(110deg, #f3f4f6 8%, #eceff3 18%, #f3f4f6 33%);
  background-size: 200% 100%;
}
.catalog-skeleton-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.catalog-skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: #eceff3;
  width: 88%;
}
.catalog-skeleton-line.short { width: 56%; }
.catalog-skeleton-line.price { width: 42%; height: 18px; margin-top: 4px; }
@keyframes catalog-skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

@media (max-width: 640px) {
  .catalog-hero-compact { padding: 24px 16px 20px; }
  .catalog-hero-compact h1 { font-size: 26px; }
  .catalog-grid { grid-template-columns: 1fr; padding: 8px 16px 80px; gap: 36px; }
  .catalog-section-banner__inner {
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
    padding: 18px 16px;
  }
  .catalog-section-banner__link { width: 100%; }
  .card-img-wrap { height: 280px; }
  .filters-panel {
    left: 0; right: 0; bottom: 0; top: auto; width: 100%;
    transform: translateY(110%); transition: transform .3s ease;
    border-radius: 20px 20px 0 0; max-height: 78vh;
  }
  .filters-panel.open { display: block; transform: translateY(0); }
  .filters-panel-footer.mobile-only { display: flex; position: sticky; bottom: 0; background: #fff; }
  body.filters-sheet-open { overflow: hidden; }
}
