/* ════════════════════════════════════════════════════════════
   CATALOG PAGE  (/catalog)
   ════════════════════════════════════════════════════════════ */
.catalog-page {
  padding: calc(80px + 48px) 0 100px;
  background: var(--cream);
  min-height: 70vh;
}

.catalog-breadcrumbs {
  font-size: 13px;
  color: var(--muted-2);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}
.catalog-breadcrumbs a { color: var(--muted); text-decoration: none; }
.catalog-breadcrumbs a:hover { color: var(--ink); }
.catalog-breadcrumbs .sep { margin: 0 8px; color: var(--line-2); }
.catalog-breadcrumbs .current { color: var(--muted-2); }

.catalog-page-head { margin-bottom: 40px; }
.catalog-page-title {
  font-family: 'Cormorant', serif;
  font-weight: 400;
  font-size: 44px;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 8px;
}
.catalog-page-count {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 48px;
  align-items: start;
}

/* ── Mobile-only elements (hidden on desktop) ── */
.catalog-mbar,
.catalog-filters__head,
.catalog-scrim { display: none; }

/* ── Filters sidebar ── */
.catalog-filters { width: 270px; }
.filters-form { display: flex; flex-direction: column; gap: 30px; max-width: 250px; }
.filter-group { display: flex; flex-direction: column; gap: 12px; }
.filter-group__title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 2px;
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink-2);
}
.filter-check input { position: absolute; opacity: 0; pointer-events: none; }
.filter-check__box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line-2);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}
.filter-check input:checked + .filter-check__box {
  background: var(--ink);
  border-color: var(--ink);
}
.filter-check input:checked + .filter-check__box::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid var(--paper);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.filter-check__label { flex: 1; }
.filter-check__count { font-size: 13px; color: var(--muted-2); }

.filter-swatches {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  justify-items: center;
}
.swatch { cursor: pointer; line-height: 0; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch__dot {
  display: inline-block;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  /* белый зазор + кольцо: при активном состоянии кольцо становится чёрным */
  box-shadow: 0 0 0 2px var(--cream), 0 0 0 2px transparent;
  transition: box-shadow 0.15s ease;
}
.swatch:hover .swatch__dot {
  box-shadow: 0 0 0 2px var(--cream), 0 0 0 3px var(--line-2);
}
.swatch.is-active .swatch__dot,
.swatch input:checked + .swatch__dot {
  box-shadow: 0 0 0 2px var(--cream), 0 0 0 3px var(--ink);
}

.filter-price { display: flex; align-items: center; gap: 10px; }
.filter-price input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper);
}
.filter-price input:focus { outline: none; border-color: var(--ink); }
.filter-price__dash { color: var(--muted-2); }

/* Dual price range slider */
.filter-range {
  position: relative;
  height: 18px;
  margin-top: 18px;
}
.filter-range__track,
.filter-range__fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  border-radius: 3px;
}
.filter-range__track {
  left: 0;
  right: 0;
  background: var(--line-2);
}
.filter-range__fill {
  background: var(--ink);
}
.filter-range__input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 18px;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.filter-range__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.12s ease;
}
.filter-range__input::-webkit-slider-thumb:hover { transform: scale(1.12); }
.filter-range__input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
  cursor: pointer;
  pointer-events: auto;
}
.filter-range__input::-moz-range-track { background: none; }

.filter-actions { display: flex; gap: 10px; align-items: stretch; flex-wrap: nowrap; }
.filter-apply { flex: 1; padding: 11px 16px; font-size: 13px; white-space: nowrap; text-align: center; }
.filter-reset { flex: 1; padding: 11px 16px; font-size: 13px; white-space: nowrap; text-align: center; }

/* ── Main column ── */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.catalog-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--cream-2);
  border: none;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}
.chip:hover { background: var(--line-2); }
.chip__x { font-size: 15px; line-height: 1; color: var(--muted); }

.catalog-sort { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.sort-label { font-size: 14px; color: var(--muted); }

/* Custom sort dropdown */
.sort-dd { position: relative; }
.sort-dd__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  justify-content: space-between;
  padding: 9px 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--paper);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.sort-dd__btn:hover { border-color: var(--ink); }
.sort-dd.is-open .sort-dd__btn { border-color: var(--ink); }
.sort-dd__chevron { color: var(--muted); transition: transform 0.18s ease; flex-shrink: 0; }
.sort-dd.is-open .sort-dd__chevron { transform: rotate(180deg); }

.sort-dd__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 14, 12, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 50;
}
.sort-dd.is-open .sort-dd__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.sort-dd__option {
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.sort-dd__option:hover { background: var(--cream); color: var(--ink); }
.sort-dd__option.is-active { background: var(--cream-2); color: var(--ink); font-weight: 600; }
.sort-dd__option:focus { outline: none; background: var(--cream); }


.catalog-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 16px;
  color: var(--muted);
}
.catalog-empty p { margin-bottom: 18px; font-size: 16px; max-width: 100%; }

/* ── Catalog responsive ── */
@media (max-width: 1024px) {
  .catalog-layout { grid-template-columns: 250px 1fr; gap: 32px; }
  .catalog-filters { width: 250px; }
  .catalog-products { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --header-h: 88px; }

  .catalog-page { padding: 100px 0 64px; overflow-x: clip; }
  .catalog-page-title { font-size: 32px; }
  .catalog-page-head { margin-bottom: 18px; }
  .catalog-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .catalog-toolbar { display: none; }

  /* ── Sticky bar ── */
  .catalog-mbar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--header-h, 88px);
    z-index: 30;
    padding: 10px 0 0;
    margin: 0 0 20px;
    background: rgba(245, 243, 240, 0.86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  /* Кнопка «Фильтры» — во всю ширину */
  .mbar-filters {
    width: 100%;
    height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: var(--paper);
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    transition: border-color 0.18s;
  }
  .mbar-filters:hover { border-color: var(--muted-2); }
  .mbar-filters svg { flex-shrink: 0; }
  .mbar-filters__count {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
  }

  /* Вкладки тканей */
  .mbar-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 14px 0 12px;
  }
  .mbar-tabs::-webkit-scrollbar { display: none; }

  .mbar-tab {
    flex-shrink: 0;
    padding: 0 4px;
    margin-right: 24px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    line-height: 1;
    transition: color 0.15s;
  }
  .mbar-tab:last-child { margin-right: 0; }
  .mbar-tab::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    bottom: -4px;
    height: 2px;
    border-radius: 1px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.15s;
  }
  .mbar-tab.is-active { color: var(--ink); font-weight: 600; }
  .mbar-tab.is-active::after { opacity: 1; }

  /* Разделитель */
  .mbar-divider {
    height: 1px;
    background: var(--line);
    margin: 0;
  }

  /* ── Скрим ── */
  .catalog-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(15, 14, 12, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }
  body.is-filters-open .catalog-scrim { opacity: 1; pointer-events: auto; }

  /* ── Bottom sheet ── */
  .catalog-filters {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 61;
    width: auto;
    max-height: 88%;
    background: var(--paper);
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -24px 60px -16px rgba(15, 14, 12, 0.36);
    display: flex;
    flex-direction: column;
    padding: 0;
    transform: translateY(102%);
    transition: transform 0.36s cubic-bezier(.32, .72, 0, 1);
  }
  body.is-filters-open .catalog-filters { transform: translateY(0); }

  /* Шапка шторки */
  .catalog-filters__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px 16px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    flex-wrap: wrap;
  }

  /* Handle */
  .catalog-filters__handle {
    width: 42px;
    height: 4px;
    border-radius: 2px;
    background: none;
    flex-basis: 100%;
    margin: 0;
  }

  .catalog-filters__title {
    font-family: 'Cormorant', serif;
    font-weight: 400;
    font-size: 24px;
    color: var(--ink);
    flex: 1;
  }

  .catalog-filters__reset {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid var(--line-2);
    padding-bottom: 1px;
    transition: color 0.15s, border-color 0.15s;
  }
  .catalog-filters__reset:hover { color: var(--ink); border-color: var(--ink); }

  .catalog-filters__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s;
  }
  .catalog-filters__close:hover { border-color: var(--muted-2); }

  /* Тело шторки */
  .filters-form {
    max-width: none;
    gap: 0;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 0;
    flex: 1;
  }
  .filters-form::-webkit-scrollbar { display: none; }

  .filter-group {
    gap: 14px;
    padding: 22px 18px;
    border-bottom: 1px solid var(--line);
  }

  .filter-group__title {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 4px;
  }

  /* Swatches touch-friendly */
  .filter-swatches { grid-template-columns: repeat(6, 1fr); gap: 14px; }
  .filter-swatches .swatch__dot { width: 40px; height: 40px; }

  /* Футер */
  .filter-actions {
    position: sticky;
    bottom: 0;
    background: var(--paper);
    border-top: 1px solid var(--line);
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    margin: 0;
    gap: 10px;
    display: flex;
  }
  .filter-reset {
    flex: 0 0 auto;
    height: 52px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    white-space: nowrap;
  }
  .filter-apply {
    flex: 1;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    white-space: nowrap;
  }

  body.is-filters-open { overflow: hidden; }
}

@media (max-width: 560px) {
  .mbar-filters { font-size: 13px; }
  .catalog-filters { max-height: 90vh; }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-filters { transition: none; }
  .catalog-scrim { transition: none; }
}

/* ── catalog-empty: editorial «no results» state ─────────────────── */
.catalog-empty {
  position: relative;
  min-height: 620px;
  margin-top: 24px;
  padding: 72px 40px 64px;
  border: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: none;
}

.catalog-empty__bg {
  position: absolute;
  left: 0;
  right: 0;
  top: 38%;
  transform: translateY(-50%);
  font-family: 'English111VivaceBT', cursive;
  font-size: 300px;
  line-height: 1;
  color: var(--ink);
  opacity: .035;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  text-align: center;
  overflow: hidden;
}

.catalog-empty__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 540px;
}

/* Medallion */
.catalog-empty__medallion {
  position: relative;
  width: 172px;
  height: 172px;
  border-radius: 50%;
  padding: 7px;
  margin-bottom: 30px;
  background: var(--paper);
  box-shadow: 0 26px 60px -32px rgba(15, 14, 12, .42);
}

.catalog-empty__ring {
  position: absolute;
  inset: -11px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  opacity: .7;
}

.catalog-empty__disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  background: var(--cream-2);
}

.catalog-empty__disc img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.62) brightness(1.05);
}

.catalog-empty__disc::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 50% 22%, rgba(245, 243, 240, .1) 30%, rgba(245, 243, 240, .7) 100%);
}

.catalog-empty__badge {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--accent);
  display: grid;
  place-items: center;
  border: 4px solid var(--cream);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Title & text */
.catalog-empty__title {
  font-family: 'Cormorant', serif;
  font-weight: 400;
  font-size: 42px;
  line-height: 1.05;
  margin: 0 0 14px;
  color: var(--ink);
}

.catalog-empty__text {
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--muted);
  max-width: 44ch;
  margin: 0 auto 26px;
  text-wrap: pretty;
}

/* Applied filters recap */
.catalog-empty__applied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .7);
  margin-bottom: 30px;
  max-width: 100%;
}

.catalog-empty__applied-lbl {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-right: 4px;
}

.catalog-empty__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}

.catalog-empty__chip .sw {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(15, 14, 12, .12);
  flex-shrink: 0;
}

.catalog-empty__chip .x {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  display: inline-grid;
  place-items: center;
  background: var(--cream-2);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}

.catalog-empty__chip .x:hover {
  background: var(--ink);
  color: #fff;
}

.catalog-empty__reset {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 4px;
  transition: text-decoration-color .15s;
}

.catalog-empty__reset:hover {
  text-decoration-color: var(--accent);
}

/* Promise line */
.catalog-empty__promise {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 30px;
  color: var(--ink-2);
}

.catalog-empty__promise::before,
.catalog-empty__promise::after {
  content: '';
  width: 44px;
  height: 1px;
  background: var(--line-2);
  flex-shrink: 0;
}

.catalog-empty__promise span {
  font-family: 'Cormorant', serif;
  font-style: italic;
  font-size: 20px;
  white-space: nowrap;
}

/* CTA buttons */
.catalog-empty__cta {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.catalog-empty__cta .btn {
  white-space: nowrap;
}

/* Entrance animation */
@media (prefers-reduced-motion: no-preference) {
  .catalog-empty__medallion {
    animation: ce-float-in .55s cubic-bezier(.22, 1, .36, 1) both;
  }
  .catalog-empty__inner > *:not(.catalog-empty__medallion) {
    animation: ce-fade-up .45s cubic-bezier(.22, 1, .36, 1) .1s both;
  }
}

@keyframes ce-float-in {
  from { opacity: 0; transform: translateY(-12px) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ce-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Responsive ≤768px */
@media (max-width: 768px) {
  .catalog-empty {
    min-height: auto;
    margin-top: 12px;
    padding: 24px 20px 32px;
  }

  .catalog-empty__bg { font-size: 140px; }

  .catalog-empty__medallion {
    width: 116px;
    height: 116px;
    margin-bottom: 20px;
  }

  .catalog-empty__badge {
    width: 42px;
    height: 42px;
  }

  .catalog-empty__title {
    font-size: 27px;
  }

  .catalog-empty__text {
    font-size: 13.5px;
    max-width: 34ch;
    margin-bottom: 20px;
  }

  .catalog-empty__applied-lbl {
    flex-basis: 100%;
    margin: 0 0 2px;
  }

  .catalog-empty__chip {
    font-size: 12px;
    padding: 5px 6px 5px 11px;
  }

  .catalog-empty__chip .x {
    width: 18px;
    height: 18px;
  }

  .catalog-empty__promise span {
    font-size: 15px;
    white-space: normal;
    text-align: center;
  }

  .catalog-empty__promise::before,
  .catalog-empty__promise::after {
    width: 22px;
  }

  .catalog-empty__cta {
    flex-direction: column;
    width: 100%;
  }

  .catalog-empty__cta .btn {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
