/* =========================================================
   Super Cars Kimberley
   Layout: the forecourt. Stock comes first, headings read like
   dealership signage, prices are written in windscreen marker.
   ========================================================= */

:root {
  /* Colour */
  --page: #ffffff;
  --chalk: #ffffff;      /* raised surfaces */
  --tint: #f7f2f2;       /* input wells, image placeholders */
  --ink: #1c1416;        /* text, footer */
  --ink-2: #5f5557;      /* secondary text */
  --rule: #e6dcdd;
  --red: #d0161e;        /* brand red: primary actions, sell band */
  --red-dark: #a8111a;
  --marker: #ffffff;     /* white windscreen paint marker */
  --open: #1f7a3f;
  --closed: #a8111a;

  /* Type */
  --sign: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --text: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat Brush", "Comic Sans MS", "Chalkboard SE", cursive;

  --wrap: 1280px;
  --r: 3px;
}

*, *::before, *::after { 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(--page); color: var(--ink);
  font-family: var(--text); font-size: 1rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.wrap {
  width: 100%; max-width: var(--wrap); margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label { font-size: .74rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }

/* ---------- Signage headings ---------- */
.sign {
  font-family: var(--sign); font-weight: 800; text-transform: uppercase;
  letter-spacing: .01em; line-height: .92;
}
.h-section { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.kicker { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .75em 1.25em; border-radius: var(--r); border: 1.5px solid transparent;
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn-go { background: var(--red); color: var(--chalk); }
.btn-go:hover { background: var(--red-dark); }
.btn-line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: var(--chalk); }
.btn-chalk { background: var(--chalk); color: var(--ink); }
.btn-chalk:hover { background: #fff; }
.btn-wide { width: 100%; }

.link { font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.link:hover { text-decoration-color: var(--red); color: var(--red); }

/* ---------- Header ---------- */
.header { background: var(--chalk); border-bottom: 1px solid var(--rule); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; }
.header-row { display: flex; align-items: center; gap: 36px; min-height: 68px; }
.logo { display: flex; align-items: center; text-decoration: none; flex: none; }
.logo-type { display: flex; flex-direction: column; line-height: 1; }
.logo-type b { font-family: var(--sign); font-weight: 900; font-size: 1.85rem; letter-spacing: .02em; text-transform: uppercase; }
.logo-type b span { color: var(--red); }
.logo-type small { font-size: .62rem; font-weight: 600; letter-spacing: .42em; color: var(--ink-2); margin-top: 2px; }
.nav { display: flex; gap: 26px; }
.nav a { text-decoration: none; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-color: var(--rule); }
.nav a[aria-current="page"] { border-color: var(--ink); }
.header-end { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--closed); flex: none; }
.status.is-open::before { background: var(--open); box-shadow: 0 0 0 3px rgba(31, 122, 63, .18); }
.status b { color: var(--ink); font-weight: 600; }
.header-phone { font-weight: 700; text-decoration: none; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1.5px solid var(--ink); border-radius: var(--r); padding: 6px 12px; font-weight: 600; cursor: pointer; }
.mobile-nav { display: none; }

/* ---------- Hero ---------- */
.hero { padding-block: 40px 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 48px; align-items: end; }
.hero-sign { font-size: clamp(5.6rem, 11.5vw, 10.5rem); line-height: .82; letter-spacing: -.005em; }
.hero-sign span { display: block; }
.hero-sign span:last-child { color: var(--red); }
.hero-town { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-weight: 600; letter-spacing: .3em; font-size: .9rem; }
.hero-town::after { content: ""; flex: 1; height: 1.5px; background: var(--ink); }
.hero-lead { font-size: 1.2rem; max-width: 36ch; margin-top: 26px; color: var(--ink); }
.hero-lead a { font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.just-in { position: relative; display: block; text-decoration: none; color: var(--chalk); border-radius: var(--r); overflow: hidden; background: var(--ink); }
.just-in img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; transition: transform .6s; }
.just-in:hover img { transform: scale(1.025); }
.just-in-label {
  position: absolute; top: 18px; left: 18px; font-family: var(--hand); color: var(--marker);
  font-size: 2.2rem; transform: rotate(-4deg); text-shadow: 0 2px 10px rgba(0, 0, 0, .55);
}
.just-in-foot {
  position: absolute; inset: auto 0 0 0; padding: 70px 22px 20px;
  background: linear-gradient(180deg, transparent, rgba(20, 10, 12, .82));
  display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap;
}
.just-in-foot h2 { font-family: var(--text); font-size: 1.15rem; font-weight: 700; text-transform: none; }
.just-in-foot p { font-size: .9rem; opacity: .85; }

/* Marker price written on the glass */
.marker {
  font-family: var(--hand); color: var(--marker); line-height: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35), 0 2px 12px rgba(0, 0, 0, .5);
  transform: rotate(-3deg); transform-origin: left bottom; display: inline-block;
}
.just-in .marker { font-size: clamp(2.4rem, 4.2vw, 3.3rem); }

/* ---------- Quick search ---------- */
.search { margin-top: 40px; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule); }
.search-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
.search .fld { padding: 14px 18px 14px 0; display: grid; gap: 2px; border-right: 1px solid var(--rule); margin-right: 18px; }
.search .fld:last-of-type { border-right: 0; }
.fld label, .fld .label { font-size: .74rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.search select { border: 0; background: transparent; font-size: 1.05rem; font-weight: 600; padding: 2px 0; cursor: pointer; width: 100%; }
.search .btn { align-self: center; margin-block: 10px; }

/* ---------- Sections ---------- */
.section { padding-block: 84px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px 40px; flex-wrap: wrap; margin-bottom: 30px; }
.section-head p { color: var(--ink-2); max-width: 52ch; margin-top: 10px; }

/* Body-type tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 4px 22px; border-bottom: 1px solid var(--rule); margin-bottom: 28px; }
.tabs button {
  background: none; border: 0; padding: 10px 0; margin-bottom: -1px; cursor: pointer;
  font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
.tabs sup { font-size: .72rem; font-weight: 500; margin-left: 2px; }

/* ---------- Car card (grid) ---------- */
.stock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 22px; }
.car { display: flex; flex-direction: column; text-decoration: none; min-width: 0; }
.car-photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r); background: var(--tint); }
.car-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.car:hover .car-photo img { transform: scale(1.035); }
.car-photo.plain::after { content: none; }
.car-photo::after { content: ""; position: absolute; inset: 55% 0 0 0; background: linear-gradient(180deg, transparent, rgba(20, 10, 12, .62)); }
.car-photo .marker { position: absolute; left: 14px; bottom: 10px; z-index: 1; font-size: 1.9rem; }
.car-tag { position: absolute; top: 8px; left: 12px; z-index: 1; font-family: var(--hand); color: var(--marker); font-size: 1.4rem; transform: rotate(-4deg); text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.car-info { padding-top: 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.car-name { font-weight: 700; font-size: 1.06rem; line-height: 1.3; }
.car:hover .car-name { text-decoration: underline; text-underline-offset: 3px; }
.car-variant { color: var(--ink-2); font-size: .94rem; }
.car-line { font-size: .88rem; color: var(--ink-2); margin-top: 6px; }
.car-notes { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
/* Instalment line sits on a shared baseline at the bottom of every card */
.car-info > :nth-last-child(2) { margin-bottom: 8px; }
.car-pm { font-size: .86rem; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--rule); }
.car-pm b { font-weight: 700; }

/* ---------- Sell band ---------- */
.band { background: var(--red); color: var(--chalk); }
.sell-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 64px; align-items: start; }
.band .kicker { color: rgba(255, 255, 255, .7); }
.band p { color: rgba(255, 255, 255, .86); }
.sell-steps { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 0; counter-reset: s; border-top: 1px solid rgba(255, 255, 255, .22); }
.sell-steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; padding: 16px 0; border-bottom: 1px solid rgba(255, 255, 255, .22); }
.sell-steps li::before { content: counter(s); font-family: var(--sign); font-weight: 800; font-size: 1.6rem; line-height: 1.1; }
.sell-steps b { display: block; }
.sell-form { background: var(--chalk); color: var(--ink); border-radius: var(--r); padding: 30px; display: grid; gap: 16px; }
.sell-form h3 { font-family: var(--sign); font-weight: 800; text-transform: uppercase; font-size: 1.9rem; line-height: 1; }

/* ---------- Form fields ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.fld { display: grid; gap: 6px; min-width: 0; }
.input, .select, .textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--rule); border-radius: var(--r);
  background: var(--chalk); color: var(--ink); outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--red); }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--chalk) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1416' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 15px; }
.textarea { min-height: 96px; resize: vertical; }
.form-note { font-size: .84rem; color: var(--ink-2); }
.form-note.done { color: var(--open); font-weight: 600; }

/* ---------- Finance quote sheet ---------- */
.finance-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.finance-copy p { color: var(--ink-2); margin-top: 14px; max-width: 44ch; }
.finance-copy ul { margin: 22px 0 0; padding: 0 0 0 18px; color: var(--ink-2); display: grid; gap: 6px; }
.quote { background: var(--chalk); border: 1px solid var(--rule); border-radius: var(--r); padding: 28px 30px; }
.q-val, .q-total b, .q-fine strong { font-variant-numeric: tabular-nums; }
.quote-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 14px; border-bottom: 1.5px solid var(--ink); flex-wrap: wrap; }
.quote-head h3 { font-family: var(--sign); font-weight: 800; text-transform: uppercase; font-size: 1.7rem; line-height: 1; }
.quote-head span { font-size: .8rem; color: var(--ink-2); }
.q-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--rule); }
.q-row > label, .q-row > span:first-child { flex: none; }
.q-row::after { content: none; }
.q-lead { flex: 1; border-bottom: 1px dotted var(--ink-2); opacity: .45; transform: translateY(5px); min-width: 12px; }
.q-val { font-weight: 600; text-align: right; }
.q-in { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid var(--rule); border-radius: var(--r); padding: 4px 8px; background: var(--tint); }
.q-in:focus-within { border-color: var(--red); }
.q-in input, .q-in select { border: 0; background: transparent; outline: none; font-weight: 600; text-align: right; }
.q-in input { width: 7.5ch; }
.q-in input.wide { width: 9.5ch; }
.q-in select { cursor: pointer; }
.q-total { display: flex; justify-content: space-between; align-items: end; gap: 12px; padding-top: 18px; margin-top: 6px; border-top: 1.5px solid var(--ink); flex-wrap: wrap; }
.q-total span { font-weight: 600; }
.q-total b { font-family: var(--sign); font-weight: 800; font-size: clamp(2.6rem, 5vw, 3.4rem); line-height: .9; }
.q-total small { font-size: 1rem; font-family: var(--text); font-weight: 500; color: var(--ink-2); margin-left: 4px; }
.q-fine { font-size: .8rem; color: var(--ink-2); margin-top: 16px; }
.q-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ---------- Find us ---------- */
.find-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: stretch; }
.find-block { display: grid; gap: 4px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.find-block:first-child { border-top: 1.5px solid var(--ink); }
.find-block .big { font-size: 1.3rem; font-weight: 700; }
.hours { width: 100%; border-collapse: collapse; }
.hours td { padding: 4px 0; }
.hours td:last-child { text-align: right; font-weight: 600; }
.hours tr.today td { font-weight: 700; }
.hours tr.today td:first-child::after { content: " · today"; font-weight: 500; color: var(--ink-2); }
.find-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.map { border-radius: var(--r); overflow: hidden; background: var(--tint); min-height: 420px; }
.map iframe { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; filter: grayscale(.85) contrast(1.05); }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: rgba(255, 255, 255, .74); padding-block: 56px 28px; font-size: .92rem; }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-bottom: 36px; border-bottom: 1px solid rgba(255, 255, 255, .16); }
.footer .logo { color: var(--chalk); }
.footer .logo-type small { color: rgba(255, 255, 255, .6); }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer h4 { margin: 0 0 10px; color: var(--chalk); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--chalk); text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px 30px; flex-wrap: wrap; padding-top: 22px; font-size: .8rem; }

/* ---------- Inventory ---------- */
.page-top { padding-block: 36px 26px; border-bottom: 1px solid var(--rule); }
.crumbs { font-size: .85rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.page-top h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin-top: 10px; }

.inv { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 44px; padding-block: 28px 84px; align-items: start; }
.filters { display: grid; gap: 24px; position: sticky; top: 88px; }
.filters-head { display: flex; justify-content: space-between; align-items: baseline; }
.filters-head h2 { font-size: 1rem; font-weight: 700; }
.filters-head button { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; color: var(--ink-2); }
.f-group { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--rule); }
.f-group legend, .f-group > .label { padding: 0; margin-bottom: 4px; font-size: .74rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
fieldset.f-group { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 16px 0 0; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .95rem; }
.check input { width: 17px; height: 17px; accent-color: var(--red); margin: 0; flex: none; }
.check span:last-child { margin-left: auto; color: var(--ink-2); font-size: .82rem; font-variant-numeric: tabular-nums; }
.check.is-empty { color: var(--ink-2); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.inv-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1.5px solid var(--ink); }
.inv-bar h2 { font-size: 1rem; font-weight: 600; }
.inv-bar-end { display: flex; gap: 10px; align-items: center; }
.inv-bar .select { width: auto; }
.filter-toggle { display: none; }

.rows { display: grid; }
.row { display: grid; grid-template-columns: 300px minmax(0, 1fr) auto; gap: 26px; padding-block: 22px; border-bottom: 1px solid var(--rule); text-decoration: none; align-items: start; }
.row .car-photo { aspect-ratio: 4 / 3; }
.row:hover .car-photo img { transform: scale(1.035); }
.row:hover .car-name { text-decoration: underline; text-underline-offset: 3px; }
.row-main { display: grid; gap: 4px; min-width: 0; }
.row-main .car-name { font-size: 1.25rem; }
.row-specs { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: .9rem; color: var(--ink-2); }
.row-specs span b { color: var(--ink); font-weight: 600; }
.row-side { text-align: right; display: grid; gap: 4px; justify-items: end; }
.row-price { font-family: var(--sign); font-weight: 800; font-size: 2rem; line-height: 1; }
.row-pm { font-size: .86rem; color: var(--ink-2); }
.row-pm b { color: var(--ink); }
.row-cta { margin-top: 12px; font-weight: 600; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; }

.empty { padding: 48px 0; display: grid; gap: 12px; justify-items: start; max-width: 52ch; }
.empty h3 { font-size: 1.3rem; }
.empty p { color: var(--ink-2); }

/* ---------- Vehicle detail ---------- */
.vd-title { display: flex; justify-content: space-between; align-items: end; gap: 16px 40px; flex-wrap: wrap; margin-top: 12px; }
.vd-title h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); }
.vd-title .sub { color: var(--ink-2); font-size: 1.1rem; margin-top: 8px; }
.vd { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; padding-block: 28px 72px; align-items: start; }
.vd-photo { position: relative; border-radius: var(--r); overflow: hidden; background: var(--tint); }
.vd-photo img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.vd-photo::after { content: ""; position: absolute; inset: 60% 0 0 0; background: linear-gradient(180deg, transparent, rgba(20, 10, 12, .6)); }
.vd-photo .marker { position: absolute; left: 24px; bottom: 18px; z-index: 1; font-size: clamp(2.4rem, 4.6vw, 3.6rem); }
.vd-photo .car-tag { font-size: 1.9rem; top: 16px; left: 20px; }
.vd-panel { position: sticky; top: 88px; display: grid; gap: 18px; }
.vd-price { font-family: var(--sign); font-weight: 800; font-size: 3.2rem; line-height: .9; }
.vd-pm { color: var(--ink-2); font-size: .92rem; margin-top: 6px; }
.vd-pm b { color: var(--ink); }
.vd-actions { display: grid; gap: 10px; }
.vd-contact { font-size: .9rem; color: var(--ink-2); padding-top: 16px; border-top: 1px solid var(--rule); display: grid; gap: 4px; }
.vd-contact b { color: var(--ink); }
.vd-section { margin-top: 44px; }
.vd-section h2 { font-family: var(--sign); font-weight: 800; text-transform: uppercase; font-size: 1.9rem; line-height: 1; padding-bottom: 12px; border-bottom: 1.5px solid var(--ink); }
.specs { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; margin: 0; }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.specs dt { color: var(--ink-2); }
.specs dd { margin: 0; font-weight: 600; text-align: right; }
.feat { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.feat li { padding: 10px 0 10px 20px; border-bottom: 1px solid var(--rule); break-inside: avoid; position: relative; }
.feat li::before { content: ""; position: absolute; left: 0; top: 1.15em; width: 10px; height: 2px; background: var(--red); }
.vd .quote { margin-top: 18px; }
.mobile-buy { display: none; }
.header-call { display: none; }
.filters-foot { display: none; }
.row-main .car-notes { margin-top: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stock { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav { gap: 18px; }
  .header-end .status { display: none; }
}

/* Tablet and phone */
@media (max-width: 900px) {
  .header-row { gap: 10px; min-height: 60px; }
  .nav, .header-end { display: none; }
  .header-call {
    display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 7px 12px;
    border-radius: var(--r); background: var(--red); color: var(--chalk); font-weight: 600; text-decoration: none;
  }
  .header-call svg { width: 15px; height: 15px; }
  .menu-btn { display: block; margin-left: 0; padding: 6px 12px; }
  .mobile-nav.open { display: grid; padding-block: 6px 18px; border-top: 1px solid var(--rule); max-height: calc(100dvh - 60px); overflow-y: auto; }
  .mobile-nav a { padding: 13px 0; border-bottom: 1px solid var(--rule); text-decoration: none; font-weight: 600; }
  .mobile-nav .status { padding-top: 14px; }

  .hero-grid, .sell-grid, .finance-grid, .find-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .search-row { grid-template-columns: 1fr 1fr; }
  .search .fld { border-right: 0; border-bottom: 1px solid var(--rule); margin-right: 0; padding-right: 0; }
  .search .fld:nth-child(odd) { border-right: 1px solid var(--rule); margin-right: 16px; padding-right: 16px; }
  .search .btn { grid-column: 1 / -1; margin-block: 14px; }

  /* Body-type tabs swipe sideways instead of wrapping */
  .tabs {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin-inline: -20px; padding-inline: 20px; gap: 22px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; padding-block: 12px; }

  .stock { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Filters become a full-screen sheet */
  .inv { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 18px; }
  .filters {
    display: none; position: fixed; inset: 0; z-index: 60; overflow-y: auto; overscroll-behavior: contain;
    background: var(--page); align-content: start; gap: 20px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  }
  .filters.open { display: grid; }
  .filters-head { position: sticky; top: calc(-14px - env(safe-area-inset-top, 0px)); z-index: 1; background: var(--page); padding-block: 14px 10px; margin-top: -14px; border-bottom: 1.5px solid var(--ink); }
  .filters-head h2 { font-family: var(--sign); font-weight: 800; text-transform: uppercase; font-size: 1.8rem; line-height: 1; }
  .filters-foot {
    display: flex; gap: 10px; position: sticky; bottom: 0; background: var(--page); margin-top: 4px;
    padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule);
  }
  .filters-foot .btn-go { flex: 1; }
  .check { padding-block: 7px; }
  .filter-toggle { display: inline-flex; }
  body.sheet-open { overflow: hidden; }

  .row { grid-template-columns: 220px minmax(0, 1fr); }
  .row-side { grid-column: 2; text-align: left; justify-items: start; }

  /* Vehicle page: price and enquiry buttons straight after the photo */
  .vd { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 20px; }
  .vd-main { display: contents; }
  .vd-photo { order: 1; }
  .vd-panel { order: 2; position: static; }
  .vd-panel .vd-price { display: none; }   /* shown in the sticky bar instead */
  .vd-section { order: 3; margin-top: 12px; }
  .mobile-buy {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 8px; align-items: center;
    background: var(--chalk); border-top: 1px solid var(--rule);
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }
  .mobile-buy .vd-price { display: block; font-size: 1.8rem; margin-right: auto; }
  body.has-buy-bar { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

/* Phone */
@media (max-width: 600px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .logo-type b { font-size: 1.6rem; }
  .section { padding-block: 52px; }
  .h-section { font-size: 2.4rem; }
  .section-head { margin-bottom: 18px; }

  .hero { padding-top: 24px; }
  .hero-grid { gap: 26px; }
  .hero-town { margin-top: 12px; }
  .hero-lead { font-size: 1.05rem; margin-top: 16px; }
  .hero-actions { margin-top: 20px; flex-wrap: nowrap; }
  .hero-actions .btn { flex: 1; padding-inline: .8em; }
  .just-in img { aspect-ratio: 4 / 3; }
  .just-in-label { font-size: 1.7rem; top: 10px; left: 14px; }
  .just-in-foot { padding: 50px 14px 12px; }
  .just-in-foot h2 { font-size: 1rem; }
  .just-in-foot p { font-size: .8rem; }
  .just-in .marker { font-size: 2.2rem; }
  .search { margin-top: 26px; }
  .search .fld { padding-block: 10px; }
  .tabs { margin-inline: -16px; padding-inline: 16px; margin-bottom: 4px; }

  /* Compact side-by-side car cards */
  .stock { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .car { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 14px; padding-block: 14px; border-bottom: 1px solid var(--rule); }
  .car-photo { align-self: start; }
  .car-photo .marker { font-size: 1.3rem; left: 8px; bottom: 5px; }
  .car-photo .car-tag { font-size: 1rem; top: 3px; left: 8px; }
  .car-info { padding-top: 0; gap: 1px; }
  .car-name { font-size: 1rem; }
  .car-variant { font-size: .85rem; }
  .car-line { font-size: .8rem; margin-top: 3px; }
  .car-notes { font-size: .68rem; }
  .car-info > :nth-last-child(2) { margin-bottom: 0; }
  .car-pm { border-top: 0; padding-top: 3px; margin-top: 0; font-size: .8rem; }

  .row { grid-template-columns: 136px minmax(0, 1fr); gap: 4px 14px; padding-block: 14px; }
  .row .car-photo { grid-row: span 2; }
  .row-main { gap: 1px; }
  .row-main .car-name { font-size: 1rem; }
  .row-main .car-variant { font-size: .85rem; }
  .row-specs { margin-top: 3px; gap: 0 10px; font-size: .8rem; }
  .row-specs span:nth-child(n+4) { display: none; }
  .row-main .car-notes { margin-top: 3px; font-size: .68rem; }
  .row-side { gap: 0; }
  .row-price { font-size: 1.5rem; }
  .row-pm { font-size: .8rem; }
  .row-cta { display: none; }
  .inv-bar { gap: 10px; }
  .inv-bar-end { flex: 1 1 100%; }
  .inv-bar-end .select { flex: 1; min-width: 0; }

  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .sell-form, .quote { padding: 22px 16px; }
  .q-row { flex-wrap: wrap; }
  .specs { grid-template-columns: minmax(0, 1fr); }
  .feat { columns: 1; }
  .vd-photo .marker { left: 14px; bottom: 10px; font-size: 2.4rem; }
  .vd-photo .car-tag { font-size: 1.5rem; top: 8px; left: 14px; }
  .map, .map iframe { min-height: 280px; }

  .footer { padding-block: 44px 24px; }
  .footer-cols { gap: 36px; }
  .footer-cols > div:first-child { display: none; }  /* make list is long on a phone */
}

/* Very narrow phones */
@media (max-width: 360px) {
  .car, .row { grid-template-columns: 112px minmax(0, 1fr); }
  .hero-actions { flex-wrap: wrap; }
  .header-call span { display: none; }
}
