/* =====================================================================
   style.css — مشويات حمادة عبد الحكيم
   ⚠ كل الألوان والخطوط والأنصاف والمسافات في الكتلتين التاليتين فقط.
   باقي الملف يستخدم المتغيرات (var(--...)) ولا يكتب أي لون ثابت.
   شرح كل متغير بالعربي في DESIGN-NOTES.md
   ===================================================================== */

/* ---------- 1) المتغيرات المشتركة (لا تتغير بين الفاتح والداكن) ---------- */
:root {
  --font-display: "Aref Ruqaa", "Amiri", "Noto Naskh Arabic", serif;
  --font-body: "IBM Plex Sans Arabic", "Tajawal", "Segoe UI", Tahoma, "DejaVu Sans", sans-serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 24px;
  --r-pill: 999px;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  --col-width: 700px;       /* عرض عمود المنيو على الشاشات الكبيرة */
  --mask-on: #000;          /* لون القناع (لا يظهر، يحدد الجزء المرئي فقط) */
  --touch: 44px;            /* أقل حجم لمس */
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* زخرفة النجمة الثمانية (تُستخدم كقناع فوق لون ذهبي) */
  --ornament-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72' fill='none' stroke='black' stroke-width='1.2'%3E%3Crect x='18' y='18' width='36' height='36'/%3E%3Crect x='18' y='18' width='36' height='36' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='7'/%3E%3Cpath d='M0 0L18 18M72 0L54 18M0 72L18 54M72 72L54 54M36 0V10M36 72V62M0 36H10M72 36H62'/%3E%3C/svg%3E");
}

/* ---------- 2) النسخة الداكنة (الافتراضية): أسود دافئ + ذهبي ---------- */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0a07;             /* خلفية الصفحة */
  --bg-raise: #15110c;       /* شريط البحث وغلاف الرأس */
  --surface: #1a150e;        /* بطاقات وأوراق */
  --surface-2: #241d13;      /* قسم مفتوح / حقول */
  --line: rgba(214, 170, 90, .32);        /* خطوط واضحة */
  --line-soft: rgba(214, 170, 90, .15);   /* خطوط خفيفة بين الأصناف */
  --dot: rgba(214, 170, 90, .5);          /* النقط بين الاسم والسعر */
  --text: #f4ecdc;           /* النص الأساسي */
  --text-dim: #bcae94;       /* النص الثانوي */
  --gold: #e3b860;           /* ذهبي للنصوص والأسعار */
  --gold-hi: #f4d58c;        /* ذهبي فاتح (تمييز / تركيز) */
  --gold-lo: #a9772c;        /* ذهبي غامق للزخرفة */
  --gold-grad: linear-gradient(135deg, #f4d58c 0%, #d3a449 48%, #a9772c 100%);  /* زر ذهبي */
  --on-gold: #1b1206;        /* نص فوق الذهبي */
  --ornament-op: .1;         /* شفافية زخرفة الرأس */
  --danger: #ff9f90;
  --ok: #9edcaa;
  --scrim: rgba(6, 4, 2, .74);
  --logo-shadow: rgba(0, 0, 0, .45);
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --glow: 0 0 0 1px var(--line), 0 10px 30px rgba(0, 0, 0, .45);
}

/* ---------- 3) النسخة الفاتحة: رخام + ذهبي أغمق (عشان النص يتقرأ) ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f1ea;
  --bg-raise: #fbf9f5;
  --surface: #ffffff;
  --surface-2: #f0eadf;
  --line: rgba(122, 84, 24, .36);
  --line-soft: rgba(122, 84, 24, .16);
  --dot: rgba(122, 84, 24, .5);
  --text: #2b2218;
  --text-dim: #665843;
  --gold: #85560f;           /* غامق عمدًا: تباين 5:1 على الرخام */
  --gold-hi: #6d450a;
  --gold-lo: #b58a3a;
  --gold-grad: linear-gradient(135deg, #ecc977 0%, #cf9f43 50%, #aa7822 100%);
  --on-gold: #1d1307;
  --ornament-op: .16;
  --danger: #b3261e;
  --ok: #1f7a3a;
  --scrim: rgba(40, 28, 10, .5);
  --logo-shadow: rgba(90, 60, 10, .3);
  --shadow: 0 18px 50px rgba(60, 40, 10, .25);
  --glow: 0 0 0 1px var(--line), 0 8px 24px rgba(60, 40, 10, .12);
}

/* =====================================================================
   الأساس
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.7 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-wrap: anywhere;
}
body.is-locked { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 2px; border-radius: var(--r-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: var(--s5); text-align: center; }
.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- تحميل ---------- */
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--s4); background: var(--bg); color: var(--text-dim); z-index: 100; }
.boot__ring { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--line-soft); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   التخطيط: موبايل عمود واحد، وعلى الكمبيوتر الرأس ثابت يمين والمنيو يسار
   ===================================================================== */
.layout { max-width: var(--col-width); margin: 0 auto; }
.menu-col { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.menu-col > .grow { flex: 1; }

@media (min-width: 1000px) {
  .layout { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, var(--col-width)); gap: var(--s7); max-width: 1240px; padding-inline: var(--s5); }
  .layout > .hero { position: sticky; top: 0; height: 100dvh; justify-content: center; }
}

/* =====================================================================
   إعلان
   ===================================================================== */
.ann { background: var(--gold-grad); color: var(--on-gold); text-align: center; padding: var(--s3) var(--s4); font-weight: 600; line-height: 1.6; }

/* =====================================================================
   الرأس (اللوجو هو البطل)
   ===================================================================== */
.hero {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--s5) var(--s4) var(--s4);
  gap: var(--s3);
  background: var(--bg-raise);
  border-bottom: 1px solid var(--line);
}
.hero::before { /* زخرفة النجمة */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--gold); opacity: var(--ornament-op);
  -webkit-mask: var(--ornament-mask) center top / 72px 72px repeat, linear-gradient(var(--mask-on), transparent 92%);
  -webkit-mask-composite: source-in;
  mask: var(--ornament-mask) center top / 72px 72px repeat, linear-gradient(var(--mask-on), transparent 92%);
  mask-composite: intersect;
}
.hero__logo { width: clamp(150px, 46vw, 210px); height: auto; aspect-ratio: 520 / 545; filter: drop-shadow(0 10px 26px var(--logo-shadow)); animation: logo-in .9s var(--ease) both; }
.hero__name { font: 700 clamp(2rem, 8vw, 2.6rem)/1.3 var(--font-display); color: var(--gold); margin: 0; animation: logo-in .9s var(--ease) both; }
.hero__tagline { margin: 0; font: 400 clamp(1.35rem, 5.4vw, 1.75rem)/1.4 var(--font-display); color: var(--gold); animation: fade-in .9s .35s var(--ease) both; }
@keyframes logo-in { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--touch); padding: 0 var(--s4);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--gold); text-decoration: none; font-weight: 500; background: transparent;
  transition: background .2s, border-color .2s;
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--gold); }

.pill { display: inline-flex; align-items: center; gap: var(--s2); min-height: 32px; padding: 0 var(--s3); border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line-soft); font-size: .9rem; color: var(--text); }
.pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--text-dim); }
.pill[data-open="true"]::before { background: var(--ok); }
.pill[data-open="false"]::before { background: var(--danger); }
.pill--table::before { display: none; }
.hero__about { margin: var(--s2) 0 0; max-width: 34ch; color: var(--text-dim); font-size: .95rem; line-height: 1.85; padding-top: var(--s4); position: relative; }
.hero__about::before { /* فاصل زخرفي: معلومة هيكلية تفصل الهوية عن النبذة */
  content: ""; position: absolute; top: 0; inset-inline: 0; margin-inline: auto; width: 120px; height: 9px;
  background: linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat;
}
.hero__about::after { content: ""; position: absolute; top: -2px; inset-inline: 0; margin-inline: auto; width: 7px; height: 7px; background: var(--bg-raise); border: 1px solid var(--gold); transform: rotate(45deg); }

/* =====================================================================
   لافتات: مغلق / متوقف / تنبيه
   ===================================================================== */
.banner { margin: var(--s4) var(--s4) 0; padding: var(--s3) var(--s4); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); line-height: 1.7; }
.banner--bad { border-color: var(--danger); }
.banner b { color: var(--gold); display: block; font-weight: 600; }
.banner--bad b { color: var(--danger); }

/* =====================================================================
   البحث
   ===================================================================== */
.searchbar { position: sticky; top: 0; z-index: 20; padding: var(--s3) var(--s4); background: var(--bg-raise); border-bottom: 1px solid var(--line-soft); }
.searchbar__field { position: relative; display: flex; align-items: center; }
.searchbar__field .ico { position: absolute; inset-inline-start: var(--s4); color: var(--gold); pointer-events: none; }
.searchbar input { width: 100%; height: 48px; padding-inline: 46px 46px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font-size: 1rem; }
.searchbar input::placeholder { color: var(--text-dim); }
.searchbar input::-webkit-search-cancel-button { display: none; }
.searchbar__clear { position: absolute; inset-inline-end: 4px; width: var(--touch); height: var(--touch); display: grid; place-items: center; color: var(--text-dim); border-radius: 50%; }
.empty-note { padding: var(--s6) var(--s4); text-align: center; color: var(--text-dim); }

/* =====================================================================
   الأقسام (أكورديون)
   ===================================================================== */
.cats { padding: var(--s4) 0 var(--s5); }
.acc { border-top: 1px solid var(--line-soft); }
.acc:last-child { border-bottom: 1px solid var(--line-soft); }
.acc__head {
  width: 100%; min-height: 68px; display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border-inline-start: 3px solid transparent;
  transition: background .25s, border-color .25s;
}
.acc__head:hover { background: var(--surface); }
.acc__title { flex: 1; min-width: 0; font: 700 1.55rem/1.35 var(--font-display); color: var(--text); }
.acc__count { font-size: .85rem; color: var(--text-dim); white-space: nowrap; }
.acc__chev { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--gold); transition: transform .35s var(--ease), background .25s; }
.acc.is-open .acc__head { background: var(--surface-2); border-inline-start-color: var(--gold); }
.acc.is-open .acc__title { color: var(--gold); }
.acc.is-open .acc__chev { transform: rotate(180deg); background: var(--gold-grad); color: var(--on-gold); border-color: transparent; }
.acc__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s var(--ease); background: var(--surface); }
.acc.is-open .acc__body { grid-template-rows: 1fr; }
.acc { scroll-margin-top: 76px; }
.acc__inner { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s .38s; }
.acc.is-open .acc__inner { visibility: visible; transition-delay: 0s; }
.acc__note { margin: 0; padding: var(--s3) var(--s4); color: var(--text-dim); font-size: .95rem; border-bottom: 1px dashed var(--line-soft); }

/* ---------- صف صنف ---------- */
.it { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border-top: 1px solid var(--line-soft); }
.it:first-child { border-top: 0; }
.it.has-img { grid-template-columns: 64px minmax(0, 1fr) auto; }
.it__img { width: 64px; height: 64px; border-radius: 32px 32px var(--r-sm) var(--r-sm); object-fit: cover; background: var(--surface-2); }
.it__open { display: flex; flex-direction: column; justify-content: center; width: 100%; min-width: 0; min-height: var(--touch); padding: var(--s1) 0; }
.it__open:disabled { cursor: default; }
.acc > h2 { margin: 0; font: inherit; }
.res-box { background: var(--surface); }
.it__top { display: flex; align-items: flex-end; gap: var(--s2); }
.it__name { font-weight: 600; font-size: 1.04rem; line-height: 1.5; }
.it__lead { flex: 1; min-width: 14px; border-bottom: 2px dotted var(--dot); margin-bottom: .55em; }
.it__price { font-weight: 600; color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.it__price s { color: var(--text-dim); font-weight: 400; margin-inline-end: var(--s2); }
.it__note { font-weight: 500; color: var(--text-dim); font-size: .92rem; }
.it__desc { display: block; margin-top: var(--s1); color: var(--text-dim); font-size: .9rem; line-height: 1.75; }
.it__cat { display: block; font-size: .8rem; color: var(--gold); }
.it__badges { display: inline-flex; gap: var(--s1); flex-wrap: wrap; }
.tag { font-size: .75rem; padding: 0 var(--s2); border-radius: var(--r-pill); border: 1px solid var(--gold); color: var(--gold); line-height: 1.6; }
.it.is-off { opacity: .55; }
.it.is-off .it__name { text-decoration: line-through; text-decoration-color: var(--text-dim); }
.it__off { font-size: .85rem; color: var(--text-dim); }

.add { position: relative; width: var(--touch); height: var(--touch); border-radius: 50%; border: 1.5px solid var(--gold); color: var(--gold); display: grid; place-items: center; transition: background .2s, color .2s, transform .15s; }
.add:hover { background: var(--gold-grad); color: var(--on-gold); border-color: transparent; }
.add:active { transform: scale(.92); }
.add--choose { width: auto; padding: 0 var(--s4); border-radius: var(--r-pill); font-weight: 600; font-size: .92rem; }
.qty-dot { position: absolute; top: -6px; inset-inline-start: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: var(--r-pill); background: var(--gold-grad); color: var(--on-gold); font-size: .78rem; font-weight: 600; line-height: 22px; text-align: center; }
.flash { animation: flash .6s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 var(--gold); } 100% { box-shadow: 0 0 0 14px transparent; } }

/* اختيارات الأحجام داخل الصف (لما القسم غير موحّد) */
.chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { position: relative; min-height: 40px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r-pill); font-size: .92rem; display: inline-flex; align-items: center; gap: var(--s2); }
.chip b { color: var(--gold); font-weight: 600; }
.chip:hover { border-color: var(--gold); }

/* ---------- شبكة الأوزان (المشويات والفراخ) ---------- */
.wg { padding: var(--s2) var(--s3) var(--s4); }
.wg__head, .wg__row { display: grid; grid-template-columns: minmax(0, 1.45fr) repeat(var(--cols), minmax(0, 1fr)); gap: 6px; align-items: center; }
.wg__head { padding: var(--s2) 0 var(--s2); font-size: .78rem; color: var(--text-dim); text-align: center; line-height: 1.4; border-bottom: 1px solid var(--line-soft); margin-bottom: var(--s2); }
.wg__row { padding: 3px 0; }
.wg__row + .wg__row { border-top: 1px dotted var(--line-soft); }
.wg__name { min-height: 48px; display: flex; align-items: center; font-weight: 600; font-size: .95rem; line-height: 1.45; padding-inline-start: var(--s1); }
.wg__cell { position: relative; min-height: var(--touch); border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: .98rem; color: var(--gold); text-align: center; display: grid; place-items: center; font-variant-numeric: tabular-nums; transition: background .2s, color .2s; }
.wg__cell:hover { background: var(--surface-2); border-color: var(--gold); }
.wg__cell[data-qty] { background: var(--gold-grad); color: var(--on-gold); border-color: transparent; }
.wg__cell .qty-dot { background: var(--on-gold); color: var(--gold-hi); }
.wg__cell s { display: block; font-size: .72rem; font-weight: 400; color: var(--text-dim); line-height: 1; }

/* =====================================================================
   شريط السلة
   ===================================================================== */
.cartbar { position: sticky; bottom: 0; z-index: 30; padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); pointer-events: none; }
.cartbar__btn {
  pointer-events: auto; width: 100%; min-height: 58px; display: flex; align-items: center; gap: var(--s3);
  padding: 0 var(--s4) 0 var(--s5); border-radius: var(--r-pill);
  background: var(--gold-grad); color: var(--on-gold); font-weight: 600; box-shadow: var(--shadow);
  animation: rise .4s var(--ease);
}
@keyframes rise { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.cartbar__count { min-width: 34px; height: 34px; border-radius: 50%; background: var(--on-gold); color: var(--gold-hi); display: grid; place-items: center; font-size: .95rem; }
.cartbar__label { flex: 1; }
.cartbar__sum { font-variant-numeric: tabular-nums; }

.toast { position: fixed; inset-inline: var(--s4); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 60; margin-inline: auto; width: fit-content; max-width: min(92vw, 460px); padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--gold); box-shadow: var(--shadow); font-size: .95rem; text-align: center; animation: rise .3s var(--ease); }

/* =====================================================================
   الفوتر / معلومات المطعم
   ===================================================================== */
.foot { padding: var(--s6) var(--s4) var(--s5); text-align: center; display: grid; gap: var(--s3); justify-items: center; border-top: 1px solid var(--line); background: var(--bg-raise); }
.foot__name { font: 700 1.5rem/1.4 var(--font-display); color: var(--gold); margin: 0; }
.foot__addr { display: flex; gap: var(--s2); align-items: flex-start; justify-content: center; color: var(--text-dim); max-width: 36ch; margin: 0; }
.foot__links { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; }
.foot__phone { direction: ltr; unicode-bidi: plaintext; }

/* =====================================================================
   الأوراق (تفاصيل الصنف) والمراجعة
   ===================================================================== */
.scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim); animation: fade-in .25s both; }
.sheet {
  position: fixed; z-index: 71; inset-inline: 0; bottom: 0; max-height: 94dvh;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; border: 1px solid var(--line); border-bottom: 0;
  box-shadow: var(--shadow); animation: sheet-up .38s var(--ease);
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 720px) {
  .sheet { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 580px; max-height: 88vh; border-radius: var(--r-lg); border-bottom: 1px solid var(--line); animation: sheet-pop .3s var(--ease); }
  @keyframes sheet-pop { from { transform: translate(-50%, -48%); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
}
.sheet--full { max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
@media (min-width: 720px) { .sheet--full { height: auto; max-height: 92vh; border-radius: var(--r-lg); border: 1px solid var(--line); width: 640px; } }

.sheet__bar { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line-soft); }
.sheet__title { flex: 1; margin: 0; font: 700 1.5rem/1.4 var(--font-display); color: var(--gold); }
.xbtn { width: var(--touch); height: var(--touch); display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--text); }
.xbtn:hover { background: var(--surface-2); }
.sheet__body { overflow-y: auto; padding: var(--s4); display: grid; gap: var(--s4); overscroll-behavior: contain; }
.sheet__foot { padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); display: grid; gap: var(--s2); background: var(--surface); }

.d-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-lg) var(--r-lg) var(--r-md) var(--r-md); background: var(--surface-2); }
.d-desc { margin: 0; color: var(--text-dim); line-height: 1.85; }
.d-price { font-size: 1.15rem; font-weight: 600; color: var(--gold); }
.d-price s { color: var(--text-dim); font-weight: 400; }

.grp { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--s2); }
.grp legend { padding: 0; font-weight: 600; margin-bottom: var(--s2); }
.grp legend small { color: var(--text-dim); font-weight: 400; margin-inline-start: var(--s2); }
.opts { display: grid; gap: var(--s2); }
.opt { position: relative; display: block; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt__box { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 48px; padding: var(--s2) var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); transition: border-color .2s, background .2s; }
.opt__box b { color: var(--gold); font-weight: 600; white-space: nowrap; }
.opt__box s { color: var(--text-dim); font-weight: 400; margin-inline-end: var(--s2); }
.opt input:checked + .opt__box { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: var(--surface); }
.opt input:checked + .opt__box::after { content: "✓"; color: var(--gold); order: -1; font-weight: 700; }
.opt input:focus-visible + .opt__box { outline: 3px solid var(--gold-hi); outline-offset: 2px; }
.opt input:disabled + .opt__box { opacity: .5; }

.field { display: grid; gap: var(--s1); }
.field label { font-weight: 500; }
.field input, .field textarea { width: 100%; min-height: 48px; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); }
.field textarea { min-height: 84px; resize: vertical; line-height: 1.7; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field input[readonly] { opacity: .75; }
.field .err { color: var(--danger); font-size: .9rem; min-height: 0; margin: 0; }
.field .err:empty { display: none; }
.field[data-bad="true"] input, .field[data-bad="true"] textarea { border-color: var(--danger); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-pill); }
.stepper button { width: var(--touch); height: var(--touch); display: grid; place-items: center; border-radius: 50%; color: var(--gold); font-size: 1.3rem; line-height: 1; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 34px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.btn { min-height: 52px; padding: 0 var(--s5); border-radius: var(--r-pill); background: var(--gold-grad); color: var(--on-gold); font-weight: 600; font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); text-align: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }
.btn--line { background: transparent; color: var(--gold); border: 1px solid var(--line); min-height: var(--touch); font-size: .95rem; font-weight: 500; }
.btn--wide { width: 100%; }
.hint { margin: 0; font-size: .88rem; color: var(--text-dim); text-align: center; line-height: 1.7; }
.msg-bad { margin: 0; color: var(--danger); font-size: .93rem; line-height: 1.7; }
.msg-ok { margin: 0; padding: var(--s3) var(--s4); border: 1px solid var(--ok); border-radius: var(--r-md); color: var(--text); line-height: 1.7; }
.msg-ok b { color: var(--ok); }

/* ---------- أسطر السلة ---------- */
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.line { display: grid; gap: var(--s2); padding: var(--s3) var(--s4); border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface-2); }
.line__top { display: flex; align-items: flex-start; gap: var(--s3); }
.line__name { flex: 1; font-weight: 600; line-height: 1.55; }
.line__sub { display: block; font-weight: 400; color: var(--text-dim); font-size: .88rem; }
.line__price { color: var(--gold); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.line__price small { color: var(--text-dim); font-weight: 400; }
.line__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.line__del { min-height: var(--touch); padding: 0 var(--s3); color: var(--danger); font-size: .92rem; }
.line input { width: 100%; min-height: 44px; padding: 0 var(--s3); border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--surface); color: var(--text); }
.line input::placeholder { color: var(--text-dim); }
.empty-cart { text-align: center; padding: var(--s6) var(--s4); color: var(--text-dim); display: grid; gap: var(--s3); justify-items: center; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-2); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; min-height: 42px; padding: 0 var(--s2); border-radius: var(--r-pill); font-weight: 500; font-size: .95rem; text-align: center; transition: background .2s, color .2s; }
.seg input:checked + span { background: var(--gold-grad); color: var(--on-gold); font-weight: 600; }
.seg input:focus-visible + span { outline: 3px solid var(--gold-hi); outline-offset: 2px; }

.totals { display: grid; gap: var(--s2); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); }
.totals div { display: flex; justify-content: space-between; gap: var(--s3); color: var(--text-dim); }
.totals .stack { display: block; }
.totals .stack p { margin-top: var(--s1); }
.totals .grand { color: var(--text); font-weight: 600; font-size: 1.15rem; padding-top: var(--s2); border-top: 1px dashed var(--line); }
.totals .grand span:last-child { color: var(--gold); }
.totals p { margin: 0; font-size: .88rem; color: var(--text-dim); line-height: 1.7; }

/* =====================================================================
   حالات كاملة (خطأ / متوقف / فارغ)
   ===================================================================== */
.state { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: var(--s4); padding: var(--s6) var(--s5); text-align: center; max-width: 520px; margin: 0 auto; }
.state img { width: 120px; opacity: .9; }
.state h1 { margin: 0; font: 700 1.9rem/1.4 var(--font-display); color: var(--gold); }
.state p { margin: 0; color: var(--text-dim); line-height: 1.85; }

/* ---------- حركة أقل لمن يفضّل ذلك ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
