/* ============================================================
   BERUNDA — The Collection · The Filter
   Renamed from "Refine" → "Filter": one unmistakable, gold-foil
   control that reads as a filter at a glance. A sticky controls
   row sits beneath the nav (count on the left, Filter on the
   right); the button drops a velvet panel of gold-chip facets.
   ============================================================ */

/* the Filter sits in normal flow (it does NOT move with the scroll) and carries
   no bar behind it — just the button on the cream field. Its z-index is lifted
   above the gallery (1) and the dimming scrim (54) so the panel it drops always
   opens in FRONT of the products, never behind them. */
.col-controls {
  position: relative;
  z-index: 56;
  background: transparent;
  border: 0;
}
.col-controls-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(20px, 2.4vw, 32px) clamp(24px, 6vw, 92px) 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;  /* Filter sits on the left */
}

/* ---------------- the Filter button ---------------- */
.col-filter { position: relative; flex-shrink: 0; }

.col-filter-btn {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 13px 22px 13px 20px;
  border: 1px solid var(--gold-400);
  border-radius: 999px;
  background:
    linear-gradient(168deg, var(--navy-700, #16407e), var(--navy-900)) padding-box,
    linear-gradient(168deg, var(--gold-300), var(--gold-600)) border-box;
  color: var(--gold-200, #f4d589);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 0 14px rgba(244, 213, 137, 0.4);
  box-shadow: 0 12px 30px rgba(0, 9, 31, 0.55),
              0 0 24px rgba(214, 162, 63, 0.16),
              0 0 0 4px rgba(214, 162, 63, 0.06),
              inset 0 1px 0 rgba(244, 213, 137, 0.18);
  transition: transform 0.3s var(--ease-entrance),
              color 0.35s var(--ease-standard),
              box-shadow 0.35s var(--ease-standard),
              border-color 0.35s var(--ease-standard),
              background 0.35s var(--ease-standard);
}
/* tiny gold caret that flips when the panel is open */
.col-filter-btn::after {
  content: "";
  width: 7px; height: 7px;
  margin-left: 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.35s var(--ease-entrance);
  flex-shrink: 0;
}
.col-filter[data-open="true"] .col-filter-btn::after { transform: rotate(225deg) translateY(-1px); }
.col-filter-btn:hover {
  transform: translateY(-2px);
  color: #fff4d6;
  background:
    linear-gradient(168deg, #1d4f99, var(--navy-900)) padding-box,
    linear-gradient(168deg, var(--gold-200, #f4d589), var(--gold-400)) border-box;
  text-shadow: 0 0 20px rgba(244, 213, 137, 0.6);
  box-shadow: 0 18px 38px rgba(0, 9, 31, 0.6),
              0 0 30px rgba(214, 162, 63, 0.34),
              0 0 0 5px rgba(214, 162, 63, 0.1),
              inset 0 1px 0 rgba(244, 213, 137, 0.26);
}
.col-filter[data-open="true"] .col-filter-btn {
  box-shadow: 0 18px 38px rgba(0, 9, 31, 0.6),
              0 0 30px rgba(214, 162, 63, 0.3),
              0 0 0 5px rgba(214, 162, 63, 0.12),
              inset 0 1px 0 rgba(244, 213, 137, 0.24);
}
.col-filter-btn:active { transform: translateY(0) scale(0.98); }
.col-filter-btn:focus-visible { outline: 2px solid var(--gold-200); outline-offset: 3px; }
.col-filter-glyph {
  width: 15px; height: 15px;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(244, 213, 137, 0.35));
}
.col-filter-badge {
  min-width: 20px; height: 20px;
  margin-left: 2px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(168deg, var(--gold-300), var(--gold-500));
  color: var(--navy-900);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  letter-spacing: 0;
}
.col-filter-badge[hidden] { display: none; }

/* ---------------- the facet panel ---------------- */
.col-filter-panel {
  position: absolute;
  z-index: 5;
  top: calc(100% + 14px);
  left: 0;
  width: min(560px, calc(100vw - 32px));
  /* deep matte royal-blue interior — the brand blue, solid (no gloss/blur) */
  background: var(--midnight-navy);
  border: 1px solid var(--gold-600);
  box-shadow: 0 30px 80px rgba(0, 5, 20, 0.66),
              0 0 28px rgba(214, 162, 63, 0.12),
              inset 0 1px 0 rgba(239, 217, 166, 0.12);
  padding: 6px;
  opacity: 0;
  transform: translateY(-8px) scale(0.99);
  transform-origin: top left;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s var(--ease-standard),
              transform 0.4s var(--ease-entrance),
              visibility 0.32s var(--ease-standard);
}
.col-filter[data-open="true"] .col-filter-panel {
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
}
.col-filter-panel-inner {
  border: 1px solid var(--hair-soft);
  padding: clamp(20px, 2.2vw, 28px);
}

.col-facet { margin-bottom: 22px; }
.col-facet:last-of-type { margin-bottom: 0; }
.col-facet-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 10px;
  color: var(--gold-300);
  margin-bottom: 12px;
  white-space: nowrap;
}
.col-facet-label::after {
  content: "";
  flex: 1;
  min-width: 18px;
  height: 1px;
  background: linear-gradient(90deg, rgba(214, 162, 63, 0.28), transparent);
}
.col-facet-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.col-chip {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background: rgba(214, 162, 63, 0.05);
  border: 1px solid rgba(214, 162, 63, 0.2);
  border-radius: 999px;
  padding: 9px 17px 8px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  color: var(--ivory-300);
  white-space: nowrap;
  transition: color 0.25s var(--ease-standard),
              border-color 0.25s var(--ease-standard),
              background-color 0.25s var(--ease-standard),
              box-shadow 0.25s var(--ease-standard),
              transform 0.15s var(--ease-standard);
}
.col-chip:hover {
  color: var(--ivory-100, #f4ecdc);
  border-color: rgba(214, 162, 63, 0.5);
  background: rgba(214, 162, 63, 0.1);
}
.col-chip:active { transform: scale(0.96); }
.col-chip[aria-pressed="true"] {
  color: #2a0206;
  border-color: var(--gold-300);
  background: linear-gradient(168deg, var(--gold-300), var(--gold-500));
  box-shadow: 0 4px 16px rgba(214, 162, 63, 0.28),
              inset 0 1px 0 rgba(255, 244, 214, 0.55);
}
.col-chip[aria-pressed="true"]:hover {
  background: linear-gradient(168deg, var(--gold-200), var(--gold-400));
  border-color: var(--gold-200);
}
.col-chip:focus-visible { outline: 1px solid var(--gold-300); outline-offset: 2px; }

.col-filter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(20px, 2.2vw, 26px);
  padding-top: 16px;
  border-top: 1px solid var(--hair-soft);
}
.col-filter-clear,
.col-filter-done {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 4px 0;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 10px;
  white-space: nowrap;
  transition: color 0.3s var(--ease-standard),
              background-color 0.3s var(--ease-standard),
              border-color 0.3s var(--ease-standard);
}
.col-filter-clear { color: var(--ivory-500); }
.col-filter-clear:hover { color: var(--gold-300); }
.col-filter-clear:disabled { opacity: 0.4; cursor: default; }
.col-filter-done {
  color: var(--gold-300);
  border: 1px solid var(--gold-600);
  border-radius: 999px;
  padding: 9px 24px 8px;
}
.col-filter-done:hover {
  color: #2a0206;
  background: linear-gradient(168deg, var(--gold-300), var(--gold-500));
  border-color: var(--gold-300);
}
.col-filter-clear:focus-visible,
.col-filter-done:focus-visible { outline: 1px solid var(--gold-300); outline-offset: 3px; }

/* scrim behind the open panel — clicking it closes (JS adds .is-open) */
.col-filter-scrim {
  position: fixed;
  inset: 0;
  z-index: 54;
  background: radial-gradient(80% 60% at 70% 0%, rgba(5, 1, 3, 0.5), transparent 72%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-standard), visibility 0.4s var(--ease-standard);
}
.col-filter-scrim.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

@media (max-width: 560px) {
  .col-filter-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 76vh;
    overflow-y: auto;
    border-bottom: 0;
    transform: translateY(12px);
  }
  .col-filter[data-open="true"] .col-filter-panel { transform: none; }

  /* The sheet was filling three quarters of the screen. Tighten the rhythm
     between the facets rather than the chips — those are already at 40px and
     shrinking them would push the tap target further below 44. */
  .col-filter-panel-inner { padding: 16px; }
  .col-facet { margin-bottom: 15px; }
  .col-facet-label { margin-bottom: 9px; }
  .col-facet-chips { gap: 7px; }
  .col-filter-foot { margin-top: 14px; padding-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .col-filter-panel, .col-chip, .col-filter-btn, .col-filter-scrim { transition: none !important; }
}
