:root {
  --bg: #f6f5f3;
  --card: #ffffff;
  --ink: #1c1b19;
  --muted: #8a8578;
  --line: #ece9e3;
  --brand: #e4572e;
  --brand-dark: #c2431f;
  --accent: #2e7d5b;
  --gold: #d9a441;
  --shadow: 0 6px 24px rgba(28,27,25,.08);
  --radius: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  padding-bottom: 96px;
}
img { display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* Header */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 22px 18px 26px;
  border-radius: 0 0 26px 26px;
  box-shadow: var(--shadow);
  position: relative;
}
.hero h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: .3px; }
.hero .sub { opacity: .9; font-size: 13px; margin-top: 4px; }
.hero .lang {
  position: absolute; inset-inline-start: 16px; top: 18px;
  background: rgba(255,255,255,.16); color:#fff; border-radius: 999px;
  padding: 6px 12px; font-size: 12px; font-weight: 700;
}
.branch-row { margin-top: 16px; display: flex; gap: 10px; align-items: center; }
.branch-row select {
  flex: 1; border: none; border-radius: 12px; padding: 12px 14px;
  font-family: inherit; font-size: 14px; color: var(--ink); background:#fff;
}
.pos-badge { font-size: 12px; padding: 6px 10px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.pos-open { background: rgba(46,125,91,.18); color: #d6ffe9; }
.pos-closed { background: rgba(0,0,0,.25); color: #ffd9d0; }

/* Category tabs */
.tabs {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  white-space: nowrap; padding: 9px 16px; border-radius: 999px;
  background: #fff; color: var(--muted); font-weight: 700; font-size: 14px;
  border: 1px solid var(--line); transition: .15s;
}
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Menu */
.menu { padding: 6px 14px 30px; max-width: 720px; margin: 0 auto; }
.cat-title { font-size: 20px; font-weight: 800; margin: 22px 4px 12px; }
.card {
  display: flex; gap: 12px; background: var(--card); border-radius: var(--radius);
  padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow); align-items: center;
}
.card .thumb {
  width: 84px; height: 84px; border-radius: 12px; object-fit: cover;
  background: var(--line) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="%23c9c4ba" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-5-5L5 21"/></svg>') center/40% no-repeat;
  flex-shrink: 0;
}
.card .info { flex: 1; min-width: 0; }
.card .name { font-weight: 800; font-size: 16px; margin: 0 0 3px; }
.card .desc { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .price { color: var(--brand); font-weight: 800; font-size: 15px; }
.card .price .cur { font-size: 11px; font-weight: 700; opacity: .8; }
.add-btn {
  width: 38px; height: 38px; border-radius: 12px; background: var(--brand); color: #fff;
  font-size: 22px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(228,87,46,.35); transition: transform .1s;
}
.add-btn:active { transform: scale(.9); }
.qty-pill { display: flex; align-items: center; gap: 10px; background: var(--brand);
  color:#fff; border-radius: 12px; padding: 4px; }
.qty-pill button { color:#fff; width: 30px; height: 30px; font-size: 20px; font-weight: 700; }
.qty-pill span { min-width: 18px; text-align: center; font-weight: 800; }

/* Cart bar */
.cartbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: transparent; pointer-events: none;
}
.cartbar .inner {
  pointer-events: auto; max-width: 720px; margin: 0 auto;
  background: var(--ink); color: #fff; border-radius: 16px; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 8px 30px rgba(0,0,0,.28); transform: translateY(0); transition: .25s;
}
.cartbar.hidden .inner { transform: translateY(160%); }
.cartbar .count { background: var(--brand); border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: 13px; }
.cartbar .total { font-weight: 800; font-size: 17px; }
.cartbar .go { display: flex; align-items: center; gap: 10px; font-weight: 800; }

/* Sheet (cart / checkout) */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; opacity: 0;
  pointer-events: none; transition: .2s; }
.overlay.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 60; background: var(--bg);
  border-radius: 22px 22px 0 0; max-width: 720px; margin: 0 auto;
  transform: translateY(100%); transition: .28s cubic-bezier(.2,.8,.2,1);
  max-height: 92vh; display: flex; flex-direction: column;
}
.sheet.show { transform: translateY(0); }
.sheet .grab { width: 44px; height: 5px; background: #d8d3ca; border-radius: 999px; margin: 10px auto; }
.sheet .head { display: flex; align-items: center; justify-content: space-between; padding: 4px 18px 12px; }
.sheet .head h2 { margin: 0; font-size: 19px; font-weight: 800; }
.sheet .head .x { font-size: 24px; color: var(--muted); width: 34px; height: 34px; }
.sheet .body { overflow-y: auto; padding: 4px 18px 18px; }

.line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line .lname { flex: 1; font-weight: 700; }
.line .lprice { color: var(--brand); font-weight: 800; }

.field { margin: 14px 0; }
.field label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-family: inherit; font-size: 14.5px; background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: 2px solid rgba(228,87,46,.35); border-color: var(--brand); }
.seg { display: flex; gap: 10px; }
.seg .opt { flex: 1; border: 1.5px solid var(--line); background:#fff; border-radius: 14px;
  padding: 14px; text-align: center; font-weight: 800; color: var(--muted); }
.seg .opt.active { border-color: var(--brand); color: var(--brand); background: #fff5f2; }
.seg .opt .ic { font-size: 22px; display:block; margin-bottom: 4px; }

.summary { background:#fff; border-radius: 14px; padding: 14px 16px; margin-top: 10px; box-shadow: var(--shadow); }
.summary .row { display: flex; justify-content: space-between; padding: 5px 0; color: var(--muted); font-size: 14px; }
.summary .row.total { color: var(--ink); font-weight: 800; font-size: 18px; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; }

.cta {
  width: 100%; background: var(--brand); color: #fff; font-weight: 800; font-size: 17px;
  border-radius: 14px; padding: 16px; margin-top: 16px; box-shadow: 0 6px 18px rgba(228,87,46,.35);
}
.cta:disabled { background: #c9c4ba; box-shadow: none; }
.cta.secondary { background: var(--ink); box-shadow:none; }

.note { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 12px; line-height: 1.6; }
.brandline { text-align:center; color: var(--muted); font-size: 12px; padding: 18px; }

/* Tracking */
.track-wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px; }
.steps { margin: 24px 0; }
.step { display: flex; gap: 14px; padding: 4px 0; }
.step .dot { width: 26px; height: 26px; border-radius: 999px; background: var(--line);
  display: grid; place-items: center; color:#fff; font-size: 14px; flex-shrink: 0; }
.step.done .dot { background: var(--accent); }
.step.active .dot { background: var(--brand); box-shadow: 0 0 0 5px rgba(228,87,46,.18); }
.step .bar { width: 2px; background: var(--line); margin: 0 12px; }
.step.done .bar { background: var(--accent); }
.step .lbl { font-weight: 700; padding-top: 2px; }
.step.pending .lbl { color: var(--muted); }
.skeleton { background: linear-gradient(90deg,#eee,#f5f5f5,#eee); background-size: 200% 100%;
  animation: sh 1.2s infinite; border-radius: 8px; }
@keyframes sh { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
