:root {
  --bg: #0E0E0F; --surface: #18181A; --surface-2: #202023; --line: #2C2C2F;
  --text: #EDEDED; --text-2: #A8A8AD; --gold: #C9A063; --gold-2: #E3C48A;
  --silver: linear-gradient(180deg, #D9D9DC, #8E8E93);
  --radius: 14px; --shadow: 0 10px 30px rgba(0,0,0,.45);
  --font-body: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
  --font-head: 'Reem Kufi', 'Cinzel', serif;
  --concrete: url('/assets/concrete.jpg');
  color-scheme: dark;
}
:root[lang="en"] { --font-body: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif; --font-head: 'Cinzel', 'Reem Kufi', serif; }
:root[data-theme="light"] {
  --bg: #E9E9EB; --surface: #F6F6F7; --surface-2: #FFFFFF; --line: #D2D2D6;
  --text: #111113; --text-2: #55555B; --gold: #9A7637; --gold-2: #B8904A; --shadow: 0 10px 30px rgba(0,0,0,.12);
  --concrete: radial-gradient(ellipse at 50% 0%, #FFFFFF, #D9D9DC 70%);
  color-scheme: light;
}
:root[data-theme="light"] .brand-word { background: linear-gradient(180deg, #2A2A2E, #6A6A70); -webkit-background-clip: text; background-clip: text; }
:root[data-theme="light"] .brand img, :root[data-theme="light"] .footer-brand img, :root[data-theme="light"] main > img[src$="logo-chrome.svg"] { filter: brightness(.25); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* The logo sweep animation briefly overflows sideways (RTL: a few px) on small phones; never allow horizontal page scroll. */
body { overflow-x: hidden; margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--font-body); font-variant-numeric: tabular-nums; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.25; margin: 0 0 .5em; }
.container { width: min(1240px, 100% - 32px); margin-inline: auto; }
.num { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--text-2); }
.gold { color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
#site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-word { font-family: 'Cinzel', serif; font-weight: 700; letter-spacing: .08em; background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 20px; margin-inline-start: auto; }
.nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; color: var(--text-2); padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"], .nav a:hover { color: var(--text); border-color: var(--gold); }
.header-actions { display: flex; gap: 8px; }
@media (max-width: 640px) { .nav { gap: 12px; font-size: 14px; } .brand-word { display: none; } }
@media (max-width: 480px) {
  .header-inner { flex-wrap: wrap; height: auto; padding-block: 8px; row-gap: 4px; }
  .header-actions { margin-inline-start: auto; }
  .nav { order: 3; width: 100%; margin: 0; justify-content: space-around; }
  .nav a { padding: 10px 4px; min-width: 44px; text-align: center; }
}

/* Buttons + inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 600;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #141414; }
.btn:hover { filter: brightness(1.08); }
.btn-ghost { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.btn-ghost.icon { width: 36px; padding: 0; }
@media (pointer: coarse) { .btn-ghost { min-height: 44px; } .btn-ghost.icon { width: 44px; } }
.btn-wa { background: #1FAF53; color: #fff; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; font-size: 16px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }

/* Hero */
/* The hero image has the chrome logo baked into its top ~36.5% (image is 1.6:1, logo bottom at 22.8% of image width).
   Size the image by width (never narrower than 704px) and push the text block below the logo at every viewport. */
.hero { --hero-w: max(100vw, 704px); position: relative; overflow: hidden; display: grid; align-content: start;
  padding-block: calc(var(--hero-w) * .228 + 24px) 56px;
  background: linear-gradient(to bottom, transparent calc(100% - 90px), #0E0E0F) no-repeat, url('/assets/backdrop-hero.jpg') center top / max(100%, 704px) auto no-repeat #0E0E0F; }
.hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 20%, rgba(255,255,255,.08), transparent 60%); animation: glow 6s ease-in-out infinite; pointer-events: none; }
@keyframes glow { 50% { opacity: .4; } }
.hero h1 { font-size: clamp(28px, 5vw, 48px); color: #F2F2F2; }
.hero p { color: #C8C8CC; max-width: 46ch; }
.quick { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; padding: 14px; margin-top: 18px; border-radius: var(--radius); background: rgba(14,14,15,.75); border: 1px solid var(--line); max-width: 720px; }
.quick .field { color: #C8C8CC; }
@media (max-width: 640px) { .quick { grid-template-columns: 1fr; } }

/* Sections */
.section { padding-block: 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.gold-rule { display: flex; align-items: center; gap: 12px; color: var(--gold); }
.gold-rule::before, .gold-rule::after { content: ''; flex: 1; height: 1px; background: var(--gold); opacity: .6; max-width: 60px; }

/* Car grid + card */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); border-radius: var(--radius); overflow: hidden; background: var(--surface) var(--concrete) center / 600px; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .25s ease, border-color .25s ease; }
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
.card::before { content: ''; position: absolute; inset-block-start: 10px; inset-inline-end: 10px; width: 54px; height: 37px; background: url('/assets/logo-mark.svg') center / contain no-repeat; opacity: .35; z-index: 1; }
.card-photo { margin: 12px 12px 0; border: 2px solid var(--gold); border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: #111; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 16px 16px; }
.card-title { font-family: var(--font-head); color: var(--gold); font-size: 19px; margin: 0; }
.card-trim { color: var(--text-2); font-size: 13px; margin: 0 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spec-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.spec-rows li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); font-size: 14px; }
.spec-rows li:last-child { border-bottom: 0; }
.spec-rows .k { color: var(--text-2); }
.price { font-weight: 700; color: var(--gold); font-size: 18px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--gold); color: var(--gold); }

/* Search layout */
.search-layout { display: grid; grid-template-columns: 290px 1fr; gap: 24px; align-items: start; }
.filters { position: sticky; top: 80px; display: grid; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); max-height: calc(100vh - 100px); overflow: auto; }
.filters-head { display: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar .field { grid-auto-flow: column; align-items: center; }
#open-filters { display: none; }
.pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 24px; }
.notice { padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); }
@media (max-width: 900px) {
  .search-layout { grid-template-columns: 1fr; }
  #open-filters { display: inline-flex; }
  .filters { position: fixed; inset: auto 0 0 0; top: auto; z-index: 40; max-height: 85dvh; padding-bottom: calc(16px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; transform: translateY(105%); transition: transform .3s ease; }
  .filters.open { transform: none; box-shadow: 0 -20px 60px rgba(0,0,0,.6); }
  /* Apply / Reset stay reachable while the long filter list scrolls underneath. */
  .filters { padding-bottom: 0; }
  .filters-actions { position: sticky; bottom: 0; z-index: 1; margin-inline: -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .filters-head { display: flex; justify-content: space-between; align-items: center; }
}
.check { min-height: 44px; }
.check input { width: 22px; height: 22px; font-size: 16px; flex: none; }
.filters-backdrop { display: none; }
.filters { overscroll-behavior: contain; }
@media (max-width: 900px) {
  .btn-ghost { min-height: 44px; min-width: 44px; }
  #open-filters { align-items: center; justify-content: center; }
  .filters { visibility: hidden; transition: transform .3s ease, visibility 0s .3s; -webkit-overflow-scrolling: touch; }
  .filters.open { visibility: visible; transition: transform .3s ease; }
  .filters-backdrop { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
  body.filters-open { overflow: hidden; }
  body.filters-open .filters-backdrop { opacity: 1; pointer-events: auto; }
  .toolbar .field { min-width: 0; }
  .toolbar .field select { width: auto; min-width: 0; max-width: 100%; }
}

/* Car detail */
.studio { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: #111 url('/assets/backdrop-hero.jpg') center / cover; border: 1px solid var(--line); }
.studio img.studio-img { width: 100%; height: 100%; object-fit: cover; }
.studio.fallback .frame { position: absolute; inset-inline: 12%; inset-block-end: 7%; height: 52%; border: 3px solid var(--gold); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.studio.fallback .frame img { width: 100%; height: 100%; object-fit: cover; }
.studio.loading::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.06) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.detail-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; margin-top: 20px; }
.panel { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: 18px; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.strip button { flex: 0 0 min(120px, 28vw); min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; scroll-snap-align: start; background: none; }
.strip button[aria-current="true"] { border-color: var(--gold); }
.gallery-main { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; margin-bottom: 8px; background: #111; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.breakdown .total { font-size: 22px; }
.sticky-wa { display: none; }
@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
  .sticky-wa { display: flex; position: fixed; inset-inline: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 30; box-shadow: var(--shadow); }
  body.has-sticky { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* Footer */
#site-footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; padding-block: 32px; }
.phones { display: grid; gap: 4px; color: var(--gold); }

/* Tap targets (phone-first: >= 44px) */
.brand { min-height: 44px; min-width: 44px; }
.phones a, .footer-contact > a { display: inline-flex; align-items: center; min-height: 44px; }
.phones { gap: 0; }
.section-head > a { display: inline-flex; align-items: center; min-height: 44px; }

/* About */
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.steps li::before { content: counter(s); display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); font-weight: 700; }

/* Motion */
.sweep { animation: sweep 1.2s cubic-bezier(.2,.7,.2,1) both; }
@keyframes sweep { from { opacity: 0; transform: translateX(-24px); clip-path: inset(0 100% 0 0); } to { opacity: 1; transform: none; clip-path: inset(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.inquiry-form { display: grid; gap: 12px; }
.detail-layout > * { min-width: 0; }
@media (max-width: 900px) { html { scroll-padding-bottom: 96px; } }
