/* ==========================================================================
   Jitcar — SRP template layer (/car/search)
   Header, filter rail, toolbar, count line, grid, soft-pull invitation,
   pagination. Anatomy per design/reference/ v3 boards (D2 desktop,
   frames 02/03 mobile), values mapped to tokens.
   One component, two layouts: same card markup desktop and mobile.
   ========================================================================== */

/* --- Site header --------------------------------------------------------- */
.site-head {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding: 14px 28px;
  background: #fff;
  border-bottom: 1px solid var(--hairline);
}
.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-lg);
  font-weight: var(--w-black);
  color: var(--asphalt);
  text-decoration: none;
}
.logo b {
  width: 17px;
  height: 4.5px;
  border-radius: 3px;
  background: var(--lane);
}
.site-nav {
  display: flex;
  gap: var(--sp-5);
  font-size: var(--fs-sm);
  font-weight: var(--w-bold);
}
.site-nav a { color: var(--asphalt); text-decoration: none; }
.site-nav a.on {
  border-bottom: 2.5px solid var(--lane);
  padding-bottom: 2px;
}
.site-nav a em {
  font-style: normal;
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  background: var(--asphalt);
  color: var(--lane);
  border-radius: 5px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: 2px;
}
.site-head .grow { flex: 1; }

/* The header budget chip — guide green, persists site-wide after the soft
   pull. Server renders it hidden (estimate state); the budget-state body
   class reveals it. Green = verified only. */
.hbudget {
  display: none;
  align-items: center;
  gap: 7px;
  background: var(--guide);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-size: var(--fs-xs);
  font-weight: var(--w-bold);
}
.hbudget .ico { width: 14px; height: 14px; }
.budget-state .hbudget { display: inline-flex; }

/* --- SRP layout ---------------------------------------------------------- */
.srp {
  display: grid;
  grid-template-columns: 256px 1fr;
  gap: 18px;
  padding: 18px 28px 34px;
  align-items: start;
  max-width: 1260px;
  margin: 0 auto;
}
.srp-main { min-width: 0; }

/* --- Filter rail — leads with payment (§7) ------------------------------- */
.drail {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 15px 15px 17px;
}
.drail h5 {
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  font-weight: var(--w-bold);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 14px 0 8px;
}
.drail h5:first-child { margin-top: 0; }

/* Cash price / Monthly payment — defaults to Monthly payment */
.seg {
  display: flex;
  background: var(--concrete);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-field);
  padding: 3px;
}
.seg > * {
  flex: 1;
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: var(--w-bold);
  padding: 7px 2px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--steel);
  cursor: pointer;
}
.seg .on {
  background: var(--asphalt);
  color: #fff;
}

/* Range slider visuals (enhancement layer draws thumbs over real inputs) */
.range {
  position: relative;
  height: 4px;
  background: var(--hairline);
  border-radius: 2px;
  margin: 10px 8px 6px;
}
.range i {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--lane);
  border-radius: 2px;
}
.range s {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2.2px solid var(--asphalt);
  transform: translate(-50%, -50%);
}
.range-lab {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  color: var(--steel);
  margin: 10px 2px 6px;
}

/* Make rows with live counts (truth rule 2: sourced live or removed) */
.checkrow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  font-size: var(--fs-sm);
}
.checkrow input[type="checkbox"] {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  accent-color: var(--asphalt);
  flex: none;
}
.checkrow label { flex: 1; }
.checkrow .count {
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  color: var(--steel);
}

.drail .btn { width: 100%; margin-top: 12px; }

/* --- Toolbar: search restatement + sort ---------------------------------- */
.srp-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.msearch {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-field);
  padding: 10px 13px;
  font-size: var(--fs-sm);
  color: var(--steel);
}
.msearch .ico { width: 15px; height: 15px; }
.sortchip {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-field);
  padding: 10px 13px;
  font-size: var(--fs-xs);
  font-weight: var(--w-bold);
  background: #fff;
  white-space: nowrap;
}
.sortchip .ico { width: 14px; height: 14px; }

/* Mobile filters trigger (offcanvas) */
.tbtn {
  display: none;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-field);
  padding: 9px 12px;
  font-size: var(--fs-xs);
  font-weight: var(--w-bold);
  background: #fff;
}
.tbtn .ico { width: 15px; height: 15px; }
.tbtn i {
  font-style: normal;
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  background: var(--asphalt);
  color: var(--lane);
  border-radius: var(--radius-pill);
  padding: 1px 6px;
}

/* --- Count line — says what mode the shopper is in ----------------------- */
.countline {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--steel);
  letter-spacing: .04em;
  margin: 0 2px 12px;
  text-transform: uppercase;
}

/* --- Results grid — 3-up at full width (§7) ------------------------------ */
.srp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* Whole card clickable via stretched title link; fav stays above (z2) */
.vcard .cover { color: inherit; text-decoration: none; }
.vcard .cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* --- Soft-pull invitation — lane-topped card in the results list (§4) ----- */
.convert {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.convert > i {
  display: block;
  height: 4px;
  background: var(--lane);
}
.convert > div {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 12px 14px;
}
.convert b {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--w-extrabold);
}
.convert span {
  font-size: var(--fs-xs);
  color: var(--steel);
}
.convert .ico {
  width: 22px;
  height: 22px;
  color: var(--lane-ink);
  flex: none;
}
.convert .btn {
  min-height: 0;
  padding: 9px 14px;
  font-size: var(--fs-xs);
}
/* Once the shopper is in budget state the invitation has done its job */
.budget-state .convert { display: none; }

/* --- Mobile budget banner (frame 03) — revealed with the flip ------------ */
.budget-banner {
  display: none;
  align-items: center;
  gap: 9px;
  margin: 12px 14px 0;
  background: var(--guide);
  border-radius: var(--radius-field);
  padding: 11px 13px;
  font-size: var(--fs-xs);
  font-weight: var(--w-bold);
  color: #fff;
}
.budget-banner .ico { width: 16px; height: 16px; flex: none; }
.budget-banner .grow { flex: 1; line-height: 1.3; }
.budget-banner small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: var(--w-semibold);
  color: var(--guide-bg);
}
.budget-banner a {
  font-weight: var(--w-bold);
  color: var(--guide-bg);
  text-decoration: none;
}

/* --- Pagination — self-canonical, crawlable prev/next (SEO.md §2) --------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
  font-family: var(--mono);
  font-size: var(--fs-sm);
}
.pager a, .pager .cur {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--asphalt);
  text-decoration: none;
}
.pager .cur {
  background: var(--asphalt);
  border-color: var(--asphalt);
  color: #fff;
}

/* --- Site footer — small, honest link set (SEO.md §2) --------------------- */
.site-foot {
  background: var(--asphalt);
  color: var(--concrete);
  margin-top: var(--sp-10);
}
.site-foot .lane-line { height: 4px; background: var(--lane-dashes); }
.site-foot-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: var(--sp-8) 28px var(--sp-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-6);
}
.site-foot h6 {
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  font-weight: var(--w-bold);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: var(--sp-2);
}
.site-foot ul { list-style: none; }
.site-foot li { padding: 3px 0; }
.site-foot a {
  color: var(--concrete);
  text-decoration: none;
  font-size: var(--fs-sm);
}
.site-foot .legal {
  grid-column: 1 / -1;
  border-top: 1px solid var(--asphalt-2);
  padding-top: var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--steel);
}

/* --- Responsive — one component, two layouts; floor is 360px (§9) --------- */
@media (max-width: 1000px) {
  .srp { grid-template-columns: 1fr; padding: 12px 14px 34px; }
  .drail { display: none; } /* offcanvas enhancement re-mounts it */
  .tbtn { display: flex; }
  .srp-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .site-head { padding: 12px 14px; gap: var(--sp-4); }
  .site-nav { display: none; } /* menu button enhancement */
  .budget-state .budget-banner { display: flex; margin: 12px 0 0; }
}
@media (max-width: 680px) {
  .srp-grid { grid-template-columns: 1fr; }
  .sortchip { display: none; } /* sort moves into the filters sheet */
}
