/* ==========================================================================
   نظام بوكسات — التصميم الأساسي (RTL / Tajawal)
   ========================================================================== */

:root {
    /* الألوان: أساس فحمي داكن + لمسة كهرمانية ذهبية + محايدات */
    --bg: #faf8f5;
    --surface: #ffffff;
    --surface-2: #f4f1ec;
    --ink: #1c1917;
    --ink-soft: #57534e;
    --ink-muted: #a8a29e;
    --line: #e7e2da;

    --brand: #f2c200;          /* أصفر بوكسات */
    --brand-dark: #d6a900;
    --brand-soft: #fdf6da;
    --brand-ink: #1c1917;      /* نص داكن فوق الأصفر */

    --charcoal: #1c1917;       /* فحمي للهيدر والداكن */
    --charcoal-2: #292524;

    --green: #15803d;
    --green-soft: #dcfce7;
    --red: #b91c1c;
    --red-soft: #fee2e2;
    --blue: #1d4ed8;
    --blue-soft: #dbeafe;
    --amber: #b45309;
    --amber-soft: #fef3c7;

    --radius: 18px;
    --radius-sm: 11px;
    --radius-lg: 26px;
    --shadow-xs: 0 1px 2px rgba(28, 25, 23, .06);
    --shadow: 0 1px 3px rgba(28, 25, 23, .06), 0 10px 24px -8px rgba(28, 25, 23, .10);
    --shadow-md: 0 4px 12px -4px rgba(28, 25, 23, .12), 0 16px 36px -12px rgba(28, 25, 23, .14);
    --shadow-lg: 0 12px 28px -8px rgba(28, 25, 23, .16), 0 32px 64px -20px rgba(28, 25, 23, .22);
    --shadow-gold: 0 8px 24px -6px rgba(242, 194, 0, .42);
    --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); }

body {
    font-family: 'Tajawal', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 16px; }
.container-sm { width: 100%; max-width: 520px; margin-inline: auto; padding-inline: 16px; }

/* ----------- أدوات عامة ----------- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-muted { color: var(--ink-muted); }
.text-soft { color: var(--ink-soft); }
.text-brand { color: var(--brand-dark); }
.fw-700 { font-weight: 700; }
.fw-500 { font-weight: 500; }
.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}.mt-8{margin-top:32px}
.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-6{margin-bottom:24px}
.w-full { width: 100%; }
.hidden { display: none; }
.small { font-size: 13px; }
.tiny { font-size: 12px; }

/* ----------- الأزرار ----------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-weight: 700; cursor: pointer; transition: transform .2s var(--ease), background .18s, box-shadow .2s, border-color .18s;
    line-height: 1; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-brand { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-gold); }
.btn-brand:hover { background: var(--brand-dark); color: var(--brand-ink); transform: translateY(-1px); }
.btn-dark { background: var(--charcoal); color: #fff; }
.btn-dark:hover { background: var(--charcoal-2); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover { background: var(--line); }
.btn-glass { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.28); backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 15px 30px; font-size: 16px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ----------- البطاقات ----------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }

/* ----------- الشارات ----------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-new { background: var(--blue-soft); color: var(--blue); }
.badge-preparing { background: var(--amber-soft); color: var(--amber); }
.badge-ready { background: var(--green-soft); color: var(--green); }
.badge-completed { background: var(--surface-2); color: var(--ink-soft); }
.badge-cancelled { background: var(--red-soft); color: var(--red); }

/* ----------- النماذج ----------- */
.field { margin-bottom: 16px; }
.label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 7px; }
.input, .select, .textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); transition: .15s; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input-group { display: flex; align-items: stretch; }
.input-group .prefix {
    display: flex; align-items: center; padding: 0 14px; background: var(--surface-2);
    border: 1px solid var(--line); border-inline-start: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-weight: 700; color: var(--ink-soft); direction: ltr;
}
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-inline-end: none; direction: ltr; text-align: right; }
.error-text { color: var(--red); font-size: 13px; margin-top: 5px; }

/* ----------- التنبيهات ----------- */
.alert { padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.alert-success { background: var(--green-soft); color: var(--green); border-color: #bbf7d0; }
.alert-info { background: var(--blue-soft); color: var(--blue); border-color: #bfdbfe; }
.alert-danger { background: var(--red-soft); color: var(--red); border-color: #fecaca; }

/* ----------- الهيدر العام (العميل) ----------- */
.site-header { background: rgba(28,25,23,.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(255,255,255,.08); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.site-logo { display: flex; align-items: center; gap: 11px; }
.logo-square { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px;
    background: #fff; padding: 5px;
    box-shadow: 0 0 0 1px rgba(242,194,0,.35), 0 4px 14px -4px rgba(0,0,0,.4);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.site-logo:hover .logo-square { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(242,194,0,.6), 0 0 20px -4px rgba(242,194,0,.6), 0 6px 16px -4px rgba(0,0,0,.45); }
.logo-square img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-words { display: flex; flex-direction: column; line-height: 1.05; }
.logo-title { font-family: 'Handjet', 'Tajawal', sans-serif; font-variation-settings: 'ELSH' 0, 'ELGR' 1; font-weight: 800; font-size: 34px; color: var(--brand); letter-spacing: 1px; line-height: 1; }
.logo-sub { font-family: 'Handjet', 'Tajawal', sans-serif; font-variation-settings: 'ELSH' 0, 'ELGR' 1; font-weight: 600; font-size: 15px; color: #e0ddd8; margin-top: 2px; letter-spacing: .4px; line-height: 1; }
@media (max-width: 380px) { .logo-square { width: 42px; height: 42px; } .logo-title { font-size: 29px; } .logo-sub { font-size: 13px; } }
.header-actions { display: flex; align-items: center; gap: 10px; }
.cart-btn { position: relative; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1); color: #fff; padding: 9px 16px; border-radius: 999px; font-weight: 700; }
.cart-btn:hover { background: rgba(255,255,255,.18); }
.cart-count { position: absolute; top: -5px; inset-inline-end: -4px; background: var(--brand); color: var(--brand-ink); min-width: 19px; height: 19px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; padding: 0 5px; box-shadow: 0 0 0 2px var(--charcoal); }
.branch-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.08); padding: 7px 14px; border-radius: 999px; font-size: 13px; color: #f5f5f4; }

/* ----------- القائمة السفلية (الهاتف) ----------- */
.mobile-nav { display: none; }
.mnav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; color: #a8a29e; font-size: 11px; font-weight: 700; padding: 4px 2px; min-width: 0; text-align: center; }
.mnav-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.mnav-item.is-active { color: var(--brand); }
.mnav-form { background: none; border: 0; }
.mnav-form button { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; color: inherit; font-weight: 700; font-size: 11px; cursor: pointer; padding: 0; }
.mnav-center { position: relative; justify-content: flex-end; }
.mnav-fab { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; margin-top: -28px; margin-bottom: 1px; background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 18px -2px rgba(242,194,0,.6), 0 0 0 5px rgba(28,25,23,.92); transition: transform .2s var(--ease); }
.mnav-center:active .mnav-fab { transform: scale(.93); }
.mnav-center.is-active .mnav-center-label { color: var(--brand); }
.mnav-center-label { color: #e7e5e4; }
.mnav-badge { position: absolute; top: -3px; inset-inline-end: -3px; min-width: 19px; height: 19px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; box-shadow: 0 0 0 2px rgba(28,25,23,.92); }

/* ----------- التذييل ----------- */
.site-footer { background: var(--charcoal); color: #d6d3d1; margin-top: 56px; padding: 36px 0; }
.site-footer a:hover { color: #fff; }
.footer-credit { color: var(--brand); font-weight: 700; transition: color .15s; }
.footer-credit:hover { color: #ffd633; text-decoration: underline; }

/* ----------- تواصل اجتماعي في الفوتر ----------- */
.footer-contact-list { display: flex; flex-direction: column; gap: 10px; }
.footer-contact-item {
    display: flex; align-items: center; gap: 10px;
    color: #d6d3d1; font-size: 14px; transition: color .15s;
}
.footer-contact-item:hover { color: #fff; }
.footer-contact-item .fc-icon {
    flex: 0 0 auto; width: 18px; height: 18px; color: var(--brand);
    display: inline-flex; align-items: center; justify-content: center;
}
.footer-social-row { display: flex; gap: 10px; margin-top: 16px; }
.footer-social-btn {
    width: 40px; height: 40px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.06); color: #d6d3d1;
    border: 1px solid rgba(255,255,255,.08);
    transition: transform .15s, background .15s, color .15s, border-color .15s;
}
.footer-social-btn:hover {
    background: var(--brand); color: var(--charcoal);
    border-color: var(--brand); transform: translateY(-2px);
}
.footer-social-btn svg { width: 20px; height: 20px; }

/* ----------- الصفحة الرئيسية ----------- */
.hero { position: relative; color: #fff; overflow: hidden; margin-top: -66px; }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); }
.hero-overlay { position: absolute; inset: 0; background:
    radial-gradient(110% 120% at 85% 10%, rgba(242,194,0,.28), transparent 50%),
    linear-gradient(180deg, rgba(28,25,23,.65) 0%, rgba(28,25,23,.8) 60%, rgba(28,25,23,.96) 100%); }
.hero-inner { position: relative; padding: 150px 0 76px; }
.hero-eyebrow { display: inline-block; padding: 6px 15px; border-radius: 999px; font-size: 13px; font-weight: 800;
    color: var(--brand); background: rgba(242,194,0,.14); border: 1px solid rgba(242,194,0,.4); margin-bottom: 18px; }
.hero h1 { font-size: clamp(32px, 7vw, 56px); font-weight: 800; line-height: 1.15; letter-spacing: -.5px; text-wrap: balance; }
.hero p { font-size: clamp(15px, 4vw, 19px); color: #e7e5e4; margin-top: 16px; max-width: 540px; line-height: 1.65; }
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }

/* ----------- قسم الفروع ----------- */
.branches-section { padding: 44px 0 8px; max-width: 940px; margin-inline: auto; }
.branches-head { text-align: center; margin-bottom: 26px; }
.branches-head .section-title { font-size: clamp(24px, 5vw, 32px); }
.branch-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .branch-grid { grid-template-columns: repeat(2, 1fr); } }
.branch-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s; }
.branch-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(242,194,0,.4); }
.branch-card-top { display: flex; gap: 13px; align-items: flex-start; }
.branch-pin { flex-shrink: 0; width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand-dark); }
.branch-pin svg { width: 22px; height: 22px; }
.branch-name { font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.branch-addr { color: var(--ink-muted); font-size: 13.5px; margin-top: 3px; line-height: 1.5; }
.branch-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 18px; }
.branch-meta-item { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px;
    background: var(--surface-2); color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.branch-meta-item svg { width: 15px; height: 15px; color: var(--brand-dark); flex-shrink: 0; }
.branch-card-foot { margin-top: auto; }

/* ----------- شبكة الأقسام ----------- */
.section-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.cat-card { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; box-shadow: var(--shadow); }
.cat-card img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.cat-card:hover img { transform: scale(1.05); }
.cat-card .cat-name { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 16px; background: linear-gradient(0deg, rgba(28,25,23,.85), transparent 70%); color: #fff; font-weight: 700; font-size: 18px; }

/* ----------- المنيو ----------- */
.menu-nav { position: sticky; top: 66px; z-index: 30; background: rgba(250,248,245,.85); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); padding: 12px 0; border-bottom: 1px solid var(--line); }
.menu-nav-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scroll-behavior: smooth; }
.menu-nav-scroll::-webkit-scrollbar { height: 0; }
.chip { white-space: nowrap; padding: 9px 17px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 14px; cursor: pointer; transition: transform .18s var(--ease), background .15s, color .15s, border-color .15s; -webkit-tap-highlight-color: transparent; }
.chip:hover { border-color: var(--brand); transform: translateY(-1px); }
.chip:active { transform: scale(.95); }
.chip.active { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }

.cat-section { padding-top: 34px; scroll-margin-top: 140px; }
.cat-section h2 { font-size: clamp(20px, 5vw, 24px); font-weight: 800; margin-bottom: 16px; display: flex; align-items: center; gap: 11px; letter-spacing: -.3px; }
.cat-section h2::before { content: ""; width: 5px; height: 26px; background: linear-gradient(var(--brand), var(--brand-dark)); border-radius: 3px; }

/* رأس القسم: صورة مربعة أنيقة بجانب العنوان */
.cat-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.cat-head-thumb { position: relative; width: 76px; height: 76px; flex-shrink: 0; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-md); border: 2px solid #fff; background: var(--surface-2); }
.cat-head-thumb::after { content: ""; position: absolute; inset: 0; border-radius: 16px; box-shadow: inset 0 0 0 2px var(--brand-soft); pointer-events: none; }
.cat-head-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.cat-head:hover .cat-head-thumb img { transform: scale(1.08); }
.cat-head-text { min-width: 0; }
.cat-head-title { font-size: clamp(20px, 5vw, 25px); font-weight: 800; letter-spacing: -.4px; margin: 0; display: flex; align-items: center; gap: 10px; }
.cat-head-title::before { content: ""; width: 5px; height: 24px; background: linear-gradient(var(--brand), var(--brand-dark)); border-radius: 3px; flex-shrink: 0; }
.cat-head-sub { font-size: 13px; color: var(--ink-soft); margin: 4px 0 0; }
@media (min-width: 768px) { .cat-head-thumb { width: 92px; height: 92px; border-radius: 20px; } }

.product-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
.product-card { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .18s; }
.product-card:hover { border-color: rgba(242,194,0,.45); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.product-card .thumb { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.product-card .pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.product-card .pname { font-weight: 800; font-size: 16px; letter-spacing: -.2px; }
.product-card .pdesc { color: var(--ink-muted); font-size: 13px; margin-top: 4px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .prow { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 10px; }
.product-card .prow .btn { transition: background .15s, color .15s; }
.product-card:hover .prow .btn { background: var(--brand); color: var(--brand-ink); }
.price { font-weight: 800; color: var(--brand-dark); font-size: 17px; }
.price .cur { font-size: 25px; color: var(--ink-muted); margin-inline-start: 2px; font-weight: 600; }

/* ----------- السعرات الحرارية وعلامات الحساسية ----------- */
.pmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.cal-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: #b45309; background: #fff7e6; border: 1px solid #fde9bf; padding: 3px 9px; border-radius: 999px; }
.cal-badge svg { width: 14px; height: 14px; flex-shrink: 0; }
.cal-unit { font-weight: 600; opacity: .8; }
.allergen-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; }
.allergen-badge svg { width: 14px; height: 14px; color: var(--brand-dark); flex-shrink: 0; }
/* شارة الحساسية: أيقونة فقط (دائرية) */
.allergen-badge-icon { padding: 0; width: 26px; height: 26px; justify-content: center; border-radius: 50%; background: #fff7e6; border-color: #fde9bf; }
.allergen-badge-icon svg { width: 15px; height: 15px; }

/* منتقي الحساسية في لوحة الأدمن */
.allergen-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.allergen-opt { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 14px; transition: all .15s; user-select: none; }
.allergen-opt:hover { border-color: var(--brand); }
.allergen-opt:has(input:checked) { background: #fff7e6; border-color: var(--brand); color: #92600c; }
.allergen-opt input { accent-color: var(--brand-dark); }

/* تحذير الحساسية أسفل المنيو */
.allergy-warning { display: flex; gap: 14px; align-items: flex-start; margin-top: 36px; padding: 18px 20px; background: #fff8ea; border: 1px solid #f5d889; border-inline-start: 4px solid var(--brand); border-radius: 16px; }
.allergy-warning-icon { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; }
.allergy-warning-icon svg { width: 24px; height: 24px; }
.allergy-warning-body strong { display: block; font-size: 16px; color: #7c4a03; margin-bottom: 4px; }
.allergy-warning-body p { font-size: 13.5px; line-height: 1.7; color: #92600c; margin: 0; }
.allergy-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.allergy-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: #7c4a03; background: rgba(255,255,255,.7); border: 1px solid #f0d28a; padding: 4px 10px; border-radius: 999px; }
.allergy-legend-item svg { width: 15px; height: 15px; color: var(--brand-dark); flex-shrink: 0; }

/* ----------- السلة / الملخص ----------- */
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; }
.summary-row.total { border-top: 2px dashed var(--line); margin-top: 8px; padding-top: 14px; font-size: 19px; font-weight: 700; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 34px; height: 34px; background: var(--surface-2); border: none; cursor: pointer; font-size: 18px; font-weight: 700; color: var(--ink); }
.qty button:hover { background: var(--line); }
.qty span { min-width: 36px; text-align: center; font-weight: 700; }

.cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; }

/* ----------- شريط الجوال السفلي ----------- */
.mobile-bar { position: fixed; bottom: 0; inset-inline: 0; background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.1); z-index: 40; }

/* ----------- شاشة ال��صادقة ----------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-logo { text-align: center; margin-bottom: 22px; display: flex; justify-content: center; }
.auth-logo .logo-square { width: 56px; height: 56px; }

/* ===========================================================================
   لوحات التحكم (الكاشير + المسؤول) — داكنة احترافية
   =========================================================================== */
.panel { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: var(--charcoal); color: #d6d3d1; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 20px; font-weight: 700; color: #fff; font-size: 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo img { width: 36px; height: 36px; border-radius: 9px; background:#fff; padding:3px; }
.nav-section { padding: 14px 12px; }
.nav-section .nav-title { font-size: 11px; color: #78716c; text-transform: uppercase; padding: 8px 12px; letter-spacing: .5px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: var(--radius-sm); color: #d6d3d1; font-weight: 500; transition: .15s; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active { background: var(--brand); color: #fff; }
.nav-link svg { width: 19px; height: 19px; flex-shrink: 0; }

.panel-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.panel-topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.panel-topbar h1 { font-size: 19px; font-weight: 700; }
.panel-body { padding: 24px; flex: 1; }

/* بطاقات الإحصائيات */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-card .stat-label { color: var(--ink-muted); font-size: 13px; font-weight: 500; }
.stat-card .stat-value { font-size: 30px; font-weight: 700; margin-top: 6px; }
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-dark); }

/* الجداول */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: right; padding: 14px 16px; background: var(--surface-2); font-size: 13px; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
table.data td { padding: 14px 16px; border-top: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
table.data tr:hover td { background: var(--surface-2); }

/* جداول لوحة الإدارة */
table.table { width: 100%; border-collapse: collapse; min-width: 640px; }
table.table th { text-align: right; padding: 13px 16px; background: var(--surface-2); font-size: 13px; color: var(--ink-soft); font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.table td { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink); vertical-align: middle; white-space: nowrap; }
table.table tbody tr:hover td { background: var(--surface-2); }
table.table .text-center { text-align: center; }

/* صورة مصغّرة داخل الجداول */
.thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--surface-2); display: block; flex-shrink: 0; }

/* بطاقات طلبات الكاشير */
.order-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
@media (min-width: 1100px) { .order-board { grid-template-columns: repeat(6, 1fr); } }
.order-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); transition: .2s; border-inline-start: 4px solid var(--line); }
.order-card.is-new { border-inline-start-color: var(--blue); background: var(--blue-soft); animation: pulse-new 1.6s ease-in-out 3; }
.order-card.is-preparing,
.order-card.is-processing { border-inline-start-color: var(--amber); background: var(--amber-soft); }
.order-card.is-ready { border-inline-start-color: var(--green); background: var(--green-soft); }
.order-card.is-completed { border-inline-start-color: var(--ink-soft); background: var(--surface-2); opacity: .85; }
@keyframes pulse-new { 0%,100% { box-shadow: var(--shadow); } 50% { box-shadow: 0 0 0 4px var(--blue-soft); } }
.order-card .oc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.order-card .oc-num { font-weight: 700; font-size: 14px; }
    .order-card .oc-items { margin: 8px 0; padding: 8px 0; border-block: 1px solid var(--line); font-size: 12.5px; }
    .order-card .oc-item { padding: 7px 0; border-bottom: 1px dashed var(--line); }
    .order-card .oc-item:first-child { padding-top: 0; }
    .order-card .oc-item:last-child { border-bottom: 0; padding-bottom: 0; }
    .order-card .oc-item-line { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
    .order-card .oc-item-name { font-size: 13px; font-weight: 600; line-height: 1.45; }
    .order-card .oc-item-name b { font-weight: 800; }
    .order-card .oc-item-cat { align-self: flex-start; font-size: 11px; font-weight: 800; color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #fde9bf; padding: 2px 9px; border-radius: 999px; white-space: nowrap; line-height: 1.4; }
    .order-card .oc-item-addons { font-size: 11.5px; color: var(--ink-soft); margin-top: 3px; }
.order-card .badge { font-size: 10.5px; padding: 2px 7px; }
.order-card .price { font-size: 15px; }
.order-card .btn-sm { padding: 5px 9px; font-size: 12px; }
.order-card .oc-prev-alert { display: flex; align-items: center; gap: 5px; margin-top: 6px; padding: 5px 8px; border-radius: 7px; background: var(--red-soft); color: var(--red); font-size: 11.5px; font-weight: 700; line-height: 1.35; }
.order-card .oc-prev-alert svg { flex-shrink: 0; }

/* ----------- بطاقات البوكسات ----------- */
.box-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.box-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); transition: .15s; }
.box-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.box-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.box-card .box-name { font-size: 17px; font-weight: 800; color: var(--ink); }
.box-card .box-size { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; font-weight: 700; }
.box-card .box-price { font-weight: 800; color: var(--brand-dark); font-size: 20px; white-space: nowrap; }
.box-card .box-price .cur { font-size: 12px; color: var(--ink-muted); margin-inline-start: 2px; }
.box-card .box-desc { color: var(--ink-soft); font-size: 14px; margin-top: 10px; line-height: 1.5; }
.box-card .box-contents { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 7px; }
.box-card .box-contents li { position: relative; padding-inline-start: 18px; color: var(--ink-soft); font-size: 14px; line-height: 1.45; }
.box-card .box-contents li::before { content: ""; position: absolute; inset-inline-start: 0; top: 7px; width: 7px; height: 7px; border-radius: 999px; background: var(--brand); }
.box-card .box-add-form { margin-top: 14px; }

/* ----------- قسم البوكسات الفخم داخل المنيو ----------- */
.boxes-block { margin: 18px 0 38px; padding: 34px 20px 36px; border-radius: var(--radius-lg);
    background:
        radial-gradient(130% 120% at 88% -10%, rgba(242,194,0,.30), transparent 52%),
        linear-gradient(160deg, #211d1b 0%, #14110f 100%);
    box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.boxes-block::before { content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 22px 22px; opacity: .6; pointer-events: none; }
.boxes-block::after { content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent); }
.boxes-block-head { position: relative; text-align: center; margin-bottom: 26px; }
.boxes-block-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px;
    border-radius: 999px; border: 1px solid rgba(242,194,0,.5); background: rgba(242,194,0,.14);
    color: var(--brand); font-size: 12.5px; font-weight: 800; letter-spacing: .4px; }
.boxes-block-badge svg { width: 16px; height: 16px; }
.boxes-block-title { color: #fff; font-size: clamp(24px, 6vw, 34px); font-weight: 800; margin-top: 14px; letter-spacing: -.5px; }
.boxes-block-sub { color: rgba(255,255,255,.7); font-size: 14.5px; margin-top: 8px; max-width: 480px; margin-inline: auto; line-height: 1.65; }

.box-cat-group { position: relative; margin-top: 30px; }
.box-cat-group:first-of-type { margin-top: 0; }
.box-cat-label { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.box-cat-label span { color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -.2px; white-space: nowrap; }
.box-cat-label small { color: rgba(255,255,255,.55); font-size: 12.5px; }
.box-cat-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(242,194,0,.5), transparent); }

.premium-box-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.premium-box { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius);
    overflow: hidden; border: 1px solid rgba(255,255,255,.06); position: relative;
    box-shadow: 0 14px 34px -10px rgba(0,0,0,.4); transition: transform .26s var(--ease), box-shadow .26s var(--ease); }
.premium-box:hover { transform: translateY(-6px); box-shadow: 0 26px 52px -14px rgba(0,0,0,.5); }
.premium-box-top { position: relative; padding: 20px 20px 18px;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(242,194,0,.22), transparent 55%),
        linear-gradient(135deg, #211d1b 0%, #14110f 100%);
    border-bottom: 2px solid var(--brand); }
.premium-box-size { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px;
    background: rgba(242,194,0,.2); border: 1px solid rgba(242,194,0,.5);
    color: var(--brand); font-size: 11.5px; font-weight: 800; margin-bottom: 10px; }
.premium-box-name { color: #fff; font-size: 20px; font-weight: 800; line-height: 1.3; letter-spacing: -.3px; }
.premium-box-body { padding: 18px 20px; flex: 1; }
.premium-box-desc { color: var(--ink-soft); font-size: 13.5px; line-height: 1.6; margin-bottom: 14px; }
.premium-box-contents { list-style: none; display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; }
.premium-box-contents li { position: relative; padding-inline-start: 24px; color: var(--ink);
    font-size: 13.5px; line-height: 1.45; font-weight: 600; }
.premium-box-contents li::before { content: ""; position: absolute; inset-inline-start: 0; top: 1px;
    width: 16px; height: 16px; border-radius: 999px; background: var(--brand-soft);
    border: 1px solid rgba(242,194,0,.5); }
.premium-box-contents li::after { content: ""; position: absolute; inset-inline-start: 5px; top: 7px;
    width: 6px; height: 6px; border-radius: 999px; background: var(--brand); }
.premium-box-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; border-top: 1px dashed var(--line); background: var(--surface-2); }
.premium-box-price { display: flex; align-items: baseline; gap: 3px; }
.premium-box-price .amt { color: var(--brand-dark); font-size: 25px; font-weight: 800; letter-spacing: -.5px; }
.premium-box-price .cur { color: var(--ink-muted); font-size: 30px; font-weight: 700; }
.premium-box-foot .btn { white-space: nowrap; }

/* شريحة البوكسات المميزة */
.chip.chip-boxes { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; border-color: transparent;
    box-shadow: var(--shadow-gold); }
.chip.chip-boxes:hover { transform: translateY(-1px); }
.chip.chip-boxes.active { background: var(--brand-dark); border-color: var(--brand-dark); }

.section-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-muted); }
.empty-state svg { width: 56px; height: 56px; margin: 0 auto 14px; opacity: .4; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-head h2 { font-size: 22px; font-weight: 700; }

/* مساعدات الشبكة للنماذج */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ----------- استجابة الجوال ----------- */
@media (min-width: 640px) {
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .box-grid { grid-template-columns: repeat(2, 1fr); }
    .premium-box-grid { grid-template-columns: repeat(2, 1fr); }
    .boxes-block { padding: 32px 28px 34px; }
    .boxes-block-title { font-size: 30px; }
}
@media (min-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .box-grid { grid-template-columns: repeat(3, 1fr); }
    .premium-box-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
    .sidebar { position: fixed; inset-inline-start: -260px; z-index: 100; transition: .25s; box-shadow: var(--shadow-lg); }
    .sidebar.open { inset-inline-start: 0; }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99; display: none; }
    .sidebar-backdrop.open { display: block; }
    .menu-toggle { display: inline-flex; }
}
@media (min-width: 1025px) {
    .menu-toggle { display: none; }
}
@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
    .hide-mobile { display: none; }
    .hero-inner { padding: 120px 20px 48px; }
    .hero-cta { gap: 10px; }
    .hero-cta .btn { flex: 1; }
    .boxes-block { padding: 26px 14px 28px; margin-inline: -2px; }
    .branches-section { padding-top: 34px; }

    /* القائمة السفلية تحل محل أزرار الهيدر على الهاتف */
    .site-header .header-actions { display: none; }
    .site-header .container { justify-content: center; }
    .mobile-nav {
        display: flex; align-items: stretch; justify-content: space-around;
        position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
        background: rgba(28,25,23,.94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
        border-top: 1px solid rgba(255,255,255,.08);
        padding: 9px 6px calc(9px + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 28px -10px rgba(0,0,0,.55);
    }
    body { padding-bottom: 78px; }
    .site-footer { margin-bottom: 0; }
}

.print-only { display: none; }
@media print {
    .no-print { display: none !important; }
    .print-only { display: block; }
    body { background: #fff; }
}

/* ===========================================================================
   إضافات وتوحيد الأصناف (aliases & helpers)
   =========================================================================== */
/* أوزان ومسافات إضافية */
.fw-800 { font-weight: 800; }
.mb-1 { margin-bottom: 4px; }
.text-left { text-align: left; }
.hide-desktop { display: none; }
@media (max-width: 640px) { .hide-desktop { display: block; } }

/* مرادفات الأزرار والتنبيهات */
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-dark); color: var(--brand-ink); }
.alert-error { background: var(--red-soft); color: var(--red); border-color: #fecaca; }

/* مرادفات الشارات لحالة processing */
.badge-processing { background: var(--amber-soft); color: var(--amber); }
.order-card.is-processing { border-inline-start-color: var(--amber); }

/* حقل الجوال السعودي */
.phone-field { display: flex; align-items: stretch; }
.phone-prefix {
    display: flex; align-items: center; padding: 0 14px; background: var(--surface-2);
    border: 1px solid var(--line); border-inline-end: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm); font-weight: 700; color: var(--ink-soft); direction: ltr;
}
.phone-input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; direction: ltr; text-align: right; }

/* صف الـ checkbox */
.checkbox-line { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; cursor: pointer; }

/* النماذج: مرادفات form-group/form-label/form-input */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 7px; }
.form-input {
    width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); transition: .15s; outline: none;
}
.form-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* رمز الريال السعودي الرسمي (icon-saudi_riyal_new من Saudi-Riyal-Font) */
.riyal-cur,
.icon-saudi_riyal_new { display: inline-block; line-height: 1; }
/* تكبير محرف الأيقونة ليتناسب مع حجم الرقم المجاور */
.riyal-cur::before,
.icon-saudi_riyal_new::before {
    font-size: 1.05em;
    vertical-align: -0.08em;
    margin-inline-start: 0.08em;
}
.fw-700 .riyal-cur, .fw-800 .riyal-cur, .price .riyal-cur,
b .riyal-cur, strong .riyal-cur { font-weight: bold; }

/* إخفاء أسهم زيادة/إنقاص الأرقام (إدخال يدوي فقط) */
.no-spin::-webkit-outer-spin-button,
.no-spin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.no-spin { -moz-appearance: textfield; appearance: textfield; }

/* صفوف تفاصيل الطلب */
.row-line { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.row-line + .row-line { border-top: 1px solid var(--line); }
.total-line { border-top: 2px dashed var(--line); margin-top: 6px; padding-top: 14px; font-size: 18px; }
.order-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* شريط تتبع حالة الطلب */
.status-track { display: flex; align-items: flex-start; justify-content: space-between; margin-top: 18px; position: relative; }
.status-track::before { content: ""; position: absolute; top: 9px; inset-inline: 10%; height: 2px; background: var(--line); z-index: 0; }
.status-step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; position: relative; z-index: 1; }
.status-step .dot { width: 20px; height: 20px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); }
.status-step .lbl { font-size: 12px; color: var(--ink-muted); font-weight: 700; }
.status-step.done .dot { background: var(--brand); border-color: var(--brand); }
.status-step.done .lbl { color: var(--ink); }

/* مساعدات شبكة إضافية للوحات */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid-3 { grid-template-columns: 1fr; } }

/* شبكات عامة */
.grid { display: grid; gap: 16px; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; } }

/* شبكة بطاقات الإحصائيات */
.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1000px) { .grid-stats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .grid-stats { grid-template-columns: 1fr; } }

/* ترويسة قسم */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

/* فاصل */
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* صف عنصر في الطلب */
.order-item-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.order-item-row:last-child { border-bottom: 0; }

/* رابط بطاقة إحصائية الفرع */
.branch-stat-link { display: block; text-decoration: none; color: inherit; transition: .15s; }
.branch-stat-link:hover { transform: translateY(-2px); }

/* هامش علوي إضافي */
.mt-5 { margin-top: 20px; }

/* ===================== لعبة الانتظار (Box Runner) ===================== */
.btn-game-cta { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; }
.btn-game-cta svg { flex-shrink: 0; }

/* شريط حالة الطلب الحيّ فوق اللعبة */
.game-status-bar { padding: 14px 16px; margin-bottom: 16px; position: sticky; top: 8px; z-index: 20; }
.game-status-bar.is-ready { box-shadow: 0 0 0 2px var(--brand), 0 8px 24px -8px rgba(242,194,0,.6); }
.gsb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.gsb-order { font-weight: 800; font-size: 16px; }
.status-track-sm .lbl { font-size: 11px; }
.status-track-sm .dot { width: 14px; height: 14px; }

/* هيكل اللعبة */
.game-shell { }
.game-hud { display: flex; gap: 10px; margin-bottom: 12px; }
.hud-item { flex: 1; background: var(--charcoal); color: #fafaf9; border-radius: 14px; padding: 12px 10px; text-align: center; }
.hud-item.hud-stage { background: var(--brand); color: var(--brand-ink); }
.hud-label { display: block; font-size: 12px; opacity: .8; font-weight: 600; }
.hud-value { display: block; font-size: 22px; font-weight: 800; line-height: 1.2; margin-top: 2px; }

/* لوحة الرسم */
.game-canvas-wrap { position: relative; border-radius: 18px; overflow: hidden; box-shadow: 0 12px 32px -10px rgba(0,0,0,.5); border: 1px solid rgba(242,194,0,.25); }
#boxRunner { display: block; width: 100%; height: auto; background: var(--charcoal); touch-action: none; cursor: pointer; }

/* الطبقات (بداية/خسارة) */
.game-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(28,25,23,.78); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); padding: 16px; transition: opacity .2s; }
.game-overlay.hidden { display: none; }
.ov-card { background: var(--surface); border-radius: 18px; padding: 26px 24px; max-width: 380px; text-align: center; box-shadow: 0 18px 40px -12px rgba(0,0,0,.5); }
.ov-title { font-size: 22px; font-weight: 800; color: var(--brand-dark); margin-bottom: 8px; }
.ov-text { font-size: 14px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 18px; }
.ov-text b { color: var(--ink); font-weight: 800; }

.game-hint { font-size: 12.5px; color: var(--ink-muted); text-align: center; margin-top: 14px; line-height: 1.7; }

/* زر ك��م/تشغيل الصوت */
.hud-sound { flex: 0 0 auto; width: 52px; display: flex; align-items: center; justify-content: center; background: var(--charcoal); color: var(--brand); border: 0; border-radius: 14px; cursor: pointer; transition: background .15s, color .15s; }
.hud-sound svg { width: 22px; height: 22px; }
.hud-sound .ic-off { display: none; }
.hud-sound.is-muted { color: #a8a29e; }
.hud-sound.is-muted .ic-on { display: none; }
.hud-sound.is-muted .ic-off { display: block; }

@media (max-width: 560px) {
    .game-hud { gap: 7px; }
    .hud-item { padding: 8px 6px; border-radius: 11px; }
    .hud-value { font-size: 16px; }
    .hud-label { font-size: 10px; }
    .hud-sound { width: 42px; border-radius: 11px; }
    .hud-sound svg { width: 18px; height: 18px; }

    /* الطبقات: تناسب ارتفاع اللوحة القصير على الهاتف */
    .game-overlay { padding: 8px; }
    .ov-card { padding: 14px 14px; max-width: 92%; border-radius: 14px; }
    .ov-title { font-size: 15px; margin-bottom: 4px; }
    .ov-text { font-size: 11.5px; line-height: 1.5; margin-bottom: 10px; }
    .ov-card .btn { padding: 7px 16px; font-size: 13px; }
    .game-hint { font-size: 11px; margin-top: 10px; }
}
@media (max-width: 380px) {
    .ov-title { font-size: 13.5px; }
    .ov-text { font-size: 10.5px; margin-bottom: 8px; }
    .ov-card { padding: 11px 12px; }
    .ov-card .btn { padding: 6px 14px; font-size: 12.5px; }
}
