/* =========================================================
   Products catalog page — /products/
   - editorial hero + 4 stat tiles
   - sticky filter chips (series + colour)
   - flat grid of all SKUs (uses the shared .lens-card)
   - a series tag floating on each card image
   ========================================================= */

/* ----- Hero ----- */
.catalog-hero {
  position: relative;
  padding: calc(var(--header-h) + 80px) 0 clamp(60px, 10vh, 120px);
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}
.catalog-hero__bg {
  position: absolute; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.catalog-hero__bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* Soft cream wash so dark headline stays readable over photography */
.catalog-hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(243, 236, 225, 0.92) 0%, rgba(243, 236, 225, 0.55) 45%, rgba(243, 236, 225, 0.25) 100%),
    linear-gradient(180deg, transparent 0%, rgba(233, 223, 206, 0.55) 100%);
  pointer-events: none;
}
.catalog-hero > .container {
  position: relative;
  z-index: 2;
}
.catalog-hero__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 14px 0 28px;
  max-width: 18ch;
}
.catalog-hero__lede {
  font-size: clamp(1rem, 1.2vw, 1.18rem);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 720px;
  margin: 0 0 60px;
}

.catalog-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.catalog-stat {
  padding: 28px 24px;
  border-right: 1px solid var(--line);
}
.catalog-stat:last-child { border-right: 0; }
.catalog-stat .num {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  color: var(--ink);
  line-height: 1;
  display: block;
  letter-spacing: -0.02em;
}
.catalog-stat .label {
  display: block;
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ----- Filter toolbar (compact bar above the grid) ----- */
.catalog-toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  background: rgba(243, 236, 225, 0.92);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.catalog-toolbar > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.catalog-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: none;
  transition: background-color .25s ease, transform .25s ease;
}
.catalog-filter-btn:hover { transform: translateY(-1px); }
.catalog-filter-btn svg { width: 18px; height: 18px; }
.catalog-filter-btn__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--accent, #d8b78a);
  border-radius: 999px;
}
.catalog-toolbar__summary {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.catalog-toolbar__count strong {
  font-weight: 700;
  color: var(--ink);
}

/* ----- Off-canvas filter drawer ----- */
.catalog-filter-drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  visibility: hidden;
  pointer-events: none;
}
.catalog-filter-drawer.is-open {
  visibility: visible;
  pointer-events: auto;
}
.catalog-filter-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 17, 15, 0.45);
  opacity: 0;
  transition: opacity .4s ease;
}
.catalog-filter-drawer.is-open .catalog-filter-drawer__backdrop { opacity: 1; }
.catalog-filter-drawer__panel {
  position: absolute;
  top: 0; right: 0;
  height: 100%;
  width: min(420px, 88vw);
  display: flex;
  flex-direction: column;
  background: var(--bg, #f3ece1);
  box-shadow: -24px 0 60px rgba(21, 17, 15, 0.18);
  transform: translateX(100%);
  transition: transform .45s cubic-bezier(.2,.85,.2,1);
}
.catalog-filter-drawer.is-open .catalog-filter-drawer__panel { transform: translateX(0); }
.catalog-filter-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
}
.catalog-filter-drawer__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--ink);
  margin: 0;
}
.catalog-filter-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: none;
  transition: background-color .25s ease, border-color .25s ease;
}
.catalog-filter-drawer__close:hover { background: rgba(21,17,15,.05); border-color: var(--ink); }
.catalog-filter-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}
.catalog-filter-group + .catalog-filter-group {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.catalog-filter-group__label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}
.catalog-filter-drawer__foot {
  display: flex;
  gap: 12px;
  padding: 20px 28px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft, #ece2d2);
}
.catalog-filter-drawer__foot .btn { flex: 1; justify-content: center; }
.catalog-filter-reset { flex: 0 0 auto !important; }

/* In the drawer the chips wrap freely instead of scrolling */
.catalog-filter-drawer .catalog-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.catalog-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink);
  cursor: none;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.catalog-chip:hover { border-color: var(--ink); }
.catalog-chip.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.catalog-chip__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(21, 17, 15, 0.06);
  border-radius: 999px;
}
.catalog-chip.is-active .catalog-chip__count {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.85);
}
.catalog-chip__swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--swatch, var(--accent));
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

/* ----- Grid ----- */
.catalog-grid-section {
  padding: clamp(60px, 8vw, 100px) 0;
  background: var(--bg);
}
.catalog-grid {
  /* Override the default 3-col lens-grid to fit more SKUs per row */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(20px, 2.4vw, 28px);
}
.catalog-card {
  /* Only transition opacity here. Transform animations are owned by GSAP
     (Flip layout transitions + the 3D tilt hover via quickTo); a CSS
     transform transition would fight Flip and cause jitter. */
  transition: opacity .35s ease;
}
.catalog-card.is-hidden {
  display: none;
}
.catalog-card__series-tag {
  position: absolute;
  top: 20px; left: 20px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  z-index: 2;
}

.catalog-empty,
.catalog-empty-msg {
  text-align: center;
  padding: 80px 20px;
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--muted);
}

/* ----- Responsive ----- */
@media (max-width: 720px) {
  /* Hero — pull the big top padding in, shrink lede gap */
  .catalog-hero {
    padding: calc(var(--header-h) + 36px) 0 40px;
  }
  .catalog-hero__title { margin: 10px 0 18px; max-width: none; }
  .catalog-hero__lede { margin: 0 0 32px; }

  /* Stats — 2x2 grid */
  .catalog-stats { grid-template-columns: repeat(2, 1fr); }
  .catalog-stat { padding: 18px 16px; }
  .catalog-stat:nth-child(2) { border-right: 0; }
  .catalog-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }

  /* Filter toolbar — keep button + count on one line */
  .catalog-toolbar { top: 64px; padding: 10px 0; }
  .catalog-filter-btn { padding: 10px 16px; }

  /* Drawer — bottom sheet on mobile for easy thumb reach */
  .catalog-filter-drawer__panel {
    top: auto; right: 0; bottom: 0;
    width: 100%;
    height: auto;
    max-height: 86vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -20px 50px rgba(21, 17, 15, 0.22);
  }
  .catalog-filter-drawer.is-open .catalog-filter-drawer__panel { transform: translateY(0); }
  .catalog-filter-drawer__head { padding: 18px 20px; }
  .catalog-filter-drawer__body { padding: 20px; }
  .catalog-filter-drawer__foot { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); }

  /* Grid — 2 compact cards per row */
  .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .catalog-card__series-tag {
    top: 10px; left: 10px;
    padding: 4px 8px;
    font-size: 8px;
    letter-spacing: 0.1em;
  }
}

@media (max-width: 420px) {
  .catalog-stats { grid-template-columns: 1fr 1fr; }
  .catalog-grid { gap: 10px; }
}
