:root {
  --green: #3E632F;
  --green-2: #5C7F4C;
  --green-soft: #EDF2E6;
  --ground: #F7F3EA;
  --surface: #FFFFFF;
  --ink: #1B1F1C;
  --muted: #5B635D;
  --line: #E6E0D3;
  --line-2: #D9D2C3;
  --honey: #E0A93B;
  --honey-soft: #FBF1DC;
  --honey-ink: #4A3410;
  --danger: #9A2B12;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; }
.display { font-family: 'Reem Kufi', sans-serif; font-weight: 700; color: var(--green); }
.wrap { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; background: var(--ground); }
@media (min-width: 600px) { body { background: #E9E3D6; } .wrap { box-shadow: 0 0 0 1px var(--line); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pad { padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.bold { font-weight: 700; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* hero */
.hero { background: var(--green); color: #F7F3EA; padding: 18px 22px 28px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.hero .top { display: flex; justify-content: flex-end; }
.hero .logo { width: 150px; margin: -8px auto 0; }
.hero p { margin: 0; color: #E3EADF; line-height: 1.8; }
.hero .info { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; color: #F1F4EE; }
.hero .info span { display: inline-flex; gap: 8px; align-items: center; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--green); display: inline-flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0; }
.hero .icon-btn { background: transparent; border-color: var(--green-2); color: #F7F3EA; }
.badge { position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--honey); color: var(--green); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.btn { min-height: 52px; border-radius: 14px; border: none; padding: 0 20px; font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-honey { background: var(--honey); color: var(--green); }
.btn-green { background: var(--green); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--green); color: var(--green); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, .tile:focus-visible, .opt:focus-visible, .chip:focus-visible, .cat-card:focus-visible, .item:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }
.notice { background: var(--honey-soft); color: var(--honey-ink); border-radius: 12px; padding: 12px 14px; }
.last-order { margin: 16px 16px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; text-decoration: none; color: var(--ink); }

/* categories */
.section-head { padding: 22px 16px 8px; display: flex; justify-content: space-between; align-items: baseline; }
.section-head h2 { font-size: 24px; }
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 8px 16px 120px; }
.cat-card { padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; text-align: right; display: flex; flex-direction: column; }
.cat-card .img { height: 118px; display: flex; align-items: center; justify-content: center; }
.cat-card .img img { width: 100%; height: 100%; object-fit: cover; }
.cat-card .img img.illus { width: 120px; height: 90px; object-fit: contain; }
.cat-card .txt { padding: 10px 12px 12px; display: flex; flex-direction: column; }
.cat-card .name { font-size: 17px; font-weight: 700; }
.cat-card.wide { grid-column: span 2; flex-direction: row; }
.cat-card.wide .img { width: 50%; height: auto; min-height: 118px; }
.cat-card.wide .txt { justify-content: center; }

/* category page */
.cat-head { padding: 16px 14px 20px; display: flex; flex-direction: column; gap: 12px; }
.cat-head .icon-btn { background: rgba(255,255,255,.85); border: none; }
.cat-head h1 { font-size: 32px; }
.items { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 120px; }
.item { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: right; width: 100%; }
.item .thumb { width: 80px; height: 80px; border-radius: 12px; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item .thumb img.illus { width: 70px; height: 52px; object-fit: contain; }
.item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .name { font-size: 16px; font-weight: 600; }
.item .price { font-weight: 700; color: var(--green); }
.item .plus { width: 40px; height: 40px; border-radius: 12px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.item[disabled] { opacity: .55; }
.item[disabled] .plus { background: var(--line-2); }
.tag-out { font-size: 12px; color: var(--danger); font-weight: 600; }

/* cart bar */
.cartbar { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); width: calc(100% - 32px); max-width: 528px; z-index: 5; }
.cartbar .btn { width: 100%; height: 56px; justify-content: space-between; border-radius: 16px; box-shadow: 0 8px 24px rgba(62,99,47,.3); font-weight: 600; }
.cartbar .count { min-width: 28px; height: 28px; border-radius: 8px; background: var(--honey); color: var(--green); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

/* sheet */
.overlay { position: fixed; inset: 0; background: rgba(20,32,25,.5); z-index: 10; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.overlay .backdrop { flex: 1; width: 100%; border: none; background: transparent; }
.sheet { width: 100%; max-width: 560px; background: var(--ground); border-radius: 24px 24px 0 0; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; overflow: hidden; }
.sheet.anim { animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet.anim { animation: none; } }
.sheet .scroll { overflow-y: auto; }
.sheet .hero-img { height: 170px; position: relative; display: flex; align-items: center; justify-content: center; }
.sheet .hero-img img { width: 100%; height: 100%; object-fit: cover; }
.sheet .hero-img img.illus { width: 150px; height: 112px; object-fit: contain; }
.sheet .hero-img .icon-btn { position: absolute; top: 12px; left: 12px; border-radius: 22px; border: none; background: rgba(255,255,255,.92); }
.sheet .content { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.sheet h2 { font-size: 24px; }
.group-title { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.opt { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: right; }
.opt[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.opt .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #B9B2A3; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #fff; }
.opt[aria-pressed="true"] .box { background: var(--green); border-color: var(--green); }
.opt .grow { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--green); font-weight: 600; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { min-height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 8px; }
.tile[aria-pressed="true"] { border: 2px solid var(--green); background: var(--green-soft); color: var(--green); }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.field input, .field textarea { min-height: 48px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); padding: 10px 14px; font-weight: 400; font-size: 16px; width: 100%; }
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.sheet-foot { display: flex; gap: 10px; align-items: center; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--ground); color: var(--green); font-size: 20px; }
.stepper .n { min-width: 24px; text-align: center; font-weight: 700; }

/* pages with a top bar */
.page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; gap: 10px; padding: 14px 12px 12px; border-bottom: 1px solid var(--line); background: var(--ground); position: sticky; top: 0; z-index: 3; }
.bar h1 { font-size: 22px; }
.page .main { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.foot { position: sticky; bottom: 0; border-top: 1px solid var(--line); background: var(--surface); padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.line-note { font-size: 13px; color: #6B4A12; background: var(--honey-soft); border-radius: 8px; padding: 6px 10px; }
.soft { background: var(--green-soft); color: var(--green); border-radius: 12px; padding: 12px 14px; }
.pay { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); text-align: right; }
.pay[aria-pressed="true"] { border: 2px solid var(--green); background: var(--green-soft); }
.pay .dot { width: 20px; height: 20px; border-radius: 10px; border: 2px solid #B9B2A3; flex-shrink: 0; background: #fff; }
.pay[aria-pressed="true"] .dot { border: 6px solid var(--green); }
.pay .t { font-weight: 700; display: block; }
.pay .s { font-size: 13px; color: var(--muted); display: block; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { background: #fff; border-radius: 10px; padding: 10px 12px; }
.stat .k { font-size: 12px; color: #6B5A3A; }
.stat .v { font-size: 18px; font-weight: 700; }
.map { width: 100%; height: 170px; border: 0; border-radius: 12px; background: var(--green-soft); }
.error { color: var(--danger); font-size: 14px; }
.file-btn { min-height: 46px; border-radius: 12px; border: 1px dashed var(--green-2); background: transparent; color: var(--green); font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 8px; text-align: center; position: relative; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }

/* tracking */
.done-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-top: 18px; }
.done-head .ok { width: 72px; height: 72px; border-radius: 36px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.done-head .ok.bad { background: var(--danger); }
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 12px; align-items: center; color: var(--muted); }
.step .d { width: 12px; height: 12px; border-radius: 6px; border: 2px solid #B9B2A3; flex-shrink: 0; }
.step.done { color: var(--ink); }
.step.done .d { background: var(--green); border-color: var(--green); }
.step.current { color: var(--ink); font-weight: 700; }
.step.current .d { background: var(--honey); border-color: var(--honey); box-shadow: 0 0 0 4px rgba(224,169,59,.25); }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 20; font-size: 14px; max-width: calc(100% - 32px); }
