/* ============================================================
   DriveCaribe — design system (no build step)
   Tokens → base → layout → components → pages. Light + dark.
   Text colours are chosen for ≥ 4.5:1 contrast on their surfaces.
   ============================================================ */

:root {
  --brand-50: #ecfdf8;
  --brand-500: #10b5a0;
  --brand-600: #0d9488;
  --brand-700: #0f766e;
  --brand-800: #115e59;
  --sand-600: #b8874a;

  --bg: #f6f7f8;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f3f4;
  --surface-3: #e6eaeb;
  --border: #e1e5e7;
  --border-strong: #c9d0d3;
  --text: #0f1f1e;
  --text-2: #3d4d4e;
  --muted: #5b6b70;
  --accent: var(--brand-700);
  --accent-hover: var(--brand-800);
  --accent-text: #ffffff;
  --accent-soft: #e3f6f1;
  --good: #0b6e45;
  --good-soft: #e5f6ed;
  --bad: #b23a0b;
  --bad-soft: #fdece3;
  --info: #1a5fb4;
  --info-soft: #e8f1fd;
  --wa: #0d7a3f;
  --wa-hover: #0b6934;

  --shadow-sm: 0 1px 2px rgba(15, 31, 30, .06), 0 1px 1px rgba(15, 31, 30, .04);
  --shadow-md: 0 4px 14px rgba(15, 31, 30, .08), 0 1px 3px rgba(15, 31, 30, .05);
  --shadow-lg: 0 18px 40px rgba(15, 31, 30, .14);
  /* resting lift for bordered surfaces: short offset shadow, so edge and depth do not compete */
  --shadow-raise: 0 1px 2px rgba(15, 31, 30, .06), 0 6px 10px -6px rgba(15, 31, 30, .18);

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-full: 999px;
  --maxw: 1360px;
  --header-h: 60px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0c1413;
  --bg-alt: #0f1a19;
  --surface: #131f1e;
  --surface-2: #192826;
  --surface-3: #21332f;
  --border: #243532;
  --border-strong: #35493f;
  --text: #e8f1ef;
  --text-2: #bccbc8;
  --muted: #8fa39f;
  --accent: #2cc2ad;
  --accent-hover: #4fd3c0;
  --accent-text: #04201c;
  --accent-soft: #0f2d29;
  --good: #4fd19a;
  --good-soft: #0e2b21;
  --bad: #f39a70;
  --bad-soft: #2e1b12;
  --info: #7fb4f2;
  --info-soft: #12253b;
  --wa: #25d366;
  --wa-hover: #3ee07c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, .55);
  --shadow-raise: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 10px -6px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1413;
    --bg-alt: #0f1a19;
    --surface: #131f1e;
    --surface-2: #192826;
    --surface-3: #21332f;
    --border: #243532;
    --border-strong: #35493f;
    --text: #e8f1ef;
    --text-2: #bccbc8;
    --muted: #8fa39f;
    --accent: #2cc2ad;
    --accent-hover: #4fd3c0;
    --accent-text: #04201c;
    --accent-soft: #0f2d29;
    --good: #4fd19a;
    --good-soft: #0e2b21;
    --bad: #f39a70;
    --bad-soft: #2e1b12;
    --info: #7fb4f2;
    --info-soft: #12253b;
    --wa: #25d366;
    --wa-hover: #3ee07c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, .45);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, .55);
    --shadow-raise: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 10px -6px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; accent-color: var(--accent); scrollbar-color: var(--border-strong) transparent; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--text); }
input, textarea { caret-color: var(--accent); }
a { text-underline-offset: .2em; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100svh;
  display: flex; flex-direction: column;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
ol, ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-text); padding: 8px 14px; border-radius: var(--r-sm); font-weight: 600;
}
.skip:focus { top: 10px; }

/* -------------------------------------------------------------- helpers */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.page-pad { padding-top: 26px; padding-bottom: 64px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap, .wrap.row { flex-wrap: wrap; padding: 0; max-width: none; margin: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.min0 { min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tone-good { color: var(--good); }
.tone-bad { color: var(--bad); }
.page-title { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.03em; line-height: 1.15; margin-bottom: 18px; }
.section-title { font-size: 1.2rem; letter-spacing: -.02em; margin: 36px 0 14px; }
.h-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.h-section { font-size: 1.12rem; font-weight: 720; letter-spacing: -.015em; line-height: 1.3; color: var(--text); margin-bottom: 12px; }
.panel .h-section { font-size: 1rem; margin-bottom: 10px; }

/* --------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 60; height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg-alt) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 14px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 750; letter-spacing: -.02em; font-size: 1.02rem; }
.logo-text span { color: var(--accent); }
.logo-mark { width: 32px; height: 32px; flex: none; display: block; }
.logo-svg { width: 100%; height: 100%; display: block; }
.logo-svg .lt { fill: var(--logo-tag); }
.logo-svg .lc { fill: #fff; }
.logo-svg .ls { fill: #dfb176; }
.nav { display: flex; gap: 2px; }
.nav a { padding: 7px 12px; border-radius: var(--r-full); font-size: .9rem; font-weight: 550; color: var(--text-2); transition: background .15s var(--ease); }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }

.icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: var(--r-sm); flex: none;
  display: grid; place-items: center; color: var(--text-2);
  border: 1px solid var(--border); background: var(--surface);
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }
.icon-btn[aria-current="page"] { color: var(--accent); border-color: var(--accent); }
.icon-btn .count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-full); background: #d43d55; color: #fff; font-size: .68rem; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}
.lang-link {
  height: 36px; min-width: 40px; padding: 0 10px; border-radius: var(--r-sm);
  display: grid; place-items: center; font-size: .78rem; font-weight: 750; letter-spacing: .04em;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
}
.lang-link:hover { border-color: var(--border-strong); color: var(--text); }
.th-sun { display: none; }
:root[data-theme="dark"] .th-sun { display: block; }
:root[data-theme="dark"] .th-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .th-sun { display: block; }
  :root:not([data-theme="light"]) .th-moon { display: none; }
}

/* ---------------------------------------------------------------- hero */
.hero {
  background:
    radial-gradient(1000px 360px at 10% -20%, color-mix(in srgb, var(--brand-500) 18%, transparent), transparent 60%),
    radial-gradient(700px 300px at 92% 0%, color-mix(in srgb, var(--sand-600) 14%, transparent), transparent 62%),
    var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: clamp(22px, 4vw, 40px) 0 22px;
}
.hero-compact { padding: 18px 0 16px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 32px; align-items: center; }
.hero-compact .hero-grid { grid-template-columns: 1fr; }
.hero-grid > * { min-width: 0; }
.hero h1 { font-size: clamp(1.55rem, 3.4vw, 2.4rem); line-height: 1.1; letter-spacing: -.035em; font-weight: 780; max-width: 20ch; }
.hero-compact h1 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); max-width: none; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { color: var(--text-2); margin-top: 8px; max-width: 56ch; }
/* one factual line instead of stat tiles: counts, linked dealers, real update date */
.dataline { margin-top: 10px; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dataline a { color: var(--text-2); font-weight: 650; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: .2em; }
.dataline a:hover { color: var(--accent); text-decoration-color: currentColor; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 16px; }
}

.searchbar {
  display: flex; align-items: center; gap: 10px; margin-top: 18px; max-width: 640px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-full);
  padding: 6px 6px 6px 16px; box-shadow: var(--shadow-raise);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.hero-compact .searchbar { margin-top: 12px; }
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.searchbar > svg, .searchbar > span > svg { width: 18px; height: 18px; color: var(--muted); }
.searchbar input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 1rem; padding: 6px 0; }
.searchbar input::-webkit-search-cancel-button { cursor: pointer; }

.quick { display: flex; gap: 7px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.quick::-webkit-scrollbar { display: none; }
.quick .chip { flex: none; background: var(--surface); border-color: var(--border); }
.quick .chip:hover { border-color: var(--accent); color: var(--accent); }
.quick .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.quick .chip-city { min-height: 44px; gap: 7px; padding-inline: 14px; }
.chip-city .n { font-size: .74rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip-city:hover .n { color: inherit; }
/* edge fade so a clipped row reads as scrollable rather than cut off */
.quick { mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); padding-right: 28px; }

/* recent price drops as a swipe row on phones (desktop keeps the side panel) */
.drops-rail { display: none; }
@media (max-width: 900px) {
  .drops-rail { display: block; grid-column: 1 / -1; margin: 6px 0; min-width: 0; }
  .rail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
  .rail-head h2 { display: flex; align-items: center; gap: 6px; font-size: .95rem; font-weight: 720; letter-spacing: -.01em; }
  .rail-head h2 svg { color: var(--good); width: 14px; height: 14px; }
  .rail-head .see-all { font-size: .85rem; font-weight: 650; color: var(--accent); min-height: 44px; display: inline-flex; align-items: center; }
  .rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -14px; padding: 2px 14px 6px; scroll-padding-inline: 14px; overscroll-behavior-x: contain; }
  .rail::-webkit-scrollbar { display: none; }
  .rail li { flex: 0 0 min(62%, 230px); scroll-snap-align: start; }
  .rail a { position: relative; display: grid; gap: 4px; height: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
  .rail a:hover, .rail a:focus-visible { border-color: var(--accent); }
  .rail-name { font-size: .86rem; font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .rail-price { font-size: 1.05rem; font-weight: 780; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: auto; }
  .rail .drop-inline { font-size: .8rem; font-weight: 700; }
}

.hero-side { display: flex; flex-direction: column; gap: 12px; }
.drops { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; }
.drops h2 { display: flex; align-items: center; gap: 6px; font-size: .95rem; font-weight: 720; letter-spacing: -.01em; color: var(--text); margin-bottom: 6px; }
.drops h2 svg { color: var(--good); width: 14px; height: 14px; }
.drops li a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; padding: 6px 0; font-size: .86rem; border-top: 1px solid var(--border); }
.drops li:first-child a { border-top: 0; }
.drops li a:hover .ellipsis { color: var(--accent); }
.see-all { display: inline-block; margin-top: 6px; font-size: .82rem; font-weight: 650; color: var(--accent); }
/* phones: the counts are already in the lede; results come first */
@media (max-width: 900px) { .hero-side { display: none; } }

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--r-full); font-size: .9rem; font-weight: 650; white-space: nowrap;
  border: 1px solid transparent; min-height: 40px;
  transition: transform .12s var(--ease), background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-hover); }
:root[data-theme="dark"] .btn-wa { color: #062012; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-wa { color: #062012; } }
.btn-sm { padding: 6px 12px; font-size: .82rem; min-height: 34px; }
.btn-lg { padding: 12px 22px; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 6px; width: 34px; }
.btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn[aria-pressed="true"] svg { fill: currentColor; }
.btn.is-disabled { opacity: .45; pointer-events: none; }
.btn.is-busy { opacity: .6; pointer-events: none; }

/* ---------------------------------------------------------- chips/badges */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 32px;
  border-radius: var(--r-full); font-size: .82rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid transparent;
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.chip svg { width: 12px; height: 12px; }
.chip-x:hover { border-color: var(--border-strong); color: var(--text); }
.chip-clear { background: none; color: var(--accent); }
.chip-sm { padding: 2px 8px; min-height: 0; font-size: .72rem; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--r-xs);
  font-size: .7rem; font-weight: 750; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-sold { background: var(--text); color: var(--bg-alt); }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 26px; padding-top: 22px; padding-bottom: 64px; align-items: start; }
@media (max-width: 960px) { .shell { grid-template-columns: 1fr; padding-top: 14px; } }

/* -------------------------------------------------------------- filters */
.filters {
  position: sticky; top: calc(var(--header-h) + 16px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 4px 16px 14px; box-shadow: var(--shadow-sm);
  max-height: calc(100svh - var(--header-h) - 32px); overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain;
}
.filters-head { display: flex; align-items: center; gap: 8px; padding: 12px 0 6px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.filters-head strong { flex: 1; font-size: .98rem; }
.filters-close { display: none; }
.fgroup { border-top: 1px solid var(--border); padding: 12px 0 8px; }
.fgroup legend { float: left; width: 100%; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 750; margin-bottom: 8px; }
.fgroup legend + * { clear: both; }
.check-list { display: flex; flex-direction: column; gap: 1px; margin-inline: -8px; }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); font-size: .88rem; cursor: pointer; }
.check:hover { background: var(--surface-2); }
.check input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; margin: 0; }
.check .n { margin-left: auto; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
details.more summary { list-style: none; cursor: pointer; padding: 6px 8px; font-size: .82rem; font-weight: 650; color: var(--accent); border-radius: var(--r-sm); }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { display: none; }
.hint { font-size: .82rem; color: var(--muted); padding: 2px 0 4px; }
/* segmented control: availability */
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; padding: 3px; background: var(--surface-2); border-radius: var(--r-sm); }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: block; text-align: center; padding: 7px 4px; border-radius: 8px; font-size: .82rem; font-weight: 650; color: var(--text-2); }
.seg-opt input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.filters-apply { position: sticky; bottom: -14px; padding: 12px 0 14px; margin-bottom: -14px; background: linear-gradient(transparent, var(--surface) 30%); }
.js .filters-apply { display: none; }

/* sliders */
.range { padding: 2px 2px 6px; }
.range-values { display: flex; justify-content: space-between; gap: 6px; font-size: .86rem; font-weight: 650; font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.range-single .range-values { justify-content: flex-start; }
.range-track { position: relative; height: 24px; }
.range-track::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 4px; border-radius: 4px; background: var(--surface-3); }
.range-fill { position: absolute; top: 10px; height: 4px; border-radius: 4px; background: var(--accent); left: 0; right: 0; }
.range input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 24px; margin: 0; background: none;
  -webkit-appearance: none; appearance: none; pointer-events: none;
}
.range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-sm); cursor: grab;
}
.range input[type="range"]::-moz-range-thumb {
  pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-sm); cursor: grab;
}
.range input[type="range"]::-moz-range-track { background: none; }
.range input[type="range"]:focus-visible { outline: none; }
.range input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }
.no-js .range-track { display: none; }

/* mobile drawer */
.filters-open { display: none; }
.badge-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full); background: var(--accent); color: var(--accent-text); font-size: .7rem; display: inline-grid; place-items: center; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 85; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
.scrim.open { opacity: 1; pointer-events: auto; }
@media (max-width: 960px) {
  .js .filters {
    position: fixed; inset: 0 auto 0 0; z-index: 90; width: min(420px, 100%); max-height: none; height: 100%;
    border-radius: 0; border: 0; transform: translateX(-102%); transition: transform .26s var(--ease);
    padding-top: 0;
  }
  .js .filters.open { transform: none; box-shadow: var(--shadow-lg); }
  .js .filters-close { display: grid; }
  .js .filters { padding-bottom: 96px; }
  /* the drawer is transformed, so this "fixed" footer is pinned to the drawer, not the page */
  .js .filters-apply {
    display: block; position: fixed; left: 0; bottom: 0; width: min(420px, 100%); margin: 0; z-index: 5;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border);
  }
  .js .filters-open { display: inline-flex; }
  .no-js .filters { position: static; max-height: none; }
  body.drawer-open { overflow: hidden; }
}

/* -------------------------------------------------------------- toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.result-count { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; margin-right: auto; }
.sort { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }
.sort .input { width: auto; }
.input, select.input {
  width: 100%; padding: 8px 12px; min-height: 36px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); outline: none; font-size: .88rem; color: var(--text);
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b70' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}
.active { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.active:empty { display: none; }

/* ----------------------------------------------------------------- grid */
.results { min-width: 0; transition: opacity .15s var(--ease); }
.results.is-loading .grid, .grid.is-loading { opacity: .45; pointer-events: none; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); }
div.more { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 28px; } /* load-more block (not the "+2 más" details) */
.more-note { font-size: .82rem; color: var(--muted); }

/* ----------------------------------------------------------------- card */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-raise); border-color: var(--border-strong); }
.card:focus-within { border-color: var(--accent); }
.card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); color: transparent; }
/* a dealer photo that fails to load: hide the broken-image box and alt text, the placeholder behind shows instead */
img.is-broken { visibility: hidden; }
.card:hover .card-media img { transform: scale(1.04); }
.noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.noimg svg { width: 38px; height: 38px; opacity: .45; }
.card-flags { position: absolute; left: 9px; top: 9px; display: flex; gap: 5px; flex-wrap: wrap; max-width: calc(100% - 90px); }
.card-flags .badge { box-shadow: var(--shadow-sm); }
.card.is-sold .card-media img { filter: grayscale(.6) brightness(.92); }
.card.is-sold:hover .card-media img { filter: none; }
.card-price .price-label { flex-basis: 100%; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); margin-bottom: -4px; }
.card-count {
  position: absolute; left: 9px; bottom: 9px; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: var(--r-xs); font-size: .72rem; font-weight: 650;
  background: rgba(0, 0, 0, .55); color: #fff;
}
.card-count svg { width: 13px; height: 13px; }
.card-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.tool {
  width: 34px; height: 34px; border-radius: var(--r-full); display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px);
  border: 1px solid var(--border); color: var(--text-2);
  transition: color .15s var(--ease), transform .15s var(--ease), background .15s var(--ease);
}
.tool:hover { transform: scale(1.08); color: var(--text); }
.tool[data-fav][aria-pressed="true"] { color: #d43d55; }
.tool[data-fav][aria-pressed="true"] svg { fill: currentColor; }
.tool[data-cmp][aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.card-body { padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: .98rem; font-weight: 680; letter-spacing: -.015em; line-height: 1.3; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.card-tools, .card-media { z-index: 1; }
.card-title .yr { color: var(--muted); font-weight: 650; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--text-2); }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-meta svg { width: 14px; height: 14px; color: var(--muted); }
.card-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 2px; }
.card-price .amount { font-size: 1.2rem; font-weight: 780; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.card-price .drop { display: inline-flex; align-items: center; gap: 2px; font-size: .78rem; font-weight: 700; color: var(--good); font-variant-numeric: tabular-nums; }
.card-price .drop svg { width: 13px; height: 13px; }
.card-price .amount-none { font-size: .92rem; font-weight: 650; letter-spacing: 0; color: var(--muted); }
.drop-inline { display: inline-flex; align-items: center; gap: 2px; position: relative; } /* contains its .sr-only text so it never widens the page */
.drop-inline svg { width: 13px; height: 13px; }
.price-none { font-size: 1.15rem; font-weight: 700; color: var(--text-2); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.card-instr { display: flex; flex-direction: column; gap: 1px; margin-top: -2px; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-instr .mk { font-weight: 650; color: var(--text-2); }
.card-instr .mk.tone-good { color: var(--good); }
.card-foot { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); padding-top: 8px; font-size: .76rem; color: var(--muted); }
.card-foot .card-dealer { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- empty */
.empty {
  grid-column: 1 / -1; border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  padding: 48px 24px; text-align: center; color: var(--muted); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty > svg { width: 42px; height: 42px; opacity: .5; }
.empty h1, .empty h2, .empty h3 { color: var(--text); font-size: 1.1rem; }
.empty .btn { margin-top: 8px; }

/* ------------------------------------------------------------ car page */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; font-size: .82rem; color: var(--muted); padding-top: 16px; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current] { color: var(--text-2); }
.detail { padding: 14px 0 64px; }
/* The sticky side column lives in .detail-top, so it stops before "Similar cars". */
.detail-top {
  display: grid; gap: 22px 30px; align-items: start;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr);
  grid-template-areas: "gallery aside" "head aside" "body aside";
}
.d-gallery { grid-area: gallery; min-width: 0; }
.d-head { grid-area: head; }
.d-aside { grid-area: aside; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.d-body { grid-area: body; display: flex; flex-direction: column; gap: 26px; min-width: 0; }
/* Only stick when the whole column fits on screen; otherwise its lower panels would be unreachable. */
@media (min-width: 901px) and (min-height: 860px) {
  .d-aside { position: sticky; top: calc(var(--header-h) + 16px); }
}
@media (max-width: 900px) {
  .detail-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "gallery" "head" "aside" "body"; gap: 18px; }
}
.d-head h1 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.03em; line-height: 1.15; }
.d-head h1 .yr { color: var(--muted); }
.d-head p { margin-top: 6px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }

.gallery { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.gallery-empty { aspect-ratio: 4 / 3; position: relative; }
.gallery-main { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); touch-action: pan-y; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; color: transparent; }
.gallery-nav, .gallery-zoom {
  position: absolute; width: 42px; height: 42px; border-radius: var(--r-full); display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(6px);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); color: var(--text);
}
.gallery-nav { top: 50%; transform: translateY(-50%); }
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
.gallery-zoom { right: 12px; bottom: 12px; width: 38px; height: 38px; }
.gallery-nav svg, .gallery-zoom svg { width: 18px; height: 18px; }
.gallery-count { position: absolute; left: 12px; bottom: 12px; padding: 3px 9px; border-radius: var(--r-full); background: rgba(0, 0, 0, .6); color: #fff; font-size: .78rem; font-weight: 650; }
.no-js .gallery-nav, .no-js .gallery-zoom, .no-js .gallery-count { display: none; }
.thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; scrollbar-width: thin; }
.thumbs button { width: 84px; aspect-ratio: 4 / 3; flex: none; border-radius: var(--r-sm); overflow: hidden; border: 2px solid transparent; background: var(--surface-2); opacity: .7; transition: opacity .15s; }
.thumbs button:hover, .thumbs button[aria-current="true"] { opacity: 1; }
.thumbs button[aria-current="true"] { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
/* Originals are heavy: phones get swipe + counter instead of a thumbnail strip. */
@media (max-width: 700px) { .thumbs { display: none; } }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; }
.sold-note { border-color: var(--border-strong); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.sold-note-title { font-weight: 750; font-size: 1.02rem; }
.sold-note .btn { margin-top: 6px; }
.price-big { font-size: clamp(1.7rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.price-big .cur { font-size: .9rem; color: var(--muted); font-weight: 650; letter-spacing: 0; }
.was { margin-top: 6px; color: var(--muted); }
.cta { display: grid; gap: 8px; margin-top: 16px; }
.cta .btn { width: 100%; min-height: 46px; font-size: .95rem; white-space: normal; text-align: center; line-height: 1.25; }
.no-phone { margin-top: 10px; }
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.tools .btn { padding-inline: 6px; min-width: 0; }
.tools .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dealer-head { display: flex; gap: 12px; align-items: center; }
.avatar { width: 42px; height: 42px; border-radius: var(--r-sm); flex: none; display: grid; place-items: center; font-weight: 750; font-size: .95rem; background: var(--accent-soft); color: var(--accent); }
.dealer-name { font-weight: 680; letter-spacing: -.01em; line-height: 1.25; font-size: 1rem; }
.addr { display: flex; gap: 6px; margin: 10px 0; }
.addr svg { margin-top: 2px; }
.also { margin: 8px 0 4px; line-height: 1.7; }
.also a { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-weight: 600; }
.also a svg { width: 12px; height: 12px; }
.panel .row.wrap { margin-top: 12px; }

.market-label { font-weight: 750; font-size: 1.02rem; }
.market-label.tone-neutral { color: var(--text); }
.market-bar { position: relative; height: 8px; border-radius: 8px; margin: 14px 0 6px; background: linear-gradient(90deg, var(--good-soft), var(--surface-3) 50%, var(--bad-soft)); }
.market-mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--border-strong); }
.market-dot { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; transform: translate(-50%, -50%); border: 3px solid var(--surface); box-shadow: var(--shadow-sm); background: var(--text-2); }
.market-dot.tone-good { background: var(--good); }
.market-dot.tone-bad { background: var(--bad); }
.market-scale { display: flex; justify-content: space-between; margin-bottom: 8px; }

.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.spec { background: var(--surface); padding: 12px 14px; }
.spec dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.spec dd { font-weight: 650; margin-top: 3px; overflow-wrap: anywhere; }

.chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 14px 10px; }
.chart svg { width: 100%; height: 140px; overflow: visible; }
.chart-line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart.tone-good .chart-line { stroke: var(--good); }
.chart.tone-bad .chart-line { stroke: var(--bad); }
.chart.tone-good .chart-area { fill: color-mix(in srgb, var(--good) 14%, transparent); }
.chart.tone-bad .chart-area { fill: color-mix(in srgb, var(--bad) 14%, transparent); }
.chart figcaption { margin-top: 6px; }
.timeline { margin-top: 10px; }
.timeline li { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; padding: 8px 2px; border-top: 1px solid var(--border); align-items: baseline; }
.tl-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-delta { font-size: .8rem; font-weight: 700; min-width: 80px; text-align: right; }

/* sticky contact bar (phones) */
.cta-bar { display: none; }
@media (max-width: 900px) {
  .cta-bar {
    display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg-alt) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
  }
  .cta-bar { align-items: center; }
  .cta-bar .btn { min-height: 46px; padding-inline: 12px; min-width: 0; }
  .cta-bar .bar-main { flex: 1; }
  .cta-bar .bar-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cta-bar .bar-icon { flex: none; width: 46px; padding: 0; }
  .cta-bar .bar-icon svg { width: 19px; height: 19px; }
  .bar-price { flex: none; display: flex; flex-direction: column; line-height: 1.1; margin-right: 4px; }
  .bar-amount { font-weight: 780; font-size: 1.02rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
  .bar-cur { font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
  .cta-bar { transition: transform .25s var(--ease); }
  .cta-bar.is-hidden { transform: translateY(110%); }
  body.has-cta-bar { padding-bottom: 72px; }
}

/* fullscreen viewer */
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: #fff; }
.viewer::backdrop { background: rgba(0, 0, 0, .92); }
.viewer img { width: 100%; height: 100%; object-fit: contain; touch-action: pan-y; }
.viewer-btn { position: absolute; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); color: #fff; }
.viewer-btn:hover { background: rgba(255, 255, 255, .26); }
.viewer-btn svg { width: 22px; height: 22px; }
.viewer-close { top: 14px; right: 14px; }
.viewer-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.viewer-next { right: 14px; top: 50%; transform: translateY(-50%); }
.viewer-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); font-size: .85rem; font-weight: 650; background: rgba(0, 0, 0, .5); padding: 4px 12px; border-radius: 999px; }
body.viewer-open { overflow: hidden; }

/* -------------------------------------------------------------- dealers */
.dealer-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); margin-top: 14px; }
.dealer-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .18s var(--ease), border-color .18s var(--ease); }
.dealer-card:hover { box-shadow: var(--shadow-raise); border-color: var(--border-strong); }
.dealer-card .dealer-name { font-size: 1rem; }
.brand-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.dealer-stats { display: flex; gap: 22px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: auto; }
.dealer-stats b { display: block; font-size: 1.05rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.dealer-stats span { font-size: .72rem; color: var(--muted); font-weight: 600; }

/* -------------------------------------------------------------- compare */
.tray {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 75;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; max-width: calc(100% - 24px);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.tray-items { display: flex; gap: 6px; }
.tray-item, .tray-slot { position: relative; width: 64px; height: 48px; border-radius: var(--r-sm); overflow: hidden; flex: none; background: var(--surface-2); }
.tray-slot { border: 1.5px dashed var(--border-strong); background: none; }
.tray-item img { width: 100%; height: 100%; object-fit: cover; }
.tray-item button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; }
.tray-item button svg { width: 11px; height: 11px; }
body.has-tray .site-footer { padding-bottom: 96px; }
@media (max-width: 900px) {
  body.has-cta-bar .tray { bottom: 84px; }
  .tray .tray-slot { display: none; }
  .tray [data-tray-clear] { display: none; }
}
.cmp-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.cmp { border-collapse: collapse; width: 100%; min-width: 560px; table-layout: fixed; }
.cmp thead td:first-child, .cmp tbody th { width: 150px; }
.cmp th, .cmp td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; font-size: .9rem; }
.cmp thead th { font-weight: 650; }
.cmp tbody th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
.cmp tbody tr:last-child > * { border-bottom: 0; }
.cmp td.best { font-weight: 750; }
.cmp .badge { margin-left: 6px; vertical-align: 1px; }
.cmp-media { position: relative; display: block; aspect-ratio: 4 / 3; max-width: 320px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); margin-bottom: 8px; }
.cmp-media img { width: 100%; height: 100%; object-fit: cover; }
.cmp-name { display: block; margin-bottom: 8px; line-height: 1.3; }
.cmp-name:hover { color: var(--accent); }

/* --------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 24px 0; font-size: .82rem; color: var(--muted); margin-top: auto; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-footer p { max-width: 60ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-links a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 120; transform: translate(-50%, 90px); opacity: 0;
  background: var(--text); color: var(--bg-alt); padding: 10px 16px; border-radius: var(--r-sm);
  font-size: .88rem; font-weight: 600; box-shadow: var(--shadow-lg); transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
body.has-tray .toast { bottom: 96px; }

/* ---------------------------------------------------------- small screens */
@media (max-width: 620px) {
  .wrap { padding-inline: 14px; }
  .site-header .wrap { gap: 8px; }
  .nav a { padding: 6px 9px; font-size: .84rem; }
  .logo-text { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card-body { padding: 10px 10px 10px; }
  .card-title { font-size: .9rem; }
  .card-price .amount { font-size: 1.05rem; }
  .tool { width: 32px; height: 32px; }
  .sort > span { display: none; }
  .sort .input { max-width: 142px; }
  .result-count { font-size: .95rem; }
  .toolbar { gap: 8px; }
}
@media (max-width: 480px) {
  .nav a { padding: 6px 8px; font-size: .8rem; }
  .site-header .wrap { gap: 6px; }
  /* phones follow the system theme; the toggle returns on wider screens */
  #themeBtn { display: none; }
}
@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------- legal + disclaimers */
.disclaimer { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font-size: .78rem; line-height: 1.45; color: var(--muted); }
.disclaimer > .i { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.disclaimer a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.disclaimer-page { margin-top: 28px; max-width: 80ch; }

.legal { display: grid; gap: 8px 48px; grid-template-columns: minmax(0, 1fr); }
.legal-head .page-title { margin-bottom: 6px; }
.legal-note { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); max-width: 72ch; }
.legal-note a, .legal-toc a, .prose a { color: var(--accent); }
.legal-toc { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); padding: 16px 18px; margin: 14px 0 6px; font-size: .88rem; }
.legal-toc ol { margin: 0 0 10px; padding-left: 1.4em; display: grid; gap: 5px; list-style: decimal; }
.legal-toc a { text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }
.prose { max-width: 72ch; line-height: 1.65; color: var(--text-2); }
.prose section { scroll-margin-top: calc(var(--header-h) + 16px); }
.prose section + section { margin-top: 26px; }
.prose h2 { font-size: 1.12rem; letter-spacing: -.01em; color: var(--text); margin-bottom: 8px; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 10px; }
.prose ul { padding-left: 1.2em; display: grid; gap: 7px; list-style: disc; }
.prose li::marker { color: var(--muted); }
.prose strong { color: var(--text); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
@media (min-width: 960px) {
  .legal { grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
  .legal-head { grid-column: 1 / -1; }
  .legal-toc { position: sticky; top: calc(var(--header-h) + 16px); margin: 0; }
}
.site-footer p { max-width: 72ch; line-height: 1.5; }
@media (max-width: 480px) {
  /* three equal tool buttons: stack icon over label so "Compartir"/"Comparar" are never cut */
  .tools .btn { flex-direction: column; gap: 3px; min-height: 54px; font-size: .74rem; padding: 6px 4px; }
  .tools .btn svg { width: 17px; height: 17px; }
}
@media (max-width: 340px) {
  /* smallest phones: drop the icon from the main bar button so its label fits */
  .cta-bar .bar-main svg { display: none; }
  .cta-bar .btn { padding-inline: 10px; font-size: .86rem; }
}
.results:focus { outline: none; }
/* very long trims: cap card titles at 3 lines (the full name is on the car page) */
.card-title a { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------------------------ touch targets (layout pass) */
/* Small visible marks keep their size; the tappable area grows to 44px around them. */
.tool { position: relative; width: 36px; height: 36px; }
.card-tools { gap: 8px; }
.tool::before, .icon-btn::before { content: ""; position: absolute; inset: -5px; } /* 36px mark + 1px border → 44px hit area */
.gallery-nav, .gallery-zoom { width: 44px; height: 44px; }
.breadcrumb a { padding-block: 12px; margin-block: -12px; }
@media (pointer: coarse) {
  .check { min-height: 44px; }
  details.more summary { min-height: 44px; display: flex; align-items: center; }
  .btn-sm { min-height: 44px; }
  .chip { min-height: 40px; }
  .see-all { min-height: 44px; display: inline-flex; align-items: center; }
}

/* phones: a one-line intro so the first cars reach the first screen */
.lede-short { display: none; }
@media (max-width: 600px) {
  .lede-long { display: none; }
  .lede-short { display: inline; }
}
@media (max-width: 380px) { .sort .input { max-width: 122px; } }
/* filter options with no cars under the current filters */
.check.is-empty { opacity: .45; cursor: default; }
.check.is-empty .n { visibility: hidden; }
.quick .chip-city[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.quick .chip-city[aria-current="page"] .n { color: inherit; }
.chip-all { font-weight: 650; }

/* numbers line up wherever prices are listed */
.drops li a, .rail a, .price-big, .tl-price, .cmp td, .bar-amount { font-variant-numeric: tabular-nums; }

/* ≈ US$ on English pages */
.card-price .usd { font-size: .78rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.usd-line { margin-bottom: 2px; font-size: .85rem; }
.usd-line .usd { font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
/* dealer types explained */
.check-desc { display: block; font-size: .72rem; color: var(--muted); line-height: 1.3; margin-top: 1px; }
.types-hint { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: .8rem; color: var(--muted); }
.types-hint b { color: var(--text-2); font-weight: 650; }
/* compare on phones: narrow sticky label column, two cars visible at once */
@media (max-width: 600px) {
  .cmp { min-width: 0; }
  .cmp[data-n="3"] { min-width: calc(76px + 3 * 140px); }
  .cmp thead td:first-child, .cmp tbody th { width: 76px; position: sticky; left: 0; z-index: 1; background: var(--surface); }
  .cmp th, .cmp td { padding: 10px 8px; font-size: .82rem; }
  .cmp tbody th { font-size: .66rem; letter-spacing: .02em; hyphens: auto; overflow-wrap: anywhere; }
  .cmp .badge { margin: 4px 0 0; display: inline-flex; }
}

/* ---------------------------------------------------- landing pages: browse by */
.browse { display: grid; gap: 28px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.browse-title { font-size: 1rem; letter-spacing: -.01em; margin: 0 0 10px; }
.browse-list { list-style: none; margin: 0; padding: 0; columns: 4 170px; column-gap: 28px; }
.browse-list li { break-inside: avoid; padding: 5px 0; display: flex; gap: 6px; align-items: baseline; }
.browse-list a { color: var(--text); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.browse-list a:hover { color: var(--accent); text-decoration: underline; }
.browse-list a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.browse-list .n { color: var(--muted); font-size: .85em; font-variant-numeric: tabular-nums; }
.hero .lede-landing { font-size: .98rem; }
@media (max-width: 600px) {
  .hero .lede-landing { font-size: .9rem; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .browse-list { columns: 2; }
  .browse-list li { padding: 8px 0; }
}
.link-btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.link-btn:hover { color: var(--accent); }
.link-btn[hidden] { display: none; }

/* logo tag colour: deep teal on light, brighter teal on dark so it stays visible */
:root { --logo-tag: #0c535d; }
:root[data-theme="dark"] { --logo-tag: #2bb3a6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --logo-tag: #2bb3a6; } }

/* ----------------------------------------------------------- brand logos */
/* --r = logo width/height (1–2.4): wordmarks like Kia or Chevrolet get a wider slot */
.bmark { --r: 1; height: 1.1em; width: calc(1.1em * var(--r)); flex: none; display: inline-block; vertical-align: -.2em; margin-right: .45em;
  background: currentColor; -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.bmark-txt { width: 1.15em; height: 1.15em; background: none; -webkit-mask: none; mask: none; border: 1.5px solid currentColor; border-radius: 50%; display: inline-grid; place-items: center; opacity: .8; }
.bmark-txt > span { font-size: .42em; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.bmark-lg { height: 52px; width: calc(52px * min(var(--r), 2)); margin: 0; }
.bmark-lg.bmark-txt { width: 52px; height: 52px; border-width: 2px; }
.bmark-lg.bmark-txt > span { font-size: 17px; }
.hero-brand { display: flex; align-items: center; gap: 18px; }
.hero-brand .bmark-lg { flex: none; color: var(--text); }
/* lists: logos in a fixed-width column so the names line up */
.check .bmark, .browse-list .bmark { color: var(--muted); height: 1.05em; width: 2.2em; margin-right: .5em; -webkit-mask-position: left center; mask-position: left center; }
.check .bmark-txt, .browse-list .bmark-txt { width: 1.15em; height: 1.15em; margin-right: 1.55em; }
.browse-list a:hover .bmark, .browse-list a[aria-current] .bmark { color: inherit; }
.quick-brands { margin-top: 8px; }
.chip-brand .bmark { color: var(--text-2); }
.d-brand { display: inline-flex; align-items: center; font-size: .86rem; font-weight: 650; color: var(--text-2); margin-bottom: 6px; }
.d-brand:hover { color: var(--accent); }
.d-brand .bmark { height: 1.4em; width: calc(1.4em * var(--r)); }
@media (max-width: 600px) {
  .bmark-lg { height: 38px; width: calc(38px * min(var(--r), 2)); }
  .bmark-lg.bmark-txt { width: 38px; height: 38px; }
  .bmark-lg.bmark-txt > span { font-size: 13px; }
  .hero-brand { gap: 12px; }
  .quick-brands { display: none; }
}

/* car page: similar cars sold recently */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin: 36px 0 4px; }
.section-head .section-title { margin: 0; }
.section-head .see-all { margin-top: 0; }
.section-note { margin: 0 0 14px; max-width: 70ch; }
@media (max-width: 600px) {
  /* phones: 2 rows of sold references; "Ver … vendidos" has the rest */
  .d-similar-sold .grid > .card:nth-child(n+5) { display: none; }
}
