/* المنيو التجريبي: موبايل أول، يمين لشمال، وألوان المطعم من متغيرات بتتبدّل (data-theme) */
:root {
  --bg: #FAF7F2; --card: #FFFFFF; --ink: #1F1B16; --muted: #6E665C; --line: #ECE5DA;
  --accent: #9A6B2F; --accent-ink: #FFFFFF; --soft: #F3ECE1;
  --sold: #B9B2A8; --radius: 18px;
  --sans: "IBM Plex Sans Arabic", system-ui, sans-serif; --head: "Noto Kufi Arabic", var(--sans);
}
:root[data-theme="olive"] { --accent: #4F6B3A; --soft: #EEF1E6; }
:root[data-theme="wine"] { --accent: #7A2E3A; --soft: #F4E9EA; }
:root[dir="ltr"] { --head: var(--sans); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #E9E3D9; color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; }
body > * { max-width: 560px; margin-inline: auto; }
main { background: var(--bg); padding: 0 16px 120px; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { display: block; }
.price { direction: ltr; unicode-bidi: isolate; font-weight: 600; white-space: nowrap; }

/* شريط كار */
.kaar-bar { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 9px 14px; background: #1C1F2B; color: #F1EBDF;
  font-size: 13.5px; text-decoration: none; text-align: center; }
.kaar-bar b { color: #E9A0A9; font-weight: 600; }

/* الغلاف */
.hero { position: relative; height: 300px; overflow: hidden; color: #fff; background: #000; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, #0006 0%, #0000 35%, #000c 100%); }
.hero-top { position: absolute; top: 14px; inset-inline: 14px; display: flex; justify-content: space-between; }
.chip-btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 99px; background: #0007; color: #fff; font-size: 14px; backdrop-filter: blur(6px); }
.chip-btn .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #fff8; }
.hero-body { position: absolute; bottom: 18px; inset-inline: 18px; }
.logo { width: 58px; height: 58px; border-radius: 16px; background: var(--accent); display: grid; place-items: center; font: 700 30px var(--head); margin-bottom: 10px; box-shadow: 0 6px 20px #0005; }
.hero h1 { margin: 0; font: 700 26px/1.4 var(--head); }
.hero p { margin: 2px 0 0; font-size: 14.5px; opacity: .9; }
.hours { display: flex; align-items: center; gap: 7px; }
.live { width: 8px; height: 8px; border-radius: 50%; background: #5CD08B; box-shadow: 0 0 0 4px #5cd08b33; }

/* الأقسام */
.cats { position: sticky; top: 0; z-index: 20; display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; background: var(--bg);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button { flex: none; padding: 7px 16px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-weight: 500; font-size: 15px; transition: .2s; }
.cats button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* البحث */
.search { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; padding: 0 14px; height: 48px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.search svg { width: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; border: 0; outline: 0; background: none; font: inherit; color: var(--ink); }

/* الأكثر طلبا */
.popular h2, .section h2 { font: 700 19px/1.5 var(--head); margin: 22px 0 12px; }
.popular-row { display: flex; gap: 12px; overflow-x: auto; margin-inline: -16px; padding: 0 16px 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.popular-row::-webkit-scrollbar { display: none; }
.pop { flex: none; width: 150px; scroll-snap-align: start; text-align: start; }
.pop img { width: 150px; height: 150px; border-radius: var(--radius); object-fit: cover; }
.pop b { display: block; margin-top: 8px; font-weight: 600; font-size: 15px; line-height: 1.4; }
.pop .price { color: var(--accent); font-size: 14.5px; }

/* الأصناف */
.section { scroll-margin-top: 64px; }
.item { width: 100%; display: flex; gap: 14px; align-items: stretch; padding: 12px; margin-bottom: 12px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line); text-align: start; transition: transform .15s; }
.item:active { transform: scale(.985); }
.item img { width: 104px; height: 104px; flex: none; border-radius: 14px; object-fit: cover; }
.item .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item b { font-weight: 600; font-size: 16.5px; line-height: 1.45; }
.item p { margin: 3px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .row { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item .row .price { font-size: 16px; }
.add { width: 34px; height: 34px; border-radius: 50%; background: var(--soft); color: var(--accent); display: grid; place-items: center; font-size: 22px; line-height: 1; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 99px; background: var(--soft); color: var(--accent); }
.tag.sold { background: #EFEBE5; color: #8A8178; }
.item.is-sold img { filter: grayscale(1); opacity: .55; }
.item.is-sold b, .item.is-sold .price { color: var(--sold); }

/* وضع صاحب المطعم */
.owner-bar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 10px 16px; background: #1C1F2B; color: #F1EBDF; font-size: 13.5px; }
.owner-bar strong { color: #E9A0A9; }
.owner-bar button { padding: 4px 12px; border-radius: 99px; background: #ffffff1f; font-size: 13px; }
.owner-ctl { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.owner-ctl button { padding: 3px 10px; border-radius: 10px; background: var(--soft); font-weight: 600; }
.owner-ctl .price { min-width: 52px; text-align: center; }
.owner-ctl .soldbtn { margin-inline-start: auto; font-size: 13px; }
.owner-ctl .soldbtn.on { background: #1C1F2B; color: #fff; }
body.owner .item { cursor: default; }
body.owner .add, body.owner .order-fab { display: none; }

.empty { text-align: center; color: var(--muted); padding: 30px 0; }
.foot { margin-top: 36px; display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.owner-try { width: 100%; padding: 14px; border-radius: var(--radius); border: 1.5px dashed var(--accent); color: var(--accent); font-weight: 600; background: var(--soft); }
.foot a { color: var(--muted); }

/* زر طلبي */
.order-fab { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); inset-inline: 16px; z-index: 40; max-width: 528px; margin-inline: auto; display: flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 18px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 12px 30px #0003; animation: up .3s ease; }
.order-fab .count { min-width: 28px; height: 28px; border-radius: 9px; background: #ffffff33; display: grid; place-items: center; }
.order-fab .sum { margin-inline-start: auto; }
.order-fab.bump { animation: bump .35s ease; }
@keyframes up { from { transform: translateY(80px); } }
@keyframes bump { 40% { transform: scale(1.04); } }

/* الشيتات */
.sheet-back { position: fixed; inset: 0; max-width: none; z-index: 50; background: #0008; animation: fade .2s; }
.sheet { position: fixed; bottom: 0; inset-inline: 0; z-index: 60; max-width: 560px; margin-inline: auto; max-height: 92vh; overflow-y: auto; background: var(--bg);
  border-radius: 24px 24px 0 0; animation: rise .28s cubic-bezier(.2,.8,.2,1); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(100%); } }
.sheet .close { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; background: #0008; color: #fff; font-size: 20px; }
.item-sheet img.big { width: 100%; height: 300px; object-fit: cover; }
.sheet .pad { padding: 18px 18px 8px; }
.sheet h3 { margin: 0; font: 700 22px/1.45 var(--head); }
.sheet .desc { color: var(--muted); margin: 6px 0 0; }
.sheet .head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sheet .head-row .price { font-size: 21px; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.chips span { padding: 3px 12px; border-radius: 99px; background: var(--soft); font-size: 13.5px; }
.group { margin-top: 20px; }
.group h4 { margin: 0 0 8px; font-size: 15px; color: var(--muted); font-weight: 600; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.opt input { width: 20px; height: 20px; accent-color: var(--accent); }
.opt .price { margin-inline-start: auto; color: var(--muted); font-weight: 500; }
.note-in { width: 100%; margin-top: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font: inherit; resize: none; }
.add-row { position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; padding: 14px 18px; background: var(--bg); border-top: 1px solid var(--line); }
.qty { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.qty button { width: 42px; height: 48px; font-size: 22px; }
.qty span { min-width: 22px; text-align: center; font-weight: 600; }
.cta { flex: 1; height: 50px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; }
.cta[disabled] { background: var(--sold); cursor: not-allowed; }

.order-sheet .pad { padding-top: 26px; }
.line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line img { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; }
.line .info { flex: 1; min-width: 0; }
.line b { font-weight: 600; }
.line small { display: block; color: var(--muted); font-size: 13px; }
.line .qty { margin-top: 6px; width: max-content; }
.line .qty button { width: 34px; height: 34px; font-size: 18px; }
.total { display: flex; justify-content: space-between; padding: 16px 0 6px; font-size: 18px; font-weight: 700; }
.total .price { color: var(--accent); }
.show-waiter { margin: 10px 0 4px; padding: 14px; border-radius: 14px; border: 1.5px dashed var(--accent); background: var(--soft); text-align: center; font-weight: 600; }
.show-waiter small { display: block; font-weight: 400; color: var(--muted); }
.clear { display: block; margin: 12px auto 0; color: var(--muted); text-decoration: underline; font-size: 14px; }

.toast { position: fixed; top: 16px; inset-inline: 16px; max-width: 360px; margin-inline: auto; z-index: 80; padding: 12px 16px; border-radius: 14px; background: #1C1F2B; color: #fff;
  text-align: center; font-size: 14.5px; opacity: 0; transform: translateY(-10px); transition: .25s; pointer-events: none; }
.toast.on { opacity: 1; transform: none; }

@media (min-width: 600px) { body { padding: 24px 0; } .hero { border-radius: 24px 24px 0 0; } .kaar-bar { border-radius: 14px; margin-bottom: 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
