/* =========================================================
   الشراره المضيئة — Landing page styles
   Vibe "Wolfsburg Counter": an official VW/Audi dealer page.
   Follows DESIGN.md: one family (Readex Pro), 4/8/16/32/64/128
   spacing, flat 4px radii, one page-load sequence.
   Logical properties throughout so RTL is the default.
   ========================================================= */

:root {
  /* Color — "Showroom Daylight" */
  --white: #ffffff;
  --panel: #f2f3f5;      /* cool dealer-UI grey */
  --navy: #1b2330;       /* logo navy: text, footer */
  --steel: #6b7380;      /* secondary text */
  --yellow: #f6b51e;     /* brand yellow: actions and active states only */
  --gold: #d9901a;       /* logo star: max 1 per view */
  --rule: #dcdfe4;
  --rule-dark: rgba(255, 255, 255, 0.16);

  --font: "Readex Pro", sans-serif;

  /* Spacing scale (DESIGN.md) */
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 32px;
  --s5: 64px;
  --s6: 128px;

  --radius: 4px;
  --wrap: 1280px;
  --gutter: var(--s4);
  --section: var(--s6);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--navy);
  font-family: var(--font);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.8;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
.ph { line-height: 1; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: var(--s1); }
.footer :focus-visible { outline-color: var(--yellow); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* Headline system: a bold line/phrase paired with a light one (dealer style) */
.w-bold { font-weight: 700; }
.w-light { font-weight: 300; }

/* ---------- Buttons: flat, 4px, no shadow ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: var(--s3) var(--s4);
  border: 0; border-radius: var(--radius); cursor: pointer;
  font: 500 1rem/1.3 var(--font); white-space: nowrap;
}
.btn .ph { font-size: 1.35rem; }
.btn--primary { background: var(--yellow); color: var(--navy); }
.btn--primary:hover { background: #ffc53d; }
.btn--dark { background: var(--navy); color: var(--white); }
.btn--dark:hover { background: #2a3546; }
.link { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 500; text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 8px; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--rule); }
.nav__inner { display: flex; align-items: center; gap: var(--s4); padding-block: var(--s3); }
.brand { display: flex; align-items: center; gap: var(--s3); }
.brand img { width: 64px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.3; }
.brand__name { font-weight: 700; font-size: 1.15rem; }
.brand__tag { font-size: 0.78rem; color: var(--steel); }
.nav__links { display: flex; gap: var(--s4); margin-inline-start: auto; }
.nav__links a { color: var(--steel); }
.nav__links a:hover { color: var(--navy); }
.nav__phone {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: var(--s2) var(--s3); border: 1px solid var(--navy); border-radius: var(--radius);
  font-weight: 500; font-variant-numeric: tabular-nums;
}
.nav__phone:hover { background: var(--navy); color: var(--white); }
.nav__phone .ph { font-size: 1.2rem; }

/* ---------- Hero: headline above a wide dealer image (60 / 40 head) ---------- */
.hero { padding-top: var(--s5); }
.hero__head { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s4) var(--s5); align-items: end; margin-bottom: var(--s4); }
.hero__title { font-size: clamp(2.1rem, 4.2vw, 3.6rem); line-height: 1.2; letter-spacing: -0.01em; }
.hero__line { display: block; text-wrap: balance; }
.hero__line--bold { font-weight: 700; }
.hero__line--light { font-weight: 300; }
.hero__sub { max-width: 40ch; color: var(--steel); font-size: 1.08rem; }
.hero__stage {
  position: relative; overflow: hidden;
  height: clamp(380px, 58vh, 580px);
  border-radius: var(--radius);
  background: var(--navy);
}
.hero__img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.hero__lines { position: absolute; z-index: 1; inset-inline: 0; bottom: var(--s5); width: 100%; height: 96px; pointer-events: none; }
.hero__lines path { fill: none; stroke: var(--yellow); stroke-width: 5; stroke-linecap: round; }
.hero__lines path + path { stroke-width: 3; opacity: 0.7; }

/* ---------- Finder bar (overlaps the image like a dealer configurator) ---------- */
.finder {
  position: relative; z-index: 3;
  margin: calc(var(--s5) * -1) var(--s5) 0;
  padding: var(--s4);
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
}
.finder__star {
  position: absolute; top: calc(var(--s3) * -1); inset-inline-end: var(--s4);
  width: var(--s4); height: var(--s4); background: var(--gold);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.finder__title { font-size: 1.25rem; font-weight: 600; margin-bottom: var(--s3); }
.finder__fields { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) auto; gap: var(--s3); align-items: end; }
.field label { display: block; margin-bottom: var(--s2); font-size: 0.9rem; color: var(--steel); }
.select { position: relative; }
.select .ph { position: absolute; top: 50%; inset-inline-end: var(--s3); transform: translateY(-50%); font-size: 1.1rem; pointer-events: none; }
.select select {
  width: 100%; padding: var(--s3); padding-inline-end: var(--s5);
  appearance: none; -webkit-appearance: none;
  background: var(--panel); color: var(--navy);
  border: 1px solid transparent; border-radius: var(--radius);
  font: 400 1rem/1.3 var(--font);
}
.select select:hover { border-color: var(--rule); }
.select select[aria-invalid="true"] { border-color: #c2410c; }
.finder__error { margin-top: var(--s3); color: #b45309; font-weight: 500; }
.finder__note { margin-top: var(--s3); font-size: 0.88rem; color: var(--steel); }

/* The one orchestrated page-load sequence */
@media (prefers-reduced-motion: no-preference) {
  .hero__img { animation: settle 1.4s var(--ease) both; }
  .hero__line { animation: rise 0.8s var(--ease) both; }
  .hero__line--bold { animation-delay: 0.15s; }
  .hero__line--light { animation-delay: 0.3s; }
  .hero__sub { animation: rise 0.8s 0.45s var(--ease) both; }
  .hero__lines path { stroke-dasharray: 1200; animation: draw 1.4s 0.5s var(--ease) both; }
  .finder { animation: rise 0.8s 0.6s var(--ease) both; }
}
@keyframes settle { from { transform: scale(1.05); } }
@keyframes rise { from { opacity: 0; transform: translateY(var(--s3)); } }
@keyframes draw { from { stroke-dashoffset: 1200; } to { stroke-dashoffset: 0; } }

/* ---------- Generic blocks ---------- */
.block { padding-block: var(--section); }
.block--panel { background: var(--panel); }
.head { max-width: 640px; margin-bottom: var(--s5); }
.head__title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 700; }
.head__lead { margin-top: var(--s3); color: var(--steel); font-size: 1.08rem; max-width: 52ch; }

/* ---------- Model explorer ---------- */
.tabs {
  display: flex; gap: var(--s4);
  border-bottom: 1px solid var(--rule);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: var(--s3) 0; margin-bottom: -1px;
  background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer;
  font: 500 1.1rem/1.3 var(--font); color: var(--steel);
}
.tab:hover { color: var(--navy); }
.tab[aria-selected="true"] { color: var(--navy); font-weight: 600; border-bottom-color: var(--yellow); }
.tab small { font-size: 0.8rem; font-weight: 400; color: var(--steel); margin-inline-start: var(--s1); }

.explorer__body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s5); padding-top: var(--s5); align-items: start; }
.explorer__stage { margin: 0; }
.explorer__stage img {
  width: 100%; max-width: 640px; aspect-ratio: 611 / 312; object-fit: cover;
  border-radius: var(--radius); background: var(--panel);
  transition: opacity 0.25s ease;
}
.explorer__stage img.is-swapping { opacity: 0; }
.explorer__stage figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s4); max-width: 640px; }
.explorer__name { font-size: 1.5rem; font-weight: 300; }
.explorer__name b { font-weight: 700; }

.gens { border-top: 1px solid var(--rule); }
.gen {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3); width: 100%;
  padding: var(--s3); margin: 0;
  background: none; border: 0; border-bottom: 1px solid var(--rule); cursor: pointer;
  font: inherit; color: inherit; text-align: start;
}
.gen:hover { background: var(--panel); }
.gen__years { font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; direction: ltr; }
.gen__trim { color: var(--steel); }
.gen[aria-checked="true"] { background: var(--navy); color: var(--white); }
.gen[aria-checked="true"] .gen__trim { color: #c3c9d3; }
.gen[aria-checked="true"] .gen__years { color: var(--yellow); }

/* ---------- Parts ---------- */
.parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.parts li { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4) var(--s3) var(--s3); background: var(--white); border-radius: var(--radius); }
/* Capped below native size (≈280px) so the catalogue crops stay crisp */
.parts img { width: 100%; max-width: 216px; height: 88px; margin-inline: auto; object-fit: contain; }
.parts span { font-weight: 500; }

/* ---------- How to order + whole car (40 / 60) ---------- */
.how { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s5); align-items: start; }
.steps li { display: grid; grid-template-columns: var(--s5) minmax(0, 1fr); gap: var(--s3); padding-block: var(--s4); border-top: 1px solid var(--rule); }
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps__n { font-size: 2.6rem; font-weight: 300; line-height: 1; color: var(--navy); }
.steps h3 { margin-bottom: var(--s1); }
.steps p { color: var(--steel); }
.car-order { background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.car-order img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
.car-order__text { padding: var(--s4); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
.car-order h3 { font-size: 1.5rem; font-weight: 700; }
.car-order p { color: var(--steel); margin-bottom: var(--s2); }

/* ---------- Audi (40 copy / 60 image) ---------- */
.audi { padding-block: 0 var(--section); }
.audi__inner { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s5); align-items: center; }
.audi__copy { order: -1; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); }
.audi__copy p { color: var(--steel); }
.audi__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 35% 60%; border-radius: var(--radius); }
.audi__models { display: flex; flex-wrap: wrap; gap: var(--s2); direction: ltr; justify-content: flex-end; }
.audi__models li { padding: 0 var(--s3); border: 1px solid var(--rule); border-radius: var(--radius); font-weight: 500; }

/* ---------- Branches (60 list / 40 map) ---------- */
.branches { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s5); align-items: start; }
.branch-list { border-top: 1px solid var(--rule); }
.branch {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--s3) var(--s4);
  padding-block: var(--s3); border-bottom: 1px solid var(--rule);
}
.branch__name p { color: var(--steel); font-size: 0.95rem; }
.branch__phone { font-size: 1.35rem; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.branch__phone:hover { text-decoration: underline; text-decoration-color: var(--yellow); text-underline-offset: 8px; }
.branch__wa {
  display: grid; place-items: center; width: var(--s5); height: var(--s5);
  border-radius: var(--radius); background: var(--white); border: 1px solid var(--rule); font-size: 1.5rem;
}
.branch__wa:hover { background: var(--yellow); border-color: var(--yellow); }
.branch--sales .branch__wa { background: var(--yellow); border-color: var(--yellow); }

.map { aspect-ratio: 1 / 1; background: var(--white); border-radius: var(--radius); overflow: hidden; }
.map iframe { display: block; width: 100%; height: 100%; border: 0; }
.map__facade { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3); padding: var(--s4); text-align: center; }
.map__facade .ph { font-size: var(--s5); color: var(--navy); }
.map__title { font-weight: 600; }
.map__note { font-size: 0.85rem; color: var(--steel); }

/* ---------- Footer ---------- */
.footer { background: var(--navy); color: #aab2bf; padding-top: var(--s5); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4); }
.footer__logo { width: 176px; }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--s4); }
.footer__links a:hover { color: var(--yellow); }
.footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s4); margin-top: var(--s4); padding-block: var(--s3); border-top: 1px solid var(--rule-dark); font-size: 0.85rem; color: #7d8695; }

/* ---------- Floating WhatsApp ---------- */
.fab {
  position: fixed; z-index: 60; bottom: var(--s3); inset-inline-end: var(--s3);
  width: var(--s5); height: var(--s5); border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--yellow); color: var(--navy); font-size: 2rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .finder { margin-inline: var(--s4); }
  .finder__fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .finder__submit { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  :root { --section: var(--s5); --gutter: var(--s3); }
  .nav__links, .brand__tag { display: none; }
  .nav__phone { margin-inline-start: auto; }
  .hero { padding-top: var(--s4); }
  .hero__head { grid-template-columns: 1fr; gap: var(--s3); }
  .hero__stage { height: auto; margin-inline: calc(var(--gutter) * -1); border-radius: 0; }
  .hero__img { aspect-ratio: 16 / 10; }
  .hero__lines { bottom: var(--s3); height: 64px; }
  .finder { margin: calc(var(--s4) * -1) 0 0; padding: var(--s4) var(--s3) var(--s3); }
  .finder__fields { grid-template-columns: 1fr; }
  .explorer__body { grid-template-columns: 1fr; gap: var(--s4); padding-top: var(--s4); }
  .gens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); border-top: 0; }
  .gen { flex-direction: column; align-items: flex-start; gap: 0; padding: var(--s2) var(--s3); border: 1px solid var(--rule); border-radius: var(--radius); }
  .gen__years { font-size: 1.1rem; }
  .gen__trim { font-size: 0.85rem; }
  .explorer__stage figcaption { margin-top: var(--s3); }
  .parts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .parts li { padding: var(--s3) var(--s2) var(--s2); }
  .parts img { height: 64px; }
  .how, .audi__inner, .branches { grid-template-columns: 1fr; gap: var(--s4); }
  .audi__copy { order: 0; }
  .map { aspect-ratio: 4 / 3; }
}
@media (max-width: 520px) {
  body { font-size: 1rem; }
  .nav__phone span { display: none; }
  .head { margin-bottom: var(--s4); }
  .branch { grid-template-columns: minmax(0, 1fr) auto; }
  .branch__name { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .explorer__stage img { transition: none; }
}
