/* Tonoloc — web design system.
 *
 * The same "Engineered Automotive Tech" system the Flutter app uses, so the
 * site and the apps are visibly one product. Tokens are copied from
 * New app design/DESIGN info, which is also what lib/core/theme.dart reads.
 *
 * Deliberately hand-written rather than Tailwind: the whole stylesheet is
 * ~25KB, it needs no build step on a PHP server, and the token names stay
 * greppable against the Dart side.
 */

/* ---------------------------------------------------------------- tokens */
:root {
  --surface: #faf8ff;
  --surface-dim: #d2d9f4;
  --sc-lowest: #ffffff;
  --sc-low: #f2f3ff;
  --sc: #eaedff;
  --sc-high: #e2e7ff;
  --sc-highest: #dae2fd;

  --on-surface: #131b2e;
  --on-surface-variant: #444653;
  --muted: #757684;
  --outline: #757684;
  --outline-variant: #c4c5d5;

  --primary: #00288e;
  --on-primary: #ffffff;
  --primary-container: #1e40af;
  --interactive: #2563eb;
  --secondary: #0051d5;

  /* Emerald is a trust signal, never decoration: verified papers, available
   * now, confirmed booking. Using it for anything else devalues all three. */
  --success: #00563a;
  --success-ink: #10b981;
  --success-bg: #e6f7f0;

  --warning: #b45309;
  --warning-bg: #fef4e6;
  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-bg: #ffdad6;

  --r-sm: .25rem;
  --r: .5rem;
  --r-md: .75rem;
  --r-lg: 1rem;
  --r-xl: 1.5rem;
  --r-full: 9999px;

  --s-xs: .25rem;
  --s-sm: .5rem;
  --s-md: 1rem;
  --s-lg: 1.5rem;
  --s-xl: 2rem;

  --head: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Plus Jakarta Sans', system-ui, sans-serif;

  /* Ambient rather than hard: cards must separate on a phone held in Algerian
   * sunlight without the shadow reading as a grey smear. */
  --lift-1: 0 1px 3px 0 rgb(15 23 42 / .05), 0 1px 2px -1px rgb(15 23 42 / .05);
  --lift-2: 0 10px 15px -3px rgb(15 23 42 / .08), 0 4px 6px -4px rgb(15 23 42 / .04);
  --lift-3: 0 20px 30px -8px rgb(15 23 42 / .12);

  --container: 1280px;
  --header-h: 72px;

  /* Introduced so the dark theme is a token swap rather than a parallel set
     of component rules. Anything a theme must change lives here. */
  --on-primary: #ffffff;
  --primary-hover: var(--primary-container);
  --header-bg: rgb(250 248 255 / .88);
  --footer-bg: #0e1526;
  --frost-bg: rgb(19 27 46 / .72);
  --ph-filter: none;
  --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23444653' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

:root[dir="rtl"] {
  --head: 'Cairo', system-ui, sans-serif;
  --body: 'Tajawal', system-ui, sans-serif;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }

/* .label and friends set display:block, which out-specifies the UA sheet's
 * [hidden] rule and leaves "hidden" labels visible. */
[hidden] { display: none !important; }

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  /* Tabular figures everywhere: prices, plates, mileage and dates all sit in
   * columns, and proportional digits make those columns wobble. */
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--head); margin: 0; letter-spacing: -.02em; }
h1 { font-size: 2.75rem; font-weight: 700; line-height: 1.18; }
h2 { font-size: 1.875rem; font-weight: 700; line-height: 1.2; }
h3 { font-size: 1.375rem; font-weight: 600; line-height: 1.27; letter-spacing: -.01em; }
h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.33; letter-spacing: -.005em; }

@media (max-width: 767px) {
  h1 { font-size: 2rem; line-height: 1.19; letter-spacing: -.02em; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

p { margin: 0 0 var(--s-md); }
a { color: var(--interactive); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--outline-variant); margin: var(--s-lg) 0; }

:focus-visible {
  outline: 3px solid var(--interactive);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Hidden by clipping, NOT by left:-9999px.
 *
 * In LTR a browser discards overflow past the left edge, so -9999px looks
 * harmless. In RTL the inline axis is mirrored: that same offset becomes
 * 9999px of genuinely scrollable overflow, giving every Arabic page a huge
 * bogus horizontal scrollbar and an empty void to scroll into. */
.skip {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip:focus {
  width: auto; height: auto; margin: 0; overflow: visible;
  clip: auto; clip-path: none; z-index: 100;
  inset-block-start: 0; inset-inline-start: 0;
  background: var(--primary); color: #fff; padding: .75rem 1rem;
  border-end-end-radius: var(--r);
}

/* --------------------------------------------------------------- layout */
.wrap { max-width: var(--container); margin-inline: auto; padding-inline: var(--s-md); }
@media (min-width: 768px)  { .wrap { padding-inline: var(--s-lg); } }
@media (min-width: 1024px) { .wrap { padding-inline: 3rem; } }

.section { padding-block: 3.5rem; }
.section--tight { padding-block: 2rem; }
@media (max-width: 767px) { .section { padding-block: 2.5rem; } }

.stack > * + * { margin-top: var(--s-md); }
.stack-lg > * + * { margin-top: var(--s-lg); }
.row { display: flex; align-items: center; gap: var(--s-sm); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-md); }
.wrap-row { display: flex; flex-wrap: wrap; gap: var(--s-sm); align-items: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.grid { display: grid; gap: var(--s-lg); }
.grid-cars { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
/* Inside the browse layout the results column is ~850px once the filter rail
 * takes its 300px, and a 290px minimum rounds that down to two very wide
 * cards. 252px fits three, which is the density a catalogue wants. */
.layout-browse .grid-cars { grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: var(--s-md); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
/* Spec tiles sit inside a padded card, so they get less room than a bare
 * .grid-3 assumes and would drop to two columns on a desktop detail page. */
.grid-specs { grid-template-columns: repeat(auto-fit, minmax(186px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Sidebar + results. Collapses to one column below the desktop breakpoint,
 * where the filter panel becomes a disclosure instead. */
.layout-browse { display: grid; gap: var(--s-xl); grid-template-columns: 1fr; }
@media (min-width: 1024px) { .layout-browse { grid-template-columns: 300px 1fr; } }

.layout-detail { display: grid; gap: var(--s-xl); grid-template-columns: 1fr; }
@media (min-width: 1024px) { .layout-detail { grid-template-columns: 1fr 380px; align-items: start; } }

.layout-app { display: grid; gap: var(--s-xl); grid-template-columns: 1fr; }
@media (min-width: 900px) { .layout-app { grid-template-columns: 236px 1fr; align-items: start; } }

/* ------------------------------------------------------------ typography */
.micro {
  font-family: var(--head); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.mono { font-family: var(--head); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.lead { font-size: 1.125rem; color: var(--on-surface-variant); }
.small { font-size: .875rem; }
.tiny { font-size: .75rem; }
.dim { color: var(--on-surface-variant); }
.dimmer { color: var(--muted); }
.strong { font-weight: 600; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--sc-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-lg);
  box-shadow: var(--lift-1);
}
.card-pad { padding: var(--s-lg); }
.card-pad-sm { padding: var(--s-md); }

.card-link {
  display: block; color: inherit; text-decoration: none;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.card-link:hover {
  text-decoration: none;
  box-shadow: var(--lift-2);
  border-color: var(--surface-dim);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .card-link, .card-link:hover { transition: none; transform: none; }
}

.panel { background: var(--sc-low); border-radius: var(--r-md); padding: var(--s-md); }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--body); font-size: .9375rem; font-weight: 600;
  padding: .75rem 1.25rem; border-radius: var(--r-md);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap; line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: var(--sc); color: var(--primary); }
.btn-secondary:hover { background: var(--sc-high); }

.btn-outline { background: transparent; color: var(--primary); border-color: var(--outline-variant); }
.btn-outline:hover { background: var(--sc-low); border-color: var(--surface-dim); }

.btn-ghost { background: transparent; color: var(--on-surface-variant); }
.btn-ghost:hover { background: var(--sc-low); }

.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }

.btn-lg { padding: 1rem 1.75rem; font-size: 1rem; border-radius: var(--r-lg); }
.btn-sm { padding: .5rem .875rem; font-size: .8125rem; border-radius: var(--r); }
.btn-block { display: flex; width: 100%; }

/* ----------------------------------------------------------- chips, tags */
.chip {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .5rem .875rem; border-radius: var(--r-full);
  background: var(--sc); color: var(--on-surface-variant);
  font-size: .875rem; font-weight: 500; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
}
.chip:hover { background: var(--sc-high); text-decoration: none; }
.chip[aria-pressed="true"], .chip.is-active {
  background: var(--primary); color: var(--on-primary); border-color: var(--primary);
}

.spec {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .375rem .625rem; border-radius: var(--r);
  background: var(--sc-low); color: var(--on-surface-variant);
  font-size: .8125rem; font-weight: 500; white-space: nowrap;
}

.badge {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .3125rem .625rem; border-radius: var(--r-full);
  font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error   { background: var(--error-bg);   color: #93000a; }
.badge-neutral { background: var(--sc); color: var(--on-surface-variant); }
.badge-primary { background: var(--primary); color: var(--on-primary); }

/* The paid placement an agency buys. Solid amber, not a tinted whisper: it
 * is the one badge on a card that exists to be noticed, and an agency that
 * has paid for it should be able to see what it bought.
 *
 * It used to be a green check labelled "verified", which broke the rule
 * three declarations above this one -- emerald is a trust signal, never
 * decoration -- and told the client the wrong thing besides: featured is
 * bought, verified is earned. Same amber as the app's FeaturedBadge, so the
 * two surfaces agree. Self-contained, so it needs no dark-mode variant. */
.badge-featured {
  background: #f59e0b;
  color: #5c2a0a;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-size: .6875rem;
}

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }

/* -------------------------------------------------------------- the rail */
.price { font-family: var(--head); font-weight: 700; letter-spacing: -.02em; color: var(--primary); }
.price-lg { font-size: 1.75rem; }
.price-xl { font-size: 2.25rem; }
.price-unit { font-family: var(--body); font-size: .8125rem; font-weight: 500; color: var(--muted); }

/* ---------------------------------------------------------------- forms */
.field { display: block; margin-bottom: var(--s-md); }
.field > label, .label {
  display: block; margin-bottom: .375rem;
  font-size: .875rem; font-weight: 600; color: var(--on-surface);
}
.input, .select, .textarea {
  width: 100%; padding: .75rem .875rem;
  font-family: var(--body); font-size: 1rem; color: var(--on-surface);
  background: var(--sc-lowest);
  border: 1px solid var(--outline-variant); border-radius: var(--r-md);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--interactive);
  box-shadow: 0 0 0 3px rgb(37 99 235 / .14);
}
.input::placeholder { color: var(--muted); }
.textarea { min-height: 110px; resize: vertical; }
.select {
  appearance: none; padding-inline-end: 2.25rem;
  background-image: var(--caret);
  background-repeat: no-repeat;
  background-position: right .75rem center;
}
:root[dir="rtl"] .select { background-position: left .75rem center; }

.hint { font-size: .8125rem; color: var(--muted); margin-top: .375rem; }
.check { display: flex; align-items: flex-start; gap: .625rem; cursor: pointer; font-size: .9375rem; }
.check input { margin-top: .2rem; width: 18px; height: 18px; accent-color: var(--primary); flex: none; }

.alert { padding: .875rem 1rem; border-radius: var(--r-md); font-size: .9375rem; margin-bottom: var(--s-md); }
.alert-error   { background: var(--error-bg);   color: #93000a; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-info    { background: var(--sc); color: var(--on-surface-variant); }

/* --------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--outline-variant);
}
.site-header .wrap { display: flex; align-items: center; gap: var(--s-md); min-height: var(--header-h); }

.brand { display: flex; align-items: center; gap: .625rem; color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: var(--r-md); }
.brand-name { font-family: var(--head); font-weight: 700; font-size: 1.125rem; letter-spacing: -.01em; color: var(--primary); line-height: 1.1; }
.brand-tag { font-family: var(--head); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* 1060, not 900. The header now carries a wider brand lockup plus language
 * and theme controls; at 900 the links wrapped onto two and three lines. Below
 * this width the burger menu takes over, which was always the fallback. */
.nav { display: none; gap: .25rem; margin-inline-start: var(--s-lg); }
@media (min-width: 1060px) { .nav { display: flex; } }
.nav a { white-space: nowrap; }
.nav a {
  padding: .5rem .75rem; border-radius: var(--r); color: var(--on-surface-variant);
  font-size: .9375rem; font-weight: 500; text-decoration: none;
}
.nav a:hover { background: var(--sc); color: var(--on-surface); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--primary); font-weight: 600; background: var(--sc); }

.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .5rem; }
.header-actions .btn { padding: .5rem .875rem; font-size: .875rem; }
.show-xs { display: none; }
@media (max-width: 599px) { .hide-xs { display: none; } .show-xs { display: inline; } }
/* The language switcher moves into the burger menu on narrow screens. Left in
 * the bar it pushed the header past the viewport, and a body wider than the
 * screen clips every row on the page, not just the header. */
@media (max-width: 767px) { .hide-sm { display: none; } }

/* The header is the narrowest thing on the page and the easiest to overflow:
 * brand + tagline + language + CTA + burger does not fit 430px. Below 600px
 * the tagline goes and the CTA keeps only its short label. No overflow-x
 * hidden on the body — that hides the symptom and silently clips real content
 * (prices, mileage) on every row of the page. */
.site-header .wrap { flex-wrap: nowrap; }
.brand-name, .brand-tag { white-space: nowrap; }
@media (max-width: 599px) {
  .brand-tag { display: none; }
  .brand img { width: 34px; height: 34px; }
  .header-actions { gap: .375rem; }
  .header-actions .btn { padding: .5rem .7rem; font-size: .8125rem; }
}

.burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--r-md);
  background: transparent; border: 1px solid var(--outline-variant); cursor: pointer;
}
@media (min-width: 1060px) { .burger { display: none; } }

.mobile-nav { display: none; border-top: 1px solid var(--outline-variant); background: var(--sc-lowest); }
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block; padding: .875rem var(--s-md); color: var(--on-surface);
  text-decoration: none; border-bottom: 1px solid var(--sc);
  font-weight: 500;
}
.mobile-nav a:hover { background: var(--sc-low); text-decoration: none; }

/* ----------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  /* Three stops rather than two, plus a warm highlight off-centre: a flat
   * two-stop gradient across 1280px reads as a printed block, not a surface. */
  background:
    radial-gradient(900px 420px at 78% -10%, rgb(99 140 255 / .55), transparent 62%),
    linear-gradient(135deg, #001e6e 0%, var(--primary) 38%, var(--primary-container) 72%, #2a4fd0 100%);
  color: #fff;
}
/* Fine grain. Without it large flat gradients band visibly on cheap panels,
 * which is exactly the screen most Algerian users will be on. */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .5; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.hero-art {
  position: absolute; inset-inline-end: -4%; top: 50%; transform: translateY(-50%);
  width: min(46%, 560px); height: auto; z-index: -1; pointer-events: none;
  opacity: .5;
}
@media (max-width: 1023px) { .hero-art { display: none; } }
.hero-inner { max-width: 60ch; }
:root[dir="rtl"] .hero-art { transform: translateY(-50%) scaleX(-1); }
/* Faint road-grid texture; the gradient alone reads flat at desktop width. */
.hero::after {
  content: ''; position: absolute; inset: 0; opacity: .13; pointer-events: none; z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / .9) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .9) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 15%, #000 10%, transparent 72%);
}
.hero > .wrap { position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 17ch; }
.hero .lead { color: rgb(255 255 255 / .84); max-width: 54ch; font-size: 1.125rem; }
.hero-inner { padding-block: 4rem 3rem; }
@media (max-width: 767px) { .hero-inner { padding-block: 2.5rem 2rem; } }

.hero-trust { display: flex; flex-wrap: wrap; gap: var(--s-lg); margin-top: var(--s-lg); }
.hero-trust > div { display: flex; align-items: center; gap: .5rem; font-size: .9375rem; color: rgb(255 255 255 / .9); }

/* Search panel straddling the hero edge. */
.searchbar {
  background: var(--sc-lowest); border-radius: var(--r-xl);
  box-shadow: var(--lift-3); padding: var(--s-md);
  display: grid; gap: var(--s-sm); grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .searchbar { grid-template-columns: 1.4fr 1fr 1fr auto; align-items: end; padding: var(--s-lg); gap: var(--s-md); }
}
.searchbar .field { margin: 0; }

/* --------------------------------------------------------------- photos */
.photo {
  position: relative; width: 100%; aspect-ratio: 16 / 10;
  background: var(--sc-highest); overflow: hidden;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty {
  display: flex; align-items: center; justify-content: center; height: 100%;
  color: var(--muted);
}
/* Generated silhouette (Art::carPlaceholder) fills the frame like a photo
 * would, so a card with no photograph still has a composed image area. */
.photo .ph { width: 100%; height: 100%; display: block; filter: var(--ph-filter, none); }
.photo-tl { position: absolute; top: .75rem; inset-inline-start: .75rem; }
.photo-tr { position: absolute; top: .75rem; inset-inline-end: .75rem; }
.photo-br { position: absolute; bottom: .75rem; inset-inline-end: .75rem; }

.frost {
  background: var(--frost-bg); color: #fff;
  backdrop-filter: blur(6px);
  padding: .3125rem .625rem; border-radius: var(--r-full);
  font-size: .75rem; font-weight: 600;
}

.avatar {
  width: 44px; height: 44px; border-radius: var(--r-md); flex: none;
  background: var(--sc); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-weight: 700; font-size: 1.125rem;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; font-size: .875rem; border-radius: var(--r); }
.avatar-lg { width: 72px; height: 72px; font-size: 1.75rem; border-radius: var(--r-lg); }

/* ------------------------------------------------------------ car cards */
.car-card { overflow: hidden; display: flex; flex-direction: column; }
.car-card .photo { aspect-ratio: 3 / 2; }
.car-body { padding: var(--s-md); display: flex; flex-direction: column; gap: .625rem; flex: 1; }
.car-title { font-family: var(--head); font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
.car-meta { display: flex; align-items: center; gap: .375rem; font-size: .8125rem; color: var(--on-surface-variant); }
.car-foot { margin-top: auto; padding-top: .625rem; border-top: 1px solid var(--sc); display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-sm); }

/* ------------------------------------------------------------- gallery */
.gallery { display: grid; gap: .5rem; grid-template-columns: 1fr; }
.gallery-main { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--outline-variant); }
.gallery-main .photo { aspect-ratio: 16 / 10; }
.gallery-thumbs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; }
.gallery-thumbs button {
  flex: none; width: 92px; aspect-ratio: 4 / 3; padding: 0; cursor: pointer;
  border: 2px solid transparent; border-radius: var(--r); overflow: hidden; background: var(--sc-highest);
}
.gallery-thumbs button[aria-current="true"] { border-color: var(--primary); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* -------------------------------------------------------------- sidebar */
.side-nav { display: flex; flex-direction: column; gap: .125rem; }
.side-nav a {
  display: flex; align-items: center; gap: .625rem;
  padding: .75rem .875rem; border-radius: var(--r-md);
  color: var(--on-surface-variant); font-weight: 500; font-size: .9375rem;
  text-decoration: none;
}
.side-nav a:hover { background: var(--sc-low); color: var(--on-surface); text-decoration: none; }
.side-nav a[aria-current="page"] { background: var(--sc); color: var(--primary); font-weight: 600; }
@media (max-width: 899px) {
  .side-nav { flex-direction: row; overflow-x: auto; gap: .375rem; padding-bottom: .25rem; }
  .side-nav a { white-space: nowrap; }
}

/* ------------------------------------------------------------- KPI tiles */
.kpi { display: grid; gap: var(--s-md); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi-tile { background: var(--sc-lowest); border: 1px solid var(--outline-variant); border-radius: var(--r-lg); padding: var(--s-md); box-shadow: var(--lift-1); }
.kpi-val { font-family: var(--head); font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }

/* ---------------------------------------------------------------- table */
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th {
  text-align: start; padding: .75rem var(--s-md);
  font-family: var(--head); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--outline-variant); white-space: nowrap;
}
.table td { padding: var(--s-md); border-bottom: 1px solid var(--sc); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* ----------------------------------------------------------- empty, misc */
.empty { text-align: center; padding: 3.5rem var(--s-md); color: var(--on-surface-variant); }
.empty svg { color: var(--surface-dim); margin-bottom: var(--s-md); }

.steps { counter-reset: s; display: grid; gap: var(--s-lg); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { position: relative; padding-top: 3.25rem; }
.step::before {
  counter-increment: s; content: counter(s);
  position: absolute; top: 0; inset-inline-start: 0;
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-weight: 700; font-size: 1.125rem;
}

.pagination { display: flex; gap: .375rem; justify-content: center; flex-wrap: wrap; margin-top: var(--s-xl); }
.pagination a, .pagination span {
  min-width: 42px; padding: .5rem .75rem; border-radius: var(--r-md);
  border: 1px solid var(--outline-variant); background: var(--sc-lowest);
  color: var(--on-surface-variant); text-align: center; text-decoration: none; font-weight: 500;
}
.pagination a:hover { background: var(--sc-low); text-decoration: none; }
.pagination [aria-current="page"] { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  background: var(--footer-bg); color: #c4c5d5;
  padding-block: 3rem var(--s-lg); margin-top: 4rem;
}
.site-footer h4 { color: #fff; font-size: .9375rem; margin-bottom: .875rem; }
.site-footer a { color: #c4c5d5; font-size: .9375rem; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: .5rem; }
.footer-grid { display: grid; gap: var(--s-xl); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.footer-bottom {
  margin-top: var(--s-xl); padding-top: var(--s-lg);
  border-top: 1px solid rgb(255 255 255 / .1);
  display: flex; flex-wrap: wrap; gap: var(--s-md); justify-content: space-between;
  font-size: .875rem; color: var(--muted);
}

/* --------------------------------------------------------------- details */
.disclosure summary {
  cursor: pointer; list-style: none; padding: .875rem var(--s-md);
  font-weight: 600; border-radius: var(--r-md); background: var(--sc-low);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-sm);
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: '⌄'; font-size: 1.25rem; line-height: 1; transition: transform .2s; }
.disclosure[open] summary::after { transform: rotate(180deg); }

/* ------------------------------------------------------------------ RTL */
:root[dir="rtl"] .hero h1 { max-width: 20ch; }

@media print {
  .site-header, .site-footer, .btn { display: none; }
}

/* ======================================================= premium layer ==
 * Added after the first pass, which read as thin: lots of air, little
 * substance, and no rhythm between sections. These give the page texture
 * (alternating bands), hierarchy (eyebrows) and weight (stats, features).
 */

/* Small tracked label above a heading. Cheap way to give a section a sense of
 * place without adding another heading level. */
.eyebrow {
  display: inline-flex; align-items: center; gap: .375rem;
  font-family: var(--head); font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgb(255 255 255 / .75);
  padding: .3125rem .625rem; border-radius: var(--r-full);
  background: rgb(255 255 255 / .12);
  border: 1px solid rgb(255 255 255 / .18);
  margin-bottom: var(--s-md);
}
.eyebrow--dark {
  color: var(--primary);
  background: var(--sc);
  border-color: transparent;
}

/* Alternating tone. A page of identical white sections has no rhythm; every
 * other block sitting on the tinted surface gives the eye somewhere to rest. */
.band { background: var(--sc-low); }

/* Figures. Space Grotesk at display size is the single biggest "this is a
 * real platform" signal available without photography. */
.stats {
  display: grid; gap: var(--s-md);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding: var(--s-lg); border-radius: var(--r-xl);
  background: var(--sc-lowest);
  border: 1px solid var(--outline-variant);
  box-shadow: var(--lift-1);
}
.stat { text-align: center; }
.stat-n {
  display: block; font-family: var(--head); font-weight: 700;
  font-size: 2.25rem; line-height: 1.1; letter-spacing: -.03em;
  color: var(--primary);
}
@media (max-width: 600px) { .stat-n { font-size: 1.75rem; } }

/* Feature rows: icon tile + copy. Reads denser than a plain card grid and
 * carries more words per screen, which is the actual problem. */
.feature { display: flex; gap: var(--s-md); align-items: flex-start; }
@media (min-width: 900px) { .band .grid-2 { grid-template-columns: 1fr 1fr; } }
.feature-ic {
  flex: none; width: 46px; height: 46px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--sc); color: var(--primary);
}

/* Vehicle-type tiles now show the generated silhouette rather than a repeated
 * outline icon, so the row reads as six vehicles instead of six glyphs. */
/* Six vehicle types in one clean row rather than auto-fit's 5 + an orphan. */
.types-row { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px)  { .types-row { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .types-row { grid-template-columns: repeat(6, 1fr); } }

.type-tile {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 0 0 var(--s-md); overflow: hidden; text-align: center;
}
.type-art { display: block; width: 100%; aspect-ratio: 2 / 1; overflow: hidden; }
.type-art .ph { width: 100%; height: 100%; }
.type-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.faq summary { font-size: 1rem; }
.faq[open] summary { border-end-start-radius: 0; border-end-end-radius: 0; }

.app-band {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-xl); flex-wrap: wrap;
  background: linear-gradient(135deg, var(--sc-low), var(--sc-high));
  border: 0;
}
.app-art { color: var(--primary); opacity: .22; flex: none; }
@media (max-width: 700px) { .app-art { display: none; } }

.cta-card {
  padding: var(--s-xl); border-radius: var(--r-xl); color: #fff;
  position: relative; overflow: hidden;
  background:
    radial-gradient(640px 300px at 88% 0%, rgb(99 140 255 / .5), transparent 60%),
    linear-gradient(135deg, var(--primary), var(--primary-container));
  box-shadow: var(--lift-2);
}

/* Cards lift a little further and the image gains a slow zoom. Restrained on
 * purpose — a marketplace card that jumps feels cheap, not premium. */
.car-card .photo img, .car-card .photo .ph { transition: transform .45s ease; }
.card-link:hover .photo img, .card-link:hover .photo .ph { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) {
  .car-card .photo img, .car-card .photo .ph,
  .card-link:hover .photo img, .card-link:hover .photo .ph { transition: none; transform: none; }
}

/* The price is the thing the eye hunts for on a listing; give it the room. */
.car-foot .price { font-size: 1.375rem; }

/* ------------------------------------------------- photographic hero
 * A photograph behind the headline, with a scrim heavy enough that white
 * text clears AA on the brightest part of any candidate image. The scrim is
 * cobalt rather than black so the photo joins the brand instead of sitting
 * in front of it.
 */
/* Photo: Unsplash (unsplash.com/photos/1446768500601-ac47e5ec3719). Unsplash
 * License — free for commercial use, attribution not required. Recorded here
 * so the provenance stays traceable if the asset is ever questioned. */
.hero--photo {
  background-image:
    linear-gradient(90deg, rgb(0 20 83 / .92) 0%, rgb(0 20 83 / .78) 42%, rgb(0 30 110 / .42) 100%),
    url(/assets/web/hero/hero-coast.webp);
  background-size: cover, cover;
  background-position: center, center;
}
.hero--photo::before, .hero--photo::after { opacity: .18; }

/* The scrim has to follow the text, not the viewport. Left unmirrored, the
 * Arabic headline sits on the light end of the gradient and loses most of its
 * contrast against the sky. */
:root[dir="rtl"] .hero--photo {
  background-image:
    linear-gradient(270deg, rgb(0 20 83 / .92) 0%, rgb(0 20 83 / .78) 42%, rgb(0 30 110 / .42) 100%),
    url(/assets/web/hero/hero-coast.webp);
}
.hero--photo .hero-inner { padding-block: 5rem 4rem; max-width: 56ch; }
@media (max-width: 767px) {
  /* Portrait viewport: the scrim goes vertical so the headline still has a
   * dark field under it rather than a bright patch of sky. */
  /* A 900px crop, squarer and a third of the weight. The hero is tall and
   * narrow on a phone, where the wide desktop crop would show mostly sea. */
  .hero--photo {
    background-image:
      linear-gradient(180deg, rgb(0 20 83 / .72) 0%, rgb(0 20 83 / .92) 70%),
      url(/assets/web/hero/hero-coast-sm.webp);
  }
  .hero--photo .hero-inner { padding-block: 3rem 2.5rem; }
}

/* ============================================================ dark mode ==
 * Same tokens as the Flutter app (AppTheme.dSurface… in lib/core/theme.dart),
 * so a user with the app and the site open sees one product.
 *
 * The palette is written once as --d-*. Two short blocks then map it onto the
 * live tokens: one for "follow the OS", one for "the reader chose dark". CSS
 * cannot share a declaration list across a media-query boundary, so the map
 * appears twice — the VALUES do not, which is the part that would rot.
 *
 * :root[data-theme] is set server-side from a cookie, so a reader who has
 * chosen a theme gets it in the very first byte, with no flash of the wrong
 * one and no JavaScript involved.
 */
:root {
  --d-surface: #0b1020;
  --d-surface-dim: #070b16;
  --d-sc-lowest: #141a2e;
  --d-sc-low: #101627;
  --d-sc: #1a2138;
  --d-sc-high: #222b45;
  --d-sc-highest: #2a3350;
  --d-on-surface: #e6e9f5;
  --d-on-surface-variant: #a9afc4;
  --d-muted: #8a90a6;
  --d-outline-variant: #2e3650;
  /* #00288E would vanish on this canvas; mirrors the app's dark scheme. */
  --d-primary: #b8c4ff;
  --d-on-primary: #001453;
  --d-primary-container: #173bab;
  --d-primary-hover: #cdd6ff;
  --d-interactive: #93b4ff;
  --d-secondary: #b4c5ff;
  --d-success: #34d399;
  --d-success-bg: #06281e;
  --d-warning: #fbbf24;
  --d-warning-bg: #2a1f05;
  --d-error: #ffb4ab;
  --d-error-bg: #3a0b08;
  --d-header-bg: rgb(11 16 32 / .9);
  --d-footer-bg: #070b16;
  --d-frost-bg: rgb(0 0 0 / .66);
  --d-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23a9afc4' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  /* Placeholders are drawn in light-mode cobalt; dim them so a grid of
     unphotographed cars does not glow on a dark page. */
  --d-ph-filter: brightness(.42) saturate(.75);
}

/* Keep these two lists identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: var(--d-surface); --surface-dim: var(--d-surface-dim);
    --sc-lowest: var(--d-sc-lowest); --sc-low: var(--d-sc-low);
    --sc: var(--d-sc); --sc-high: var(--d-sc-high); --sc-highest: var(--d-sc-highest);
    --on-surface: var(--d-on-surface); --on-surface-variant: var(--d-on-surface-variant);
    --muted: var(--d-muted); --outline: var(--d-muted); --outline-variant: var(--d-outline-variant);
    --primary: var(--d-primary); --on-primary: var(--d-on-primary);
    --primary-container: var(--d-primary-container); --primary-hover: var(--d-primary-hover);
    --interactive: var(--d-interactive); --secondary: var(--d-secondary);
    --success: var(--d-success); --success-ink: var(--d-success); --success-bg: var(--d-success-bg);
    --warning: var(--d-warning); --warning-bg: var(--d-warning-bg);
    --error: var(--d-error); --error-bg: var(--d-error-bg);
    --header-bg: var(--d-header-bg); --footer-bg: var(--d-footer-bg);
    --frost-bg: var(--d-frost-bg); --caret: var(--d-caret); --ph-filter: var(--d-ph-filter);
    --wm-1: #dbe2ff; --wm-2: #6d9bff;
    --lift-1: 0 1px 2px rgb(0 0 0 / .4);
    --lift-2: 0 10px 20px -6px rgb(0 0 0 / .55);
    --lift-3: 0 20px 36px -10px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: var(--d-surface); --surface-dim: var(--d-surface-dim);
  --sc-lowest: var(--d-sc-lowest); --sc-low: var(--d-sc-low);
  --sc: var(--d-sc); --sc-high: var(--d-sc-high); --sc-highest: var(--d-sc-highest);
  --on-surface: var(--d-on-surface); --on-surface-variant: var(--d-on-surface-variant);
  --muted: var(--d-muted); --outline: var(--d-muted); --outline-variant: var(--d-outline-variant);
  --primary: var(--d-primary); --on-primary: var(--d-on-primary);
  --primary-container: var(--d-primary-container); --primary-hover: var(--d-primary-hover);
  --interactive: var(--d-interactive); --secondary: var(--d-secondary);
  --success: var(--d-success); --success-ink: var(--d-success); --success-bg: var(--d-success-bg);
  --warning: var(--d-warning); --warning-bg: var(--d-warning-bg);
  --error: var(--d-error); --error-bg: var(--d-error-bg);
  --header-bg: var(--d-header-bg); --footer-bg: var(--d-footer-bg);
  --frost-bg: var(--d-frost-bg); --caret: var(--d-caret); --ph-filter: var(--d-ph-filter);
  --wm-1: #dbe2ff; --wm-2: #6d9bff;
  --lift-1: 0 1px 2px rgb(0 0 0 / .4);
  --lift-2: 0 10px 20px -6px rgb(0 0 0 / .55);
  --lift-3: 0 20px 36px -10px rgb(0 0 0 / .6);
  color-scheme: dark;
}

/* ------------------------------------------------------- theme switcher
 * Two buttons, only one ever visible: whichever is the opposite of the
 * current theme. Done in CSS rather than JavaScript so it is correct on the
 * first paint even when the reader has expressed no preference and the
 * server cannot know what their OS is set to.
 */
.theme-form { display: flex; margin: 0; }
.theme-btn {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; cursor: pointer;
  background: transparent; color: var(--on-surface-variant);
  border: 1px solid var(--outline-variant); border-radius: var(--r-md);
}
.theme-btn:hover { background: var(--sc-low); color: var(--on-surface); }
/* Light now -> offer dark. */
:root:not([data-theme="dark"]) .theme-to-dark { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-to-dark { display: none; }
  :root:not([data-theme="light"]) .theme-to-light { display: inline-flex; }
}
/* Explicit choices win over the OS in both directions. */
:root[data-theme="dark"] .theme-to-dark { display: none; }
:root[data-theme="dark"] .theme-to-light { display: inline-flex; }
:root[data-theme="light"] .theme-to-light { display: none; }
:root[data-theme="light"] .theme-to-dark { display: inline-flex; }

/* Two plain claims where four figures used to be. */
.claims {
  display: grid; gap: var(--s-lg);
  grid-template-columns: 1fr;
  padding: var(--s-lg); border-radius: var(--r-xl);
  background: var(--sc-lowest);
  border: 1px solid var(--outline-variant);
  box-shadow: var(--lift-1);
}
@media (min-width: 820px) { .claims { grid-template-columns: 1fr 1fr; gap: var(--s-xl); } }
.claim { display: flex; gap: var(--s-md); align-items: flex-start; }
.claim strong { display: block; margin-bottom: .2rem; font-size: 1.0625rem; }
.claim-ic {
  flex: none; width: 42px; height: 42px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--sc); color: var(--primary);
}

/* ------------------------------------------------- brand lockup (header)
 * Re-added at the end of the file after an earlier edit spliced this range
 * out along with the block it was meant to replace, which silently dropped
 * the logo back to the base 38px rule and left the wordmark unsized.
 *
 * The wordmark is the traced brand drawing, so it is two <path>s filled from
 * --wm-1 / --wm-2 and recolours with the theme.
 */
.brand img { width: 52px; height: 52px; border-radius: var(--r-md); }
.brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-wordmark { height: 27px; width: auto; display: block; }
.brand-tag { font-size: 10.5px; }
.footer-wordmark { height: 26px; width: auto; --wm-1: #fff; --wm-2: #6d9bff; }

@media (max-width: 599px) {
  .brand img { width: 42px; height: 42px; }
  .brand-wordmark { height: 22px; }
}

/* Language switcher, kept compact so the header does not grow with it.
 *
 * The caret used to be placed with physical `padding: .4rem 2rem .4rem .6rem`
 * while the caret itself is positioned logically, so under RTL the caret moved
 * to the left edge and the padding stayed on the right — it sat on top of
 * "العربية". Logical on both axes is one rule correct in both directions. */
.select-lang {
  width: auto;
  font-size: .8125rem;
  border-radius: var(--r);
  padding-block: .45rem;
  padding-inline-start: .7rem;
  padding-inline-end: 2rem;
}

/* ------------------------------------------------------- app install bar
 * A bar at the bottom, never an interstitial. Google demotes mobile pages
 * whose content is covered by an app-install popup; a compact bar using a
 * reasonable amount of screen space is explicitly fine. The bottom also
 * covers nothing the reader is in the middle of.
 *
 * Rendered server-side from the User-Agent, so it is present in the first
 * paint rather than shoving the page down a moment later.
 */
.app-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
  display: flex; align-items: center; gap: .625rem;
  padding: .625rem .75rem;
  /* Clear of the iPhone home indicator and Android gesture bar. */
  padding-bottom: calc(.625rem + env(safe-area-inset-bottom, 0px));
  background: var(--sc-lowest);
  border-top: 1px solid var(--outline-variant);
  box-shadow: 0 -6px 24px -8px rgb(2 8 36 / .22);
}
@media (min-width: 768px) { .app-bar { display: none; } }

.app-bar img { width: 38px; height: 38px; border-radius: var(--r); flex: none; }
.app-bar-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
/* BOTH lines need truncating. Only the second had it, so the title's longest
 * word ("Réservations,") set a floor the flex item could not shrink below and
 * pushed the button off a 412px screen. */
.app-bar-text strong,
.app-bar-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-bar-text strong { font-size: .9375rem; }
.app-bar .btn { flex: none; padding: .5rem .75rem; }

.app-bar-close { margin: 0; flex: none; }
.app-bar-close button {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; cursor: pointer;
  background: transparent; border: 0; color: var(--muted); border-radius: var(--r);
}
.app-bar-close button:hover { background: var(--sc-low); color: var(--on-surface); }

/* The fixed bar would otherwise sit on top of the last of the footer. */
@media (max-width: 767px) { .site-footer { padding-bottom: 5.5rem; } }
