﻿:root {
  --bg: #F6F8FA;
  --surface: #FFFFFF;
  --nav: #0B1220;
  --text: #111827;
  --text-2: #6B7280;
  --accent: #0F766E;
  --accent-2: #2563EB;
  --border: #E5E7EB;
  --available-bg: #DCFCE7;
  --available-text: #166534;
  --soon-bg: #FEF3C7;
  --soon-text: #92400E;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Outfit, Zain, sans-serif; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; }
.row { display: flex; }
.center { align-items: center; }
.between { justify-content: space-between; }
.gap-sm { gap: .5rem; }
.topbar { background: var(--nav); color: #fff; border-bottom: 1px solid #1f2937; position: sticky; top: 0; z-index: 30; }
.topbar .container { min-height: 64px; }
.brand-wrap { display: flex; gap: .75rem; align-items: center; }
.brand-wrap > div:last-child { min-width: 0; }
.logo-mark { background: #fff; color: var(--nav); font-weight: 700; font-size: .85rem; padding: .35rem .5rem; border-radius: .4rem; }
.brand-name { margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { margin: 0; color: #9CA3AF; font-size: .8rem; }
.btn { border: 1px solid transparent; background: transparent; color: inherit; padding: .55rem .85rem; border-radius: .5rem; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; }
.btn:focus-visible, input:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.btn-ghost { border-color: #334155; color: #E5E7EB; }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-icon { width: 40px; height: 40px; padding: 0; }
.btn-icon svg { width: 20px; height: 20px; display: block; fill: currentColor; }
.btn-lang { height: 40px; padding: 0 .55rem; gap: .35rem; }
.btn-lang span { font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.top-actions { flex-shrink: 0; }
.main { padding: 1rem 0 2rem; flex: 1 0 auto; }
.intro h1 { margin: 0 0 .25rem; font-size: 1.45rem; }
.intro p { margin: 0; color: var(--text-2); }
.controls { margin: 1rem 0; }
input[type="search"] { width: 100%; border: 1px solid var(--border); border-radius: .6rem; height: 44px; padding: 0 .85rem; background: var(--surface); }
.chips { margin-top: .75rem; display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .2rem; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); padding: .45rem .75rem; border-radius: 999px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.chip[aria-selected="true"] { background: var(--text); color: #fff; border-color: var(--text); }
.car-grid { display: grid; gap: 1rem; }
.car-card { background: var(--surface); border: 1px solid var(--border); border-radius: .75rem; overflow: hidden; }
.car-image { width: 100%; height: 200px; object-fit: cover; background: #E2E8F0; }
.card-body { padding: .9rem; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: .5rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .25rem .55rem; border-radius: 999px; }
.badge.available { background: var(--available-bg); color: var(--available-text); }
.badge.available_soon { background: var(--soon-bg); color: var(--soon-text); }
.badge.reserved, .badge.unavailable { background: #F3F4F6; color: #4B5563; }
.specs, .price-line { color: var(--text-2); margin: .45rem 0; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-top: 1px solid var(--border); padding-top: .75rem; margin-top: .75rem; }
.price { font-weight: 700; font-size: 1.1rem; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-secondary { background: #fff; color: var(--accent-2); border-color: var(--accent-2); }
.empty { text-align: center; color: var(--text-2); padding: 1rem 0; }
.overlay { position: fixed; inset: 0; background: rgba(11, 18, 32, .55); z-index: 40; }
.details { position: fixed; z-index: 50; background: #fff; box-shadow: 0 -16px 32px rgba(0,0,0,.18); }
.sheet-handle { width: 48px; height: 4px; border-radius: 999px; background: #D1D5DB; margin: .6rem auto .45rem; }
.close-btn { position: absolute; right: .75rem; top: .5rem; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 1.2rem; }
.details img { width: 100%; height: 190px; object-fit: cover; background: #E2E8F0; }
.details-head { padding: .9rem 1rem .2rem; display: flex; justify-content: space-between; gap: .75rem; align-items: start; }
.details-head h3 { margin: 0; font-size: 1.2rem; }
.muted { color: var(--text-2); }
#detailsDescription { margin: 0; padding: 0 1rem .9rem; }
.price-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem; padding: 0 1rem .9rem; }
.kv { border: 1px solid var(--border); border-radius: .6rem; padding: .55rem .6rem; }
.kv dt { color: var(--text-2); font-size: .85rem; }
.kv dd { margin: .15rem 0 0; font-weight: 700; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; padding: 0 1rem 1rem; }
.spec-grid div { border: 1px solid var(--border); border-radius: .55rem; padding: .5rem; }
.spec-grid dt { color: var(--text-2); font-size: .8rem; }
.spec-grid dd { margin: .1rem 0 0; font-weight: 600; font-size: .92rem; }
.btn-full { width: calc(100% - 2rem); margin: 0 1rem 1rem; }
.footer { border-top: 1px solid var(--border); padding: 1rem 0 1.5rem; font-size: .95rem; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; border: 0; padding: 0; clip: rect(0 0 0 0); overflow: hidden; }

/* Enforce Arabic typography when Arabic mode is active */
html[dir="rtl"] body,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] p,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] span,
html[dir="rtl"] a,
html[dir="rtl"] dt,
html[dir="rtl"] dd {
  font-family: "Zain", Outfit, sans-serif;
}
@media (max-width: 767px) {
  .topbar .container { gap: .5rem; }
  .brand-wrap { flex: 1 1 auto; min-width: 0; }
  .brand-sub { display: none; }
  .logo-mark { padding: .3rem .42rem; font-size: .78rem; }
  .brand-name { font-size: .92rem; }
  .footer .row { flex-direction: column; align-items: flex-start; gap: .3rem; }
  .details { left: 0; right: 0; bottom: 0; max-height: 90vh; border-radius: 1rem 1rem 0 0; overflow: auto; }
}
@media (min-width: 768px) {
  .car-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .details { right: 0; top: 0; height: 100vh; width: min(430px, 92vw); overflow: auto; }
  .sheet-handle { display: none; }
}
@media (min-width: 1080px) {
  .car-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
