/* Layout: black signage band with the gold badge, then a filter rail beside a car grid.
   Black + gold to match the Jag Auto Motors badge; Montserrat for the name, headings and figures (same face as the logo), Public Sans for reading. */
:root {
  --bg: #F3F2EF;
  --surface: #FFFFFF;
  --sunk: #E7E5E0;
  --ink: #161513;
  --muted: #615C54;
  --line: #DAD6CE;
  --green: #161513;          /* primary buttons and selected chips */
  --green-ink: #85662C;      /* gold text on light backgrounds (links, "View details") */
  --on-green: #F3E3BE;
  --brass: #C9A25E;          /* gold */
  --brass-soft: #F1E7D2;
  --band: #111111;
  --on-band: #F3F0EA;
  --on-band-muted: #A9A398;
  --glass: rgba(17, 17, 17, 0.72);
  --shadow: 0 1px 2px rgba(17, 17, 17, .06), 0 8px 24px rgba(17, 17, 17, .07);

  --f-display: "Montserrat", "Public Sans", system-ui, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-data: "Montserrat", "Public Sans", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0F0E; --surface: #191816; --sunk: #222120; --ink: #EDEAE4; --muted: #A39D92;
    --line: #2F2D2A; --green: #C9A25E; --green-ink: #D7B575; --on-green: #141210;
    --brass: #C9A25E; --brass-soft: #3A3122; --band: #090909; --on-band: #F3F0EA;
    --on-band-muted: #9A948A; --glass: rgba(6, 6, 6, 0.8);
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F0F0E; --surface: #191816; --sunk: #222120; --ink: #EDEAE4; --muted: #A39D92;
  --line: #2F2D2A; --green: #C9A25E; --green-ink: #D7B575; --on-green: #141210;
  --brass: #C9A25E; --brass-soft: #3A3122; --band: #090909; --on-band: #F3F0EA;
  --on-band-muted: #9A948A; --glass: rgba(6, 6, 6, 0.8);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 30; background: var(--band);
}
.wrap {
  width: 100%; max-width: 1240px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { text-wrap: balance; margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.num { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--band); color: var(--on-band);
  border-bottom: 3px solid var(--brass);
}
.head-inner { display: flex; align-items: center; gap: 24px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; flex: none; }
.brand-word { display: grid; line-height: 1; }
.brand-name { font-family: var(--f-display); font-weight: 600; font-size: 1.55rem; letter-spacing: .04em; color: var(--brass); }
.brand-sub { font-family: var(--f-data); font-weight: 500; font-size: .6rem; letter-spacing: .32em; color: var(--on-band); margin-top: 4px; }
.nav { display: flex; gap: 20px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 600; font-size: .9rem; color: var(--on-band-muted); }
.nav a:hover { color: var(--on-band); }
.head-phone { font-family: var(--f-data); font-size: .9rem; text-decoration: none; color: var(--on-band); white-space: nowrap; }
@media (max-width: 640px) { .nav { display: none; } .head-phone { margin-left: auto; font-size: .8rem; } }

/* ---------- Hero ---------- */
.hero { background: var(--band); color: var(--on-band); }
.hero-inner { padding-block: 44px 40px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.hero-text { display: grid; gap: 18px; min-width: 0; }
.hero-badge { width: clamp(180px, 22vw, 250px); height: auto; max-width: 100%; }
@media (max-width: 760px) { .hero-inner { grid-template-columns: minmax(0, 1fr); } .hero-badge { display: none; } }
.eyebrow { margin: 0; font-family: var(--f-data); font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--brass); }
.hero h1 {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(2rem, 5.6vw, 3.8rem); line-height: 1.08; letter-spacing: .01em;
}
.lede { margin: 0; max-width: 56ch; color: var(--on-band-muted); font-size: 1.02rem; }
.quick {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; max-width: 640px; margin-top: 6px;
}
.quick .select select { background: var(--surface); }
@media (max-width: 560px) { .quick { grid-template-columns: 1fr 1fr; } .quick .btn { grid-column: 1 / -1; } }

/* ---------- Controls ---------- */
.field { display: grid; gap: 6px; }
.field-label { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.select { position: relative; min-width: 0; }
.select select, .input {
  width: 100%; appearance: none; -webkit-appearance: none;
  font: inherit; font-size: .92rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  padding: 10px 12px; min-height: 42px;
}
.select select { padding-right: 32px; cursor: pointer; }
.select select:disabled { opacity: .55; cursor: not-allowed; }
.select::after {
  content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.input::placeholder { color: var(--muted); }
.btn {
  font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer;
  border-radius: 4px; padding: 10px 18px; min-height: 42px; border: 1px solid transparent;
  background: var(--brass); color: #141210; letter-spacing: .02em;
}
.btn:hover { filter: brightness(1.06); }
.btn-green { background: var(--green); color: var(--on-green); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--green-ink); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Inventory layout ---------- */
.inv { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 32px; padding-block: 36px 56px; align-items: start; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-title { font-family: var(--f-display); font-weight: 700; font-size: 1.7rem; letter-spacing: .02em; }

.filters {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 80px);
  display: grid; gap: 18px; align-content: start;
  max-height: calc(100vh - 100px); overflow: auto; padding: 2px 4px 4px 2px;
}
.filters-head { display: flex; align-items: center; justify-content: space-between; }
.filters-head h2 { font-family: var(--f-display); font-weight: 700; font-size: 1.25rem; }
.filters-close, .filters-foot { display: none; }
.body-types { display: flex; flex-wrap: wrap; gap: 6px; }
.body-types input { position: absolute; opacity: 0; pointer-events: none; }
.body-types label {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: .85rem; font-weight: 600; user-select: none;
}
.body-types label .ct { font-family: var(--f-data); font-size: .72rem; color: var(--muted); }
.body-types input:checked + label { background: var(--green); border-color: var(--green); color: var(--on-green); }
.body-types input:checked + label .ct { color: inherit; opacity: .8; }
.body-types input:focus-visible + label { outline: 3px solid var(--brass); outline-offset: 2px; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.count { margin: 0; color: var(--muted); font-size: .92rem; }
.count strong { color: var(--ink); }
.sort { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.sort .select { width: 190px; }
.filter-toggle { display: none; }
.filter-toggle .badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: var(--brass); color: #141210; font-size: .72rem; margin-left: 6px; padding: 0 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .8rem; font-weight: 600;
  background: var(--brass-soft); color: var(--ink); border: 0; border-radius: 4px; padding: 5px 8px 5px 10px; cursor: pointer;
}
.chip span[aria-hidden] { font-size: 1rem; line-height: 1; color: var(--muted); }

/* ---------- Cards ---------- */
.grid { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card {
  width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr; text-align: left; padding: 0;
  font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--green-ink); }
.media { position: relative; aspect-ratio: 16 / 10; max-width: 100%; background: var(--sunk); display: grid; place-items: center; overflow: hidden; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media .art { width: 82%; height: auto; }
.tag {
  position: absolute; top: 10px; left: 10px; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  background: var(--band); color: var(--on-band); padding: 4px 8px; border-radius: 3px;
}
.tag.pending { background: var(--brass); color: #141210; }
.stockno { position: absolute; top: 10px; right: 10px; font-family: var(--f-data); font-size: .7rem; color: var(--muted); }
.card-body { padding: 14px 16px 16px; display: grid; gap: 4px; align-content: start; }
.card-title { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; line-height: 1.2; letter-spacing: .01em; }
.card-trim { color: var(--muted); font-size: .88rem; }
.card-specs { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-family: var(--f-data); font-size: .76rem; color: var(--muted); }
.card-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.price { font-family: var(--f-data); font-weight: 600; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.view { font-size: .82rem; font-weight: 700; color: var(--green-ink); }

/* car drawing */
.art-body { stroke-width: 5; stroke-linejoin: round; }
.art-glass { fill: var(--glass); }
.art-arch { fill: var(--sunk); }
.art-tire { fill: #121614; }
.art-rim { fill: #9AA29E; }
.art-floor { fill: var(--ink); opacity: .1; }

.empty { margin-top: 24px; padding: 40px 24px; text-align: center; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); }
.empty h3 { font-family: var(--f-display); font-size: 1.4rem; color: var(--ink); margin-bottom: 6px; }
.sample-note { margin: 4px 0 0; font-size: .82rem; color: var(--muted); }
.sample-note b { color: var(--green-ink); }

/* ---------- Mobile filter drawer ---------- */
@media (max-width: 900px) {
  .inv { grid-template-columns: minmax(0, 1fr); padding-block: 24px 48px; }
  .filter-toggle { display: inline-flex; align-items: center; }
  .sort { margin-left: 0; }
  .sort .select { width: 170px; }
  .filters {
    position: fixed; inset: 0; z-index: 40; max-height: none; top: 0;
    background: var(--bg); padding: calc(env(safe-area-inset-top, 0px) + 16px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
    transform: translateY(100%); visibility: hidden; transition: transform .25s ease, visibility .25s;
    overflow: auto; gap: 18px;
  }
  body.filters-open { overflow: hidden; }
  body.filters-open .filters { transform: none; visibility: visible; }
  .filters-close { display: inline-block; }
  .filters-foot {
    display: grid; grid-template-columns: auto 1fr; gap: 10px; position: sticky; bottom: 0;
    background: var(--bg); padding: 12px 0 calc(env(safe-area-inset-bottom, 0px) + 14px); border-top: 1px solid var(--line);
  }
  .filters .reset-desktop { display: none; }
}

/* ---------- Promise strip ---------- */
.promise { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.promise-inner { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; padding-block: 32px; }
.promise h3 { font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; margin-bottom: 4px; }
.promise p { margin: 0; color: var(--muted); font-size: .92rem; max-width: 40ch; }
@media (max-width: 720px) { .promise-inner { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

/* ---------- Visit ---------- */
.visit-inner { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; padding-block: 48px; }
.visit-inner > * { min-width: 0; }
.contact-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.contact-list li { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.contact-list .k { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact-list .v { font-family: var(--f-data); font-size: .95rem; overflow-wrap: anywhere; user-select: all; }
.copy { font: inherit; font-size: .78rem; font-weight: 700; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 4px; padding: 4px 10px; cursor: pointer; }
.hours { width: 100%; border-collapse: collapse; margin-top: 18px; }
.hours td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.hours td:last-child { text-align: right; font-family: var(--f-data); font-size: .9rem; }
@media (max-width: 760px) { .visit-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

.site-foot { background: var(--band); color: var(--on-band-muted); font-size: .82rem; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-block: 22px calc(22px + env(safe-area-inset-bottom, 0px)); }
.site-foot strong { color: var(--on-band); }

/* ---------- Detail dialog ---------- */
.sheet {
  width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
}
.sheet::backdrop { background: rgba(6, 12, 10, .6); }
.sheet-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); position: relative; }
.sheet-media { background: var(--sunk); display: grid; align-content: center; gap: 10px; padding: 24px; min-height: 280px; }
.sheet-media .art { width: 100%; height: auto; }
.sheet-media .main-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 3px; cursor: pointer; background: none; }
.thumbs button[aria-current="true"] { border-color: var(--brass); }
.thumbs img { width: 64px; height: 48px; object-fit: cover; display: block; }
.sheet-body { padding: 26px 26px 24px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.sheet-close {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; z-index: 2;
}
.sheet-stock { margin: 0; font-family: var(--f-data); font-size: .75rem; color: var(--muted); }
.sheet h2 { font-family: var(--f-display); font-weight: 700; font-size: 1.8rem; line-height: 1.1; padding-right: 36px; }
.sheet-trim { margin: 0; color: var(--muted); }
.sheet-price { margin: 10px 0 0; font-family: var(--f-data); font-weight: 600; font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.fine { margin: 0; font-size: .78rem; color: var(--muted); }
.specs { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 18px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .9rem; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; }
.hl { margin: 14px 0 0; padding-left: 18px; font-size: .9rem; display: grid; gap: 3px; }
.hl li::marker { color: var(--brass); }
.ask { margin-top: 18px; padding: 14px; background: var(--sunk); border-radius: 6px; display: grid; gap: 8px; }
.ask h3 { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ask-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ask-row .v { font-family: var(--f-data); font-size: .92rem; overflow-wrap: anywhere; user-select: all; }
.ask p { margin: 0; font-size: .82rem; color: var(--muted); }
@media (max-width: 720px) {
  .sheet { width: 100vw; max-width: 100vw; max-height: 100%; height: 100%; margin: 0; border-radius: 0; border: 0; }
  .sheet-inner { grid-template-columns: minmax(0, 1fr); }
  .sheet-media { min-height: 0; padding: calc(env(safe-area-inset-top, 0px) + 44px) 16px 16px; }
  .sheet-body { padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .sheet-close { top: calc(env(safe-area-inset-top, 0px) + 8px); right: max(10px, env(safe-area-inset-right, 0px)); }
}