/* =========================================================
   Design tokens live in tokens.css (loaded before this file).
   ========================================================= */

/* =========================================================
   Reset & base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-on-light);
  background: var(--surface-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Scroll lock while the mobile nav drawer is open (navigation.js). */
body.nav-open { overflow: hidden; }

img, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.25rem, 4vw + 1rem, 4rem); }
h2 { font-size: clamp(1.75rem, 2vw + 1rem, 2.75rem); }
h3 { font-size: clamp(1.25rem, 1vw + 1rem, 1.75rem); }
p { margin: 0 0 var(--space-3); color: var(--text-on-light-muted); }

a { color: inherit; text-decoration: none; }

/* Consistent, visible focus ring for keyboard users everywhere. */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-primary);
  color: var(--text-on-dark);
  padding: var(--space-2) var(--space-3);
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }

.btn-primary { background: var(--brand-accent); color: var(--brand-primary); }
.btn-primary:hover { background: var(--brand-accent-dark); }

.btn-dark { background: var(--brand-primary); color: var(--text-on-dark); }
.btn-dark:hover { background: var(--brand-primary-light); }

.btn-outline { background: transparent; border-color: currentColor; color: var(--text-on-light); }
.btn-outline:hover { background: var(--surface-1); }

.btn-outline-light { background: transparent; border-color: rgba(245,243,238,0.5); color: var(--text-on-dark); }
.btn-outline-light:hover { background: rgba(245,243,238,0.1); border-color: var(--text-on-dark); }

.btn-whatsapp { background: #25d366; color: #06210f; }
.btn-whatsapp:hover { background: #1fb958; }

/* Vertical stack of floating action buttons — new FABs just become another
   flex child, no manual offset math needed to avoid overlapping siblings. */
.fab-stack {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
}
.fab-stack .whatsapp-fab { box-shadow: var(--shadow-lg); }
@media (max-width: 600px) {
  .fab-stack { bottom: var(--space-3); right: var(--space-3); gap: var(--space-2); }
  .fab-stack .whatsapp-fab { padding: 0.65rem 1.1rem; }
}
@media (max-width: 768px) {
  .fab-stack {
    bottom: calc(var(--bottom-nav-height) + (var(--bottom-nav-gap) * 2) + env(safe-area-inset-bottom, 0));
  }
}

/* =========================================================
   Live chat widget
   ========================================================= */
.chat-fab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--brand-primary);
  color: var(--brand-accent);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}
.chat-fab:hover { transform: translateY(-1px); background: var(--brand-primary-light); }
.chat-fab-icon, .chat-fab-icon-close {
  position: absolute;
  width: 24px;
  height: 24px;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.chat-fab-icon-close { opacity: 0; transform: rotate(-45deg) scale(0.7); }
.chat-fab.is-open .chat-fab-icon { opacity: 0; transform: rotate(45deg) scale(0.7); }
.chat-fab.is-open .chat-fab-icon-close { opacity: 1; transform: rotate(0) scale(1); }
.chat-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid var(--surface-0);
  border-radius: 999px;
  background: var(--brand-danger);
  color: var(--text-on-dark);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

.chat-panel {
  position: fixed;
  z-index: var(--z-overlay);
  right: var(--space-4);
  bottom: calc(var(--space-4) + 56px + var(--space-3));
  width: 22rem;
  max-width: calc(100vw - (var(--space-4) * 2));
  height: min(32rem, calc(100vh - var(--space-6) * 2));
  display: flex;
  flex-direction: column;
  background: var(--surface-0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: chat-panel-in var(--transition-base);
}
/* The unconditional `display: flex` above is an author-stylesheet rule, which
   always wins over the `hidden` attribute's user-agent `display: none` rule
   regardless of specificity — without this, panel.hidden = true in chat.js
   has no visual effect at all. */
.chat-panel[hidden] { display: none; }
.chat-panel.is-closing { animation: chat-panel-out var(--transition-fast) ease-in forwards; }
@keyframes chat-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes chat-panel-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(12px) scale(0.98); }
}
@media (max-width: 768px) {
  .chat-panel {
    right: var(--space-3);
    left: var(--space-3);
    bottom: calc(var(--bottom-nav-height) + var(--bottom-nav-gap) + 56px + (var(--bottom-nav-gap) * 2) + env(safe-area-inset-bottom, 0));
    width: auto;
    max-width: none;
    height: min(28rem, calc(100vh - var(--bottom-nav-height) - var(--space-6)));
  }
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3);
  background: var(--brand-primary);
  color: var(--text-on-dark);
  flex-shrink: 0;
}
.chat-panel-header strong { font-family: var(--font-heading); font-size: 1rem; }
.chat-panel-status { display: block; font-size: 0.75rem; color: var(--text-on-dark-muted); }
.chat-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-on-dark);
  cursor: pointer;
  border-radius: 50%;
}
.chat-panel-close:hover { background: rgba(245, 243, 238, 0.1); }
.chat-panel-close svg { width: 18px; height: 18px; }

.chat-details-form { padding: var(--space-3); overflow-y: auto; }
.chat-details-intro { font-size: 0.85rem; color: var(--text-on-light-muted); margin-bottom: var(--space-3); }

.chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  overflow-y: auto;
}
.chat-message { display: flex; }
.chat-message-customer { justify-content: flex-end; }
.chat-message-admin { justify-content: flex-start; }
.chat-message-bubble {
  max-width: 80%;
  padding: 0.5rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.88rem;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.chat-message-customer .chat-message-bubble {
  background: var(--brand-primary);
  color: var(--text-on-dark);
  border-bottom-right-radius: 0.25rem;
}
.chat-message-admin .chat-message-bubble {
  background: var(--surface-2);
  color: var(--text-on-light);
  border-bottom-left-radius: 0.25rem;
}

.chat-input-form {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.chat-input-form input { flex: 1; }
.chat-input-form button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
}
.chat-input-form button svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
  .chat-panel { animation: none; }
  .chat-fab-icon, .chat-fab-icon-close, .chat-fab { transition: none; }
}

.btn-block { width: 100%; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

/* =========================================================
   Navigation
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--brand-primary);
  border-bottom: 1px solid rgba(245,243,238,0.08);
}
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
  gap: var(--space-4);
}
.brand {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-on-dark);
  letter-spacing: 0.01em;
}
.brand span { color: var(--brand-accent); }

#primary-nav { position: relative; }

.nav-links {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-on-dark-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text-on-dark); }

.nav-actions { display: flex; align-items: center; gap: var(--space-3); }

/* Hamburger — three bars that morph into an X, driven purely off the
   button's own [aria-expanded] state (no extra JS-toggled class needed). */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 1px solid rgba(245,243,238,0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle-bar {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-on-dark);
  transition: transform var(--transition-base), opacity var(--transition-fast);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 600px) {
  /* The bottom nav (Inventory/Contact) and WhatsApp FAB already cover these
     actions on phone widths; keeping them here just crowds brand + hamburger. */
  .nav-actions { display: none; }
}

.nav-drawer-header, .nav-close, .nav-links-mobile-only { display: none; }

/* Dimmed backdrop behind the open drawer — click to close. */
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-drawer) - 1);
  background: rgba(11, 13, 16, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.nav-scrim.is-open { opacity: 1; pointer-events: auto; }

@media (min-width: 901px) {
  .nav-scrim { display: none; }
}

@media (max-width: 900px) {
  /* #primary-nav *is* the sliding drawer panel — fixed to the right edge,
     full viewport height, off-screen until .is-open. .nav-links is just the
     scrollable link list inside it, no longer independently positioned. */
  #primary-nav {
    position: fixed;
    inset-block: 0;
    right: 0;
    width: min(85vw, 360px);
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    background: var(--brand-primary);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-drawer);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  #primary-nav.is-open { transform: translateX(0); }

  .nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid rgba(245,243,238,0.08);
    flex-shrink: 0;
  }
  .nav-drawer-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-on-dark);
  }
  .nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-on-dark);
    cursor: pointer;
    transition: background var(--transition-fast);
  }
  .nav-close:hover { background: rgba(245,243,238,0.1); }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-3) var(--space-4) var(--space-4);
    gap: var(--space-3);
    overflow-y: auto;
    flex: 1 1 auto;
  }
  .nav-links-mobile-only { display: block; margin-top: var(--space-2); }
  .nav-toggle { display: inline-flex; }
}

/* =========================================================
   Mega menu (Browse by Make / Body Type)
   ========================================================= */
.nav-item-has-menu { display: flex; align-items: center; gap: 2px; position: relative; }

.mega-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-on-dark-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
}
.mega-menu-toggle:hover { color: var(--text-on-dark); }
.js .mega-menu-toggle { display: inline-flex; }
.mega-menu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.mega-menu-toggle svg { transition: transform var(--transition-fast); }

.mega-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  min-width: 420px;
  background: var(--surface-0);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-drawer, 400);
  padding: var(--space-4);
}
.mega-menu[hidden] { display: none; }
.mega-menu-inner { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: var(--space-4); }
.mega-menu-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-on-light-muted); margin-bottom: var(--space-2); }
.mega-menu-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.mega-menu-col a { color: var(--text-on-light); font-size: 0.92rem; }
.mega-menu-col a:hover { color: var(--brand-accent-dark); }
.mega-menu-cta p { font-size: 0.85rem; margin-bottom: var(--space-3); }

@media (max-width: 900px) {
  /* Keep the "Inventory" link and its caret toggle side by side; only the
     panel itself wraps onto its own full-width row underneath. */
  .nav-item-has-menu { flex-wrap: wrap; }
  .mega-menu {
    position: static;
    flex-basis: 100%;
    transform: none;
    width: auto;
    min-width: 0;
    box-shadow: none;
    background: rgba(245,243,238,0.04);
    border-radius: var(--radius-sm);
    margin-top: var(--space-2);
    padding: var(--space-3);
  }
  .mega-menu-inner { grid-template-columns: 1fr; gap: var(--space-3); }
  .mega-menu-col a { color: var(--text-on-dark-muted); }
  .mega-menu-col a:hover { color: var(--text-on-dark); }
  .mega-menu-col h4 { color: var(--text-on-dark-muted); }
}

/* =========================================================
   Bottom mobile navigation
   ========================================================= */
/* Outer .bottom-nav is a transparent, pointer-events:none positioning
   shell spanning the full viewport width — it exists only to center the
   visible bar and to own the safe-area-aware floating gap beneath it.
   The actual visible surface is .bottom-nav-bar, so the bar reads as a
   floating rounded panel rather than a docked edge-to-edge toolbar. */
.bottom-nav {
  display: none;
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: var(--z-sticky);
  justify-content: center;
  padding-inline: var(--space-3);
  padding-bottom: calc(var(--bottom-nav-gap) + env(safe-area-inset-bottom, 0));
  pointer-events: none;
}
.bottom-nav-bar {
  pointer-events: auto;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 30rem;
  height: var(--bottom-nav-height);
  padding: 0.375rem;
  gap: 0.125rem;
  background: var(--brand-primary);
  border: 1px solid rgba(245, 243, 238, 0.08);
  border-radius: 1.75rem;
  box-shadow: var(--shadow-lg);
}
.bottom-nav-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
  min-height: 44px;
  border-radius: 1.4rem;
  color: var(--text-on-dark-muted);
}
.bottom-nav-icon-circle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}
.bottom-nav-icon-circle svg { width: 20px; height: 20px; transition: color var(--transition-fast); }
.bottom-nav-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--transition-fast), font-weight var(--transition-fast);
}

/* Active state: the icon sits inside a solid accent "knockout" circle —
   immediately obvious at a glance, with no reliance on motion or a
   separate sliding indicator element. */
.bottom-nav-item[aria-current="page"] .bottom-nav-icon-circle {
  background: var(--brand-accent);
  box-shadow: 0 4px 12px rgba(184, 147, 90, 0.35);
  transform: translateY(-1px);
}
.bottom-nav-item[aria-current="page"] .bottom-nav-icon-circle svg { color: var(--brand-primary); }
.bottom-nav-item[aria-current="page"] .bottom-nav-label { color: var(--text-on-dark); font-weight: 700; }

/* Tactile press feedback — transform only, GPU-friendly. */
.bottom-nav-item:active .bottom-nav-icon-circle { transform: scale(0.9); }

@media (hover: hover) {
  .bottom-nav-item:not([aria-current="page"]):hover .bottom-nav-icon-circle {
    background: rgba(245, 243, 238, 0.08);
  }
  .bottom-nav-item:not([aria-current="page"]):hover .bottom-nav-label {
    color: var(--text-on-dark);
  }
}

.bottom-nav-item:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.bottom-nav-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border: 2px solid var(--brand-primary);
  border-radius: 999px;
  background: var(--brand-accent);
  color: var(--brand-primary);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
}
.favourites-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--brand-accent);
  color: var(--brand-primary);
  font-size: 0.65rem;
  font-weight: 700;
}

@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  body {
    padding-bottom: calc(var(--bottom-nav-height) + var(--bottom-nav-gap) + env(safe-area-inset-bottom, 0));
  }
}

@media (prefers-reduced-motion: reduce) {
  .bottom-nav-icon-circle,
  .bottom-nav-icon-circle svg,
  .bottom-nav-label {
    transition: none;
  }
  .bottom-nav-item[aria-current="page"] .bottom-nav-icon-circle,
  .bottom-nav-item:active .bottom-nav-icon-circle {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mega-menu-toggle svg { transition: none; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
  color: var(--text-on-dark);
  padding-block: var(--space-7);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at top right, rgba(184,147,90,0.18), transparent 60%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; max-width: 46rem; }

/* Ambient WebGL layer (effects3d.js) — sits between the gradient background
   and the glow overlay/content. The CSS gradient above is the permanent base
   layer, so if WebGL is unavailable/disabled/reduced-motion, the hero still
   looks intentional with zero extra work: the canvas just never gets an
   .is-ready class and stays fully transparent. */
#hero-webgl {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}
#hero-webgl.is-ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  #hero-webgl { display: none; }
}
.hero-eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-accent);
  margin-bottom: var(--space-3);
}
.hero h1 { color: var(--text-on-dark); }
.hero p.lead { color: var(--text-on-dark-muted); font-size: 1.15rem; max-width: 38rem; }
.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }

/* =========================================================
   Sections
   ========================================================= */
.section { padding-block: var(--space-6); }
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.section-header p { margin: 0; max-width: 40ch; }
.section-alt { background: var(--surface-1); }

/* =========================================================
   Vehicle cards & grid
   ========================================================= */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--space-4);
}

.vehicle-card {
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  display: flex;
  flex-direction: column;
}
.vehicle-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.vehicle-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
}
.vehicle-card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--transition-base);
}
.vehicle-card:hover .vehicle-card-media img { transform: scale(1.04); }

.vehicle-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-on-light-muted);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  text-align: center;
  padding: var(--space-3);
  background: linear-gradient(135deg, var(--surface-2), var(--surface-1));
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3em 0.65em;
  border-radius: 999px;
  background: var(--brand-primary);
  color: var(--text-on-dark);
}
.badge-accent { background: var(--brand-accent); color: var(--brand-primary); }
.badge-outline { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-on-light-muted); }

.vehicle-card-badges {
  position: absolute; top: var(--space-2); left: var(--space-2);
  display: flex; gap: var(--space-1); flex-wrap: wrap;
  pointer-events: none;
}

.favourite-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 2;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 13, 16, 0.45);
  border: none;
  border-radius: 999px;
  color: var(--text-on-dark);
  cursor: pointer;
  backdrop-filter: blur(2px);
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.favourite-btn:hover { background: rgba(11, 13, 16, 0.65); }
.favourite-btn svg { width: 19px; height: 19px; }
.favourite-btn-static { position: static; background: var(--surface-1); color: var(--text-on-light-muted); flex-shrink: 0; }
.favourite-btn-static:hover { background: var(--surface-2); }
.favourite-btn.is-active { color: #ff6b57; }
.favourite-btn.is-active svg { fill: currentColor; }
.favourite-btn.is-pulsing { transform: scale(1.15); }
@media (prefers-reduced-motion: reduce) {
  .favourite-btn.is-pulsing { transform: none; }
}

.vehicle-card-body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.vehicle-card-title { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 600; margin: 0; }
.vehicle-card-title a::after { content: ""; position: absolute; inset: 0; }
.vehicle-card-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); font-size: 0.85rem; color: var(--text-on-light-muted); }
.vehicle-card-price { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 600; color: var(--brand-primary); margin-top: auto; }
.vehicle-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: var(--space-2); border-top: 1px solid var(--border-subtle); }

/* =========================================================
   Forms
   ========================================================= */
.form-field { margin-bottom: var(--space-4); }
.form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--space-1);
}
.form-field .hint { font-size: 0.8rem; color: var(--text-on-light-muted); margin-top: var(--space-1); }
.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--surface-0);
  color: var(--text-on-light);
  transition: border-color var(--transition-fast);
}
.form-control:focus { border-color: var(--brand-accent); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); }

.field-error { color: var(--brand-danger); font-size: 0.85rem; margin-top: var(--space-1); display: block; }
.form-control.input-validation-error { border-color: var(--brand-danger); }

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
}
.alert-success { background: #e9f5ee; border-color: var(--brand-success); color: #1d5c38; }
.alert-danger { background: #fbe9e5; border-color: var(--brand-danger); color: #7d2e1c; }

/* =========================================================
   Filter panel
   ========================================================= */
.filter-panel {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); align-items: end; }

.filter-toggle { display: none; align-items: center; gap: var(--space-2); }

.filter-chips { margin-top: var(--space-3); }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.35rem 0.5rem 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-on-light);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.filter-chip:hover { background: var(--surface-2); border-color: var(--text-on-light-muted); }
.filter-chip span[aria-hidden] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 0.9rem;
  line-height: 1;
}
.filter-chip-clear {
  background: transparent;
  border-style: dashed;
  color: var(--text-on-light-muted);
}

/* Generic "only makes sense with scripting" gate — mirrors the filter-toggle
   pattern below: hidden until no-fouc.js confirms JS is available, so no-JS
   visitors see the <noscript> fallback instead of a dead/stuck UI. */
.js-required { display: none; }
.js .js-required { display: block; }

/* Collapsible on mobile — but only once .js confirms scripting is available,
   so a no-JS visitor always sees the full filter form, never a dead toggle. */
@media (max-width: 768px) {
  .js .filter-toggle { display: inline-flex; }
  .js .filter-panel { display: none; }
  .js .filter-panel.is-open { display: block; }
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--brand-primary);
  color: var(--text-on-dark-muted);
  padding-block: var(--space-6) var(--space-4);
  margin-top: var(--space-7);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}
.footer-grid h4 { color: var(--text-on-dark); font-size: 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.footer-grid a:hover { color: var(--text-on-dark); }
.footer-bottom {
  border-top: 1px solid rgba(245,243,238,0.08);
  padding-top: var(--space-4);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: 0.85rem;
}

/* =========================================================
   Empty / loading states
   ========================================================= */
.empty-state {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  color: var(--text-on-light-muted);
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 37%, var(--surface-1) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* =========================================================
   Vehicle gallery + lightbox
   ========================================================= */
.gallery-mode-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.gallery-mode-tab {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-on-light-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.gallery-mode-tab.is-active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-dark);
}

.viewer-360 {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
  cursor: grab;
  touch-action: pan-y;
}
.viewer-360.is-dragging { cursor: grabbing; }
.viewer-360 img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
.viewer-360-hint {
  position: absolute;
  bottom: var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 13, 16, 0.65);
  color: var(--text-on-dark);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.78rem;
  pointer-events: none;
}

.gallery-main {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
}
.gallery-main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  cursor: zoom-in;
  transition: opacity 0.25s ease;
}
.gallery-main-image.is-fading { opacity: 0; }

.gallery-expand-btn {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-2);
  background: rgba(11, 13, 16, 0.65);
  color: var(--text-on-dark);
  border: 1px solid rgba(245, 243, 238, 0.25);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.gallery-expand-btn:hover { background: rgba(11, 13, 16, 0.85); }

.gallery-thumbs {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  overflow-x: auto;
  padding-bottom: 2px;
}
.gallery-thumb {
  flex: 0 0 auto;
  width: 88px;
  height: 66px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  background: none;
  transition: border-color var(--transition-fast);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.is-active { border-color: var(--brand-accent); }
.gallery-thumb:hover { border-color: var(--border-subtle); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 9, 11, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: lightbox-fade-in 0.2s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lightbox-fade-in { from { opacity: 0; } to { opacity: 1; } }

.lightbox-image {
  max-width: min(1200px, 92vw);
  max-height: 86vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-close, .lightbox-nav {
  position: absolute;
  background: rgba(245, 243, 238, 0.1);
  border: 1px solid rgba(245, 243, 238, 0.25);
  color: var(--text-on-dark);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(245, 243, 238, 0.2); }

.lightbox-close {
  top: var(--space-3);
  right: var(--space-3);
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 1;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 1.75rem;
  line-height: 1;
}
.lightbox-prev { left: var(--space-3); }
.lightbox-next { right: var(--space-3); }

.lightbox-counter {
  position: absolute;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(245, 243, 238, 0.1);
  color: var(--text-on-dark-muted);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
}

body.lightbox-open { overflow: hidden; }

@media (max-width: 600px) {
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.4rem; }
}

/* =========================================================
   Scroll reveal (progressive enhancement — only active once
   no-fouc.js has confirmed JS is available; no-JS visitors
   always see full content immediately, no flash either way)
   ========================================================= */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

.reveal-group > .reveal:nth-child(2) { transition-delay: 60ms; }
.reveal-group > .reveal:nth-child(3) { transition-delay: 120ms; }
.reveal-group > .reveal:nth-child(4) { transition-delay: 180ms; }
.reveal-group > .reveal:nth-child(5) { transition-delay: 240ms; }
.reveal-group > .reveal:nth-child(6) { transition-delay: 300ms; }
.reveal-group > .reveal:nth-child(7) { transition-delay: 360ms; }
.reveal-group > .reveal:nth-child(8) { transition-delay: 420ms; }

/* =========================================================
   Premium motion layer (animations.js / cursor.js)
   Additive only — none of this touches the .reveal fallback above,
   which keeps working unmodified if GSAP fails to load from the CDN.
   ========================================================= */

/* Fluid active-nav indicator — desktop only; the mobile stacked menu
   (<=900px) doesn't have a meaningful horizontal position for it. */
.nav-indicator {
  display: none;
  position: absolute;
  left: 0;
  bottom: -8px;
  height: 2px;
  width: 0;
  background: var(--brand-accent);
  border-radius: 999px;
  pointer-events: none;
}
@media (min-width: 901px) {
  .nav-indicator { display: block; }
}

/* Desktop custom cursor — only ever shown once cursor.js confirms a
   fine-pointer, hover-capable, non-reduced-motion desktop and adds
   body.has-custom-cursor; the native cursor is otherwise untouched. */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor-dot {
  width: var(--cursor-size);
  height: var(--cursor-size);
  background: var(--cursor-color);
}
.cursor-ring {
  width: var(--cursor-ring-size);
  height: var(--cursor-ring-size);
  border: 1px solid var(--cursor-color);
  opacity: 0.6;
  transition: width var(--transition-fast), height var(--transition-fast), opacity var(--transition-fast);
}
.cursor-ring.is-hovering {
  width: calc(var(--cursor-ring-size) * 1.6);
  height: calc(var(--cursor-ring-size) * 1.6);
  opacity: 0.9;
}
body.has-custom-cursor a,
body.has-custom-cursor button,
body.has-custom-cursor [role="button"],
body.has-custom-cursor .vehicle-card,
body.has-custom-cursor .gallery-thumb {
  cursor: none;
}
@media (max-width: 900px) {
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* Opt-in arrow-move CTA treatment — applied deliberately to primary
   navigational CTAs (Index.cshtml hero), not every .btn on the site. */
.btn-cta .btn-arrow {
  display: inline-block;
  transition: transform var(--transition-fast);
}
.btn-cta:hover .btn-arrow { transform: translateX(4px); }

/* data-gsap / data-gsap-stagger hooks (animations.js): intentionally NO
   CSS here that hides these elements by default. If the GSAP CDN request
   fails, animations.js no-ops and these elements must stay at their normal
   visible state — GSAP sets and animates the hidden->visible state itself,
   only once it has actually loaded. */

/* =========================================================
   Legal pages
   ========================================================= */
.legal-content { max-width: 72ch; }
.legal-meta { color: var(--text-on-light-muted); font-size: 0.9rem; margin-bottom: var(--space-5); }
.legal-toc {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}
.legal-toc h2 { font-size: 1rem; margin-bottom: var(--space-2); }
.legal-toc ol { margin: 0; padding-left: 1.25em; }
.legal-toc li { margin-bottom: var(--space-1); }
.legal-content h2 { margin-top: var(--space-6); scroll-margin-top: calc(64px + var(--space-3)); }
.legal-content h3 { margin-top: var(--space-4); }
.legal-content ul, .legal-content ol { color: var(--text-on-light-muted); padding-left: 1.4em; }
.legal-content li { margin-bottom: var(--space-2); }
.legal-content a { color: var(--brand-accent-dark); text-decoration: underline; }

.legal-review-note {
  margin-top: var(--space-7);
  padding: var(--space-4);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}
.legal-review-note p { font-size: 0.85rem; margin: 0; }

.consent-field {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.consent-field input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; }
.consent-field label { font-weight: 400; font-size: 0.9rem; color: var(--text-on-light-muted); }

/* =========================================================
   Utility
   ========================================================= */
.text-muted { color: var(--text-on-light-muted); }
.mt-0 { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

.form-section-title { font-family: var(--font-heading); font-size: 1.1rem; margin: var(--space-4) 0 var(--space-2); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
}
.timeline li:last-child { border-bottom: none; }
