/*
 * catalog-finder.css — T640 (2026-09-07, ask #1966) Wine-Searcher-literal
 * bottle finder filter panel, behind `auth.resolve_finder` (`?finder=1`).
 * Robert's pick "A" (the mock-up round, sprint-state/ui-rebuild/finder-
 * round/NOTES.md "Variant A"), built from that round's finder-base.css +
 * variant-a.css (renamed `.ff-*` -> `.cf-*`/`.cshop-*` here to match the
 * real markup `static/js/catalog-finder.js` builds).
 *
 * Every colour is one of the live "restyle A" skin's own custom properties
 * (--r2-*, wb-catalog-restyle-a.css) — light and dark inherit automatically,
 * no new palette. Only the per-shop $ (`.cshop-price`) uses the accent
 * colour; every other control (slider thumbs, ticked checkboxes) is ink.
 * No shadows, 1px hairlines, 6px control radius.
 *
 * Desktop only for now (step 3): the sidebar layout is fenced to >=861px.
 * `catalog-mobile.css` already hides the whole `.catalog-shell` (this
 * panel's container) below 860px, so the explicit media query below is
 * belt-and-suspenders, not the only thing hiding it. Step 4 reuses this
 * same panel module inside the phone filter sheet.
 */

/* ---- desktop sidebar layout ---------------------------------------------- */
.cat-finder-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.cat-finder {
  flex: none;
  width: 260px;
  border-right: 1px solid var(--r2-hair);
  padding-right: 24px;
  box-sizing: border-box;
  /* #3350: sit just below the sticky search toolbar and scroll inside the
     remaining height, so the filters are never under the bar. */
  position: sticky;
  top: calc(var(--wb-header-h, 0px) + var(--cat-toolbar-h, 140px) + 8px);
  max-height: calc(100vh - var(--wb-header-h, 0px) - var(--cat-toolbar-h, 140px) - 80px);
  overflow-y: auto;
}
.cat-finder[hidden] { display: none; }
.cat-finder-layout .results { flex: 1 1 auto; min-width: 0; }

@media (max-width: 860px) {
  /* catalog-mobile.css already hides .catalog-shell entirely at this width;
     this is defensive, not load-bearing. */
  .cat-finder { display: none !important; }
}

/* Old coarse dropdowns: hidden when the finder flag is on, EXCEPT #fSort
   (Sort stays in the toolbar, styled exactly as it always was — see
   catalog.css's .filter-secondary select rules, untouched here). The
   elements stay in the DOM (catalog.js reads them at module scope with no
   null guard). */
html[data-finder] .filter-secondary > *:not(#fSort) { display: none; }

/* T640 fix 1: with every other .filter-secondary sibling hidden above, the
   live toolbar's two-column `form.f` (filter-primary | filter-secondary,
   side by side, wb-catalog-restyle-a.css's !important grid) leaves
   #fSort alone in a track sized `minmax(10.5rem, 1fr)` with no neighbour to
   share the row — 1fr then means "the whole row", which is the stretched
   bar the review caught. The pick (desktop-a-light.png) instead stacks the
   toolbar: the search row full-width, #fSort on its own row underneath at
   its natural compact width, left-aligned. `:not(#_)` matches restyle-a's
   own id-specificity hack so these rules actually win the cascade instead
   of losing silently to its !important declarations. */
html:not(#_)[data-finder] form.f {
  grid-template-columns: minmax(0, 1fr) !important;
}
html:not(#_)[data-finder] .filter-secondary {
  grid-template-columns: max-content !important;
  justify-content: flex-start !important;
}
html:not(#_)[data-finder] #fSort {
  width: 176px !important;
  min-width: 0 !important;
  flex: none !important;
}

/* ---- live count above the grid ------------------------------------------- */
.cf-grid-head {
  font-size: 16px;
  font-weight: 650;
  color: var(--r2-ink);
  margin: 0 0 16px 0;
}
.cf-grid-head[hidden] { display: none; }

/* ---- panel groups --------------------------------------------------------- */
.cf-panel-count {
  font-size: 16px;
  font-weight: 650;
  color: var(--r2-ink);
  margin: 0 0 16px 0;
}
/* T640 fix 1: the desktop sidebar (#catFinder) already gets the live count
   above the grid instead (#cfGridHead) — the panel's own first-child count
   would just repeat it (desktop-a-light.png: "733 bottles" appears once,
   above the grid, nothing atop PRICE). Same reasoning, same hidden-not-
   removed treatment as the phone sheet's rule in catalog-mobile.css. */
#catFinder .cf-panel-count { display: none; }
.cf-group { margin: 0 0 24px 0; }
.cf-group:last-child { margin-bottom: 0; }

.cf-label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--r2-ink-2);
  margin-bottom: 8px;
}

.cf-range-value {
  font-size: 17px;
  font-weight: 650;
  color: var(--r2-ink);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

/* ---- two-handle slider: two overlaid native <input type=range>, a
   decorative track underneath. The inputs themselves are invisible except
   for their thumbs (pointer-events:none on the input, re-enabled on the
   thumb pseudo-element) so both handles stay independently draggable. ---- */
.cf-slider {
  position: relative;
  height: 28px;
  margin: 0 0 12px 0;
}
.cf-track {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: var(--r2-hair);
  border-radius: 999px;
}
.cf-track-fill {
  position: absolute;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: var(--r2-ink);
  border-radius: 999px;
}
.cf-range {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 28px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  color: var(--sk-range-ink); /* T72: invisible; palette token instead of the browser's own range-input grey */
}
.cf-range:focus { outline: none; }
.cf-range::-webkit-slider-runnable-track { background: transparent; height: 28px; }
.cf-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 26px; height: 26px;
  margin-top: 1px;
  background: var(--r2-ink);
  border: 3px solid var(--r2-paper);
  border-radius: 999px;
  box-sizing: border-box;
  cursor: pointer;
}
.cf-range::-moz-range-track { background: transparent; height: 28px; border: 0; }
.cf-range::-moz-range-thumb {
  pointer-events: auto;
  width: 26px; height: 26px;
  background: var(--r2-ink);
  border: 3px solid var(--r2-paper);
  border-radius: 999px;
  box-sizing: border-box;
  cursor: pointer;
}

.cf-minmax {
  display: flex;
  gap: 12px;
}
.cf-input-wrap {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}
.cf-minmax input {
  width: 100%;
  height: 44px;
  min-width: 0;
  border: 1px solid var(--r2-hair);
  border-radius: 6px;
  background: var(--r2-paper);
  color: var(--r2-ink);
  font-size: 16px;
  padding: 0 12px;
  font-family: var(--r2-body);
  box-sizing: border-box;
}
/* $/% adornments (T640 fix 1): fixed inside the box, secondary ink, never
   part of the typed value — the input stays type=number underneath. */
.cf-input-wrap-pre input { padding-left: 22px; }
.cf-input-wrap-suf input { padding-right: 22px; }
.cf-input-adorn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--r2-ink-2);
  pointer-events: none;
}
.cf-input-adorn-pre { left: 12px; }
.cf-input-adorn-suf { right: 12px; }

/* ---- unknown-ABV note ------------------------------------------------------ */
.cf-abv-note {
  font-size: 14px;
  color: var(--r2-ink-2);
  margin-top: 8px;
}
.cf-abv-note[hidden] { display: none; }
.cf-abv-show {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--r2-ink-2);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ---- retailer checklist ---------------------------------------------------- */
.cf-check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
}
.cf-check-input {
  flex: none;
  width: 20px; height: 20px;
  accent-color: var(--r2-ink);
}
.cf-check-name {
  flex: 1 1 auto;
  font-size: 16px;
  color: var(--r2-ink);
}
.cf-check-count {
  flex: none;
  font-size: 14px;
  color: var(--r2-ink-2);
  font-variant-numeric: tabular-nums;
}
.cf-more-row {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--r2-hair);
  border-radius: 6px;
  background: none;
  padding: 8px 14px; /* #3347: was 0, text sat on the edge */
  font: inherit;
  font-size: 14px;
  color: var(--r2-ink-2);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ---- brand family / release type selects ----------------------------------- */
.cf-select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--r2-hair);
  border-radius: 6px;
  background: var(--r2-paper);
  color: var(--r2-ink);
  font-size: 14px;
  padding: 0 12px;
  font-family: var(--r2-body);
}

/* ---- reset all -------------------------------------------------------------- */
.cf-reset-all {
  min-height: 44px;
  border: 1px solid var(--r2-hair);
  border-radius: 6px;
  background: none;
  padding: 8px 14px; /* #3347: was 0 */
  font: inherit;
  font-size: 14px;
  color: var(--r2-ink-2);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ---- per-shop card line + shop heading -------------------------------------- */
.cshop-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 6px;
  row-gap: 0;
  font-size: 14px;
  color: var(--r2-ink);
  margin-top: 4px;
}
.cshop-name { white-space: nowrap; }
.cshop-sep { color: var(--r2-ink-2); }
.cshop-price { color: var(--r2-accent); font-weight: 650; white-space: nowrap; }
.cshop-go {
  color: var(--r2-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 14px;
  white-space: nowrap;
}
.cshop-date { color: var(--r2-ink-2); white-space: nowrap; }
.cshop-error { color: var(--r2-ink-2); }

/* ---- cheaper-elsewhere line (T640 fix 4, Robert #1970, 2026-09-07) ------ */
/* Small muted line under a ticked shop's headline price, shown ONLY when
   somewhere else is actually cheaper than the headlining ticked shop.
   Plain ink-2 (no accent) — the accent stays reserved for .cshop-price so
   this reads as a caveat, not another buyable price. */
.ccheaper {
  font-size: 12px;
  color: var(--r2-ink-2);
  margin-top: 2px;
}
.cshop-retry {
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
