/* Mida — public menu page (what the café's customers see). Light, fast, appetizing. */
:root {
  --accent: #D9481F; --ink: #1A1611; --ink-2: #4A4239; --muted: #7A7062; --line: #EEE6D9;
  --bg: #FBF7F0; --card: #FFFFFF; --soft: #F4EEE4; --wa: #1FA855;
  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
html[dir="rtl"] body { font-family: 'Geeza Pro', 'Noto Kufi Arabic', Tahoma, system-ui, sans-serif; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Cover ---------- */
.cover { position: relative; min-height: 230px; display: flex; align-items: flex-end; overflow: hidden; color: #fff;
  background: radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--accent) 90%, #fff 10%), transparent 60%),
              linear-gradient(160deg, #1d150e 0%, color-mix(in srgb, var(--accent) 45%, #1d150e) 60%, var(--accent) 130%); }
.cover::before { content: ''; position: absolute; inset: 0; background: url("../img/zellige.svg") center/86px repeat; opacity: .22; mix-blend-mode: screen; }
.cover::after { content: ''; position: absolute; inset: auto 0 0 0; height: 70%; background: linear-gradient(to top, rgba(0,0,0,.45), transparent); }
.cover-in { position: relative; z-index: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 60px 16px 22px; display: flex; gap: 14px; align-items: flex-end; }
.logo { flex: none; width: 76px; height: 76px; border-radius: 22px; background: #fff; display: grid; place-items: center; overflow: hidden;
  font: 800 34px/1 var(--display); color: var(--accent); box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); border: 3px solid rgba(255,255,255,.9); }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.cover-txt { min-width: 0; }
h1 { font: 800 clamp(1.8rem, 7.5vw, 2.5rem)/1.05 var(--display); letter-spacing: -.03em; margin: 0 0 4px; text-wrap: balance; text-shadow: 0 2px 16px rgba(0,0,0,.25); }
.tagline { margin: 0; color: rgba(255,255,255,.85); font-size: .95rem; }
.langs { position: absolute; z-index: 2; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; display: flex; gap: 2px; background: rgba(0,0,0,.35);
  padding: 4px; border-radius: 99px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
html[dir="rtl"] .langs { right: auto; left: 12px; }
.langs button { border: 0; background: none; color: #fff; padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: .8rem; cursor: pointer; }
.langs button[aria-pressed="true"] { background: #fff; color: var(--ink); }

.infos { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; }
.ichip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: var(--card); border: 1px solid var(--line);
  font-size: .84rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.ichip.live { color: #11643A; background: #E6F5EC; border-color: #CBEBD8; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #1FA855; box-shadow: 0 0 0 0 rgba(31,168,85,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(31,168,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,168,85,0); } }

/* ---------- Category nav ---------- */
.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); margin-top: 12px; border-bottom: 1px solid transparent; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; max-width: 680px; margin: 0 auto; scroll-behavior: smooth; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 1px solid var(--line); background: var(--card); padding: 9px 15px; border-radius: 99px; font-weight: 700; font-size: .9rem;
  cursor: pointer; white-space: nowrap; transition: background .2s, color .2s, transform .15s; }
.chips button:active { transform: scale(.97); }
.chips button[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.search { width: 100%; margin: 12px 0 0; padding: 13px 16px 13px 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A7062' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 14px center/18px no-repeat; font: inherit; font-size: 16px; }
html[dir="rtl"] .search { padding: 13px 42px 13px 16px; background-position: calc(100% - 14px) center; }
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Sections & cards ---------- */
.cat { padding-top: 26px; scroll-margin-top: 66px; }
.cat-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cat-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.cat h2 { font: 800 1.35rem/1.1 var(--display); letter-spacing: -.02em; margin: 0; }
.cat-n { margin-inline-start: auto; font-size: .78rem; font-weight: 700; color: var(--muted); background: var(--soft); padding: 4px 9px; border-radius: 99px; }
.cards { display: grid; gap: 10px; }
.item { display: flex; gap: 14px; align-items: stretch; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 1px 2px rgba(26,22,17,.04), 0 8px 24px -18px rgba(26,22,17,.25);
  animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.vis { flex: none; width: 96px; height: 96px; border-radius: 16px; object-fit: cover; background: var(--soft); }
.emo { display: grid; place-items: center; font-size: 42px; line-height: 1; }
.item .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item h3 { font: 700 1.04rem/1.25 var(--display); margin: 2px 0 3px; letter-spacing: -.01em; }
.item p { margin: 0 0 8px; color: var(--muted); font-size: .88rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font: 800 1.05rem/1 var(--display); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, #fff); padding: 7px 11px; border-radius: 10px; }
.item.off { opacity: .6; }
.item.off .vis { filter: grayscale(1); }
.item.off .price { color: var(--muted); background: var(--soft); text-decoration: line-through; }
.soldout { font-size: .74rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: #B42318; background: #FDECEA; padding: 6px 10px; border-radius: 99px; }
.add { width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--ink); color: #fff; font-size: 1.4rem; font-weight: 600; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: transform .15s, background .2s; }
.add:active { transform: scale(.9); }
.qty { display: inline-flex; align-items: center; gap: 2px; border-radius: 12px; background: var(--ink); color: #fff; padding: 2px; }
.qty button { width: 34px; height: 34px; border: 0; background: none; color: #fff; border-radius: 10px; font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.qty span { min-width: 18px; text-align: center; font-weight: 800; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.empty h1 { color: var(--ink); text-shadow: none; }

/* ---------- Cart ---------- */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 60%, transparent); transform: translateY(120%); transition: transform .3s var(--ease); }
.cartbar.show { transform: none; }
.cartbar button { width: 100%; max-width: 648px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; border: 0; border-radius: 18px;
  padding: 16px 20px; background: var(--wa); color: #fff; font-weight: 800; font-size: 1rem; cursor: pointer; box-shadow: 0 14px 28px -12px rgba(31,168,85,.75); }
dialog { border: 0; padding: 0; width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; margin: auto auto 0; max-height: 90dvh; background: var(--card); color: var(--ink); }
dialog[open] { animation: up .3s var(--ease); }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
dialog::backdrop { background: rgba(0,0,0,.45); }
@media (min-width: 700px) { dialog { border-radius: 24px; margin: auto; } }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font: 800 1.25rem var(--display); }
.dlg-body { padding: 8px 18px 18px; overflow-y: auto; }
.x { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: none; cursor: pointer; }
.line { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.total { display: flex; justify-content: space-between; font: 800 1.15rem var(--display); padding: 14px 0; }
label.f { display: block; font-weight: 600; font-size: .9rem; margin: 10px 0 6px; }
.in { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); font: inherit; font-size: 16px; background: #fff; }
.send { width: 100%; margin-top: 16px; border: 0; border-radius: 16px; padding: 16px; background: var(--wa); color: #fff; font-weight: 800; font-size: 1rem; cursor: pointer; }
.note { font-size: .82rem; color: var(--muted); margin-top: 10px; text-align: center; }
pre.preview { white-space: pre-wrap; background: var(--soft); padding: 12px; border-radius: 12px; font: .88rem/1.45 ui-monospace, Menlo, monospace; }

/* ---------- Footer ---------- */
.badge { display: flex; justify-content: center; margin: 40px 0 120px; }
.badge a { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; font-size: .85rem; color: var(--muted); padding: 9px 15px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); }
.badge a b { color: var(--ink); }
.foot { height: 120px; }
.toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 50; width: min(92vw, 400px); display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; opacity: 0; transition: opacity .2s; }
.toast.in { opacity: 1; }

/* ---------- Loading skeleton ---------- */
.sk { background: linear-gradient(90deg, #F2ECE2 25%, #E9E1D4 37%, #F2ECE2 63%); background-size: 400% 100%; animation: sh 1.3s ease infinite; border-radius: 12px; }
.cover.sk { min-height: 230px; border-radius: 0; }
.sk-logo { width: 76px; height: 76px; border-radius: 22px; margin-top: -40px; position: relative; }
.sk-line { height: 18px; margin: 14px 0 0; }
.w60 { width: 60%; } .w40 { width: 40%; }
.sk-row { height: 120px; margin-top: 12px; border-radius: 20px; }
@keyframes sh { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .sk, .item, .dot { animation: none; } .cartbar, dialog[open] { transition: none; animation: none; } }

.price, .line b, .total span:last-child, #cart-total { direction: ltr; unicode-bidi: isolate; display: inline-block; }
