/* Esh Bedak — warm & minimal */
:root {
  --bg: #FAF6F0;
  --surface: #FFFFFF;
  --surface-2: #F3EDE4;
  --ink: #221C18;
  --ink-2: #4A413A;
  --muted: #8C8178;
  --line: #ECE4D9;
  --accent: #D2603A;
  --accent-press: #B9512F;
  --accent-ink: #FFFFFF;
  --accent-soft: #FBEAE2;
  --success: #3B8A5E;
  --danger: #C2412D;
  --shadow-sm: 0 1px 2px rgba(60, 35, 20, .05), 0 2px 8px rgba(60, 35, 20, .05);
  --shadow: 0 2px 6px rgba(60, 35, 20, .05), 0 12px 32px rgba(60, 35, 20, .08);
  --shadow-accent: 0 10px 28px rgba(210, 96, 58, .35);
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161210; --surface: #201A16; --surface-2: #2A231E; --ink: #F4ECE4; --ink-2: #D6CBC0; --muted: #A89A8E;
    --line: #362D26; --accent: #E8774F; --accent-press: #D2603A; --accent-soft: #3A231A;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 12px 32px rgba(0,0,0,.35); --shadow-accent: 0 10px 28px rgba(232,119,79,.3);
  }
}
:root[data-theme="dark"] {
  --bg: #161210; --surface: #201A16; --surface-2: #2A231E; --ink: #F4ECE4; --ink-2: #D6CBC0; --muted: #A89A8E;
  --line: #362D26; --accent: #E8774F; --accent-press: #D2603A; --accent-soft: #3A231A;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 12px 32px rgba(0,0,0,.35); --shadow-accent: 0 10px 28px rgba(232,119,79,.3);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 14px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: var(--r-sm); font-weight: 600; transition: transform .15s var(--ease), background .15s; }
.btn:active { transform: scale(.98); }
.btn.block { width: 100%; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn.primary:hover { background: var(--accent-press); }
.btn.primary:disabled { opacity: .6; cursor: default; }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.danger-text { color: var(--danger); }
.link { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); transition: background .15s; }
.icon-btn:hover { background: var(--surface-2); }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative;
  background: radial-gradient(120% 60% at 50% 0%, var(--accent-soft), transparent 70%), var(--bg); }
.lang-switch { position: absolute; top: max(16px, env(safe-area-inset-top)); inset-inline-end: 16px; padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 600; font-size: 14px; }
.auth-card { width: 100%; max-width: 400px; text-align: center; }
.auth-logo { border-radius: 18px; box-shadow: var(--shadow); }
.auth h1 { margin: 14px 0 0; font-size: 32px; font-weight: 700; letter-spacing: -.01em; }
.auth-tag { margin: 2px 0 28px; color: var(--muted); }
.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; margin-bottom: 20px; }
.seg button { flex: 1; padding: 10px; border-radius: 10px; font-weight: 600; color: var(--muted); transition: all .2s var(--ease); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg.small { margin: 0; }
.seg.small button { padding: 8px; font-size: 14px; }
#authForm { text-align: start; display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.field input, .add-addr textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm);
  padding: 13px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .add-addr textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
[dir="rtl"] .field input[dir="ltr"] { text-align: right; }
.pw { position: relative; }
.pw input { padding-inline-end: 46px; }
.pw-toggle { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); border-radius: 8px; }
.hint { color: var(--muted); font-size: 13px; }
.form-error { color: var(--danger); font-size: 14px; margin: 0; min-height: 1px; }
#authSubmit { margin-top: 4px; padding: 15px; font-size: 17px; }

/* ---------- app shell ---------- */
.app { height: 100dvh; display: flex; flex-direction: column; max-width: 600px; margin: 0 auto; position: relative; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; padding-top: max(12px, env(safe-area-inset-top)); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; color: var(--accent); }
.logo img { border-radius: 9px; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-size: 16px; }
.avatar.lg { width: 60px; height: 60px; font-size: 24px; flex: none; }

.scroller { flex: 1; overflow-y: auto; padding: 0 20px 16px; min-height: 0; scroll-behavior: smooth; }

/* ---------- home ---------- */
.home { padding-top: 12px; animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.greet { font-size: 28px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.greet-sub { font-size: 18px; color: var(--muted); margin: 2px 0 18px; }
.addr-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 14px; color: var(--ink-2); max-width: 100%; }
.addr-chip svg { color: var(--accent); flex: none; }
.addr-chip .chev { color: var(--muted); }
.addr-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr-chip.empty span { color: var(--accent); font-weight: 600; }

.reorder { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 18px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); text-align: start; transition: transform .15s var(--ease), box-shadow .15s; }
.reorder:hover { box-shadow: var(--shadow); }
.reorder:active { transform: scale(.99); }
.reorder-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 20px; font-weight: 700; flex: none; }
.reorder-body { display: grid; min-width: 0; }
.reorder-body small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.section-title { font-size: 15px; font-weight: 600; color: var(--muted); margin: 26px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.r-card { background: var(--surface); border-radius: var(--r); padding: 16px; text-align: start; box-shadow: var(--shadow-sm); display: grid; gap: 2px; transition: transform .15s var(--ease), box-shadow .15s; }
.r-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.r-card:active { transform: scale(.98); }
.r-emoji { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; font-size: 26px; margin-bottom: 10px; }
.r-card b { font-weight: 600; font-size: 15px; }
.r-card small { color: var(--muted); font-size: 12.5px; }

/* ---------- chat thread ---------- */
.thread { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.msg { max-width: 82%; padding: 11px 15px; border-radius: 20px; white-space: pre-wrap; word-wrap: break-word; unicode-bidi: plaintext; animation: rise .25s var(--ease); }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-end-end-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--surface); box-shadow: var(--shadow-sm); border-end-start-radius: 6px; }
.msg.error { align-self: center; background: transparent; color: var(--danger); font-size: 14px; text-align: center; box-shadow: none; }
.msg .vtag { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .8; margin-bottom: 2px; }

.voice { min-width: 230px; }
.voice-row { display: flex; align-items: center; gap: 10px; }
.play { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; flex: none; font-size: 12px; }
.wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 26px; }
.wave i { flex: 1; background: currentColor; opacity: .55; border-radius: 2px; min-height: 3px; }
.wave.playing i { opacity: .95; }
.dur { font-size: 12px; opacity: .85; font-variant-numeric: tabular-nums; }
.transcript { font-size: 14px; opacity: .92; border-top: 1px solid rgba(255,255,255,.25); padding-top: 6px; margin-top: 6px; unicode-bidi: plaintext; }

.typing { align-self: flex-start; background: var(--surface); box-shadow: var(--shadow-sm); padding: 14px 16px; border-radius: 20px; border-end-start-radius: 6px; display: flex; gap: 5px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.card { background: var(--surface); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); animation: rise .25s var(--ease); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.card-head b { font-size: 17px; }
.card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.line { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.line:last-child { border-bottom: 0; }
.line .q { color: var(--accent); font-weight: 700; margin-inline-end: 6px; }
.line small { display: block; color: var(--muted); font-size: 12.5px; }
.totals { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; color: var(--muted); display: grid; gap: 3px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { color: var(--ink); font-weight: 700; font-size: 18px; margin-top: 4px; }
.card .btn.primary { margin-top: 14px; width: 100%; padding: 15px; font-size: 16px; border-radius: 14px; box-shadow: var(--shadow-accent); }
.pill { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }

.track { display: flex; gap: 6px; margin-top: 14px; }
.track div { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.track div::before { content: ""; display: block; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 6px; transition: background .4s; }
.track div.done { color: var(--ink); font-weight: 600; }
.track div.done::before { background: var(--success); }

/* ---------- dock ---------- */
.dock { padding: 10px 20px; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.dock-home { display: grid; justify-items: center; gap: 6px; padding-top: 4px; }
.mic-big { width: 76px; height: 76px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow-accent); transition: transform .2s var(--ease); position: relative; }
.mic-big::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--accent); opacity: .25; animation: halo 2.4s var(--ease) infinite; }
@keyframes halo { 0% { transform: scale(.9); opacity: .35; } 100% { transform: scale(1.25); opacity: 0; } }
.mic-big:active { transform: scale(.94); }
.dock-hint { margin: 4px 0 0; font-weight: 600; color: var(--ink-2); }
.composer { display: flex; gap: 8px; align-items: center; background: var(--surface); border-radius: 999px; padding: 6px; padding-inline-start: 18px; box-shadow: var(--shadow); }
.composer input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 8px 0; unicode-bidi: plaintext; }
.send-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.send-btn .i-send { display: none; }
.send-btn.has-text .i-send { display: block; }
.send-btn.has-text .i-mic { display: none; }
[dir="rtl"] .i-send { transform: scaleX(-1); }

/* ---------- recording sheet ---------- */
.rec { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(30, 18, 10, .35); backdrop-filter: blur(6px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.rec-card { width: 100%; max-width: 600px; background: var(--surface); border-radius: 28px 28px 0 0; padding: 22px 24px; padding-bottom: max(28px, env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 10px; animation: up .3s var(--ease); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.rec-lang { display: flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.rec-lang button { padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.rec-lang button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.orb { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; margin: 14px 0 4px; background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%); }
.orb span { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); box-shadow: var(--shadow-accent); transition: transform .08s linear; }
.rec-time { font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.rec-live { min-height: 3.2em; margin: 0; text-align: center; color: var(--ink-2); max-width: 100%; unicode-bidi: plaintext; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rec-actions { display: flex; gap: 40px; align-items: center; margin-top: 6px; }
.round { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; transition: transform .15s var(--ease); }
.round:active { transform: scale(.94); }
.round.ghost { background: var(--surface-2); color: var(--ink-2); width: 56px; height: 56px; }
.round.primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-accent); width: 72px; height: 72px; }

/* ---------- profile sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(30, 18, 10, .35); backdrop-filter: blur(4px); animation: fade .2s; }
.sheet { position: relative; width: 100%; max-width: 600px; max-height: 92dvh; overflow-y: auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 20px; padding-bottom: max(24px, env(safe-area-inset-bottom)); animation: up .3s var(--ease); }
@media (min-width: 900px) {
  .sheet-wrap { justify-content: flex-end; align-items: stretch; }
  .sheet { max-width: 420px; max-height: none; height: 100%; border-radius: 0; animation: side .3s var(--ease); }
  [dir="rtl"] .sheet-wrap { justify-content: flex-start; }
  .sheet-grip { display: none; }
}
@keyframes side { from { transform: translateX(30px); opacity: 0; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 8px; }
.sheet-close { position: absolute; top: 12px; inset-inline-end: 12px; }
.profile-head { display: flex; align-items: center; gap: 14px; margin: 14px 0 8px; }
.profile-head h2 { margin: 0; font-size: 21px; }
.p-section { background: var(--surface); border-radius: var(--r); padding: 16px; margin: 12px 0; box-shadow: var(--shadow-sm); }
.p-section h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.p-section .muted.small { margin: -4px 0 10px; }
.list { list-style: none; margin: 0 0 10px; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow b { display: block; font-weight: 600; font-size: 15px; }
.list .grow small { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.list .empty { color: var(--muted); font-size: 14px; border: 0; }
.mini { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; }
.mini:hover { background: var(--surface-2); color: var(--ink); }
.mini.star.on { color: var(--accent); }
.list .mem span { display: block; font-size: 15px; unicode-bidi: plaintext; }
.mem-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.status.delivered { background: rgba(59, 138, 94, .12); color: var(--success); }
.add-addr { display: grid; gap: 10px; margin-bottom: 10px; }
.add-addr textarea { resize: vertical; unicode-bidi: plaintext; }
.add-addr .row { display: flex; gap: 8px; justify-content: flex-end; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; }
.chips button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ---------- restaurant cards (photos) ---------- */
.grid.photos { grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 520px) { .grid.photos { grid-template-columns: 1fr 1fr; } }
.r-card.photo { padding: 0; overflow: hidden; gap: 0; }
.r-card.photo .cover { aspect-ratio: 16 / 7; width: 100%; object-fit: cover; background: var(--surface-2); display: block; }
.r-card.photo .body { display: flex; gap: 12px; align-items: center; padding: 12px 14px 14px; }
.r-card.photo .logo-sm { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; margin-top: -30px; border: 3px solid var(--surface); background: var(--surface); box-shadow: var(--shadow-sm); flex: none; }
.r-card.photo .txt { display: grid; min-width: 0; }
.r-card.photo .txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rating { color: var(--accent); font-weight: 600; }

/* ---------- header cart button ---------- */
.cart-btn { position: relative; }
.badge { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* ---------- restaurant page ---------- */
.rpage { position: absolute; inset: 0; z-index: 10; background: var(--bg); display: flex; flex-direction: column; animation: fade .2s; }
.rpage-scroll { flex: 1; overflow-y: auto; padding-bottom: 110px; }
.r-hero { position: relative; aspect-ratio: 16 / 7; background: var(--surface-2); }
.r-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-btn { position: absolute; top: max(12px, env(safe-area-inset-top)); inset-inline-start: 12px; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; }
[dir="rtl"] .hero-btn svg { transform: scaleX(-1); }
.r-info { padding: 0 20px 6px; text-align: center; }
.r-logo { width: 76px; height: 76px; border-radius: 20px; object-fit: cover; margin-top: -38px; border: 4px solid var(--bg); background: var(--surface); box-shadow: var(--shadow); position: relative; }
.r-info h2 { margin: 6px 0 0; font-size: 22px; }
.r-meta { display: flex; justify-content: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.r-meta span { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); }
.r-sticky { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 10px 20px 0; }
.r-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 14px; padding: 0 14px; box-shadow: var(--shadow-sm); color: var(--muted); }
.r-search input { flex: 1; border: 0; background: transparent; outline: none; padding: 11px 0; min-width: 0; }
.r-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.r-tabs::-webkit-scrollbar { display: none; }
.r-tabs button { flex: none; padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.r-tabs button.on { background: var(--ink); color: var(--bg); }
.r-menu { padding: 0 20px; }
.r-section { scroll-margin-top: 120px; }
.r-section h3 { font-size: 18px; margin: 22px 0 6px; }
.item-row { display: flex; gap: 14px; width: 100%; padding: 14px 0; border-bottom: 1px solid var(--line); text-align: start; align-items: flex-start; }
.item-row .info { flex: 1; min-width: 0; display: grid; gap: 3px; }
.item-row b { font-weight: 600; }
.item-row .desc { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-row .price { font-weight: 600; margin-top: 4px; }
.item-row .price small { color: var(--muted); font-weight: 400; }
.thumb { position: relative; flex: none; width: 96px; height: 96px; }
.thumb img { width: 100%; height: 100%; border-radius: 14px; object-fit: cover; background: var(--surface-2); display: block; }
.thumb .add { position: absolute; bottom: -6px; inset-inline-end: -6px; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: var(--accent); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 20px; font-weight: 600; }
.thumb .qty-tag { position: absolute; top: 6px; inset-inline-start: 6px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.empty-search { text-align: center; color: var(--muted); padding: 40px 0; }
/* Mic sits beside the cart bar, on the side away from the item photos. */
.fab-mic { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); inset-inline-start: 20px; width: 56px; height: 56px; border-radius: 50%; background: var(--surface); color: var(--accent); box-shadow: var(--shadow); display: grid; place-items: center; z-index: 3; }
.cart-bar { position: absolute; inset-inline-start: 86px; inset-inline-end: 20px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 3; display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: var(--shadow-accent); animation: up .25s var(--ease); }
.cart-bar span:nth-child(2) { flex: 1; text-align: start; }
.cart-count { min-width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 14px; }

/* ---------- item sheet ---------- */
.item-sheet { padding: 0; overflow-x: hidden; }
.item-img { aspect-ratio: 4 / 3; background: var(--surface-2); }
.item-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-img.noimg { aspect-ratio: auto; height: 56px; }
.sheet-close.on-img { background: var(--surface); box-shadow: var(--shadow); }
.item-body { padding: 18px 20px; display: grid; gap: 8px; }
.item-body h2 { margin: 0; font-size: 21px; }
.item-price { font-size: 18px; font-weight: 700; margin: 0; }
.opt-note { margin: 0; font-size: 13.5px; color: var(--accent); background: var(--accent-soft); padding: 8px 12px; border-radius: 10px; }
.item-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.stepper { display: flex; align-items: center; background: var(--surface-2); border-radius: 12px; }
.stepper button { width: 42px; height: 46px; font-size: 22px; font-weight: 600; color: var(--accent); }
.stepper span { min-width: 24px; text-align: center; font-weight: 700; }
.stepper.sm button { width: 32px; height: 32px; font-size: 18px; }
.btn.grow { flex: 1; padding: 14px; }
.btn.big { padding: 16px; font-size: 17px; border-radius: 14px; box-shadow: var(--shadow-accent); margin-top: 14px; }

/* ---------- option groups ---------- */
.opt-groups { display: grid; gap: 12px; margin: 4px 0; }
.opt-group { border: 0; margin: 0; padding: 12px 14px 6px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-sm); min-width: 0; }
.opt-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 0 0 6px; float: left; }
[dir="rtl"] .opt-head { float: right; }
.opt-head + * { clear: both; }
.opt-head b { display: block; font-size: 15px; }
.opt-head small { color: var(--muted); font-size: 12.5px; }
.opt-badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.opt-badge.req { background: var(--accent-soft); color: var(--accent); }
.opt-badge.ok { background: rgba(59, 138, 94, .12); color: var(--success); }
.opt-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.opt-row input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; flex: none; }
.opt-row input:disabled + .opt-name { color: var(--muted); }
.opt-name { flex: 1; }
.opt-price { color: var(--muted); font-size: 14px; white-space: nowrap; }
.opt-row.on .opt-name { font-weight: 600; }
.btn.primary.dim { background: var(--surface-2); color: var(--muted); box-shadow: none; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.item-sheet .item-actions { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 4px; }

/* ---------- cart sheet ---------- */
.sheet-title { margin: 14px 0 0; font-size: 22px; }
.cart-lines { list-style: none; margin: 12px 0; padding: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.cart-lines li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cart-lines li:last-child { border-bottom: 0; }
.cart-lines img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--surface-2); flex: none; }
.cart-lines .grow { flex: 1; min-width: 0; }
.cart-lines .grow b { display: block; font-weight: 600; font-size: 15px; }
.cart-lines .grow small { color: var(--muted); font-size: 12.5px; display: block; }
.cart-lines .lp { font-weight: 600; font-size: 14px; white-space: nowrap; }
.addr-pick { display: grid; gap: 8px; }
.addr-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.addr-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.addr-opt input { accent-color: var(--accent); margin-top: 4px; }
.addr-opt small { display: block; color: var(--muted); font-size: 13px; }
.plain-input { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 11px 12px; outline: none; }
.plain-input:focus { border-color: var(--accent); }
#cartSheet .totals { padding: 4px 4px 0; border-top: 0; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: calc(120px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 40; box-shadow: var(--shadow); animation: rise .2s var(--ease); max-width: calc(100vw - 32px); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
