/* Darakum — readability pass: calmer, smaller type (IBM Plex Sans Arabic), back button, compact filters, account menus. Loaded last. */
:root { --font: 'Plex Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif; }
html { font-size: 15px; }
body { font-family: var(--font); font-size: 1rem; line-height: 1.6; font-weight: 400; letter-spacing: 0; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: 0; line-height: 1.35; }
h1 { font-size: clamp(1.3rem, 3vw, 1.65rem); font-weight: 700; }
h2 { font-size: clamp(1.08rem, 2.4vw, 1.3rem); }
h3 { font-size: 1rem; }
h4 { font-size: .95rem; }
.small { font-size: .85rem; } .xs { font-size: .76rem; }
.btn { font-size: .95rem; font-weight: 600; min-height: 42px; padding: 0 16px; }
.btn.sm { font-size: .85rem; min-height: 34px; }
.btn.lg { font-size: 1rem; min-height: 48px; }
.chip { font-size: .85rem; padding: 7px 13px; font-weight: 500; }
.pill { font-size: .72rem; font-weight: 600; }
.input, select.input, textarea.input { font-size: 16px; min-height: 44px; }  /* 16px stops iOS zoom-on-focus */
.field > span { font-size: .85rem; font-weight: 600; }
.brand b { font-size: 1.2rem; }
.scard h3 { font-size: .98rem; } .pcard h4 { font-size: .9rem; font-weight: 500; }
.meta { font-size: .78rem; }
.hero2 h1 { font-size: clamp(1.55rem, 4.6vw, 2.5rem); line-height: 1.25; }
.hero2 p.lead { font-size: .98rem; }
.section-h h2 { font-size: 1.15rem; }
.bnav a { font-size: .7rem; }
.ptitle { margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.ptitle .ico { font-size: 1.2em; }
.price { font-weight: 600; }
table.tbl { font-size: .85rem; }
.kpi .v { font-size: 1.2rem; } .kpi .l { font-size: .78rem; }
.side a { font-size: .88rem; } .mnav a { font-size: .82rem; }

/* back button — sits at the top of every inner page */
.backrow { padding-top: 10px; padding-bottom: 0; }
.backbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--green-ink); font-weight: 600; font-size: .85rem; cursor: pointer; box-shadow: var(--shadow-xs, none); transition: background .15s; }
.backbtn:hover { background: var(--peach); }
.backbtn .ico { font-size: 1.05rem; }
.shell .main > .backbtn { margin-bottom: 12px; }

/* search / category page: one search row + one-tap chips, nothing else */
.sbar { position: relative; margin-bottom: 10px; }
.sbar .s-ico { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; pointer-events: none; }
.sbar input { width: 100%; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: 0 42px; font-size: 16px; outline: none; }
.sbar input:focus { border-color: var(--green-ink); box-shadow: 0 0 0 3px var(--focus-ring); }
.fchips { display: flex; gap: 8px; align-items: center; overflow-x: auto; padding: 2px 0 6px; margin-bottom: 8px; scrollbar-width: none; }
.fchips::-webkit-scrollbar { display: none; }
.fchips .chip { box-shadow: none; }
.fchips .chip .ico { font-size: 1rem; }
.fchips .chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.fchips .vr { width: 1px; height: 20px; background: var(--line); flex-shrink: 0; }
.fchips.cats .chip { background: transparent; }

/* account */
.prof-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.prof-head .pi { flex: 1; min-width: 0; } .prof-head h2 { margin: 0; font-size: 1.1rem; }
.avatar.big { width: 56px; height: 56px; font-size: 1.3rem; flex-shrink: 0; }
.gear { border: 1px solid var(--line); background: var(--surface); border-radius: 50%; width: 44px; height: 44px; color: var(--green-ink); }
.gear:hover { background: var(--peach); }
.card.menu { padding: 4px 0; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 13px 16px; color: var(--ink); border-bottom: 1px solid var(--line); }
.mrow:last-child { border-bottom: 0; }
.mrow:hover { background: var(--peach); color: var(--ink); }
.mrow .mi, .set-h .mi { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--green-100); color: var(--green-ink); flex-shrink: 0; font-size: 1.1rem; }
.mrow .ml { flex: 1; font-weight: 500; }
.mrow em { font-style: normal; background: var(--terra); color: #fff; border-radius: 99px; padding: 0 8px; font-size: .75rem; }
.mrow .mc { color: var(--muted); display: grid; }
.set-jump { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 12px; scrollbar-width: none; }
.set-jump a { flex-shrink: 0; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; font-weight: 500; }
.set-sec { scroll-margin-top: 84px; }
.set-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.set-h h3 { margin: 0; } .set-h p { margin: 0; }
.set-sec .form { max-width: 520px; }

/* order note on the cart page */
.note-card { display: grid; gap: 8px; margin-top: 12px; }
.note-card .nt { font-weight: 600; display: flex; align-items: center; gap: 6px; font-size: .92rem; }
.note-card textarea { min-height: 64px; resize: vertical; }

/* ===== round 2 ===== */
/* back button stays put while scrolling */
.backrow { position: sticky; top: 64px; z-index: 30; pointer-events: none; height: 0; padding: 0; overflow: visible; }
.backrow .backbtn { pointer-events: auto; margin-top: 10px; box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.12)); }
.backrow + * { padding-top: 0; }
main > .backrow ~ .container.section, main > .backrow ~ .section { padding-top: 62px; }
main > .backrow ~ .container:not(.section) { padding-top: 56px; }
.shell .main > .backbtn { position: sticky; top: 84px; z-index: 30; box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.12)); }
@media (min-width: 760px) { .backrow { top: 72px; } }

/* header: location chip */
.loc-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 260px; height: 44px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--green-ink); cursor: pointer; text-align: start; flex: 0 1 auto; }
.loc-chip:hover { background: var(--peach); }
.loc-chip .lp { color: var(--terra-ink); display: grid; font-size: 1.15rem; }
.loc-chip .lt { display: grid; min-width: 0; line-height: 1.25; }
.loc-chip small { font-size: .68rem; color: var(--muted); }
.loc-chip b { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-chip > .ico:last-child { color: var(--muted); font-size: .9rem; }
@media (max-width: 759px) { .hdr .brand > div { display: none; } .loc-chip { flex: 1 1 0; max-width: none; } .hdr-actions { margin-inline-start: 0; } }
.loc-opt { width: 100%; text-align: start; cursor: pointer; background: var(--surface); }
.loc-opt.on { border-color: var(--green); box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 25%, transparent); }

/* language / theme preference buttons */
.pref-grp { display: grid; gap: 8px; margin-bottom: 14px; }
.pref-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pref-opt { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; color: var(--ink); }
.pref-opt i { font-style: normal; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--green-100); color: var(--green-ink); font-weight: 700; }
.pref-opt.on { border-color: var(--green); background: color-mix(in srgb, var(--green) 9%, var(--surface)); }

/* store top bar (replaces the site header on store pages) */
.stbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--cream) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.stbar .container { display: flex; align-items: center; gap: 12px; height: 56px; }
.stbar .stn { flex: 1; min-width: 0; font-size: 1rem; font-weight: 700; color: var(--green-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.backbtn.round { width: 40px; height: 40px; padding: 0; justify-content: center; flex-shrink: 0; }
.backbtn.round .ico { font-size: 1.15rem; }

/* store hero card */
.store-hero .cover { height: 150px; }
@media (min-width: 760px) { .store-hero .cover { height: 220px; } }
.store-card { position: relative; margin-top: -46px; padding: 18px 16px 16px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 18px 40px -18px rgba(20,40,30,.35), 0 0 0 1px color-mix(in srgb, var(--gold, #C9A227) 22%, transparent) inset; margin-bottom: 14px; }
.store-card::before { content: ''; position: absolute; inset-inline: 22px; top: 0; height: 3px; border-radius: 0 0 6px 6px; background: linear-gradient(90deg, var(--gold, #C9A227), var(--terra), var(--gold, #C9A227)); }
.store-card .fav { top: 14px; inset-inline-end: 14px; width: 38px; height: 38px; border: 1px solid var(--line); background: var(--surface); }
.sc-top { display: flex; gap: 14px; align-items: center; padding-inline-end: 44px; }
.sc-top .logo { width: 76px; height: 76px; border-radius: 22px; flex-shrink: 0; overflow: hidden; display: grid; place-items: center; background: var(--peach); border: 3px solid var(--surface); box-shadow: 0 8px 20px -8px rgba(0,0,0,.35), 0 0 0 1.5px var(--gold, #C9A227); font-weight: 700; font-size: 1.8rem; color: var(--green-ink); }
.sc-top .logo img { width: 100%; height: 100%; object-fit: cover; }
.sc-id { min-width: 0; } .sc-id h1 { margin: 0 0 4px; font-size: 1.3rem; }
.sc-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .82rem; }
.sc-sub .ico { font-size: .95rem; vertical-align: -2px; }
.sc-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sc-desc { margin: 14px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.7; }
.sc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin-top: 14px; }
.tile { display: grid; justify-items: center; gap: 1px; padding: 10px 6px; border-radius: 16px; background: var(--cream); border: 1px solid var(--line); text-align: center; font: inherit; color: var(--ink); }
button.tile { cursor: pointer; } button.tile:hover { background: var(--peach); }
.tile i { font-style: normal; color: var(--terra-ink); font-size: 1.15rem; display: grid; }
.tile b { font-size: .92rem; font-weight: 700; color: var(--green-ink); }
.tile small { font-size: .7rem; color: var(--muted); }

/* category sections on the store page */
.sticky-tabs { top: 56px; }
.sticky-tabs .chips { scrollbar-width: none; } .sticky-tabs .chips::-webkit-scrollbar { display: none; }
.sticky-tabs .chip[hidden] { display: none; }
.sticky-tabs .chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.cat-sec { padding-top: 18px; scroll-margin-top: 120px; }
.cat-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cat-h h2 { margin: 0; font-size: 1.1rem; padding-inline-start: 12px; border-inline-start: 4px solid var(--terra); line-height: 1.2; }
.cat-h .cnt { font-size: .75rem; color: var(--muted); background: var(--cream); border: 1px solid var(--line); border-radius: 99px; padding: 1px 9px; }

/* account: the bottom bar already has these on phones */
@media (max-width: 899px) { .acct-tabs { display: none; } }

/* ===== round 3: compact layout — less scrolling ===== */
.section { padding: 14px 0; }
.section-h { margin-bottom: 10px; }
.card { padding: 14px; } .card + .card { margin-top: 10px; }
.grid { gap: 10px; } .stack { gap: 10px; }
.home2 .hsec { padding: 10px 0 2px; }
.home2 .section-h { margin-bottom: 8px; }
.hero2.compact .container { padding-top: 14px; padding-bottom: 16px; gap: 10px; }
.hero2.compact h1 { font-size: clamp(1.25rem, 4.2vw, 1.8rem); margin: 6px 0 10px; }
.hero2 .kick { font-size: .78rem; padding: 3px 12px 3px 4px; }
.hero2 .kick i { width: 22px; height: 22px; }
.hero2 .hero-search input, .hero2 .hero-search .btn { height: 42px; min-height: 42px; }
@media (min-width: 960px) { .hero2.compact .container { padding-top: 20px; padding-bottom: 22px; } }
.cat-grid { gap: 8px 6px; }
.cat2 { font-size: .74rem; gap: 4px; }
.cat2 .cimg { border-radius: 14px; max-width: 76px; }
.sgrid { gap: 10px 8px; }
.scard .cover { aspect-ratio: 16/7; }
.pgrid { gap: 8px; }
.pcard .img { aspect-ratio: 5/4; }
.pcard .body { padding: 6px 8px 8px; }
.pcard h4 { font-size: .82rem; }
.pcard .add-btn { width: 30px; height: 30px; font-size: 1rem; }
.offer2 { padding: 8px 10px; } .offer2 .ol { width: 34px; height: 34px; }
.seller-mini { padding: 10px 12px; } .seller-mini .si { width: 36px; height: 36px; }
.empty { padding: 20px 12px; }
.shell .main { padding-top: 14px; }

/* store page: smaller info card */
.store-hero .cover { height: 96px; }
@media (min-width: 760px) { .store-hero .cover { height: 150px; } }
.store-card { margin-top: -30px; padding: 12px; border-radius: 20px; margin-bottom: 8px; }
.store-card .fav { top: 10px; inset-inline-end: 10px; width: 32px; height: 32px; }
.sc-top { gap: 10px; padding-inline-end: 38px; }
.sc-top .logo { width: 54px; height: 54px; border-radius: 16px; font-size: 1.4rem; box-shadow: 0 6px 14px -6px rgba(0,0,0,.35), 0 0 0 1.5px var(--gold, #C9A227); }
.sc-id h1 { font-size: 1.08rem; margin: 0 0 2px; }
.sc-sub { font-size: .76rem; } .sc-pills { margin-top: 4px; gap: 4px; }
.sc-desc { margin: 8px 0 0; font-size: .82rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-tiles { grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 6px; margin-top: 10px; }
.tile { padding: 6px 2px; border-radius: 12px; gap: 0; }
.tile i { font-size: .95rem; } .tile b { font-size: .8rem; } .tile small { font-size: .64rem; }
.store-card .notice { margin-top: 8px !important; padding: 6px 10px; font-size: .8rem; }
.store-card > p.xs { margin-top: 6px !important; }
.seller-info { padding: 10px 12px !important; margin-bottom: 8px !important; }
.sticky-tabs { padding: 6px 0; }
.cat-sec { padding-top: 10px; }
.cat-h { margin-bottom: 8px; } .cat-h h2 { font-size: 1rem; }

/* sheets: always leave a strip at the top so they read as a window */
.modal-bg { padding-top: 56px; }
.modal { max-height: calc(100dvh - 56px); padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); }
.modal-h { margin-bottom: 8px; top: -14px; }
.modal-h h3 { font-size: 1rem; }
@media (min-width: 700px) { .modal-bg { padding: 20px; } .modal { max-height: 86vh; } }

/* product sheet: short image, tight rows, details folded */
.psheet .pimg { border-radius: 12px; overflow: hidden; background: var(--peach); height: 140px; }
.psheet .pimg img { width: 100%; height: 100%; object-fit: cover; }
.psheet .ph-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.psheet .pdesc { margin: 0; font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.psheet h4 { font-size: .88rem; margin: 0 0 4px; }
.psheet .opt { padding: 8px 12px; min-height: 0; }
.psheet details.fold { border-top: 1px solid var(--line); padding-top: 8px; }
.psheet .more-h { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--green-ink); }

/* "new version" banner */
.upd-bar { position: fixed; z-index: 300; inset-inline: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--green); color: #fff; box-shadow: 0 14px 34px -10px rgba(0,0,0,.5); animation: up .25s; max-width: 460px; margin-inline: auto; }
.upd-bar span { flex: 1; font-size: .88rem; font-weight: 500; }
.upd-bar .btn { min-height: 34px; padding: 0 14px; font-size: .85rem; background: var(--terra); color: #fff; }
.upd-bar button.x { background: transparent; border: 0; color: #fff; opacity: .7; cursor: pointer; font-size: 1.1rem; }
@media (min-width: 900px) { .upd-bar { bottom: 20px; } }
.sc-tiles { display: flex; gap: 5px; }
.sc-tiles .tile { flex: 1 1 0; min-width: 0; }
.tile small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }




/* ===== round 4 ===== */
/* old price: clear red strike-through */
.price .was, s.was, .summary s { color: var(--muted); font-weight: 400; text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--err); opacity: .9; }
.pcard .price .was { font-size: .74rem; }
.price .now.is-sale { color: var(--err); }

/* bottom bar: slimmer */
.bnav a { padding: 5px 0 4px; font-size: .64rem; gap: 0; }
.bnav a span.i { font-size: 1.05rem; }
.bnav .ico { width: 1.15em; height: 1.15em; }
body.has-bnav { padding-bottom: 54px; }
.cartbar { bottom: 62px; }
@media (min-width: 900px) { .cartbar { bottom: 20px; } }
.upd-bar { bottom: calc(64px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .upd-bar { bottom: 20px; } }

/* footer (logo + sellers + links): compact */
.ftr { margin-top: 24px; padding: 18px 0 14px; border-radius: 18px 18px 0 0; }
.ftr .cols { gap: 14px 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .ftr .cols { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.ftr .cols > div:first-child { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
@media (min-width: 760px) { .ftr .cols > div:first-child { grid-column: auto; display: block; } }
.ftr-logo { width: 56px; height: auto; padding: 4px; border-radius: 12px; }
.ftr .cols > div:first-child p { margin: 0 !important; font-size: .78rem; }
.ftr h4 { font-size: .85rem; margin-bottom: 6px; }
.ftr ul { gap: 3px; font-size: .8rem; }
.ftr .copy { margin-top: 12px; padding-top: 10px; font-size: .74rem; }
.ftr .biz { margin-top: 10px; padding-top: 10px; font-size: .74rem; }
/* .money is inline-block, which stops the parent's line-through from reaching the digits — apply it on the inner box too */
.was .money, s .money, s.was .money { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--err); }

/* ===== round 5: windows freeze the page behind; chat photos + robot label ===== */
html.scroll-locked { overflow: hidden; }
.modal, .modal-bg, .chat-b { overscroll-behavior: contain; }
.cm .who.bot { color: var(--green-ink); }
.cm .who.bot .ico { color: var(--terra-ink); }
.cm .cimg { display: block; margin: 2px 0 6px; }
.cm .cimg img { display: block; max-width: 200px; max-height: 220px; border-radius: 12px; object-fit: cover; }
.chat-att { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--green-ink); cursor: pointer; font-size: 1.2rem; }
.chat-att:hover { background: var(--peach); }

/* ===== round 6: customer ↔ store chat, complaint boxes, receipts ===== */
.tk { display: grid; grid-template-rows: auto 1fr auto auto; height: min(70vh, 640px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.tk-h { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.tk-h small { color: var(--muted); font-size: .78rem; }
.tk-b { overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--cream); overscroll-behavior: contain; }
.tk-m { max-width: 78%; align-self: flex-start; display: grid; gap: 2px; }
.tk-m.me { align-self: flex-end; }
.tk-bub { padding: 8px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; font-size: .92rem; }
.tk-m.me .tk-bub { background: var(--green); color: #fff; border-color: var(--green); }
.tk-m time { font-size: .68rem; color: var(--muted); padding: 0 4px; }
.tk-m.me time { text-align: end; }
.tk-empty { color: var(--muted); text-align: center; font-size: .85rem; margin: auto; }
.tk-f { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.tk-f textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; border-radius: 12px; border: 1px solid var(--line); padding: 10px 12px; background: var(--surface-2); font-size: 16px; }
.tk-f .btn { width: 46px; padding: 0; }
.tk-note { margin: 0; padding: 0 12px 10px; font-size: .72rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
/* admin complaint page: boxes side by side */
.boxes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); align-items: start; }
.boxes .bx-main { grid-row: span 3; }
.boxes > * + * { margin-top: 0 !important; }
.thread-box { max-height: 52vh; overflow-y: auto; overscroll-behavior: contain; padding-inline-end: 4px; }
.msg-img { max-width: 220px; max-height: 220px; border-radius: 10px; margin-top: 6px; display: block; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok, #2f7a4a); margin-inline-start: 6px; vertical-align: middle; animation: livep 1.6s infinite; }
@keyframes livep { 50% { opacity: .3; } }
.cprof .kps { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.kp { background: var(--cream); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; text-align: center; display: grid; }
.kp b { font-size: 1.05rem; color: var(--green-ink); } .kp small { font-size: .68rem; color: var(--muted); }
.kp.warn { background: color-mix(in srgb, var(--warn, #c98a00) 12%, var(--surface)); border-color: color-mix(in srgb, var(--warn, #c98a00) 40%, transparent); }
.kp.bad { background: color-mix(in srgb, var(--err) 10%, var(--surface)); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.kp.bad b { color: var(--err); }
.note-i { background: var(--cream); border-radius: 10px; padding: 6px 10px; }
/* bank transfer receipts */
.receipt-img { max-width: 260px; max-height: 320px; border-radius: 12px; border: 1px solid var(--line); display: block; }
.receipt-img.sm { max-width: 160px; max-height: 180px; margin-bottom: 8px; }
.receipt-up { margin-top: 12px; padding: 12px; border-radius: 14px; border: 1.5px dashed var(--terra); background: color-mix(in srgb, var(--terra) 6%, var(--surface)); }
.receipt-up.done { border-style: solid; border-color: var(--ok, #2f7a4a); background: color-mix(in srgb, var(--ok, #2f7a4a) 6%, var(--surface)); }
.receipt-card { border-color: var(--terra); }
.modal { overflow-x: hidden; }
.receipt-up img, .receipt-img { max-width: 100%; }

/* ===== admin e-mail alerts page ===== */
.al-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.al-card { display: grid; gap: 10px; transition: opacity .2s; }
.al-card.off { opacity: .55; }
.al-card.off .al-mails { pointer-events: none; }
.al-mails { display: grid; gap: 6px; }
.al-mails .input { min-height: 38px; font-size: 14px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; top: 3px; inset-inline-start: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(20px); }
[dir=rtl] .switch input:checked + span::before { transform: translateX(-20px); }

/* ===== standalone sign-up pages (/join/seller, /join/driver) ===== */
body.standalone { padding-bottom: 0 !important; background: var(--cream); }
.jn { min-height: 100vh; display: flex; flex-direction: column; }
.jn-wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
.jn-top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--cream) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.jn-top .jn-wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.jn-brand { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; color: var(--green-ink); }
.jn-lang { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 12px; font-weight: 700; cursor: pointer; color: var(--green-ink); }
.jn-hero { background: var(--grad-green, linear-gradient(135deg, #1E3A2C, #2C5440)); color: #EAF1EC; padding: 42px 0 46px; border-radius: 0 0 26px 26px; position: relative; overflow: hidden; }
.jn-hero::after { content: ''; position: absolute; inset-inline-end: -60px; bottom: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(201,162,39,.35), transparent 70%); }
.jn-hero.drv { background: linear-gradient(135deg, #2C2A1E, #5A4320); }
.jn-kick { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); font-size: .82rem; }
.jn-hero h1 { color: #fff; font-size: clamp(1.6rem, 5.2vw, 2.6rem); line-height: 1.25; margin: 14px 0 10px; max-width: 18ch; }
.jn-hero h1 em { font-style: normal; background: linear-gradient(90deg, #E8C98A, #D89363); -webkit-background-clip: text; background-clip: text; color: transparent; }
.jn-hero p { max-width: 54ch; color: rgba(234,241,236,.86); margin: 0 0 18px; }
.jn-sec { padding-top: 26px; }
.jn-sec h2 { font-size: 1.2rem; margin: 0 0 12px; }
.jn-bens { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.jn-b { display: grid; gap: 2px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.jn-b span { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--green-100); color: var(--green-ink); font-size: 1.2rem; margin-bottom: 4px; }
.jn-b small, .jn-step small { color: var(--muted); font-size: .8rem; }
.jn-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px; }
.jn-step { display: grid; gap: 2px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px dashed var(--terra); }
.jn-step i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--terra); color: #fff; font-weight: 700; margin-bottom: 4px; }
.jn-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.jn-plan input { position: absolute; opacity: 0; }
.jn-plan-in { display: grid; gap: 4px; padding: 16px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); cursor: pointer; height: 100%; transition: .15s; }
.jn-plan input:checked + .jn-plan-in { border-color: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 15%, transparent); }
.jn-plan input:focus-visible + .jn-plan-in { outline: 2px solid var(--terra); }
.jn-price { font-size: 1.2rem; font-weight: 700; color: var(--green-ink); }
.jn-plan ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: .82rem; }
.jn-plan li .ico { color: var(--ok, #2f7a4a); }
.jn-form { margin-bottom: 30px; }
.jn-email { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.jn-email .btn { min-height: 44px; }
.jn-foot { margin-top: auto; padding: 18px 0; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); }
.jn-done { text-align: center; display: grid; gap: 8px; }
.jn-done-ic { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; font-size: 1.8rem; }
.jn-done p { color: var(--muted); margin: 0 0 8px; }
.jn-link { display: grid; gap: 8px; }
.jn-app.approved { border-color: color-mix(in srgb, var(--ok, #2f7a4a) 40%, transparent); }
.jn-app.rejected { opacity: .7; }

/* ---- readability polish: nothing on screen smaller than ~11.5px ---- */
.sc2-meta { font-size: .8rem; }
.sc2-closed, .pcard .pill { font-size: .76rem; }
.tile small { font-size: .76rem; }
.tile b { font-size: .9rem; }
.kp small, .tk-m time, .cm time, .loc-chip small { font-size: .76rem; }
.bnav a { font-size: .72rem; }
@media (max-width: 640px) { .tile small { font-size: .72rem; } .tile b { font-size: .86rem; } }
.seg.mini button .ico { width: 1em; height: 1em; vertical-align: -2px; }
#neworder-pop .btn { font-size: 1rem; }
img { max-width: 100%; }

/* ---- audit fixes (Nov 2026): 16px base, nothing under ~11.5px, tiles never cut, tap targets ≥36px ---- */
html { font-size: 16px; }
.bnav a { font-size: .74rem; }
.sc-tiles .tile small { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
@media (max-width: 480px) { .sc-tiles { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); } .sc-tiles .tile { flex: none; } }
.store-hero .cover { overflow: hidden; }
.badge { font-size: .72rem; }
.pcard .add-btn { width: 36px; height: 36px; font-size: 1.1rem; }
.ob-link.sm { padding: 9px 12px; min-height: 40px; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
@media (max-width: 480px) { .sc-tiles .tile:last-child:nth-child(odd) { grid-column: 1 / -1; } }
/* product without a photo: a warm brand tile with its first letter (never a grey logo) */
.ph { background: linear-gradient(135deg, var(--peach, #EFD9C1), var(--terra-100, #f3d6c3)); }
.ph-l { font-size: clamp(2.2rem, 9vw, 3.4rem); font-weight: 700; color: var(--terra-ink, #8a4422); opacity: .55; line-height: 1; }
html.dark .ph, [data-theme="dark"] .ph { background: linear-gradient(135deg, #2b2620, #3a2c22); }
html.dark .ph-l, [data-theme="dark"] .ph-l { color: #e3a57d; opacity: .7; }
/* 320px audit fixes */
.loc-chip .lt b { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv dd, .kv dt { min-width: 0; overflow-wrap: anywhere; }
.filters .input { min-width: 0; max-width: 100%; }
#stores .section-h { flex-wrap: wrap; align-items: center; }
.seg.mini { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg.mini::-webkit-scrollbar { display: none; }
.seg.mini button { white-space: nowrap; }
.card .btn { max-width: 100%; white-space: normal; text-align: center; }
.upl button, [data-rm], .up-rm { min-width: 32px; min-height: 32px; }
main > .backrow ~ .auth-shell { padding-top: 64px; }
/* micro-interactions: lift 2px, photo zoom inside its frame, press on click (no tilt / spin) */
.pcard .img, .sc2-img { overflow: hidden; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .sc2, .pcard { transition: transform .22s ease, box-shadow .22s ease; }
  .sc2:hover, .pcard:hover { transform: translateY(-2px); }
  .sc2:hover .sc2-img > img { transform: scale(1.03); }
  .pcard .img img { transition: transform .4s ease; }
  .pcard:hover .img img { transform: scale(1.03); }
  body.fx .pcard:hover .add-btn { transform: scale(1.08); }
}
.btn, .add-btn, .chip, .icon-btn { transition: transform .12s ease, background-color .2s ease, box-shadow .2s ease; }
.btn:active, .add-btn:active, .chip:active, .icon-btn:active { transform: translateY(1px) scale(.98); }
/* very small phones (≤360px): give the delivery-location chip room; settings stay in the footer and account menu */
@media (max-width: 360px) {
  .hdr-actions a.icon-btn[href="/settings"] { display: none; }
  .loc-chip { padding: 0 8px; gap: 5px; max-width: none; flex: 1 1 auto; }
  .loc-chip small { display: none; }
}
.seg.mini button { min-height: 36px; }

/* ===================== store page v2 (delivery-app style, compact) ===================== */
.st2-cover { height: 150px; background: linear-gradient(135deg, var(--green), var(--green-500, #2f5a44)); overflow: hidden; }
.st2-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 760px) { .st2-cover { height: 230px; } }
.st2-head { display: flex; align-items: flex-end; gap: 12px; margin-top: -34px; position: relative; }
.st2-logo { width: 76px; height: 76px; flex: none; border-radius: 20px; overflow: hidden; background: var(--surface); border: 3px solid var(--surface); box-shadow: var(--shadow, 0 6px 18px rgba(0,0,0,.18)); display: grid; place-items: center; font-weight: 700; font-size: 1.5rem; color: var(--green-ink); }
.st2-logo img { width: 100%; height: 100%; object-fit: cover; }
.st2-id { flex: 1; min-width: 0; padding-bottom: 2px; }
.st2-id h1 { font-size: clamp(1.25rem, 4.5vw, 1.7rem); margin: 0 0 4px; line-height: 1.25; }
.st2-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .84rem; color: var(--muted); }
.st2-sub > span:not(.pill) { display: inline-flex; align-items: center; gap: 3px; }
.st2-head .fav { position: static; flex: none; align-self: center; }
.st2-meta { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: .86rem; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.st2-meta::-webkit-scrollbar { display: none; }
.st2-meta > span { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.st2-meta .ico { color: var(--terra-ink); }
.st2-meta .m-r .ico { color: #e0a43a; }
.st2-meta small { color: var(--muted); }
.st2-meta .m-new { color: var(--ok); font-weight: 600; }
.st2-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line); flex: none; }
.st2-actions { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.st2-actions::-webkit-scrollbar { display: none; }
.st2-act { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--green-ink); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.st2-act:hover { background: var(--peach); }
.st2-note { margin-top: 10px; font-size: .84rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.st2 .notice { margin-top: 10px !important; }
.st2 .hscroll { margin: 12px 0 0 !important; }
.st2 .hscroll .card { padding: 10px 14px; }
/* sticky category tabs with the store search beside them */
.st2-tabs { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 0; background: var(--cream); }
.st2-tabs .chips { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.st2-tabs .chips::-webkit-scrollbar { display: none; }
.st2-tabs .chip { flex: none; }
.st2-search { position: relative; flex: 0 0 auto; width: 170px; }
.st2-search .s-ico { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; pointer-events: none; }
.st2-search .input { min-height: 38px; border-radius: 999px; padding-inline-start: 36px; width: 100%; }
@media (max-width: 600px) { .st2-tabs { flex-direction: column-reverse; align-items: stretch; } .st2-search { width: 100%; } }
/* product rows */
.prows { display: grid; gap: 10px; }
@media (min-width: 900px) { .prows { grid-template-columns: 1fr 1fr; gap: 12px; } }
.prow { display: flex; gap: 12px; align-items: stretch; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.prow:hover { border-color: var(--terra-line, var(--terra)); box-shadow: var(--shadow-xs, 0 2px 8px rgba(0,0,0,.08)); }
.prow.has { border-color: var(--terra); }
.prow.off { opacity: .6; }
.prow-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prow-t h4 { margin: 0; font-size: 1rem; line-height: 1.35; }
.prow-t p { margin: 4px 0 0; font-size: .84rem; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prow-p { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.prow-p .now { font-weight: 700; color: var(--green-ink); }
.prow-p .now.is-sale { color: var(--terra-ink); }
.prow-p .was { font-size: .8rem; color: var(--muted); }
.prow-p .pill { font-size: .72rem; padding: 2px 8px; }
.prow-p .pill.hot { background: var(--peach); color: var(--terra-ink); }
.prow-img { position: relative; flex: none; width: 104px; height: 104px; border-radius: 14px; overflow: visible; }
.prow-img > img, .prow-img > .ph { width: 100%; height: 100%; border-radius: 14px; object-fit: cover; display: grid; place-items: center; overflow: hidden; }
@media (min-width: 900px) { .prow-img { width: 116px; height: 116px; } }
.prow-img .add-btn { position: absolute; bottom: -8px; inset-inline-end: -6px; width: 36px; height: 36px; border-radius: 12px; font-size: 1.25rem; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.qbadge { position: absolute; top: -8px; inset-inline-end: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--terra); color: #fff; font-size: .8rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.qstep { position: absolute; bottom: -8px; inset-inline: -6px; display: flex; align-items: center; justify-content: space-between; height: 36px; border-radius: 12px; background: var(--terra); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.qstep button { width: 36px; height: 36px; border: 0; background: none; color: inherit; font-size: 1.25rem; font-weight: 700; cursor: pointer; border-radius: 12px; }
.qstep button:active { background: rgba(255,255,255,.18); }
.qstep b { font-size: .95rem; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .prow-img > img { transition: transform .4s ease; } .prow:hover .prow-img > img { transform: scale(1.03); } }
.st2 .cat-sec { scroll-margin-top: 130px; }
.st2 .cat-h { margin: 18px 0 10px; }
/* the cart bar takes the bottom of the screen when the page has no bottom nav (store pages) */
.cartbar.at-bottom { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.st2 #sprods { padding-bottom: 90px; }
.st2-head { align-items: flex-start; }
.st2-id { padding-top: 40px; }
.st2-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); overflow: visible; }
.st2-act { padding: 0 8px; font-size: .84rem; min-width: 0; }
.st2-act .ico { flex: none; }
/* the chat bubble moves above the bottom cart bar while it shows */
body:has(.cartbar.at-bottom) .chatw { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 760px) {
  .st2-meta { display: inline-flex; max-width: 100%; }
  .st2-actions { display: flex; }
  .st2-act { flex: 0 0 auto; padding: 0 16px; }
}

/* ===================== customer account (delivery-app style) ===================== */
.acct { padding-top: 14px; }
.ahero { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 22px; color: #fff; background: var(--grad-green, linear-gradient(135deg, #233C2F, #2f5a44)); box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.18)); }
.ahero .avatar.big { width: 60px; height: 60px; font-size: 1.3rem; flex: none; background: rgba(255,255,255,.16); color: #fff; border: 2px solid rgba(255,255,255,.35); }
.ah-id { flex: 1; min-width: 0; }
.ah-id h1 { margin: 0; font-size: 1.3rem; color: #fff; line-height: 1.3; }
.ah-id span { font-size: .86rem; opacity: .85; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-edit { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; min-height: 40px; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; font-size: .86rem; font-weight: 600; flex: none; }
.ah-edit:hover { background: rgba(255,255,255,.24); color: #fff; }
.alive { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--terra); color: var(--ink); }
.alive:hover { color: var(--ink); background: var(--peach); }
.lv-img { width: 48px; height: 48px; border-radius: 14px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--peach); color: var(--terra-ink); }
.lv-img img { width: 100%; height: 100%; object-fit: cover; }
.lv-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.lv-t small { color: var(--terra-ink); font-weight: 600; font-size: .8rem; }
.lv-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.atile { display: grid; justify-items: center; gap: 2px; padding: 14px 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-align: center; transition: transform .2s ease, border-color .2s ease; }
.atile:hover { color: var(--ink); border-color: var(--terra); transform: translateY(-2px); }
.atile .ti { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--peach); color: var(--terra-ink); font-size: 1.15rem; margin-bottom: 4px; }
.atile b { font-size: 1.15rem; line-height: 1.2; }
.atile small { color: var(--muted); font-size: .8rem; }
.agroup { font-size: .86rem; color: var(--muted); font-weight: 600; margin: 20px 4px 8px; }
.alist { border-radius: 18px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.arow { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 56px; color: var(--ink); border-bottom: 1px solid var(--line); }
.arow:last-child { border-bottom: 0; }
.arow:hover { background: var(--peach); color: var(--ink); }
.arow .ai { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--green-ink); font-size: 1.1rem; flex: none; }
.arow .al { flex: 1; font-weight: 500; }
.arow em { font-style: normal; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--terra); color: #fff; font-size: .78rem; font-weight: 700; display: grid; place-items: center; }
.arow .ac, .alive .ac { color: var(--muted); display: grid; }
.asignout { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 20px 0 8px; min-height: 48px; border: 0; border-radius: 16px; background: none; color: var(--err, #c0392b); font: inherit; font-weight: 600; cursor: pointer; }
.asignout:hover { background: color-mix(in srgb, var(--err, #c0392b) 10%, transparent); }
/* three-item bottom nav */
.bnav { grid-template-columns: repeat(3, 1fr); }
.container.acct { padding-inline: 16px; }
.acct .asignout { margin-bottom: 24px; }
@media (max-width: 360px) { .ah-edit span { display: none; } .ah-edit { padding: 8px 10px; } .ahero { gap: 10px; padding: 16px 14px; } }

/* ===================== header: location · notifications · cart ===================== */
.desk-only { display: none !important; }
@media (min-width: 900px) { .desk-only { display: inline-flex !important; } }
.hdr .icon-btn.hb { position: relative; width: 44px; height: 44px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--green-ink); display: grid; place-items: center; font-size: 1.25rem; transition: background .2s ease, transform .12s ease; }
.hdr .icon-btn.hb:hover { background: var(--peach); }
.hdr .icon-btn.hb .badge { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--terra); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); box-shadow: 0 2px 6px rgba(0,0,0,.2); animation: badgepop .35s cubic-bezier(.3,1.6,.5,1); }
.hdr .icon-btn.hb .badge.hide { display: none; }
@keyframes badgepop { from { transform: scale(.4); } to { transform: scale(1); } }
@media (max-width: 759px) { .hdr .container { gap: 8px; } .hdr-actions { gap: 8px; } }

/* ===================== bottom nav: floating pill, hides on scroll down ===================== */
@media (max-width: 899px) {
  .bnav { left: 14px; right: 14px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); border-radius: 22px; border: 1px solid var(--line); padding: 4px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.35); transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .25s ease; }
  .bnav a { border-radius: 16px; padding: 7px 0 6px; transition: background .2s ease, color .2s ease; }
  .bnav a.on { background: color-mix(in srgb, var(--terra) 14%, transparent); color: var(--terra-ink); }
  .bnav a.on::before { display: none; }
  .cartbar, .chatw { transition: bottom .32s cubic-bezier(.2,.8,.2,1), opacity .2s ease, transform .2s ease; }
  .cartbar:not(.at-bottom) { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}

/* ===================== chat button: quiet until it is used ===================== */
.chatw:not(.open):not(.active):not(.used) .chat-fab { opacity: .45; transform: scale(.82); filter: saturate(.6); box-shadow: none; transition: opacity .25s ease, transform .25s ease, filter .25s ease; }
.chatw:not(.open):not(.active):not(.used) .chat-fab:hover, .chatw:not(.open):not(.active):not(.used) .chat-fab:focus-visible { opacity: 1; transform: none; filter: none; }
.chatw:not(.open):not(.active):not(.used), .chatw:not(.open):not(.active):not(.used) .chat-fab { animation: none !important; }
.chatw:not(.open):not(.active):not(.used)::before, .chatw:not(.open):not(.active):not(.used)::after, .chatw:not(.open):not(.active):not(.used) .chat-fab::before, .chatw:not(.open):not(.active):not(.used) .chat-fab::after { display: none; }

/* ===================== notifications page note ===================== */
.notif-keep { display: flex; align-items: center; gap: 8px; margin: 6px 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: .84rem; }

/* ===================== home search: "ابحث عن" + rolling word ===================== */
.hero-search { position: relative; }
.hero-search .sh-hint { position: absolute; inset-inline-start: 48px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 6px; color: var(--muted); pointer-events: none; white-space: nowrap; overflow: hidden; max-width: calc(100% - 140px); font-size: 1rem; }
.hero-search .sh-hint.hide { display: none; }
.sh-rot { display: inline-block; height: 1.5em; overflow: hidden; vertical-align: bottom; }
.sh-w { display: inline-block; color: var(--terra-ink); font-weight: 600; transition: transform .26s ease, opacity .26s ease; }
.sh-w.out { transform: translateY(-110%); opacity: 0; }
.sh-w.in { transform: translateY(110%); opacity: 0; transition: none; }

/* ===================== offers slider ===================== */
.oslider .os-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
.oslider .os-track::-webkit-scrollbar { display: none; }
.os-slide { position: relative; flex: 0 0 min(88%, 560px); scroll-snap-align: center; height: 190px; border-radius: 22px; overflow: hidden; color: #fff; display: flex; align-items: flex-end; box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.18)); isolation: isolate; }
@media (min-width: 900px) { .os-slide { height: 230px; flex-basis: calc(50% - 6px); } }
.os-bg { position: absolute; inset: 0; z-index: -1; background: linear-gradient(135deg, var(--terra), var(--green)); }
.os-bg img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.os-slide::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(10,18,14,.88) 0%, rgba(10,18,14,.45) 55%, rgba(10,18,14,.05) 100%); }
.os-slide:hover { color: #fff; }
.os-slide:hover .os-bg img { transform: scale(1.03); }
.os-c { display: grid; gap: 6px; padding: 16px 18px; width: 100%; }
.os-tag { justify-self: start; padding: 4px 10px; border-radius: 999px; background: var(--terra); font-weight: 700; font-size: .86rem; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.os-c b { font-size: 1.2rem; line-height: 1.3; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.os-st { display: flex; align-items: center; gap: 8px; font-size: .84rem; opacity: .92; }
.os-lg { width: 26px; height: 26px; border-radius: 8px; overflow: hidden; background: #fff; color: var(--green-ink); display: grid; place-items: center; font-size: .7rem; font-weight: 700; flex: none; }
.os-lg img { width: 100%; height: 100%; object-fit: cover; }
.os-go { position: absolute; top: 14px; inset-inline-end: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.92); color: #233C2F; font-size: .82rem; font-weight: 700; }
.os-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.os-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: width .3s ease, background .3s ease; position: relative; }
.os-dots button::after { content: ""; position: absolute; inset: -10px -4px; }
.os-dots button.on { width: 22px; background: var(--terra); }

/* ===================== update window (centered, must reload) ===================== */
.upd-modal { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 20px; background: rgba(8,14,11,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: updfade .25s ease; }
.upd-card { width: min(380px, 100%); padding: 26px 22px 20px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); text-align: center; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); animation: updpop .35s cubic-bezier(.3,1.4,.5,1); }
.upd-ic { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 20px; display: grid; place-items: center; font-size: 1.8rem; background: var(--peach); color: var(--terra-ink); }
.upd-card h2 { margin: 0 0 6px; font-size: 1.25rem; }
.upd-card p { margin: 0 0 18px; color: var(--muted); font-size: .92rem; line-height: 1.6; }
@keyframes updfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes updpop { from { transform: scale(.9) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.upd-bar { display: none !important; }
@media (prefers-reduced-motion: reduce) { .bnav, .cartbar, .chatw, .sh-w, .os-bg img { transition: none !important; } .upd-modal, .upd-card, .hdr .icon-btn.hb .badge { animation: none !important; } }
@media (max-width: 899px) { body.has-bnav { padding-bottom: 88px; } }
.hero2 .container { grid-template-columns: minmax(0, 1fr); } .hero2 .container > * { min-width: 0; } .hero-search input { min-width: 0; width: 100%; }

/* top bar hides while scrolling down and slides back on the first move up; the bottom nav always stays */
@media (max-width: 899px) {
  .hdr, .stbar { transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease; will-change: transform; }
  .sticky-tabs, .backrow { transition: top .3s cubic-bezier(.2,.8,.2,1); }
  body.hdr-hide:not(:has(.shell)) .hdr, body.hdr-hide .stbar { transform: translateY(-110%); }
  body.hdr-hide:not(:has(.shell)) .sticky-tabs { top: 0; }
  body.hdr-hide:not(:has(.shell)) .backrow { top: 0; }
}
@media (prefers-reduced-motion: reduce) { .hdr, .stbar, .sticky-tabs, .backrow { transition: none !important; } }

/* ===================== phone top bar v3: no logo · location block · round actions ===================== */
@media (max-width: 899px) {
  .hdr .brand { display: none !important; }
  .hdr { border-bottom: 0 !important; box-shadow: none; background: color-mix(in srgb, var(--cream) 88%, transparent); }
  body.hdr-scrolled .hdr { box-shadow: 0 8px 24px -14px rgba(0,0,0,.45); }
  .hdr .container { height: 66px; gap: 10px !important; padding-inline: 16px !important; }
  /* location: round pin + "التوصيل إلى ⌄" + the address, no box */
  .hdr .loc-chip { flex: 1 1 auto; min-width: 0; max-width: none; height: auto; padding: 4px 0; gap: 10px; border: 0; background: none; border-radius: 14px; text-align: start; }
  .hdr .loc-chip:hover { background: none; }
  .hdr .loc-chip:active .lp { transform: scale(.94); }
  .hdr .loc-chip .lp { width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--terra); color: #fff; font-size: 1.15rem; display: grid; place-items: center; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--terra) 70%, transparent); transition: transform .15s ease; }
  .hdr .loc-chip .lt { gap: 1px; }
  .hdr .loc-chip small { display: inline-flex !important; align-items: center; gap: 3px; font-size: .76rem; color: var(--muted); font-weight: 500; }
  .hdr .loc-chip small .ico { font-size: .8rem; }
  .hdr .loc-chip .lt b { font-size: 1rem; font-weight: 700; color: var(--ink); }
  /* notifications & cart: soft round buttons */
  .hdr-actions { gap: 8px !important; margin-inline-start: 0; flex: none; }
  .hdr .icon-btn.hb { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: 0 2px 10px -4px rgba(0,0,0,.25), inset 0 0 0 1px var(--line); font-size: 1.2rem; }
  .hdr .icon-btn.hb:active { transform: scale(.94); }
  .hdr .icon-btn.hb .badge { top: -3px; inset-inline-end: -3px; }
}
/* the chevron sits next to "Deliver to" on every screen size */
.loc-chip small .ico { vertical-align: -2px; }
@media (min-width: 900px) { .loc-chip > .ico:last-child { display: none; } }

/* calmer, smaller location block (phone) */
@media (max-width: 899px) {
  .hdr .container { height: 58px; }
  .hdr .loc-chip { flex: 0 1 auto; max-width: 64%; gap: 8px; padding: 2px 0; }
  .hdr .loc-chip .lp { width: 30px; height: 30px; font-size: .95rem; background: color-mix(in srgb, var(--terra) 14%, transparent); color: var(--terra-ink); box-shadow: none; }
  .hdr .loc-chip small { font-size: .7rem; }
  .hdr .loc-chip .lt b { font-size: .86rem; font-weight: 600; }
  .hdr-actions { margin-inline-start: auto !important; }
  .hdr .icon-btn.hb { width: 40px; height: 40px; font-size: 1.1rem; }
}

/* home: the hero background runs up behind the top bar; the bar is see-through until the page scrolls */
:root { --hdr-h: 58px; }
@media (min-width: 900px) { :root { --hdr-h: 72px; } }
body:has(.hero2) .hero2 { margin-top: calc(-1 * var(--hdr-h)); }
body:has(.hero2) .hero2.compact .container { padding-top: calc(var(--hdr-h) + 14px); }
@media (min-width: 960px) { body:has(.hero2) .hero2.compact .container { padding-top: calc(var(--hdr-h) + 22px); } }
body:has(.hero2) .hdr { transition: background-color .3s ease, box-shadow .3s ease, transform .3s cubic-bezier(.2,.8,.2,1); }
body:has(.hero2):not(.hdr-scrolled) .hdr { background: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; box-shadow: none !important; border-bottom-color: transparent !important; }
/* light text and glassy buttons while the bar sits on the green hero */
body:has(.hero2) .hdr .loc-chip .lt b { color: #fff; }
body:has(.hero2) .hdr .loc-chip small { color: rgba(255,255,255,.72); }
body:has(.hero2) .hdr .loc-chip .lp { background: rgba(255,255,255,.14); color: #fff; }
body:has(.hero2) .hdr .icon-btn.hb { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
body:has(.hero2) .hdr .icon-btn.hb .badge { border-color: transparent; }
body:has(.hero2) .hdr .brand b, body:has(.hero2) .hdr .brand small { color: #fff; }
body:has(.hero2) .hdr .icon-btn:not(.hb) { color: #fff; }
@media (min-width: 900px) { body:has(.hero2) .hdr .loc-chip { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); } body:has(.hero2) .hdr .loc-chip > .ico, body:has(.hero2) .hdr .loc-chip .lp { color: #fff; background: none; } }

/* home: when the top bar comes back after scrolling it keeps the hero's green and brings a search row */
.hdr-sbar { display: none; }
body:has(.hero2).hdr-scrolled .hdr { background: var(--grad-green) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
body:has(.hero2).hdr-scrolled .hdr::before { content: ""; position: absolute; inset: 0 0 -64px; pointer-events: none; background: radial-gradient(420px 140px at 85% 0%, rgba(212,176,106,.18), transparent 60%); }
@media (max-width: 899px) {
  body:has(.hero2) .hdr-sbar { display: block; position: absolute; left: 0; right: 0; top: 100%; padding: 2px 16px 12px; background: var(--grad-green); border-radius: 0 0 22px 22px; box-shadow: 0 14px 28px -18px rgba(0,0,0,.6); opacity: 0; visibility: hidden; transform: translateY(-10px); transition: opacity .25s ease, transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s linear .3s; }
  body:has(.hero2).hdr-scrolled .hdr-sbar { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s; }
  body:has(.hero2).hdr-scrolled .hdr { box-shadow: none !important; }
  body:has(.hero2).hdr-hide .hdr { transform: translateY(calc(-100% - 76px)); }
}
.hero-search.mini { display: flex; align-items: center; height: 46px; padding: 0 14px 0 14px; gap: 8px; border-radius: 14px; background: #fff; box-shadow: 0 4px 14px -6px rgba(0,0,0,.35); }
.hero-search.mini .s-ico { position: static; transform: none; color: #8a9390; display: grid; flex: none; }
.hero-search.mini input { flex: 1; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: .95rem; color: #1d2a24; padding: 0; min-width: 0; }
.hero-search.mini .sh-hint { inset-inline-start: 42px; max-width: calc(100% - 56px); font-size: .95rem; color: #7b8580; }
.hero-search.mini .sh-w { color: #b0592b; }
