:root {
  --cream: #EFE3CC;
  --paper: #F7F0E3;
  --card: #FFFBF4;
  --olive: #6B6A3E;
  --olive-d: #56552F;
  --coffee: #5A3A2A;
  --ink: #2E2018;
  --muted: #8A7A6A;
  --line: #E5D8C3;
  --ok: #3F7A4A;
  --red: #8E1B32;
  --r: 18px;
  --shadow: 0 1px 2px rgba(46, 32, 24, .06), 0 8px 24px rgba(46, 32, 24, .07);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; position: relative; padding-bottom: calc(84px + var(--safe-b)); }

/* ── الهيدر ── */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 16px 10px; background: var(--ink); color: var(--cream); }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.top-mid { flex: 1; min-width: 0; }
.hello { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.open-state { font-size: 12.5px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.open-state i { width: 8px; height: 8px; border-radius: 50%; background: #7BC47F; display: inline-block; }
.open-state.closed i { background: #E07A6B; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--olive); display: grid; place-items: center; font-weight: 600; color: var(--cream); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.notice { margin: 12px 16px 0; padding: 10px 14px; border-radius: 14px; background: #FBE6C2; color: var(--coffee); font-size: 14px; }

.view { padding: 16px; }
.loading { display: grid; place-items: center; padding: 80px 0; }
.loading span { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--olive); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

h1, h2, h3 { margin: 0; line-height: 1.35; }
h2 { font-size: 20px; font-weight: 600; }
.sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.section { margin-top: 22px; }
.section-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }

/* ── أزرار ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 600; font-size: 16px; cursor: pointer; background: var(--olive); color: #fff; transition: transform .12s, background .2s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.block { width: 100%; }
.btn.dark { background: var(--ink); color: var(--cream); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.soft { background: var(--cream); color: var(--coffee); }
.btn.wa { background: #1FA855; }
.btn.sm { padding: 9px 14px; font-size: 14px; border-radius: 12px; }
.link { background: none; border: 0; color: var(--olive); font-weight: 600; cursor: pointer; padding: 4px; font-size: 14px; }

/* ── الترحيب ── */
.hero { position: relative; border-radius: 24px; overflow: hidden; min-height: 300px; color: #fff; display: flex; align-items: flex-end; box-shadow: var(--shadow); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 12, 8, 0) 30%, rgba(20, 12, 8, .85)); }
.hero-txt { position: relative; z-index: 1; padding: 22px; }
.hero h1 { font-size: 26px; font-weight: 700; }
.hero p { margin: 6px 0 0; opacity: .9; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.step { background: var(--card); border-radius: 16px; padding: 14px 10px; text-align: center; box-shadow: var(--shadow); font-size: 13px; }
.step b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--cream); color: var(--coffee); margin: 0 auto 8px; font-size: 14px; }

/* ── كروت ونماذج ── */
.card { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.field { display: block; margin-top: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 16px; outline: none; transition: border-color .2s; }
.input:focus { border-color: var(--olive); }
.input.ltr-in { direction: ltr; text-align: right; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.err { color: var(--red); font-size: 14px; margin-top: 10px; min-height: 1em; }
.seg { display: flex; background: var(--cream); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 10px; font-weight: 500; cursor: pointer; color: var(--coffee); }
.seg button.on { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); color: var(--ink); font-weight: 600; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.gbtn { background: #fff; color: #1f1f1f; border: 1.5px solid var(--line); }
.gbtn svg { width: 20px; height: 20px; }

.colors { display: flex; flex-wrap: wrap; gap: 8px; }
.colors button { display: flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px 6px 10px; font-size: 13.5px; cursor: pointer; }
.colors button.on { border-color: var(--olive); background: #F1F0E4; font-weight: 600; }
.car-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); display: inline-block; vertical-align: -2px; margin-inline-end: 4px; }

.plate { display: inline-flex; direction: ltr; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; font-size: 14px; background: #fff; vertical-align: middle; }
.plate b, .plate i { padding: 2px 8px; font-style: normal; font-weight: 700; letter-spacing: 1px; }
.plate i { border-left: 2px solid var(--ink); direction: rtl; }

/* ── المنيو ── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; margin: 0 -16px; padding-inline: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; background: var(--card); padding: 9px 16px; border-radius: 999px; font-size: 14px; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); color: var(--coffee); }
.chip.on { background: var(--ink); color: var(--cream); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.prod { background: var(--card); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; border: 0; padding: 0; text-align: inherit; transition: transform .15s; }
.prod:active { transform: scale(.98); }
.prod .ph { aspect-ratio: 1/1; display: grid; place-items: center; padding: 14px; position: relative; }
.prod .ph img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(46, 32, 24, .18)); }
.prod .tag { position: absolute; top: 10px; right: 10px; background: var(--ink); color: var(--cream); font-size: 11px; padding: 3px 9px; border-radius: 999px; }
.prod .info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.prod .nm { font-weight: 600; font-size: 15px; }
.prod .ds { font-size: 12px; color: var(--muted); line-height: 1.5; flex: 1; }
.prod .pr { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-weight: 600; font-size: 14px; color: var(--coffee); }
.plus { width: 30px; height: 30px; border-radius: 10px; background: var(--olive); color: #fff; display: grid; place-items: center; font-size: 20px; line-height: 1; }
.prod.off { opacity: .45; pointer-events: none; }

/* ── شريط السلة ── */
.cart-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + var(--safe-b)); width: min(488px, calc(100% - 32px)); z-index: 25; }
.cart-bar a { display: flex; align-items: center; justify-content: space-between; background: var(--olive); color: #fff; border-radius: 16px; padding: 14px 18px; box-shadow: 0 10px 30px rgba(86, 85, 47, .4); font-weight: 600; animation: fade .3s; }
.cart-bar .cnt { background: rgba(255, 255, 255, .2); border-radius: 8px; padding: 2px 9px; margin-inline-end: 8px; }

/* ── التابات السفلية ── */
.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255, 251, 244, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + var(--safe-b)); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); padding: 4px 0; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--ink); font-weight: 600; }
.tabs a.on svg { stroke: var(--olive); stroke-width: 2; }

/* ── الشيت (اختيار المنتج) ── */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(20, 12, 8, .45); animation: fadebg .25s; }
@keyframes fadebg { from { opacity: 0; } }
.sheet-card { position: relative; width: 100%; max-width: 520px; max-height: 88dvh; overflow: auto; background: var(--paper); border-radius: 26px 26px 0 0; padding: 0 0 calc(18px + var(--safe-b)); animation: up .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes up { from { transform: translateY(40%); opacity: 0; } }
.sheet-hero { display: grid; place-items: center; height: 260px; position: relative; }
.sheet-hero img { height: 220px; object-fit: contain; filter: drop-shadow(0 16px 18px rgba(46, 32, 24, .2)); }
.sheet-x { position: absolute; top: 14px; left: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .8); font-size: 20px; cursor: pointer; }
.sheet-body { padding: 18px 18px 0; }
.opt-g { margin-top: 18px; }
.opt-g h4 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts button { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 16px; cursor: pointer; font-size: 14.5px; }
.opts button.on { border-color: var(--olive); background: #F1F0E4; font-weight: 600; }
.qty { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border-radius: 14px; padding: 4px; border: 1.5px solid var(--line); }
.qty button { width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--cream); font-size: 20px; cursor: pointer; color: var(--coffee); }
.qty span { min-width: 30px; text-align: center; font-weight: 600; }
.sheet-foot { display: flex; gap: 12px; align-items: center; margin-top: 22px; }
.sheet-foot .btn { flex: 1; }

/* ── السلة والدفع ── */
.line { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .th { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; padding: 6px; flex: none; }
.line .th img { width: 100%; height: 100%; object-fit: contain; }
.line .mid { flex: 1; min-width: 0; }
.line .mid b { font-weight: 600; font-size: 15px; }
.line .mid small { display: block; color: var(--muted); font-size: 12.5px; }
.line .qty button { width: 30px; height: 30px; font-size: 17px; }
.line .qty span { min-width: 22px; font-size: 14px; }
.sum { display: flex; justify-content: space-between; padding: 6px 0; font-size: 15px; }
.sum.total { font-weight: 700; font-size: 18px; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice button { border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 14px 10px; cursor: pointer; text-align: center; font-size: 14.5px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.choice button span { font-size: 22px; }
.choice button.on { border-color: var(--olive); background: #F1F0E4; font-weight: 600; }
.car-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reward-box { display: flex; align-items: center; gap: 12px; background: #F1F0E4; border: 1.5px dashed var(--olive); border-radius: 16px; padding: 12px 14px; cursor: pointer; }
.reward-box input { width: 22px; height: 22px; accent-color: var(--olive); }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 46px; margin-bottom: 10px; }

/* ── متابعة الطلب ── */
.track-head { text-align: center; padding: 8px 0 4px; }
.track-head .code { display: inline-block; background: var(--ink); color: var(--cream); border-radius: 12px; padding: 4px 14px; font-weight: 700; letter-spacing: 1px; margin-bottom: 10px; }
.track-head h2 { font-size: 24px; }
.track-icon { font-size: 54px; margin: 6px 0; }
.track-icon.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.progress { display: flex; justify-content: space-between; position: relative; margin: 22px 6px 6px; }
.progress::before { content: ''; position: absolute; top: 15px; right: 15px; left: 15px; height: 3px; background: var(--line); }
.progress .bar { position: absolute; top: 15px; right: 15px; height: 3px; background: var(--olive); transition: width .6s ease; }
.progress .p { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 70px; font-size: 12px; color: var(--muted); text-align: center; }
.progress .p i { width: 32px; height: 32px; border-radius: 50%; background: var(--paper); border: 3px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 14px; }
.progress .p.on { color: var(--ink); font-weight: 600; }
.progress .p.on i { background: var(--olive); border-color: var(--olive); color: #fff; }
.eta-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.eta-row button { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 6px; cursor: pointer; font-size: 14px; }
.eta-row button.on { border-color: var(--olive); background: #F1F0E4; font-weight: 600; }
.arrive { font-size: 18px; padding: 18px; }
.arrived-ok { background: #E7F1E4; color: var(--ok); border-radius: 16px; padding: 14px; text-align: center; font-weight: 600; }

/* ── طلباتي ── */
.ord { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.ord + .ord { margin-top: 10px; }
.ord .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--cream); display: grid; place-items: center; font-size: 22px; flex: none; }
.ord .mid { flex: 1; min-width: 0; }
.ord .mid b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ord .mid small { color: var(--muted); font-size: 12.5px; }
.badge { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--cream); color: var(--coffee); white-space: nowrap; }
.badge.new { background: #FBE6C2; }
.badge.preparing { background: #F1F0E4; color: var(--olive-d); }
.badge.ready { background: #DFF0DC; color: var(--ok); }
.badge.cancelled { background: #F6DDE1; color: var(--red); }
.live-banner { display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--cream); border-radius: 18px; padding: 14px 16px; margin-bottom: 16px; cursor: pointer; }
.live-banner .dot { width: 10px; height: 10px; border-radius: 50%; background: #7BC47F; box-shadow: 0 0 0 0 rgba(123, 196, 127, .6); animation: ping 1.6s infinite; flex: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(123, 196, 127, 0); } 100% { box-shadow: 0 0 0 0 rgba(123, 196, 127, 0); } }

/* ── الولاء ── */
.loyal { background: linear-gradient(140deg, #3A2A1F, #2E2018 60%, #4A3A26); color: var(--cream); border-radius: 22px; padding: 20px; position: relative; overflow: hidden; }
.loyal::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(239, 227, 204, .05); left: -70px; top: -90px; }
.loyal .lh { display: flex; justify-content: space-between; align-items: center; }
.loyal .lh img { width: 46px; }
.loyal h3 { font-size: 17px; font-weight: 600; }
.loyal p { margin: 4px 0 0; font-size: 13px; opacity: .8; }
.beans { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 16px; }
.bean { aspect-ratio: 1; border-radius: 50%; border: 1.5px dashed rgba(239, 227, 204, .35); display: grid; place-items: center; }
.bean svg { width: 60%; height: 60%; opacity: 0; transform: scale(.6); transition: all .4s; }
.bean.on { background: var(--cream); border: 0; }
.bean.on svg { opacity: 1; transform: none; }
.rewards { margin-top: 14px; background: rgba(239, 227, 204, .12); border-radius: 12px; padding: 10px 12px; font-size: 14px; }

.menu-list a, .menu-list button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; font-size: 15px; text-align: start; }
.menu-list > :last-child { border-bottom: 0; }

/* ── الموقع ── */
.map { border-radius: 20px; overflow: hidden; height: 240px; box-shadow: var(--shadow); background: var(--cream); }
.map iframe { width: 100%; height: 100%; border: 0; }
.info-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.info-row:last-child { border-bottom: 0; }
.info-row span:first-child { font-size: 20px; }

.install { display: flex; gap: 12px; align-items: center; }
.install img { width: 48px; height: 48px; border-radius: 12px; }

#toast { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--cream); padding: 12px 18px; border-radius: 14px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .3s; z-index: 99; max-width: 90%; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }
.demo-flag { position: fixed; top: calc(70px + var(--safe-t)); left: 8px; z-index: 40; background: #F0A43C; color: var(--ink); font-size: 11px; padding: 3px 8px; border-radius: 8px; opacity: .9; }

@media (min-width: 600px) {
  body { background: #E9DDC8; }
  #app { background: var(--paper); box-shadow: 0 0 60px rgba(46, 32, 24, .12); }
}
