/* Trade Ordering Platform — design system.
   Palette/typeface pulled from the real autopartuk.com site (Work Sans,
   deep teal-green accent, near-black header/footer) so this reads as part
   of the same business rather than a generic scaffold. */

:root {
  --color-primary: #1f5c46;
  --color-primary-dark: #143f30;
  --color-primary-light: #2c7a5b;
  --color-dark: #16171a;
  --color-bg: #f2f3f5;
  --color-surface: #ffffff;
  --color-text: #434549;
  --color-text-muted: #75777c;
  --color-border: #e1e3e6;
  --color-danger: #b3261e;
  --color-danger-bg: #fdecea;
  --color-success: #1f5c46;
  --color-success-bg: #e9f3ef;
  --color-warning: #a15c00;
  --color-warning-bg: #fff4e5;
  --radius: 8px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(22, 23, 26, 0.06), 0 1px 8px rgba(22, 23, 26, 0.05);
}

* { box-sizing: border-box; }
/* The `hidden` attribute must always win, even over a class that sets
   display (e.g. .btn's inline-flex) — otherwise `el.hidden = true` in JS
   silently does nothing for those elements. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Work Sans", Arial, Helvetica, sans-serif;
  font-variant-numeric: tabular-nums;   /* prices, sizes and codes line up in columns */
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: "Work Sans", Arial, Helvetica, sans-serif;
  color: var(--color-dark);
  font-weight: 700;
  margin: 0 0 0.6em;
}
h1 { font-size: 1.625rem; }
h2 { font-size: 1.25rem; margin-top: 1.6em; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout shell ---- */

.site-header {
  background: var(--color-dark);
  color: #fff;
}
.site-header__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-header__brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
}
.site-header__brand span { color: var(--color-primary-light); }
.site-header__nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.9375rem;
}
.site-header__nav a {
  color: rgba(255, 255, 255, 0.85);
}
.site-header__nav a:hover { color: #fff; }
.site-header__menu { display: none; }   /* phones only, see the 640px rules */
.site-header__signout { display: inline; }
.site-header__cart-count {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  padding: 1px 8px;
  margin-left: 4px;
}

/* Basket hover preview. The dropdown sits flush against the nav link's own
   bottom edge (no gap) so the mouse never leaves .basket-nav while moving
   from the link down into the dropdown — a gap there would make it flicker
   closed before you reach it. */
.basket-nav {
  position: relative;
}
.basket-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  margin-top: 0;
  padding-top: 12px;
  z-index: 20;
}
.basket-nav:hover .basket-dropdown,
.basket-nav.is-open .basket-dropdown {
  display: block;
}
/* Nothing in the basket: shown as dimmed text rather than a link. */
.basket-nav--empty {
  color: rgba(255, 255, 255, 0.45);
  cursor: default;
}
.basket-dropdown__list {
  list-style: none;
  margin: 0;
  padding: 8px;
  background: var(--color-surface);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
}
.basket-dropdown__list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text);
}
.basket-dropdown__list li:last-child { border-bottom: none; }
.basket-dropdown__name { flex: 1 1 auto; }
.basket-dropdown__qty { color: var(--color-text-muted); }
.basket-dropdown__price { font-weight: 600; white-space: nowrap; }
.basket-dropdown__footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text);
}
.basket-dropdown .btn--block {
  border-radius: 0 0 var(--radius) var(--radius);
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 40px;
}
.site-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.breadcrumb {
  font-size: 0.875rem;
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--color-text-muted); }

/* ---- Cards & surfaces ---- */

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
/* Paid confirmation on the order page: green, so a dealer landing back
   from the card gateway sees at a glance that it went through. */
.card--paid {
  background: var(--color-success-bg);
  border-left: 4px solid var(--color-success);
}
.paid-panel__title { color: var(--color-success); }
/* Not yet quoted: amber, the same warning tone as the fitment banner, so a
   dealer doesn't take the order as finished. */
.card--policy { margin-top: 16px; background: var(--color-warning-bg); border-left: 4px solid var(--color-warning); font-size: 0.9375rem; }
.policy-panel__title { font-size: 1.0625rem; }
.card--pending {
  background: var(--color-warning-bg);
  border-left: 4px solid var(--color-warning);
}
.pending-panel__title { color: var(--color-warning); }
.paid-panel__title::before { content: "\2713"; margin-right: 8px; }

/* Tracking on the order page: its own card with the Track parcel button. */
.card--tracking { border-left: 4px solid var(--color-primary); }
.tracking-panel__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tracking-panel__actions .btn { flex: 1 1 auto; justify-content: center; text-align: center; }

/* My orders: courier and consignment number, then a Track button. */
.track-cell { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.track-cell__number { font-weight: 600; position: relative; z-index: 2; cursor: text; }   /* selectable: above the row link */
.track-cell__btn { position: relative; z-index: 2; }   /* above the row's stretched link, so it opens the courier, not the order */

.card--narrow {
  max-width: 420px;
  margin: 48px auto;
}

/* Order detail: totals / payment / delivery side by side instead of
   stacked full-width blocks, so the page doesn't run on forever. */
.order-summary-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 20px;
  margin-top: 20px;
}
.order-summary-grid > .card {
  flex: 1 1 280px;
  min-width: 0;   /* may shrink below its inputs' intrinsic width on a phone */
  padding: 20px 24px;
}
/* Inputs side by side (City/Postcode, phone/email) must be allowed to
   shrink, or the card can't and the whole page goes wider than the phone.
   Same for the <fieldset> around the delivery address: browsers give
   fieldsets min-inline-size: min-content, which pinned it at 402px. */
.cluster > input { min-width: 0; }
fieldset { min-inline-size: 0; min-width: 0; }

/* Basket totals box: sits under the line-item table, right-aligned on
   desktop like an invoice's totals block, full-width on phones. */
.basket-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-top: 12px;
}
.basket-summary { flex: 0 1 380px; margin-left: auto; }
.basket-summary__zone { font-weight: 400; font-size: 0.875rem; }
.basket-summary__zone:has(> [data-total="zone"]:empty) { display: none; }
.basket-summary__note { margin-top: 10px; font-size: 0.8125rem; }
@media (max-width: 640px) {
  .basket-summary { flex-basis: 100%; }
}

/* Basket / order tables on phones: no sideways scrolling. Each row becomes
   a stacked block — the product cell as a heading, the other cells as
   "Label   value" lines (label from data-label), actions at the bottom. */
@media (max-width: 640px) {
  .table-scroll:has(> .table-stack) { overflow-x: visible; }
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 12px 14px; border-bottom: 1px solid var(--color-border); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { padding: 5px 0; border: 0; white-space: normal; }
  .table-stack td[data-label] {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .table-stack td[data-label]::before {
    content: attr(data-label);
    flex: none;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
  }
  .table-stack td[data-label] > * { text-align: right; }
  .table-stack td[data-label] select { max-width: 60%; }
  .table-stack__title { font-weight: 600; padding-bottom: 6px; }
  .table-stack__actions { padding-top: 10px; text-align: right; }
}

.summary-list { margin: 0; }
.summary-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
}
.summary-list > div:last-child { border-bottom: none; }
.summary-list dt { color: var(--color-text-muted); margin: 0; }
.summary-list dd { margin: 0; font-weight: 600; }
.summary-list__total dt,
.summary-list__total dd { font-weight: 700; color: var(--color-dark); }

/* ---- Messages ---- */

.messages { list-style: none; margin: 0 0 20px; padding: 0; }
.messages li {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 0.9375rem;
  border-left: 4px solid var(--color-text-muted);
  background: var(--color-bg);
}
.messages li.success { background: var(--color-success-bg); border-color: var(--color-success); color: var(--color-primary-dark); }
.messages li.error { background: var(--color-danger-bg); border-color: var(--color-danger); color: var(--color-danger); }
.messages li.warning { background: var(--color-warning-bg); border-color: var(--color-warning); color: var(--color-warning); }
.messages li.info { background: var(--color-bg); border-color: var(--color-text-muted); }

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 9px 20px;
  cursor: pointer;
  background: var(--color-primary);
  color: #fff;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--color-primary-dark); text-decoration: none; }
.btn:disabled { background: var(--color-border); color: var(--color-text-muted); cursor: not-allowed; }

.btn--secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn--secondary:hover { background: var(--color-bg); }

.btn--danger {
  background: transparent;
  color: var(--color-danger);
  border-color: var(--color-danger-bg);
}
.btn--danger:hover { background: var(--color-danger-bg); }

.btn--small { padding: 5px 14px; font-size: 0.75rem; }
.btn--block { width: 100%; justify-content: center; }

/* ---- Forms ---- */

label { font-size: 0.875rem; color: var(--color-text-muted); }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="tel"],
select,
textarea {
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 10px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 92, 70, 0.12);
}
input[type="number"] { width: 5.5em; }
input:disabled, select:disabled, textarea:disabled {
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 4px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; }

/* The most common choice on the delivery step, so it gets its own
   button-like toggle instead of a plain small checkbox easy to miss. */
.ship-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
/* Checkout: "Ship to us" / "Ship direct to customer" side by side. */
.ship-choice { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.ship-choice .ship-toggle { flex: 1 1 200px; margin-bottom: 0; }
.ship-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-primary);
}
.ship-toggle--on {
  border-color: var(--color-primary);
  background: var(--color-success-bg);
  color: var(--color-primary-dark);
}

/* Plain Django {{ form.as_p }} output */
form p { margin-bottom: 16px; }
form p label { display: block; margin-bottom: 4px; font-weight: 600; color: var(--color-text); }
form p input, form p select, form p textarea { width: 100%; }

/* Vehicle lookup on the product list: the picker (four cascading
   dropdowns, shown until a vehicle is chosen) and the banner that replaces
   it once one is. Same card treatment as the filter bar beneath, but not
   sticky — it's a one-off choice, not something to keep at hand while
   scrolling. */
.vehicle-picker,
.vehicle-banner {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 20px;
  margin-bottom: 16px;
}
/* Vehicle picker, list style: collapsed to a one-line bar by default on
   every screen size (see .collapse-toggle); open, it's Make › Model ›
   Version crumbs and one scrollable pick-list at a time with a filter box. */
.vehicle-picker { padding: 12px 20px; border-left: 4px solid var(--color-primary); }
.vehicle-picker > .collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: center;   /* centred, and reads as an action, not a footnote */
  flex-wrap: wrap;
  gap: 10px 16px;
  width: 100%;
  padding: 2px 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--color-dark);
  cursor: pointer;
  text-align: center;
}
.collapse-toggle__icon { flex: none; color: var(--color-primary); }
.collapse-toggle__text strong { font-size: 1rem; }
.collapse-toggle__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  transition: background 0.15s ease;
}
.vehicle-picker > .collapse-toggle:hover .collapse-toggle__cta { background: var(--color-primary-dark); }
.collapse-toggle__cta svg { transition: transform 0.15s ease; }
.vehicle-picker > .collapse-toggle[aria-expanded="true"] .collapse-toggle__cta svg { transform: rotate(180deg); }
.vehicle-picker > .collapse-body { display: none; padding-top: 14px; }
.vehicle-picker.is-open > .collapse-body { display: block; }
.vp-tabs {
  display: flex;
  width: min(100%, 420px);
  margin: 0 auto 14px;
  border: 1px solid var(--color-dark);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.vp-tab {
  flex: 1;
  padding: 9px 12px;
  border: 0;
  background: var(--color-surface);
  color: var(--color-dark);
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}
.vp-tab[aria-selected="true"] { background: var(--color-dark); color: #fff; }
.vp-reg {
  display: flex;
  align-items: stretch;
  width: min(100%, 400px);
  margin: 0 auto 14px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--color-dark);
}
.vp-reg__msg { margin: 8px 0 0; font-size: 0.875rem; color: var(--color-text-muted); }
.vp-reg__msg--ok { color: var(--color-primary); }
.vp-reg__msg--warn { color: var(--color-warning); }
.vp-reg__flag {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #1d4ed8;
  color: #fff;
  font-weight: 700;
  font-size: 0.8125rem;
}
.vp-reg__input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 10px 12px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  background: #fcd34d;
  color: var(--color-dark);
}
.vp-reg__go {
  border: 0;
  padding: 0 16px;
  background: var(--color-dark);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.vp-steps__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  margin-bottom: 10px;
}
.vp-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}
.vp-crumb {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}
.vp-crumb + .vp-crumb::before { content: none; }
.vp-crumb--done { background: var(--color-success-bg); color: var(--color-primary-dark); }
.vp-crumb--current { background: var(--color-dark); color: #fff; }
.vp-steps__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.vp-steps__label { margin: 0; font-weight: 700; color: var(--color-dark); }
.vp-filter { width: min(100%, 260px); padding: 7px 10px; font-size: 0.875rem; }
.vp-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}
.vp-list li + li { border-top: 1px solid var(--color-border); }
.vp-list__empty { padding: 14px 16px; color: var(--color-text-muted); font-size: 0.875rem; }
.vp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 16px;
  border: 0;
  background: transparent;
  color: var(--color-dark);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.vp-item:hover, .vp-item:focus-visible { background: var(--color-success-bg); outline: none; }
.vp-item__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vp-item__title { font-weight: 600; font-size: 0.9375rem; }
.vp-item__sub { font-size: 0.8125rem; color: var(--color-text-muted); }
.vp-item__chevron { flex: none; color: var(--color-text-muted); }
@media (max-width: 767px) {
  .vehicle-picker { padding: 10px 14px; }
  .collapse-toggle__icon { display: none; }
  .vehicle-picker > .collapse-toggle { font-size: 0.875rem; gap: 6px 12px; padding: 0; }
  .collapse-toggle__text strong { font-size: 0.9375rem; }
  .collapse-toggle__cta { padding: 6px 14px; font-size: 0.8125rem; }
  .guest-notice { padding: 8px 12px; font-size: 0.8125rem; gap: 2px 8px; margin-bottom: 10px; }
  .vp-steps__head { flex-wrap: wrap; }
  .vp-filter { width: 100%; }
  .vp-list { max-height: 55vh; }
}

/* Fitment disclaimer: an amber banner (meant to be noticed) with a
   one-line summary; native <details> expands the fuller explanation —
   always in the HTML, never in the way. */
.fitment-disclaimer {
  flex: 1 1 100%;
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 6px;
  border-left: 4px solid var(--color-warning);
  background: var(--color-warning-bg);
  color: var(--color-warning);
  font-size: 0.875rem;
  line-height: 1.45;
}
.fitment-disclaimer summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}
.fitment-disclaimer summary::-webkit-details-marker { display: none; }
.fitment-disclaimer__icon {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-warning);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  margin-top: 1px;
}
.fitment-disclaimer__text { flex: 1; }
.fitment-disclaimer__short, .fitment-disclaimer__full { display: none; }
.fitment-disclaimer__more {
  flex: none;
  text-decoration: underline;
  font-weight: 600;
  white-space: nowrap;
}
.fitment-disclaimer[open] .fitment-disclaimer__more { display: none; }
.fitment-disclaimer__body { margin-top: 8px; padding-left: 30px; font-weight: 400; }
.fitment-disclaimer__body p { margin: 6px 0 0; }
.fitment-disclaimer__body strong { font-weight: 700; }
@media (max-width: 640px) {
  /* One line on a phone: icon, a short label, "Read more". The full sentence is the first line of the drop-down. */
  .fitment-disclaimer { padding: 8px 12px; }
  .fitment-disclaimer summary { flex-wrap: nowrap; align-items: center; gap: 8px; }
  .fitment-disclaimer__icon { margin-top: 0; }
  .fitment-disclaimer__text { display: none; }
  .fitment-disclaimer__short { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fitment-disclaimer__full { display: block; }
  .fitment-disclaimer__body { padding-left: 0; }
}

.vehicle-picker__note {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 6px;
  border-left: 4px solid var(--color-warning);
  background: var(--color-warning-bg);
  color: var(--color-warning);
  font-size: 0.875rem;
}

.vehicle-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  border-left: 4px solid var(--color-primary);
}
.vehicle-banner__main {
  display: flex;
  flex-direction: column;
  flex: 1 1 220px;
}
.vehicle-banner__eyebrow {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.vehicle-banner__title {
  font-size: 1rem;
  color: var(--color-dark);
}
.vehicle-banner__version {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
.vehicle-banner__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
}
.vehicle-banner__specs > div { display: flex; flex-direction: column; }
.vehicle-banner__specs dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.vehicle-banner__specs dd {
  margin: 0;
  font-weight: 600;
  color: var(--color-dark);
}
.vehicle-banner__limit {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
/* Van load-rating slider (business's design spec, 10 Sep 2026): a white
   card inside the banner. 61 discrete stops (Any, then 750–1350kg in
   10kg steps) — position is index/61; the fill and handle are positioned
   by the script (and server-side for first paint). The readout lives in
   the header, not in a bubble over the handle (it would overflow the card
   at the ends). */
.load-scale {
  flex: 1 1 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 24px 18px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.load-scale__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.load-scale__title { font-size: 15px; font-weight: 600; color: #111827; letter-spacing: -0.005em; }
.load-scale__sub { font-size: 13px; color: #9ca3af; margin-top: 3px; }
.load-scale__controls { display: flex; align-items: center; gap: 10px; }
.load-scale__readout {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 3.2em;
  text-align: center;
}
.load-scale__nudge {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.load-scale__nudge:hover { background: #f9fafb; }
.load-scale__track {
  position: relative;
  height: 56px;
  margin-top: 18px;
  touch-action: none;
  cursor: pointer;
  outline: none;
}
.load-scale__track:focus-visible .load-scale__handle { box-shadow: 0 1px 3px rgba(16, 24, 40, 0.18), 0 0 0 6px rgba(20, 83, 45, 0.12); }
.load-scale__rail,
.load-scale__fill {
  position: absolute;
  left: 0;
  top: 14px;
  height: 6px;
  border-radius: 999px;
}
.load-scale__rail { right: 0; background: #e5e7eb; }
.load-scale__fill { width: 0; background: #14532d; }
.load-scale__handle {
  position: absolute;
  top: 6px;
  left: 0;
  margin-left: -11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #14532d;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.18);
  cursor: grab;
  transition: box-shadow 0.12s;
}
.load-scale__handle.is-dragging { cursor: grabbing; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.18), 0 0 0 6px rgba(20, 83, 45, 0.12); }
/* ≥44px touch target around the 22px handle, without enlarging the visual. */
.load-scale__hit { position: absolute; inset: -12px; border-radius: 50%; }
.load-scale__scale { position: absolute; left: 0; right: 0; top: 30px; height: 24px; }
.load-scale__label {
  position: absolute;
  top: 0;
  padding-top: 8px;
  transform: translateX(-50%);
  font-size: 11px;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.2;
}
.load-scale__label::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 5px;
  background: #d1d5db;
}
.load-scale__label--any { transform: none; }
.load-scale__label--any::before { left: 0; }
.load-scale__label--any.is-active { color: #111827; font-weight: 700; }
.load-scale__fallback { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
@media (max-width: 480px) {
  /* A phone-width track can't fit eight labels: 800 and 1300 would sit on
     top of "Any" and "1350+", so they go (their ticks too). */
  .load-scale { padding: 14px 14px 12px; }
  /* Title and controls share ONE row at every phone width: the readout is
     smaller and holds a fixed width so "Any" → "1350 kg+" never wraps or
     shifts the −/+ buttons (business, 14 Sep 2026). */
  .load-scale__header { flex-wrap: nowrap; align-items: center; gap: 10px; }
  .load-scale__header > div:first-child { flex: 1 1 auto; min-width: 0; }
  .load-scale__title { font-size: 14px; }
  .load-scale__sub { font-size: 12px; margin-top: 1px; }
  .load-scale__controls { flex: none; gap: 6px; }
  .load-scale__readout { font-size: 20px; min-width: 5.2em; }
  .load-scale__nudge { width: 30px; height: 30px; font-size: 16px; }
  .load-scale__label[data-kg="800"], .load-scale__label[data-kg="1300"] { display: none; }
}
.vehicle-banner__caveat {
  flex: 1 1 100%;
  margin: 0;
  padding: 10px 14px;
  border-radius: 6px;
  border-left: 4px solid var(--color-warning);
  background: var(--color-warning-bg);
  color: var(--color-warning);
  font-size: 0.875rem;
}

/* Filter bar on the product list. Sticks to the top of the viewport while
   scrolling through a long results table, so the filters are always at
   hand. Needs a solid background + shadow (already has both) so the table
   scrolling underneath it is fully hidden, not overlapping — the earlier
   "blocks the table" complaint turned out to be about the Django admin's
   changelist filter, not this one. */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.filter-bar__row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}
.filter-bar__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-bar__field label {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.8125rem;
}
.filter-bar__field--search {
  flex: 1 1 200px;
}
.filter-bar__field--search input {
  width: 100%;
}
/* Desktop arrangement (business, 1 Oct 2026): every dropdown on the first
   row; the search box, the In stock / Any size toggles and Clear filters on
   the row below. Done with flex order so the phone grid (search first) and
   the markup stay as they are. The ::before is the forced line break. */
@media (min-width: 768px) {
  /* Row spacing comes from a top margin on each field rather than row-gap,
     so the zero-height break line doesn't add a second gap. */
  .filter-bar__row { row-gap: 0; margin-top: -14px; }
  .filter-bar__row > .filter-bar__field { margin-top: 14px; }
  .filter-bar__row::before {
    content: "";
    order: 1;
    flex: 0 0 100%;
    height: 0;
  }
  .filter-bar__field--search,
  .filter-bar__field--stock,
  .filter-bar__field--clear { order: 2; }
  .filter-bar__field--search { flex: 0 1 340px; }
}
/* Search box with its magnifier submit button attached on the right. */
.search-field {
  display: flex;
  align-items: stretch;
}
.search-field input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px 0 0 6px;
  padding: 8px 10px;
  -webkit-appearance: none;
  appearance: none;
}
.search-field input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
.search-field__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  padding: 0;
  border: 1px solid var(--color-primary);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
}
.search-field__btn:hover { filter: brightness(1.08); }
.search-field__btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* "In stock only" — was a plain small checkbox + label that read as an
   afterthought next to a row of proper dropdowns. Styled as a bordered
   toggle (same idea as .ship-toggle on the basket page: lights up green
   once checked) sized to match the height of the <select>s beside it. */
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 37px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.filter-toggle:hover {
  border-color: var(--color-primary);
}
.filter-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--color-primary);
}
.filter-toggle.filter-toggle--on {
  /* Two classes, not one — needs to outrank .filter-bar__field label's
     (0,1,1) specificity, which otherwise wins the `color` property back to
     the default text colour regardless of rule order. */
  border-color: var(--color-primary);
  background: var(--color-success-bg);
  color: var(--color-primary-dark);
}

/* ---- Tables ---- */

.table-scroll {
  overflow-x: auto;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
}
th, td {
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border);
}
th {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  background: #fafafb;
}
tbody tr:hover { background: #fafbfa; }
td img { display: block; border-radius: 6px; }

/* Product list: fewer, narrower columns (stock code/brand/design merged,
   bore/max bore merged, qty+add merged) plus wrapping instead of nowrap, so
   the whole table fits without horizontal scrolling on an ordinary desktop
   width instead of needing .table-scroll's overflow-x as the only way to
   see the last few columns. */
.product-table th, .product-table td {
  white-space: normal;
  padding: 10px 12px;
}
.product-table { font-size: 0.8125rem; }
.product-table select { max-width: 110px; }
.product-table input[type="number"] { width: 3.5em; }

/* Product photo thumbnail + hover zoom. Wheels are a heavily look-driven
   purchase, so 64px (up from 36px) reads more clearly at a glance, and
   hovering shows a much larger preview via #product-thumb-zoom (a single
   shared, fixed-position <img> — see the inline script in
   product_list.html for why fixed rather than absolute). */
.product-thumb {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
}
.product-thumb-zoom {
  display: none;
  position: fixed;
  width: 260px;
  height: 260px;
  object-fit: cover;
  border-radius: 10px;
  border: 4px solid var(--color-surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  z-index: 50;
  pointer-events: none;
}

/* Whole-row link: the row-link anchor stretches over the entire <tr> via
   ::after so clicking anywhere in the row navigates, while still being a
   real, keyboard/screen-reader-accessible link (not JS-driven). */
.table-row-links tbody tr { position: relative; cursor: pointer; }
.table-row-links .row-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* Public catalogue: guests see the table without prices/order columns and
   this one-line prompt to sign in (or to become a dealer) instead. */
.guest-notice {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  padding: 10px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  border-left: 4px solid var(--color-primary);
  background: var(--color-success-bg);
  color: var(--color-primary-dark);
  font-size: 0.875rem;
}
.guest-notice a { font-weight: 600; text-decoration: underline; }

.result-count {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 10px;
}

/* ---- Status badges ---- */

.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge--placed { background: #e8eaf0; color: #3d4560; }
.badge--in_review { background: var(--color-warning-bg); color: var(--color-warning); }
.badge--quote_sent { background: #e6effa; color: #1c5aa3; }
.badge--queued_for_machining { background: #f1e9fa; color: #6a3cad; }
.et-window { white-space: nowrap; font-weight: 600; }
.badge--cancelled { background: #fbe9e7; color: #a3271b; }
.card--cancelled { background: #fdf3f2; border-color: #f1c6c1; }
.cancelled-panel__title { color: #a3271b; }
.cancel-request { margin-top: 24px; font-size: 0.9375rem; }
.cancel-request summary { cursor: pointer; color: var(--color-text-muted); }
.cancel-request form { max-width: 420px; }
.badge--dispatched { background: var(--color-success-bg); color: var(--color-primary); }

.stock--in { color: var(--color-primary); font-weight: 600; }
.stock--out { color: var(--color-danger); font-weight: 600; }

/* ---- Product results: grid / list ----
   Both renderings are in the page; the modifier class on .product-results
   picks one. The table (list) is the dense ordering tool; the card grid is
   for browsing and for phones, where the table needs sideways scrolling. */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.results-bar .result-count { margin: 0; }
.sort-form { margin-left: auto; }
.sort-form__label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 600; color: var(--color-text); }
.sort-form select { padding: 6px 28px 6px 10px; font-size: 0.8125rem; }
/* Phones: count · sort · grid/list stay on ONE row (business, 14 Sep 2026):
   the count stays short, the sort dropdown takes the slack with its label
   hidden, and the view buttons are icon-only. */
@media (max-width: 640px) {
  .results-bar { flex-wrap: nowrap; gap: 8px; margin-bottom: 8px; }
  .results-bar .result-count { flex: none; white-space: nowrap; font-size: 0.875rem; }
  .sort-form { margin-left: 0; flex: 1 1 auto; min-width: 0; }
  .sort-form__label { display: flex; gap: 0; }
  .sort-form__label > select { width: 100%; min-width: 0; }
  .sort-form__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .view-toggle { flex: none; }
  .view-toggle__btn { padding-left: 10px; padding-right: 10px; }
  .view-toggle__btn .view-toggle__text { display: none; }
}
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-surface);
}
.view-toggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.view-toggle__btn + .view-toggle__btn { border-left: 1px solid var(--color-border); }
.view-toggle__btn svg { fill: currentColor; }
.view-toggle__btn[aria-pressed="true"] {
  background: var(--color-success-bg);
  color: var(--color-primary-dark);
}
.product-results--grid .product-results__list { display: none; }
.product-results--list .product-results__grid { display: none; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.product-grid__empty {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-radius: var(--radius);
}
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.product-card--out .product-card__image img { opacity: 0.55; }
.product-card__image {
  aspect-ratio: 1 / 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  /* It's a <button> (tap to enlarge) — strip the button chrome. */
  width: 100%;
  border: 0;
  cursor: zoom-in;
}
.product-card__image:disabled { cursor: default; }
.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
  flex: 1;
}
.product-card__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}
.product-card__specs {
  margin: 0;
  display: grid;
  /* Two label/value pairs on one row: Bore … | Load … */
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 2px 8px;
  font-size: 0.8125rem;
  line-height: 1.35;
}
.product-card__specs > div { display: contents; }
.product-card__specs > div[hidden] { display: none; }
.product-card__specs dd { white-space: nowrap; }
.product-card__specs dt { color: var(--color-text-muted); }
.product-card__specs dd { margin: 0; color: var(--color-text); }
.product-card__status {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
  font-size: 0.8125rem;
  white-space: nowrap;   /* "In stock (16)" and the price each stay on one line */
}
.product-card__price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-dark);
}
.product-card__order {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-card__order select { min-width: 0; font-size: 0.8125rem; padding: 6px 8px; }
/* Row 1: PCD + offset side by side (dropdowns or fixed values); row 2: qty + Add. */
.product-card__order-row { display: grid; gap: 6px; align-items: center; }
.product-card__order-row--spec { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.product-card__order-row--spec > span { display: contents; }   /* the js-pcd / js-offset hosts; their select/span is the grid item */
.product-card__order-row--size select { width: 100%; }
.product-card__finish { margin: -4px 0 0; font-size: 0.8125rem; color: var(--color-text-muted); }
.product-card__order-row--buy { grid-template-columns: auto 1fr; }
.product-card__order-row--buy .btn { justify-content: center; }
.product-card__order-row input[type="number"] { width: 3.6em; padding-left: 6px; padding-right: 2px; }
.product-card__fixed {
  font-size: 0.8125rem;
  color: var(--color-text);
  padding: 6px 8px;
  border: 1px solid transparent;   /* same height as the neighbouring select */
  white-space: nowrap;
}

/* Tap-to-enlarge photo overlay. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(22, 23, 26, 0.9);
  cursor: zoom-out;
}
.lightbox__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: default;
}
.lightbox__img {
  max-width: min(92vw, 900px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}
/* Host for the in-page 360° viewer (aw360.js takes over the .aw360 div),
   or the frame used for a non-native viewer page. Square, sized to the
   viewport. */
.lightbox__spin,
.lightbox__frame {
  width: min(92vw, 88vh, 720px);
  height: min(92vw, 88vh, 720px);
  border: 0;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.lightbox__spin .aw360 { max-width: none; width: 100%; height: 100%; }
.lightbox__hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(22, 23, 26, 0.65);
  color: #fff;
  font-size: 0.75rem;
  pointer-events: none;
}
/* Colour strip on a design tile: one photo per finish, swipe (scroll-snap)
   or use the arrows / dots. Single-finish tiles are just the one photo. */
.product-card__gallery { position: relative; }
.product-card__slides {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.product-card__slides::-webkit-scrollbar { display: none; }
.product-card__slide { flex: 0 0 100%; scroll-snap-align: start; }
.product-card__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(22, 23, 26, 0.55);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  padding: 0 0 3px;
  cursor: pointer;
  /* Always visible (not hover-only): the arrows double as the signal that
     the design comes in more colours, so they need to be seen up front. */
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}
.product-card__arrow--prev { left: 6px; }
.product-card__arrow--next { right: 6px; }
.product-card__arrow:hover,
.product-card__arrow:focus-visible { opacity: 1; background: rgba(22, 23, 26, 0.75); }
@media (hover: none) {
  .product-card__arrow { width: 24px; height: 24px; font-size: 16px; }
}
.product-card__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 5px;
  z-index: 1;
}
.product-card__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(22, 23, 26, 0.22);
  cursor: pointer;
}
.product-card__dot.is-active { background: var(--color-primary); }
.product-card__finish-count { color: var(--color-text-muted); font-size: 0.75rem; white-space: nowrap; }
.product-card__finish-count::before { content: "· "; }

/* "360°" corner badge on card photos that have a spin. */
.product-card__image { position: relative; }
.badge-360 {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(22, 23, 26, 0.75);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.lightbox__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 767px) {
  /* Phone filter panel, open by default (colleagues expected to see it),
     so it has to be compact: a 3-column grid — Search (2 cols) + Brand;
     Design / Diameter / Width; PCD / Colour / Finish; In stock —
     with small labels and controls. "Clear filters" is dropped here (the
     header row's Clear link does the same). Roughly a quarter of a phone
     screen instead of half. */
  .filter-bar__row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 8px;
    align-items: end;
  }
  .filter-bar__field { gap: 2px; min-width: 0; }
  .filter-bar__field label { font-size: 0.6875rem; line-height: 1.2; }
  .filter-bar__field label[style*="visibility"] { display: none; }   /* the spacer labels above Stock/Size */
  .filter-bar__field select,
  .filter-bar__field input[type="text"],
  .filter-bar__field input[type="search"] { width: 100%; padding: 6px 8px; font-size: 0.875rem; }
  .search-field__btn { width: 38px; }
  .filter-bar__field select { padding-right: 24px; background-position: right 8px center; }
  .filter-bar__field--search { grid-column: span 2; flex: none; }
  .filter-bar__field--stock { grid-column: span 1; }
  .filter-toggle { height: 34px; padding: 0 10px; font-size: 0.75rem; gap: 6px; }
  .filter-bar__field--clear { display: none; }
}

@media (max-width: 640px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-card__body { padding: 8px 9px 10px; gap: 6px; }
  /* Two tiles across a phone: "Bore 72.6–74.1mm" and "Load 1000kg" don't
     fit on one row, so the pairs stack (one per row) here. */
  .product-card__specs { font-size: 0.75rem; gap: 1px 6px; grid-template-columns: auto minmax(0, 1fr); }
  .product-card__title { font-size: 0.875rem; }
  .product-card__status { font-size: 0.75rem; }
  .product-card__price { font-size: 0.9375rem; }
  /* Two tiles across a phone leaves no room for "In stock (24)" plus a
     struck-through list price AND the dealer price — drop the list price. */
  .product-card__price s { display: none; }
  .product-card__order select { font-size: 0.75rem; padding: 5px 4px; }
  .product-card__order-row { gap: 4px; }
  .product-card__order-row input[type="number"] { width: 2.8em; font-size: 0.8125rem; padding: 5px 2px 5px 5px; }
  .product-card__order-row .btn { padding: 5px 10px; font-size: 0.75rem; }
}

/* ---- Utility ---- */

.text-muted { color: var(--color-text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
/* Basket: one vehicle-details block per line item (each product in the
   basket can be going on a different car), stacked in their own card next
   to Delivery rather than as extra columns in the fitment table — the
   table was the wrong place for free-text vehicle fields since it forced
   them into narrow, horizontally-scrolling cells no matter how the other
   columns were sized. */
.vehicle-details-line {
  padding: 16px 0;
  border-top: 1px solid var(--color-border);
}
.vehicle-details-line:first-of-type {
  border-top: none;
  padding-top: 4px;
}
.vehicle-details-line__title {
  margin: 0 0 12px;
  font-size: 0.9375rem;
}
/* "Same vehicle as previous line" — mirrored, read-only fields (see the
   inline script in cart.html), styled to look inert rather than a normal
   editable field. */
.field--linked {
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.stack { display: flex; flex-direction: column; gap: 10px; }
.cluster { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* Basket: the fitment row a line was chosen for via the vehicle lookup. */
.fitment-tag {
  margin: -6px 0 12px;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 4px solid var(--color-primary);
  background: var(--color-success-bg);
  color: var(--color-primary-dark);
  font-size: 0.8125rem;
}
/* Infinite scroll: the sentinel/“Load more” fallback and the end note. */
.load-more { display: flex; justify-content: center; margin: 24px 0 8px; }
.load-more__end { margin: 24px 0 8px; text-align: center; color: var(--color-text-muted); font-size: 0.875rem; }

/* Phone-only collapsing of the vehicle picker and filter bar. On a phone
   the sticky filter bar pinned half the screen for the whole visit; now
   both panels are single-line buttons that expand on tap, and the bar
   isn't sticky. Desktop (>=768px): toggles hidden, bodies always shown. */
.collapse-toggle,
.collapse-toggle-row { display: none; }
@media (max-width: 767px) {
  .collapse-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .collapse-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--color-dark);
    cursor: pointer;
    text-align: left;
  }
  .collapse-toggle svg { flex: none; transition: transform 0.15s ease; }
  .collapse-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .collapse-toggle__count {
    display: inline-block;
    min-width: 1.5em;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: #fff;
    font-size: 0.75rem;
    text-align: center;
    margin-left: 4px;
  }
  .collapse-toggle-row__clear { font-size: 0.875rem; white-space: nowrap; }
  .collapse-body { display: none; padding-top: 12px; }
  .is-open > .collapse-body { display: block; }
  .vehicle-picker, .filter-bar { padding: 12px 16px; margin-bottom: 12px; }
  .filter-bar { position: static; }          /* no longer pinned on phones */
}

@media (max-width: 640px) {
  /* One pinned row (9 Oct 2026): brand, basket, menu button. The nav's
     other links hide until the button opens them, each on its own row. */
  .site-header { position: sticky; top: 0; z-index: 60; box-shadow: 0 1px 0 rgba(255,255,255,0.08); }
  .site-header__inner { flex-wrap: wrap; height: auto; min-height: 48px; padding: 6px 14px; gap: 0 10px; }
  .site-header__brand { order: 0; margin-right: auto; }
  .site-header__nav { display: contents; }               /* its children join the header row */
  .site-header__nav a, .site-header__nav button { white-space: nowrap; }
  .site-header__nav > a, .site-header__nav > form { display: none; order: 3; flex: 0 0 100%; padding: 10px 2px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 1rem; }
  .site-header__nav > form { padding: 6px 2px 10px; }
  .site-header__nav > form button { display: inline-flex; }
  /* Guests: the sign-in button stays in the pinned row, beside the menu button. */
  .site-header__nav > a.site-header__signin { display: inline-flex; order: 1; flex: 0 0 auto; padding: 6px 12px; border-top: 0; font-size: 0.875rem; }
  .site-header.is-open .site-header__nav > a.btn--secondary { display: inline-flex; margin: 6px 0 10px; }   /* staff's Admin button sits in the menu, as a button */
  .site-header.is-open .site-header__nav > a, .site-header.is-open .site-header__nav > form { display: block; }
  .site-header.is-open .site-header__nav > form { display: block; }
  #basket-nav-host { display: contents; }
  .basket-nav { order: 1; }
  .site-header__menu { display: inline-flex; order: 2; flex-direction: column; justify-content: center; gap: 4px; width: 38px; height: 36px; padding: 0 9px; border: 1px solid rgba(255,255,255,0.3); border-radius: 8px; background: transparent; cursor: pointer; }
  .site-header__menu span { display: block; height: 2px; border-radius: 1px; background: rgba(255,255,255,0.9); }
  .site-header.is-open .site-header__menu { background: rgba(255,255,255,0.12); }
  /* Basket preview on phones: opened by tapping "Basket" (base.html script)
     rather than hover, and anchored to the header itself — not the link —
     so it spans the screen width instead of hanging 320px off the right
     edge of wherever the link happens to sit. */
  .basket-nav { position: static; }   /* the dropdown anchors to the (sticky) header itself */
  .basket-dropdown {
    display: none;
    left: 12px;
    right: 12px;
    width: auto;
    padding-top: 6px;
  }
  .basket-nav:hover .basket-dropdown { display: none; }   /* touch "hover" must not open it */
  .basket-nav.is-open .basket-dropdown { display: block; }
  .page { padding: 20px 14px 48px; }
  .card { padding: 20px; }
}

/* ---- Added-to-basket feedback (product list) ----
   A toast at the foot of the screen naming the wheel just added, an
   "In basket ×N" mark on the tile/row, and the Add button's brief tick. */
.add-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: min(680px, calc(100vw - 28px));
  padding: 12px 18px;
  border-radius: var(--radius);
  border-left: 4px solid var(--color-success);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 6px 24px rgba(22, 23, 26, 0.18);
  font-size: 0.9375rem;
  line-height: 1.35;
}
.add-toast--error { border-left-color: var(--color-danger); color: var(--color-danger); }
.add-toast__text { flex: 1 1 auto; }
.add-toast__text::before { content: "\2713"; margin-right: 8px; color: var(--color-success); font-weight: 700; }
.add-toast--error .add-toast__text::before { content: "!"; color: var(--color-danger); }
.add-toast__link { white-space: nowrap; font-weight: 600; }
.product-card__inbasket, .row-inbasket {
  display: inline-block;
  margin: 6px 0 0;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--color-success-bg);
  color: var(--color-success);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.btn.is-added { background: var(--color-success); border-color: var(--color-success); color: #fff; }
@media (max-width: 640px) {
  .add-toast { bottom: 12px; flex-wrap: wrap; gap: 6px 14px; font-size: 0.875rem; }
}

/* ---- Basket: one-off delivery address (DPD's field set) two-up ---- */
.dropship-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.dropship-grid .field { margin-bottom: 10px; }
.dropship-grid .field label { font-size: 0.875rem; }
.dropship-grid__full { grid-column: 1 / -1; }
@media (max-width: 640px) { .dropship-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Live parcel status (order page + My orders) ---- */
.tracking-status { margin-top: -6px; }
.badge--track-delivered { background: var(--color-success-bg); color: var(--color-primary); }
.badge--track-out_for_delivery { background: var(--color-success-bg); color: var(--color-success); }
.badge--track-in_transit { background: #e6effa; color: #1c5aa3; }
.badge--track-info_received, .badge--track-pending, .badge--track-unknown { background: #e8eaf0; color: #3d4560; }
.badge--track-failed_attempt, .badge--track-expired { background: var(--color-warning-bg); color: var(--color-warning); }
.badge--track-exception { background: var(--color-danger-bg); color: var(--color-danger); }

/* ---- Vehicle banner: diameter buttons (one or more at once) ---- */
.dia-pick { flex: 1 1 100%; display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 100%; }
.dia-pick__row { display: flex; flex-wrap: wrap; gap: 10px; }
.dia-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 78px; height: 54px; padding: 0 18px;
  border: 2px solid var(--color-border); border-radius: 12px;
  background: var(--color-surface); color: var(--color-dark);
  font-size: 1.25rem; font-weight: 700; text-decoration: none; letter-spacing: 0.01em;
  transition: border-color 0.12s, background-color 0.12s, color 0.12s;
}
.dia-pill:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }
.dia-pill.is-active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.dia-pill.is-active:hover { background: var(--color-primary-dark, var(--color-primary)); }
/* Phones: every size on screen at once — a wrapping grid that shrinks the
   buttons to fit (4–5 across a 375px screen) rather than a scrolling strip. */
@media (max-width: 640px) {
  .dia-pick__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
  .dia-pill { min-width: 0; height: 46px; padding: 0 6px; font-size: 1rem; border-radius: 10px; }
}
.fitment-disclaimer__body .vehicle-banner__limit { margin: 6px 0 0; }

/* Screen-reader-only text (the products page keeps its heading for assistive tech without spending a line on it). */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }


/* ---- Basket side panel (products page, desktop) ----
   Outside the content column, so the wheel grid keeps its four tiles.
   Hidden below 1024px. 1024–1799px: a slim tab on the right edge; clicking
   it slides the drawer over the page (body.basket-panel-open / .is-open).
   ≥1800px: the page's 1180px column leaves ≥310px of margin, so the panel
   docks there permanently and the tab disappears. */
.basket-panel { display: none; }
@media (min-width: 1024px) {
  .basket-panel { display: block; position: fixed; top: 0; right: 0; z-index: 35; height: 100vh; width: 0; pointer-events: none; }
  .basket-panel__tab {
    pointer-events: auto;
    position: absolute; top: 40vh; right: 0;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 12px 8px; border: 1px solid var(--color-border); border-right: 0; border-radius: 10px 0 0 10px;
    background: var(--color-surface); color: var(--color-text); box-shadow: 0 4px 16px rgba(22, 23, 26, 0.12);
    font: inherit; font-size: 0.8125rem; cursor: pointer; transition: transform 0.2s ease;
  }
  .basket-panel__tab-label { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: 0.04em; font-weight: 600; }
  .basket-panel__tab-count {
    min-width: 22px; height: 22px; line-height: 22px; border-radius: 11px; text-align: center;
    background: var(--color-primary); color: #fff; font-size: 0.75rem; font-weight: 700;
  }
  .basket-panel--empty .basket-panel__tab-count { background: var(--color-text-muted); }
  .basket-panel__tab-total { font-size: 0.75rem; color: var(--color-text-muted); writing-mode: vertical-rl; transform: rotate(180deg); }
  .basket-panel.is-bumped .basket-panel__tab { transform: translateX(-6px); }
  .basket-panel__body {
    pointer-events: auto;
    position: absolute; top: 0; right: 0; height: 100vh; width: 320px; max-width: 90vw;
    display: flex; flex-direction: column; gap: 12px; padding: 20px 20px 24px; box-sizing: border-box;
    background: var(--color-surface); border-left: 1px solid var(--color-border); box-shadow: -8px 0 28px rgba(22, 23, 26, 0.16);
    transform: translateX(100%); transition: transform 0.22s ease; overflow-y: auto;
  }
  .basket-panel.is-open .basket-panel__body { transform: translateX(0); }
  .basket-panel.is-open .basket-panel__tab { display: none; }   /* the drawer has its own close button */
  .basket-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .basket-panel__title { margin: 0; font-size: 1rem; }
  .basket-panel__count { margin-left: 6px; font-size: 0.875rem; font-weight: 400; color: var(--color-text-muted); }
  .basket-panel__controls { display: flex; align-items: center; gap: 6px; }
  .basket-panel__pin, .basket-panel__close {
    font: inherit; font-size: 0.8125rem; cursor: pointer; border: 1px solid var(--color-border); border-radius: 6px;
    background: var(--color-surface); color: var(--color-text); padding: 4px 8px;
  }
  .basket-panel__pin[aria-pressed="true"] { background: var(--color-success-bg); border-color: var(--color-success); color: var(--color-success); }
  .basket-panel__close { font-size: 1rem; line-height: 1; padding: 2px 8px; }
  .basket-panel__list { list-style: none; margin: 0; padding: 0; }
  .basket-panel__line { display: flex; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--color-border); font-size: 0.875rem; }
  .basket-panel__name { flex: 1 1 auto; }
  .basket-panel__line { flex-wrap: wrap; }
  .basket-panel__ctl { flex-basis: 100%; display: flex; align-items: center; gap: 4px; margin-top: 4px; }
  .basket-panel__qty { min-width: 24px; text-align: center; font-weight: 600; }
  .basket-panel__step, .basket-panel__remove {
    width: 26px; height: 26px; padding: 0; border: 1px solid var(--color-border); border-radius: 6px;
    background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 1rem; line-height: 1; cursor: pointer;
  }
  .basket-panel__step:disabled { opacity: 0.4; cursor: default; }
  .basket-panel__step:hover:not(:disabled), .basket-panel__remove:hover { border-color: var(--color-primary); }
  .basket-panel__remove { margin-left: auto; color: var(--color-danger); }
  .basket-panel__price { font-weight: 600; white-space: nowrap; }
  .basket-panel__foot { display: flex; justify-content: space-between; padding: 10px 0 4px; font-size: 0.875rem; }
  .basket-panel__empty { margin: 0; color: var(--color-text-muted); font-size: 0.875rem; }
}
@media (min-width: 1800px) {
  /* Docked in the right margin: always open, no tab, no drawer chrome. */
  .basket-panel { width: 300px; height: auto; top: 96px; right: 16px; bottom: auto; }
  .basket-panel__tab, .basket-panel__close, .basket-panel__pin { display: none; }
  .basket-panel__body, .basket-panel.is-open .basket-panel__body {
    position: static; height: auto; max-height: calc(100vh - 120px); width: 300px; transform: none;
    border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px 20px;
  }
}

/* Application form honeypot: off-screen, not display:none (some bots skip those). */
.apply-form .hp-field, .apply-form label[for="id_website"] { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Choose-a-password page (accounts/password_reset_confirm.html) ---- */
.pw-form label { display: block; font-weight: 600; margin: 14px 0 6px; }
.pw-field { display: flex; gap: 8px; align-items: stretch; }
.pw-field input { flex: 1 1 auto; min-width: 0; }
.pw-toggle { flex: none; padding: 0 12px; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 0.875rem; cursor: pointer; }
.pw-toggle:hover { border-color: var(--color-primary); }
.pw-rules { list-style: none; margin: 8px 0 0; padding: 0; font-size: 0.875rem; color: var(--color-text-muted); }
.pw-rules li { padding: 2px 0 2px 22px; position: relative; }
.pw-rules li::before { content: "○"; position: absolute; left: 4px; }
.pw-rules li.is-ok { color: var(--color-success); }
.pw-rules li.is-ok::before { content: "✓"; font-weight: 700; }
.pw-rules li.is-bad { color: var(--color-danger); }
.pw-rules li.is-bad::before { content: "✗"; font-weight: 700; }
.pw-match { margin: 8px 0 0; font-size: 0.875rem; font-weight: 600; }
.pw-match.is-ok { color: var(--color-success); }
.pw-match.is-bad { color: var(--color-danger); }
.pw-errors { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--color-danger-bg, #fdeceb); border-left: 4px solid var(--color-danger); color: var(--color-danger); font-size: 0.9375rem; }
.pw-errors ul { margin: 6px 0 0; padding-left: 18px; }
.pw-form .btn { margin-top: 16px; }

/* One typeface everywhere (2 Oct 2026): form controls don't inherit a
   typeface by default, so a few buttons were falling back to Arial. */
button, input, select, textarea, optgroup { font-family: inherit; }

/* Basket: the wheel described in words, with its photo (7 Oct 2026). */
.basket-wheel { display: flex; gap: 12px; align-items: flex-start; min-width: 220px; }
.basket-wheel__img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--color-border); flex: none; }
.basket-wheel__name { font-weight: 700; }
.basket-wheel__spec { font-size: 0.9em; }
.basket-wheel__code { font-size: 0.8em; margin-top: 2px; }
.table-stack td.table-stack__title { white-space: normal; }

/* Order notes panel (9 Oct 2026): five short notes, two columns on a desktop, one on a phone. */
.policy-notes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px 24px; }   /* two columns where the panel is wide enough, one where it isn't */
.policy-notes__item { margin: 0; padding-left: 18px; position: relative; font-size: 0.9375rem; line-height: 1.45; }
.policy-notes__item::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; border-radius: 50%; background: var(--color-warning); }
.policy-notes__lead { display: inline; }
@media (max-width: 720px) {
  .policy-notes { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .policy-notes__item { font-size: 0.875rem; }
}

/* Basket, lower half (9 Oct 2026): two columns that end together. Left: vehicle details then the order notes; right: totals then delivery with Place order. One column on a phone, same order. */
.basket-save { display: flex; justify-content: flex-end; margin: 12px 0 0; }
.basket-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 20px; }
.basket-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.basket-col > .card { padding: 20px 24px; margin: 0; }
.basket-col .card--policy { margin-top: 0; }
.basket-col .basket-summary { flex: none; margin-left: 0; }
@media (max-width: 800px) {
  .basket-columns { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .basket-col { gap: 16px; }
  .basket-save { justify-content: flex-start; }
}
