/* تطبيق الزبون — موبايل أول */
html, body { height: auto; min-height: 100%; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.hdr { position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--cream); padding: 10px 14px; display: flex; gap: 12px; align-items: center; }
.hdr .brand { color: var(--cream); text-decoration: none; }
.hdr .brand img { border-radius: 9px; }
.hdr .brand .name { color: var(--cream); }
.hdr .search { flex: 1; }
.hdr .search input { background: #fff; border: 0; min-height: 42px; }
main { max-width: 980px; margin: 0 auto; padding: 14px; }

.tabs { position: fixed; bottom: 0; inset-inline: 0; z-index: 20; background: var(--panel); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; text-decoration: none; color: var(--muted); font-size: .78rem; font-weight: 600; position: relative; }
.tabs a span { font-size: 1.3rem; }
.tabs a[aria-current="page"] { color: var(--forest); }
.tabs a[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 36px; height: 3px; border-radius: 0 0 3px 3px; background: var(--forest); }
.badge { position: absolute; top: 6px; inset-inline-start: calc(50% + 6px); background: var(--clay); color: #fff; border-radius: 999px; font-size: .7rem; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }

.hero { background: var(--forest); color: var(--cream); border-radius: 16px; padding: 18px; margin-bottom: 16px; background-image: repeating-linear-gradient(56deg, rgba(255,255,255,.05) 0 12px, transparent 12px 24px); }
.hero h1 { font-size: 1.3rem; margin-bottom: 4px; }
.hero p { margin: 0; opacity: .9; font-size: .92rem; }
.closed { background: #f6e3d3; color: var(--warn); border-radius: 12px; padding: 12px; margin-bottom: 12px; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-bottom: 18px; }
.cats a { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 6px; text-align: center; text-decoration: none; color: var(--ink); font-size: .82rem; font-weight: 600; min-height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.cats a .e { font-size: 1.6rem; }
.strip-h { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 10px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 158px; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.strip > * { scroll-snap-align: start; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }

.p { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.p .img { aspect-ratio: 1; background: var(--sage-l); display: grid; place-items: center; font-size: 2.4rem; color: var(--forest); font-weight: 700; position: relative; }
.p .img img { width: 100%; height: 100%; object-fit: cover; }
.p .img .pill { position: absolute; top: 8px; inset-inline-start: 8px; }
.p .body { padding: 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.p .nm { font-size: .9rem; font-weight: 600; line-height: 1.35; min-height: 2.7em; }
.p .unit { font-size: .75rem; color: var(--muted); }
.p .pr { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.p .pr b { font-size: 1.05rem; }
.p .pr s { color: var(--muted); font-size: .8rem; }
.p .pr.offer b { color: var(--clay); }
.p .add { margin: 0 10px 10px; }
.p .add .btn { width: 100%; min-height: 42px; }
.stepper { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--forest); border-radius: 10px; overflow: hidden; }
.stepper button { width: 44px; min-height: 42px; border: 0; background: var(--forest); color: #fff; font-size: 1.2rem; cursor: pointer; }
.stepper span { font-weight: 700; }

.list .row-i { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list .row-i .grow { min-width: 0; }
.sum-box { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); margin-top: 14px; }
.sum-line { display: flex; justify-content: space-between; padding: 3px 0; }
.sum-line.total { font-size: 1.2rem; font-weight: 700; color: var(--forest); border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.opt input { width: auto; min-height: auto; margin-top: 4px; }
.opt:has(input:checked) { border-color: var(--forest); box-shadow: 0 0 0 2px var(--sage-l); }

.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 14px 0; }
.stage { text-align: center; font-size: .75rem; color: var(--muted); }
.stage .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--line); margin: 0 auto 4px; display: grid; place-items: center; font-size: .9rem; }
.stage.done .dot { background: var(--sage); color: #fff; }
.stage.now .dot { background: var(--forest); color: #fff; box-shadow: 0 0 0 4px var(--sage-l); }
.stage.now { color: var(--forest); font-weight: 700; }
.ol li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ol li.removed { color: var(--muted); }
.ol li.removed .n { text-decoration: line-through; }
.ol { list-style: none; padding: 0; margin: 8px 0; }

.qr { background: #fff; border-radius: 16px; padding: 14px; width: min(280px, 100%); margin: 10px auto; }
.qr svg { width: 100%; height: auto; display: block; }
.code { font-family: "Montserrat", monospace; font-size: 2rem; letter-spacing: .25em; text-align: center; font-weight: 700; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; width: min(280px, 100%); margin: 6px auto; }
.bar i { display: block; height: 100%; background: var(--sage); transition: width 1s linear; }
.bal { text-align: center; font-size: 2rem; font-weight: 700; color: var(--forest); }
.bal.neg { color: var(--bad); }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-decoration: none; color: var(--ink); font-weight: 600; cursor: pointer; text-align: start; }
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(30,31,28,.45); display: flex; align-items: flex-end; }
.sheet > div { background: var(--panel); width: 100%; max-height: 88vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px; }
@media (min-width: 760px) { .sheet { align-items: center; justify-content: center; } .sheet > div { width: min(640px, 100%); border-radius: 18px; } }
html { scroll-padding-bottom: 96px; scroll-padding-top: 70px; }
#toasts { bottom: calc(78px + env(safe-area-inset-bottom)); }
