/*
 * NUEAGAIN — category + search filters v2 (28 Nov 2026). Shared by both shops;
 * loaded only by resources/views/nueagain/filters-v2.blade.php.
 * Structure is common; each brand only sets the --fv2-* tokens below.
 * Bump ?v= in that partial on every change (Cloudflare caches this file).
 */

/* ---------- brand tokens ---------- */
.fv2--nue {
  --fv2-panel: #fff;
  --fv2-drawer-bg: #fff;
  --fv2-soft: var(--na-surface, #F2F9FA);
  --fv2-line: var(--na-line, #DEECEC);
  --fv2-ink: var(--na-ink, #063D2E);
  --fv2-ink-2: var(--na-ink-2, #485C5D);
  --fv2-box: #8FA3A3;
  --fv2-accent: var(--na-primary, #146B52);
  --fv2-accent-hover: var(--na-primary-hover, #0F5240);
  --fv2-accent-ink: #fff;
  --fv2-chip-bg: rgba(20, 107, 82, .10);
  --fv2-chip-ink: var(--na-primary, #146B52);
  --fv2-switch-off: #C9D8D6;
  --fv2-focus: var(--na-primary, #146B52);
  --fv2-radius: 16px;
  --fv2-ctl: 10px;
  --fv2-pill: 999px;
  --fv2-shadow: 0 1px 2px rgba(6, 61, 46, .04), 0 8px 24px rgba(6, 61, 46, .06);
}

.fv2--rw {
  --fv2-panel: var(--rw-panel, #1A1F5C);
  --fv2-drawer-bg: var(--rw-bg, #141850);
  --fv2-soft: var(--rw-field, #10143F);
  --fv2-line: var(--rw-border, #2A2F6E);
  --fv2-ink: var(--rw-head, #fff);
  --fv2-ink-2: var(--rw-muted, #A9B0D6);
  --fv2-box: var(--rw-faint, #6F77B0);
  --fv2-accent: var(--rw-magenta, #FF2FA8);
  --fv2-accent-hover: #E61E92;
  --fv2-accent-ink: #fff;
  --fv2-chip-bg: rgba(30, 216, 240, .12);
  --fv2-chip-ink: var(--rw-cyan, #1ED8F0);
  --fv2-switch-off: var(--rw-border, #2A2F6E);
  --fv2-focus: var(--rw-cyan, #1ED8F0);
  --fv2-radius: var(--rw-radius, 12px);
  --fv2-ctl: 8px;
  --fv2-pill: 8px;
  --fv2-shadow: 0 8px 28px rgba(0, 0, 0, .25);
}

/* ---------- base ---------- */
.fv2-host { display: contents; }

.fv2 { color: var(--fv2-ink); font-size: 14px; line-height: 1.35; }
.fv2 *, .fv2 *::before, .fv2 *::after { box-sizing: border-box; }
.fv2 svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* :where() keeps these resets at zero extra weight, so component rules below win */
.fv2 :where(button) { font: inherit; color: inherit; cursor: pointer; text-align: left; }
.fv2 :where(button:disabled) { cursor: default; }
.fv2 button:focus-visible,
.fv2 input:focus-visible { outline: 2px solid var(--fv2-focus); outline-offset: 2px; }

/* ---------- desktop sidebar (option C) ---------- */
.fv2-side {
  flex: 0 0 264px;
  width: 264px;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--fv2-panel);
  border: 1px solid var(--fv2-line);
  border-radius: var(--fv2-radius);
  box-shadow: var(--fv2-shadow);
  overflow: hidden;
}

.fv2-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--fv2-line);
}
.fv2 .fv2-title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.2; color: var(--fv2-ink); letter-spacing: 0; }
.fv2--rw .fv2-title { font-weight: 400; font-size: 17px; }
.fv2-total { margin-left: auto; font-size: 12px; color: var(--fv2-ink-2); font-variant-numeric: tabular-nums; }

.fv2-body { padding: 0 16px 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }

/* ---------- active filters ---------- */
.fv2-active { padding: 12px 0; border-bottom: 1px solid var(--fv2-line); }
.fv2-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fv2-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 6px 4px 10px;
  border-radius: var(--fv2-pill);
  background: var(--fv2-chip-bg);
  color: var(--fv2-chip-ink);
  font-size: 12.5px;
  font-weight: 600;
}
.fv2-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv2-chip svg { width: 14px; height: 14px; stroke-width: 2.4; opacity: .8; }
.fv2-chip:hover svg { opacity: 1; }
.fv2--rw .fv2-chip { border: 1px solid rgba(30, 216, 240, .35); }
.fv2-clear { margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--fv2-accent); text-decoration: underline; text-underline-offset: 2px; }
.fv2--rw .fv2-clear { color: var(--rw-cyan, #1ED8F0); }

/* ---------- sections ---------- */
.fv2-sec + .fv2-sec, .fv2-active + .fv2-sec { border-top: 1px solid var(--fv2-line); }
.fv2-active + .fv2-sec { border-top: 0; }
.fv2-sec__head {
  display: flex;
  align-items: baseline;
  width: 100%;
  gap: 6px;
  padding: 12px 0 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--fv2-ink);
}
.fv2-sec__note { overflow: hidden; font-size: 12px; font-weight: 400; color: var(--fv2-ink-2); white-space: nowrap; text-overflow: ellipsis; }
.fv2-chev { margin-left: auto; align-self: center; width: 16px !important; height: 16px !important; color: var(--fv2-ink-2); transition: transform .15s ease; }
.fv2-sec__head[aria-expanded="false"] .fv2-chev { transform: rotate(-90deg); }
.fv2-sec__body { padding-bottom: 14px; }

/* ---------- segmented ---------- */
.fv2-seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--fv2-line);
  border-radius: var(--fv2-ctl);
  background: var(--fv2-soft);
}
.fv2-seg__btn {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border-radius: calc(var(--fv2-ctl) - 3px);
  font-size: 13px;
  font-weight: 600;
  text-align: center !important;
  color: var(--fv2-ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color .12s ease, color .12s ease;
}
.fv2-seg__btn:hover { color: var(--fv2-ink); }
.fv2-seg__btn[aria-checked="true"] { background: var(--fv2-accent); color: var(--fv2-accent-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.fv2-seg--sm .fv2-seg__btn { min-height: 28px; padding: 0 6px; font-size: 12px; }
/* 4+ buttons (e.g. search: All / Pre-owned / New / For Parts) in the 264px
   sidebar: tighter, and wrap to a second row rather than truncate. */
.fv2-seg { flex-wrap: wrap; }
.fv2-side .fv2-seg--many .fv2-seg__btn { padding: 0 6px; font-size: 12px; }

/* ---------- price ---------- */
.fv2-price { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; margin: 0; }
.fv2-money { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fv2-money__label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fv2-ink-2); }
.fv2-money__box {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--fv2-line);
  border-radius: var(--fv2-ctl);
  background: var(--fv2-panel);
  color: var(--fv2-ink-2);
}
.fv2--rw .fv2-money__box { background: var(--fv2-soft); }
.fv2-money__box:focus-within { border-color: var(--fv2-focus); box-shadow: 0 0 0 1px var(--fv2-focus); }
.fv2 .fv2-money__box input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 0 0 4px;
  border: 0 !important;          /* beats RetroWorld's global .rw input:not(...) box */
  border-radius: 0 !important;
  background: transparent !important;
  font-size: 14px;
  color: var(--fv2-ink);
  outline: none;
  box-shadow: none !important;
}
.fv2 .fv2-money__box input::placeholder { color: var(--fv2-box); opacity: 1; }
.fv2-price__dash { padding-bottom: 10px; color: var(--fv2-ink-2); }
.fv2-apply {
  grid-column: 1 / -1;
  min-height: 34px;
  border-radius: var(--fv2-ctl);
  background: var(--fv2-accent);
  color: var(--fv2-accent-ink) !important;
  font-size: 13px;
  font-weight: 700;
  text-align: center !important;
}
.fv2-apply:hover:not(:disabled) { background: var(--fv2-accent-hover); }
.fv2-apply:disabled { background: transparent; border: 1px solid var(--fv2-line); color: var(--fv2-ink-2) !important; }

/* ---------- toggle ---------- */
.fv2-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 2px 0; }
.fv2-toggle__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.fv2-toggle__label { font-size: 14px; font-weight: 600; color: var(--fv2-ink); }
.fv2-toggle__hint { font-size: 12px; color: var(--fv2-ink-2); }
.fv2-switch { position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px; background: var(--fv2-switch-off); transition: background-color .15s ease; }
.fv2-switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s ease; }
.fv2-toggle[aria-checked="true"] .fv2-switch { background: var(--fv2-accent); }
.fv2-toggle[aria-checked="true"] .fv2-switch span { transform: translateX(16px); }

/* ---------- checklist ---------- */
.fv2-search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  margin-bottom: 8px;
  padding: 0 10px;
  border: 1px solid var(--fv2-line);
  border-radius: var(--fv2-ctl);
  background: var(--fv2-soft);
  color: var(--fv2-ink-2);
}
.fv2-search svg { width: 16px; height: 16px; }
.fv2-search:focus-within { border-color: var(--fv2-focus); }
.fv2 .fv2-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0 !important; border-radius: 0 !important; background: transparent !important; font-size: 13px; color: var(--fv2-ink); outline: none; box-shadow: none !important; }

.fv2-checks { max-height: 252px; margin: 0 -6px; padding: 0; list-style: none; overflow-y: auto; scrollbar-width: thin; }
.fv2-check { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; cursor: pointer; }
.fv2-check:hover { background: var(--fv2-soft); }
.fv2-check input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.fv2-check__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--fv2-box);
  border-radius: 5px;
  background: var(--fv2-panel);
  transition: background-color .12s ease, border-color .12s ease;
}
.fv2--rw .fv2-check__box { background: var(--fv2-soft); }
.fv2-check__box svg { width: 13px; height: 13px; stroke-width: 3; color: var(--fv2-accent-ink); opacity: 0; }
.fv2-check input:checked + .fv2-check__box { background: var(--fv2-accent); border-color: var(--fv2-accent); }
.fv2-check input:checked + .fv2-check__box svg { opacity: 1; }
.fv2-check input:focus-visible + .fv2-check__box { outline: 2px solid var(--fv2-focus); outline-offset: 2px; }
.fv2-check__name { flex: 1; min-width: 0; font-size: 14px; color: var(--fv2-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv2-check__count { flex: none; min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--fv2-soft); font-size: 11.5px; font-weight: 600; text-align: center; color: var(--fv2-ink-2); font-variant-numeric: tabular-nums; }
.fv2-empty { padding: 6px; font-size: 13px; color: var(--fv2-ink-2); }
.fv2-more { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--fv2-accent); }
.fv2--rw .fv2-more { color: var(--rw-cyan, #1ED8F0); }

/* ---------- sort (drawer) ---------- */
.fv2-radios { display: flex; flex-direction: column; }
.fv2-radio { display: flex; align-items: center; gap: 12px; min-height: 42px; font-size: 14.5px; color: var(--fv2-ink); }
.fv2-radio__dot { position: relative; flex: none; width: 20px; height: 20px; border: 1.5px solid var(--fv2-box); border-radius: 50%; }
.fv2-radio[aria-checked="true"] .fv2-radio__dot { border-color: var(--fv2-accent); }
.fv2-radio[aria-checked="true"] .fv2-radio__dot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--fv2-accent); }
.fv2-radio[aria-checked="true"] { font-weight: 600; }

/* ---------- loading: results count + "Show N results" ---------- */
.fv2-total { display: inline-flex; align-items: center; gap: 6px; }
.fv2-stale { opacity: .5; }
.fv2-spin {
  display: inline-block;
  flex: none;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: fv2-rot .7s linear infinite;
}
@keyframes fv2-rot { to { transform: rotate(360deg); } }

/* ---------- phones: bar + drawer (option B) ---------- */
.fv2-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--fv2-panel);
  border-top: 1px solid var(--fv2-line);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, .06);
}
.fv2--rw.fv2-bar { background: var(--rw-chrome, #0B0D2E); }
html.na-cookie-open .fv2-bar { bottom: var(--na-cookie-space, 0px); }
html.rw-cookie-open .fv2-bar { bottom: var(--rw-cookie-space, 0px); }
html.fv2-has-bar body { padding-bottom: 68px; }

.fv2-open {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  border-radius: var(--fv2-pill);
  background: var(--fv2-accent);
  color: var(--fv2-accent-ink) !important;
  font-size: 15px;
  font-weight: 700;
  text-align: center !important;
}
.fv2-open svg { width: 20px; height: 20px; }
.fv2-open circle { fill: var(--fv2-accent); }
.fv2-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--fv2-accent-ink);
  color: var(--fv2-accent);
  font-size: 12px;
  font-weight: 800;
}

.fv2-drawer {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--fv2-drawer-bg);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s;
}
.fv2-drawer.is-open { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.fv2-drawer .fv2-head { padding: 10px 8px 10px 16px; min-height: 58px; }
.fv2-drawer .fv2-title { font-size: 18px; }
.fv2-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: auto; border-radius: 50%; }
.fv2-close svg { width: 22px; height: 22px; }
.fv2-drawer .fv2-body { flex: 1; padding: 0 16px 16px; }
.fv2-drawer .fv2-sec__head { padding: 14px 0 12px; font-size: 15px; }
.fv2-drawer .fv2-seg__btn { min-height: 40px; font-size: 14px; }
.fv2-drawer .fv2-seg--sm .fv2-seg__btn { min-height: 36px; font-size: 13px; }
.fv2-drawer .fv2-check { padding: 9px 6px; }
.fv2-drawer .fv2-checks { max-height: none; }
.fv2-drawer .fv2-money__box { height: 44px; }
.fv2-drawer .fv2-money__box input { font-size: 16px; } /* 16px: no iOS zoom on focus */
.fv2-drawer .fv2-search input { font-size: 16px; }

.fv2-foot {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--fv2-panel);
  border-top: 1px solid var(--fv2-line);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, .08);
}
.fv2--rw .fv2-foot { background: var(--rw-chrome, #0B0D2E); }
.fv2-foot__clear { min-height: 48px; padding: 0 10px; font-size: 15px; font-weight: 600; color: var(--fv2-ink); text-decoration: underline; text-underline-offset: 3px; }
.fv2-foot__clear:disabled { opacity: .4; text-decoration: none; }
.fv2-foot__show {
  min-height: 48px;
  border-radius: var(--fv2-pill);
  background: var(--fv2-accent);
  color: var(--fv2-accent-ink) !important;
  font-size: 15px;
  font-weight: 700;
  text-align: center !important;
}
.fv2-foot__show { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.fv2-foot__show .fv2-spin { width: 16px; height: 16px; }
.fv2-foot__show:disabled { opacity: .5; }

html.fv2-lock, html.fv2-lock body { overflow: hidden !important; }

@media (prefers-reduced-motion: reduce) {
  .fv2-drawer, .fv2-drawer.is-open, .fv2-switch, .fv2-switch span, .fv2-chev { transition: none; }
  .fv2-spin { animation-duration: 1.6s; }
}
