/* Shared by all designs: brand tokens, reset, forms, dialogs, toast.
   Each design sets the semantic variables (--bg, --fg, --primary …) and its own layout. */
:root {
  /* HID brand palette (guidelines p.12–13) */
  --hid-green: #053931;  --hid-red: #911828;  --hid-cream: #ddcaac;
  --hid-rose: #c88c94;   --hid-sage: #829c98; --hid-leaf: #638968;
  --hid-ink: #03241f;    --hid-paper: #efe7d8;

  --bg: var(--hid-paper); --fg: var(--hid-green); --muted: #4b5f5a;
  --surface: #fff; --surface-fg: var(--hid-green); --line: rgba(5, 57, 49, .18);
  --primary: var(--hid-green); --on-primary: var(--hid-cream); --accent: var(--hid-red);
  --field-bg: #f7f1e6; --dlg-bg: var(--hid-paper); --dlg-fg: var(--hid-green);
  --radius: 14px; --font-head: 'Archivo', system-ui, sans-serif; --font-body: 'Archivo', system-ui, sans-serif;
  --font-ar: 'IBM Plex Sans Arabic', 'Archivo', sans-serif;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 9 0 0 0 -4.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.55 var(--font-body); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.08; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
a { color: inherit; }
[lang="ar"], .h-ar { font-family: var(--font-ar); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--hid-rose); outline-offset: 3px; }
.ico { flex: none; }
[hidden] { display: none !important; } /* hidden always wins over a component's display rule */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Brand marks — cut-outs used as masks, so they take any colour via `color`. */
.h-logo, .h-ostrich { display: block; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.h-logo { --m: url(assets/logo.png); aspect-ratio: 440 / 260; }
.h-ostrich { --m: url(assets/ostrich-grain.png); aspect-ratio: 900 / 655; }
.h-ostrich--flat { --m: url(assets/ostrich.png); aspect-ratio: 900 / 714; }
/* Grain texture overlay, like the guideline backgrounds. */
.h-grain { position: relative; isolation: isolate; }
.h-grain::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--noise); opacity: .07; }
/* The spotlight beam from the guideline covers. */
.h-beam { position: absolute; pointer-events: none; clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%);
  background: linear-gradient(var(--hid-cream), transparent 85%);
  -webkit-mask: var(--noise); mask: var(--noise); -webkit-mask-size: 160px; mask-size: 160px; opacity: .9; }

/* Buttons */
.h-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: .75em 1.4em;
  border-radius: var(--radius); border: 1.5px solid transparent; font-weight: 600; text-decoration: none; line-height: 1.1;
  transition: transform .2s, background-color .2s, color .2s, border-color .2s; }
.h-btn:hover { transform: translateY(-1px); }
.h-btn--primary { background: var(--primary); color: var(--on-primary); }
.h-btn--accent { background: var(--hid-red); color: #fff; }
.h-btn--light { background: var(--hid-cream); color: var(--hid-green); }
.h-btn--ghost { border-color: currentColor; background: transparent; }
.h-btn--small { min-height: 44px; padding: .5em 1em; font-size: .9rem; }
.h-btn--block { width: 100%; }
.h-icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; }
.h-icon-btn:hover { background: rgba(0,0,0,.06); }

/* Menu bits that every design needs to work */
.h-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.h-filter button { min-height: 44px; padding: .5em 1.1em; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; font-weight: 500; }
.h-filter button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.h-item[hidden] { display: none; }
.h-add { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid currentColor; background: transparent; flex: none; transition: background-color .2s, color .2s; }
.h-add:hover { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.h-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.h-chips li { font-size: .8rem; padding: .25em .7em; border-radius: 999px; border: 1px solid currentColor; opacity: .85; }
.h-product__art { overflow: hidden; }
.h-product__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.h-tag { position: absolute; z-index: 1; top: 12px; inset-inline-start: 12px; font-size: .75rem; font-weight: 600; padding: .2em .6em; border-radius: 999px; background: var(--hid-red); color: #fff; }

/* Forms */
.h-form { display: grid; gap: 14px; }
.h-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.h-field { display: grid; gap: 6px; }
.h-field label { font-size: .875rem; font-weight: 600; }
.h-field input, .h-field select, .h-field textarea { width: 100%; min-height: 48px; padding: .7em .9em; border-radius: calc(var(--radius) * .6);
  border: 1.5px solid var(--line); background: var(--field-bg); color: var(--hid-green); transition: background-color .2s, border-color .2s; }
.h-field input::placeholder, .h-field textarea::placeholder { color: #7d8a84; }
.h-field input:focus, .h-field select:focus, .h-field textarea:focus { background: #fbf8f1; border-color: var(--hid-leaf); }
.h-field textarea { resize: vertical; }
.h-field [aria-invalid] { border-color: var(--hid-red); }
.h-err { color: var(--hid-red); font-size: .85rem; font-weight: 500; margin: 0; min-height: 0; }
.h-err:empty { display: none; }
.h-check { display: flex; gap: 10px; align-items: center; font-size: .95rem; min-height: 44px; }
.h-check input { width: 20px; height: 20px; accent-color: var(--hid-green); }

/* Floating car-order button */
.h-fab { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 22px;
  border: 0; border-radius: 999px; background: var(--hid-red); color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(3, 36, 31, .35); }
.h-fab[hidden] { display: none; }
.h-fab__count { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 13px; background: #fff; color: var(--hid-red); font-size: .85rem; }

/* Dialogs: right-side drawer (order) and centred modal (signup) */
.h-drawer, .h-modal { border: 0; padding: 0; background: var(--dlg-bg); color: var(--dlg-fg); max-height: 100dvh;
  --line: rgba(5, 57, 49, .18); --muted: #4b5f5a; --primary: var(--hid-green); --on-primary: var(--hid-cream); }
.h-drawer { margin-block: 0; margin-inline: auto 0; width: min(520px, 100%); height: 100dvh; }
.h-modal { width: min(560px, 100% - 32px); border-radius: var(--radius); max-height: calc(100dvh - 32px); }
.h-drawer::backdrop, .h-modal::backdrop { background: rgba(3, 36, 31, .6); backdrop-filter: blur(3px); }
.h-drawer[open] { animation: h-slide .3s ease-out; }
.h-modal[open] { animation: h-pop .25s ease-out; }
@keyframes h-slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes h-slide-rtl { from { transform: translateX(-40px); opacity: 0; } }
[dir="rtl"] .h-drawer[open] { animation-name: h-slide-rtl; }
[dir="rtl"] * { letter-spacing: 0 !important; } /* letter-spacing breaks Arabic joining */
[dir="rtl"] input[type="tel"], [dir="rtl"] input[type="email"] { text-align: right; } /* numbers stay left-to-right, but line up with the other fields */
@keyframes h-pop { from { transform: scale(.96); opacity: 0; } }
.h-drawer__head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; background: var(--dlg-bg); border-bottom: 1px solid var(--line); }
.h-drawer__head h2 { display: flex; gap: 10px; align-items: center; margin: 0; font-size: 1.35rem; }
.h-drawer__body { padding: 20px 24px 32px; }
.h-drawer__intro { color: var(--muted); }
.h-drawer__label { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin: 24px 0 10px; }
.h-empty { padding: 18px; border: 1.5px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.h-lines { list-style: none; padding: 0; margin: 0; }
.h-line { display: grid; grid-template-columns: 1fr auto 80px; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.h-line__price { text-align: end; font-weight: 600; }
.h-stepper { display: flex; align-items: center; gap: 4px; }
.h-stepper button { display: grid; place-items: center; width: 44px; height: 44px; border: 1.5px solid var(--line); border-radius: 50%; background: transparent; }
.h-stepper output { min-width: 22px; text-align: center; font-weight: 600; }
.h-total { display: flex; justify-content: space-between; font-size: 1.15rem; margin: 14px 0 0; }
.h-quick { margin: 18px 0 4px; border: 1.5px solid var(--line); border-radius: var(--radius); }
.h-quick summary { padding: 14px 16px; font-weight: 600; cursor: pointer; min-height: 44px; }
.h-quick ul { list-style: none; margin: 0; padding: 0 12px 12px; max-height: 300px; overflow: auto; }
.h-quick li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 4px 4px; }
.h-success { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 40px 12px; }
.h-success .ico { color: var(--hid-leaf); }

.h-toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 140%); padding: 12px 20px; border-radius: 16px; text-align: center; width: max-content;
  background: var(--hid-ink); color: var(--hid-cream); font-weight: 500; transition: transform .3s, opacity .3s; opacity: 0; pointer-events: none; max-width: calc(100% - 32px); }
.h-toast.is-on { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 640px) { .h-toast { bottom: 140px; } } /* keep the red Car order button visible */

/* Small floating link to switch between design options (prototype only). */

/* Order tracker (after placing a car order) */
.h-track { display: grid; gap: 16px; padding-top: 4px; }
.h-track__id { margin: 0; font-size: 1.02rem; }
.h-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); isolation: isolate; }
.h-steps li { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; font-size: .8rem; font-weight: 600; color: var(--muted); }
.h-steps li span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); background: var(--field-bg); }
.h-steps li::before { content: ''; position: absolute; z-index: -1; top: 17px; inset-inline-end: 50%; width: 100%; height: 2px; background: var(--line); }
.h-steps li:first-child::before { display: none; }
.h-steps li.is-done, .h-steps li.is-now { color: var(--hid-green); }
.h-steps li.is-done span { background: var(--hid-leaf); border-color: var(--hid-leaf); color: #fff; }
.h-steps li.is-now span { background: var(--hid-green); border-color: var(--hid-green); color: var(--hid-cream); box-shadow: 0 0 0 5px rgba(99, 137, 104, .25); }
.h-steps li.is-done::before, .h-steps li.is-now::before { background: var(--hid-leaf); }
.h-track__msg { margin: 0; padding: 14px 16px; border-radius: 12px; background: #e3ebe4; font-weight: 600; }
.h-track__car { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); }
.h-plate { margin-inline-start: auto; font: 700 .9rem/1 ui-monospace, monospace; padding: 6px 8px; border: 2px solid currentColor; border-radius: 6px; white-space: nowrap; }
.h-btn--big { min-height: 64px; font-size: 1.15rem; }
.h-track__hint { margin: -8px 0 0; text-align: center; color: var(--muted); font-size: .9rem; }
.h-arrived { display: flex; gap: 10px; align-items: center; margin: 0; padding: 16px; border-radius: 12px; background: var(--hid-green); color: var(--hid-cream); font-weight: 600; }
.h-track__items { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; display: grid; gap: 2px; }

/* "Track order" button: bottom right, sits above the red Car order button when both show. */
.h-track-btn { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px;
  border: 0; border-radius: 999px; background: var(--hid-green); color: var(--hid-cream); font-weight: 600; box-shadow: 0 10px 30px rgba(3, 36, 31, .35); }
.h-track-btn[hidden] { display: none; }
.h-fab:not([hidden]) ~ .h-track-btn { bottom: 88px; }

/* Required-field marker */
.h-req { color: var(--hid-red); font-weight: 700; }
.h-req-note { margin: -4px 0 0; font-size: .85rem; color: var(--muted); }
