/* =====================================================================
   كودو كودو — نظام التصميم المشترك (التطبيق ولوحة الإدارة)
   الطابع: أسلوب تطبيق KFC: أبيض مسطّح، أحمر للأسعار والأزرار فقط، نص أسود،
   رمادي فاتح للأسطح والحدود، زوايا خفيفة، وخط واحد Cairo متغيّر الوزن للنص والعناوين.
   كل الأبعاد الاتجاهية منطقية (inline-start/end) فتنعكس تلقائياً بين
   العربية والإنجليزية بمجرد تغيير dir على <html>.
   ===================================================================== */

:root {
  /* ---------- الأرضية والحبر ---------- */
  --paper:      #ffffff;   /* الخلفية الرئيسية: أبيض */
  --paper-2:    #f4f4f4;   /* أسطح ثانوية: رمادي فاتح */
  --canvas:     #ffffff;   /* أرضية الصفحة */
  --cream:      #faf5ea;   /* أرضية شاشة الدخول */
  --paper-3:    #e3e3e3;   /* حدود ناعمة، فواصل */
  --ink:        #1a1a1a;   /* النص والحدود */
  --ink-2:      #3d3d3d;
  --ink-3:      #6f6f6f;   /* نص ثانوي */
  --ink-4:      #b0b0b0;   /* نص خافت، أيقونات معطّلة */

  /* ---------- الأحمر: لون الشعار والفعل ---------- */
  --brand:      #e11e2a;
  --brand-2:    #bf1420;   /* عند التمرير */
  --brand-deep: #8b1a19;   /* خلفيات داكنة (كخلفية التميمة) */
  --brand-soft: #fde3e2;
  --brand-on:   #ffffff;   /* النص فوق الأحمر */
  --brand-text: #e11e2a;   /* الأحمر حين يكون نصاً أو أيقونة على سطح، لا خلفيةً */

  /* ---------- الأصفر: لون الديك، للتمييز والشارات ---------- */
  --sun:        #f4a71d;
  --sun-2:      #d98f0a;
  --sun-soft:   #fff1cf;
  --sun-on:     #24100f;

  /* ---------- الحالات ---------- */
  --ok:         #2f7d4f;  --ok-soft:     #dcefe3;
  --warn:       #b7791f;  --warn-soft:   #fbeec2;
  --danger:     #b3261e;  --danger-soft: #f8dcd9;
  --info:       #2d5c8a;  --info-soft:   #dbe7f3;
  /* نسخ النص من ألوان الحالة: تُفتَح في الوضع الليلي وحده، لأن الأصل يُستعمل خلفيةً أيضاً */
  --ok-text: #2f7d4f;  --warn-text: #b7791f;  --danger-text: #b3261e;  --info-text: #2d5c8a;

  /* ---------- الخطوط ---------- */
  --font-body:    'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    ui-monospace, 'Cascadia Mono', Consolas, monospace;

  /* ---------- سلّم أحجام النص: كل نص في التطبيق من هذه القيم، فلا تختلف شاشة عن أخرى ---------- */
  --fs-2xs:  .6875rem;  /* شريط التنقّل السفلي، الشارات */
  --fs-xs:   .75rem;    /* تعليقات صغيرة */
  --fs-sm:   .8125rem;  /* نص ثانوي */
  --fs-base: .9375rem;  /* النص العادي وأسماء الأصناف */
  --fs-md:   1.0625rem; /* عنوان بطاقة */
  --fs-lg:   1.25rem;   /* عنوان قسم كبير */
  --fs-xl:   1.45rem;   /* عنوان ورقة/حوار */

  /* ---------- الحدود والظلال ---------- */
  --line:       1.5px solid var(--paper-3);
  --line-soft:  1px solid var(--paper-3);
  --line-ink:   2px solid var(--ink);
  --radius:     12px;
  --radius-lg:  18px;
  --radius-pill: 999px;
  --shadow:     0 12px 30px rgba(0, 0, 0, .14);
  --shadow-sm:  0 1px 4px rgba(0, 0, 0, .06);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, .05);
  --shadow-red: 0 6px 16px -6px rgba(225, 30, 42, .45);

  /* ---------- الإيقاع ---------- */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --fast: 140ms;
  --normal: 240ms;

  color-scheme: light;
}

/* ---------- الوضع الليلي: تُبدَّل الرموز فقط، والأحمر يبقى ---------- */
html[data-theme="dark"] {
  --canvas:     #26282d;   /* أرضية الصفحة: رمادي داكن مخفّف لا أسود */
  --cream:      #26282d;   /* شاشة الدخول تتبع الأرضية */
  --paper:      #303339;
  --paper-2:    #3b3e46;
  --paper-3:    #525661;
  --ink:        #fafafa;
  --ink-2:      #e4e5e8;
  --ink-3:      #b8bbc2;
  --ink-4:      #858892;
  --brand-soft: #54262a;
  /* الأحمر على سطح داكن لا يُقرأ: 2.7:1 للسعر وتبويب الفئة وزر «المتابعة كزائر».
     الدرجة نفسها (H=356) أفتح حتى يتجاوز 4.5:1 على كل الأسطح الليلية. الخلفيات
     الحمراء تبقى بـ‏ --brand لأن نصها أبيض. */
  --brand-text: #ff858d;
  --ok-text:     #5cd98a;   /* «جديد» كان 2.1:1 على أرضيته الداكنة */
  --warn-text:   #f5c451;
  --danger-text: #ff9a92;   /* «حار» كان 1.9:1 */
  --info-text:   #8ec5ff;
  --sun-soft:   #4c3b18;
  --ok-soft:    #20452f;
  --warn-soft:  #4a3a18;
  --danger-soft:#532521;
  --info-soft:  #203a52;
  --shadow:     0 12px 30px rgba(0, 0, 0, .32);
  --shadow-sm:  0 2px 8px rgba(0, 0, 0, .22);
  color-scheme: dark;
}
html[data-theme="dark"] .card { border-color: var(--paper-3); }
/* عناصر خلفيتها لون الحبر (داكنة في النهار) تبقى داكنة في الليل بدل أن تنقلب بيضاء */
html[data-theme="dark"] .btn-ink, html[data-theme="dark"] .badge:not([class*="badge-"]), html[data-theme="dark"] .badge-sun, html[data-theme="dark"] .toast, html[data-theme="dark"] .tooltip, html[data-theme="dark"] .bottom-nav-cart .count-badge, html[data-theme="dark"] #announce, html[data-theme="dark"] .site-footer { background: #23252a; border-color: #23252a; }
html[data-theme="dark"] .input, html[data-theme="dark"] .select, html[data-theme="dark"] .textarea { background: var(--paper-2); color: var(--ink); border-color: var(--paper-3); }
html[data-theme="dark"] img.item-img, html[data-theme="dark"] .cat-circle-img img, html[data-theme="dark"] .summary-item img { filter: brightness(.97); }

/* ---------- إعادة الضبط ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 500; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand); color: #fff; }

/* ---------- الطباعة ---------- */
.display, .h-display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0;
}
.latin { font-family: var(--font-display); }
/* سلّم عناوين بنسبة ثابتة (~1.25) فتتناسق الأحجام على الهاتف والحاسوب */
.h1 { font-size: var(--fs-lg); }
.h2 { font-size: var(--fs-md); }
.h3 { font-size: var(--fs-md); }
.h4 { font-size: var(--fs-base); }

/* عناوين موحّدة في كل الصفحات: عنوان الصفحة، عنوان القسم، عنوان البطاقة */
.page-title    { font-family: var(--font-display); font-weight: 600; line-height: 1.2; font-size: var(--fs-lg); }
.section-title { font-family: var(--font-display); font-weight: 600; line-height: 1.25; font-size: var(--fs-md); }
.card-title    { font-family: var(--font-display); font-weight: 600; line-height: 1.3; font-size: var(--fs-base); }
.state-title   { font-family: var(--font-display); font-weight: 600; line-height: 1.3; font-size: var(--fs-md); }
.eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-text);
}
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.tiny  { font-size: var(--fs-xs); }
.num   { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- الحاوية ---------- */
.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }
.container-narrow { width: min(720px, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 46px; padding: 0 var(--space-5);
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
  font-weight: 500; font-size: var(--fs-base); line-height: 1;
  box-shadow: none;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background var(--fast), color var(--fast);
  user-select: none; white-space: nowrap;
}
.btn:hover { background: var(--paper-2); }
.btn:active { transform: translateY(0) scale(.99); box-shadow: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-on); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-sun { background: var(--sun); border-color: var(--sun); color: var(--sun-on); }
.btn-sun:hover { background: var(--sun-2); border-color: var(--sun-2); }
.btn-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ink:hover { background: #000; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--paper-2); transform: none; box-shadow: none; }
.btn-flat { box-shadow: none; border-color: transparent; }
.btn-flat:hover, .btn-flat:active { transform: none; box-shadow: none; }
.btn-outline { background: transparent; border-color: var(--brand); color: var(--brand-text); box-shadow: none; }
.btn-outline:hover { background: var(--brand-soft); }
.btn-sm { min-height: 36px; padding: 0 var(--space-4); font-size: var(--fs-sm); }
.btn-lg { min-height: 56px; padding: 0 var(--space-6); font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; border-radius: var(--radius-pill); box-shadow: none; background: transparent; border-color: transparent; }
.btn-icon:hover { background: var(--paper-2); transform: none; box-shadow: none; }
.btn .icon { width: 20px; height: 20px; flex: none; }

/* ---------- الحقول ---------- */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.label { font-weight: 500; font-size: var(--fs-base); }
.label .req { color: var(--brand-text); margin-inline-start: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 10px 16px;
  background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--paper-3); border-radius: var(--radius);
  transition: box-shadow var(--fast), border-color var(--fast);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%;
  -webkit-min-logical-width: 0; box-sizing: border-box; text-align: start;
}
input[type="date"]::-webkit-date-and-time-value { text-align: start; }
.grid-2 > *, .grid-3 > *, .field-row > *, .field > .input, .field > .select { min-width: 0; }
.select {
  appearance: none;
  padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2324100f' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center; background-size: 16px;
}
[dir="ltr"] .select { background-position: right 14px center; }
.help { font-size: var(--fs-sm); color: var(--ink-3); }
.error-text { font-size: var(--fs-sm); color: var(--danger-text); font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); margin: 0; }

/* ---------- الشارات ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px;
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .02em;
  background: var(--ink); color: #fff; line-height: 1.5;
}
.badge-brand  { background: var(--brand); color: #fff; }
.badge-sun    { background: var(--ink); color: #fff; }
.badge-soft   { background: var(--paper-2); color: var(--ink-2); }
.badge-ok     { background: var(--ok-soft); color: var(--ok-text); }
.badge-warn   { background: var(--warn-soft); color: var(--warn-text); }
.badge-danger { background: var(--danger-soft); color: var(--danger-text); }
.badge-info   { background: var(--info-soft); color: var(--info-text); }

/* ---------- البطاقات والصناديق ---------- */
.card { background: var(--paper); border: 1px solid var(--paper-3); border-radius: var(--radius-lg); }
.card-shadow { box-shadow: var(--shadow-sm); }
.box { background: var(--paper-2); border-radius: var(--radius-lg); padding: var(--space-5); }
.rule { border: 0; border-top: var(--line); margin: 0; }
.rule-soft { border: 0; border-top: var(--line-soft); margin: 0; }
.divider-text { display: flex; align-items: center; gap: var(--space-4); color: var(--ink-3); font-size: var(--fs-sm); }
.divider-text::before, .divider-text::after { content: ''; flex: 1; border-top: var(--line-soft); }

/* ---------- الشبكات والمساعدات ---------- */
.stack  { display: flex; flex-direction: column; }
.row    { display: flex; align-items: center; }
.wrap   { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); } .gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); } .gap-5 { gap: var(--space-5); } .gap-6 { gap: var(--space-6); }
.grow { flex: 1 1 auto; min-width: 0; }
.text-center { text-align: center; }
.text-start { text-align: start; }
.text-end { text-align: end; }
.upper { text-transform: uppercase; letter-spacing: .1em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-old { text-decoration: line-through; color: var(--ink-3); font-weight: 600; margin-inline-start: 6px; }

/* ---------- الهيكل العظمي أثناء التحميل ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 50%, var(--paper-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- الإشعارات ---------- */
.toast-host {
  position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100% - 32px));
}
.toast {
  background: var(--ink); color: #fff;
  padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow);
  font-weight: 600; font-size: var(--fs-base);
  animation: toast-in var(--normal) var(--ease);
  display: flex; align-items: center; gap: 10px;
}
.toast-ok { background: var(--ok); color: #fff; }
.toast-danger { background: var(--danger); color: #fff; }
.toast-action { color: var(--sun); font-weight: 600; padding: 4px 8px; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

/* ---------- الحوارات والأدراج ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(36, 16, 15, .55); backdrop-filter: blur(2px);
  animation: fade var(--normal) var(--ease);
}
.backdrop.is-closing { animation: fade-out .2s var(--ease) forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.modal {
  position: fixed; inset: 0; z-index: 910; display: grid; place-items: center; padding: 16px;
  pointer-events: none;
}
.modal > .modal-panel {
  pointer-events: auto;
  width: min(560px, 100%); max-height: min(90dvh, 900px); overflow: auto;
  background: var(--paper); box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  animation: pop var(--normal) var(--ease);
}
.modal-lg > .modal-panel { width: min(960px, 100%); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: var(--line); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: var(--line-soft); }
/* على الهاتف: الحوار ورقة تنزلق من الأسفل */
@media (max-width: 599px) {
  .modal { align-items: end; padding: 0; }
  .modal > .modal-panel { width: 100%; max-height: 92dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; animation: sheet-in var(--normal) var(--ease); }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
}
/* أثناء الكتابة: الطبقات المثبّتة تتبع نافذة العرض المرئية (‎--kb-top/‎--kb-h من keyboard.js)
   لأن iOS يزيح الصفحة لإظهار الحقل فترتفع الطبقة كلها فوق حافة الشاشة ويختفي ما يُكتب. */
body.kb-open .modal, body.kb-open .search-overlay { top: var(--kb-top, 0px); height: var(--kb-h, 100%); bottom: auto; }
body.kb-open .modal > .modal-panel { max-height: 100%; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 910;
  width: min(440px, 100%); background: var(--paper);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  animation: slide-in var(--normal) var(--ease);
}
.drawer.is-closing { animation: slide-out .2s var(--ease) forwards; }
@keyframes slide-in { from { transform: translateX(var(--drawer-from, 100%)); } }
@keyframes slide-out { to { transform: translateX(var(--drawer-from, 100%)); } }
[dir="ltr"] .drawer { --drawer-from: 100%; }
[dir="rtl"] .drawer { --drawer-from: -100%; }
.drawer-start { inset-inline-end: auto; inset-inline-start: 0; }
[dir="ltr"] .drawer-start { --drawer-from: -100%; }
[dir="rtl"] .drawer-start { --drawer-from: 100%; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: var(--line); }
.drawer-body { flex: 1; overflow: auto; padding: 20px; }
.drawer-foot { padding: 16px 20px; border-top: var(--line); background: var(--paper); }
body.no-scroll { overflow: hidden; }

/* ---------- الجداول ---------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th, .table td { padding: 10px 12px; text-align: start; border-bottom: var(--line-soft); vertical-align: middle; }
.table th { font-size: var(--fs-xs); letter-spacing: .06em; color: var(--ink-3); border-bottom: var(--line-ink); }
.table tbody tr:hover { background: var(--paper); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- الأيقونات ---------- */
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-xl { width: 40px; height: 40px; }

/* ---------- تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- الطباعة الورقية ---------- */
@media print {
  .toast-host, .backdrop { display: none !important; }
  body { background: var(--paper); }
  .btn { box-shadow: none; }
}

/* ---------- الخريطة (Leaflet): مؤشرات مرسومة بـ CSS لا صور ---------- */
.leaflet-container { font-family: inherit; background: #e9e5df; isolation: isolate; z-index: 0; } /* طبقات الخريطة تبقى داخلها فلا تعلو الشريط السفلي أو الحوارات */
.leaflet-container a.leaflet-attribution-flag { display: none !important; }
.leaflet-control-attribution { font-size: 9px; opacity: .75; }
.map-pin { position: relative; display: block; width: 30px; height: 40px; }
.map-pin::before { content: ''; position: absolute; left: 3px; top: 0; width: 24px; height: 24px; border-radius: 50% 50% 50% 0; background: var(--brand); border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); transform: rotate(-45deg); }
.map-pin-dot { position: absolute; left: 11px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--paper); }
.map-pin::after { content: ''; position: absolute; left: 9px; bottom: -2px; width: 12px; height: 5px; border-radius: 50%; background: rgba(0, 0, 0, .3); filter: blur(1px); }
.map-driver-inner { display: grid; place-items: center; width: 64px; height: 64px; transition: transform .8s linear; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); }
.map-driver-inner .icon { width: 26px; height: 26px; }
.map-driver-img { width: 64px; height: 64px; object-fit: contain; display: block; }
.map-driver-inner::after { content: ''; position: absolute; left: 50%; bottom: -2px; width: 44px; height: 16px; transform: translateX(-50%); border-radius: 50%; border: 2px solid rgba(225, 30, 42, .55); animation: driver-pulse 1.8s ease-out infinite; z-index: -1; }
@keyframes driver-pulse { from { transform: translateX(-50%) scale(.7); opacity: 1; } to { transform: translateX(-50%) scale(1.4); opacity: 0; } }
.map-driver { position: relative; }
.map-store-inner { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
.map-store-inner .icon { width: 20px; height: 20px; }
/* حوار الخريطة يملأ الشاشة على الهاتف */
.modal-map > .modal-panel { display: flex; flex-direction: column; width: min(680px, 100%); height: min(760px, 92dvh); max-height: none; overflow: hidden; }
.modal-map .modal-body { flex: 1; min-height: 0; padding: 0; position: relative; display: flex; }
@media (max-width: 599px) { .modal-map > .modal-panel { height: 100dvh; max-height: none; border-radius: 0; } }
.loc-body { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.loc-map { flex: 1; min-height: 240px; z-index: 0; }
.loc-pin { position: absolute; left: 50%; top: calc(50% - 60px); transform: translate(-50%, -100%) translateY(20px); z-index: 2; pointer-events: none; transition: transform .15s var(--ease); }
.loc-body.is-moving .loc-pin { transform: translate(-50%, -100%) translateY(8px); }
.loc-locate { position: absolute; inset-inline-end: 12px; bottom: 132px; z-index: 2; height: 44px; padding: 0 14px 0 12px; border-radius: 999px; background: var(--paper); color: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: var(--fs-sm); border: 0; }
.loc-locate .icon { color: var(--brand-text); }
.loc-locate.is-busy .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loc-panel { position: relative; z-index: 2; background: var(--paper); padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: var(--line); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -8px 24px rgba(0, 0, 0, .08); }
.loc-panel-icon { color: var(--brand-text); }
.loc-label { font-size: var(--fs-base); line-height: 1.35; }

/* زر تكبير الخريطة وحالة ملء الشاشة */
.map-expand { position: absolute; top: 10px; right: 10px; z-index: 900; width: 38px; height: 38px; border-radius: 8px; background: var(--paper); color: var(--ink); border: 1px solid rgba(0, 0, 0, .15); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); display: grid; place-items: center; }
.is-full { display: flex; flex-direction: column; height: 100%; width: 100%; border: 0 !important; border-radius: 0 !important; margin: 0 !important; }
.is-full > .track-map, .is-full > .driver-map, .order-map.is-full { flex: 1; height: auto !important; min-height: 0; border-radius: 0 !important; margin: 0 !important; }
.modal-map .modal-body > .is-full { flex: 1; }

/* شريط انقطاع الاتصال: شريحة عائمة فوق المحتوى، لا تستبدله.
   المعروض يبقى كما هو (آخر نسخة) تماماً كما تفعل التطبيقات الكبيرة. */
#offline-pill {
  position: fixed;
  inset-inline: 0;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 80;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
#offline-pill > span {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  max-width: 90vw;
  padding: .6rem 1.1rem;
  border-radius: 999px;
  background: rgba(26, 28, 32, .93);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .55);
  animation: offline-pill-in .25s ease-out;
}
#offline-pill svg { width: 18px; height: 18px; flex: none; }
@keyframes offline-pill-in { from { transform: translateY(12px); opacity: 0; } }
