:root{
  --bg:#faf5ee; --card:#fff; --ink:#2b1a10; --muted:#7a6656; --line:#eadfd1;
  --brand:#3b2418; --accent:#c8873a; --accent-ink:#fff; --ok:#2f7d4f; --bad:#b3402f;
  --r:16px; --shadow:0 2px 10px rgba(59,36,24,.08);
}
@media (prefers-color-scheme:dark){
  :root{--bg:#1a110b; --card:#261a12; --ink:#f4e9dc; --muted:#b39d89; --line:#3a2a1e; --brand:#120b07; --shadow:0 2px 10px rgba(0,0,0,.4)}
}
*{box-sizing:border-box;margin:0}
[hidden]{display:none!important}
html{scroll-behavior:smooth;scroll-padding-top:calc(var(--bar-h,130px) + 8px)}
body{font-family:'Tajawal',system-ui,-apple-system,'Segoe UI',Tahoma,sans-serif;background:var(--bg);color:var(--ink);line-height:1.6;-webkit-text-size-adjust:100%}
img{display:block;max-width:100%}

.hero{background:var(--brand) center/cover no-repeat;color:#fff;text-align:center;position:relative}
.hero::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(20,10,5,.35),rgba(20,10,5,.8))}
.hero-inner{position:relative;padding:44px 16px 34px}
#logoLink{display:block;width:fit-content;margin:0 auto}
.logo{width:112px;height:112px;border-radius:50%;object-fit:cover;margin:0 auto 12px;box-shadow:0 4px 18px rgba(0,0,0,.45)}
.hero h1{font-size:2.6rem;font-weight:800;letter-spacing:.5px}
.tagline{opacity:.92;margin-top:2px}
.hours{opacity:.75;font-size:.85rem;margin-top:8px}
.hero-link{margin-top:14px;display:flex;justify-content:center}
.hero-link:empty{display:none}

.bar{position:sticky;top:0;z-index:10;background:var(--bg);border-bottom:1px solid var(--line)}
.search{padding:10px 16px 4px;max-width:900px;margin:auto}
.search input{width:100%;padding:11px 16px;border-radius:999px;border:1px solid var(--line);background:var(--card);color:var(--ink);font:inherit;outline:none}
.search input:focus{border-color:var(--accent)}
.tabs{display:flex;gap:8px;overflow-x:auto;padding:8px 16px 10px;max-width:900px;margin:auto;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tab{flex:none;padding:7px 16px;border-radius:999px;border:1px solid var(--line);background:var(--card);color:var(--ink);font:inherit;font-size:.92rem;cursor:pointer;white-space:nowrap}
.tab.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink);font-weight:700}

.menu{max-width:900px;margin:auto;padding:8px 16px 40px}
.loading,.empty{text-align:center;color:var(--muted);padding:48px 0}
.cat{padding-top:20px}
/* آخر قسم يملأ الشاشة تحت الشريط، فيصل لأعلاها حتى لو فيه صنف واحد */
.cat:last-of-type{min-height:calc(70vh - var(--bar-h,130px) - var(--foot-h,70px) - 44px)}
.cat h2{font-size:1.4rem;font-weight:800;margin-bottom:12px;display:flex;align-items:center;gap:10px}
.cat h2::after{content:"";flex:1;height:1px;background:var(--line)}
.grid{display:grid;grid-template-columns:1fr;gap:12px}
@media(min-width:640px){.grid{grid-template-columns:1fr 1fr}}

.item{display:flex;flex-direction:column;background:var(--card);border-radius:var(--r);box-shadow:var(--shadow);padding:0;overflow:hidden;cursor:pointer;text-align:start;border:0;font:inherit;color:inherit;width:100%;position:relative}
.item:focus-visible{outline:2px solid var(--accent)}
/* صورة المنتج مستطيلة 16:9 بعرض البطاقة فتظهر كاملة */
.imgw{width:100%;aspect-ratio:16/9;background:var(--line)}
.thumb{display:block;width:100%;height:100%;object-fit:cover}
.info{flex:1;min-width:0;display:flex;flex-direction:column;padding:12px 14px 14px}
.name{font-weight:700;font-size:1.05rem}
.desc{color:var(--muted);font-size:.86rem;margin-top:2px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.meta{margin-top:auto;display:flex;align-items:center;justify-content:space-between;padding-top:6px}
.price{font-weight:800;color:var(--accent);font-size:1.05rem}
.price .sar{height:.92em;width:auto;margin-inline-start:.3em;vertical-align:-.06em}
.price small{font-weight:500;font-size:.75rem;margin-inline-start:3px;color:var(--muted)}
.cal{font-size:.76rem;color:var(--muted)}
.badge{position:absolute;top:10px;inset-inline-start:10px;z-index:1;font-size:.7rem;font-weight:700;padding:2px 9px;border-radius:999px;color:#fff}
.b-new{background:var(--ok)} .b-popular{background:var(--bad)} .b-signature{background:var(--accent)}
.item.noimg .badge{position:static;align-self:flex-start;margin:12px 14px 0}
.item.sold{opacity:.55}
.item.sold .thumb{filter:grayscale(1)}
.soldtag{font-size:.75rem;color:var(--bad);font-weight:700}

.foot{text-align:center;color:var(--muted);font-size:.82rem;padding:8px 16px 40px}
.links{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin:6px auto 16px;max-width:900px}
.link{display:inline-flex;align-items:center;gap:8px;padding:10px 18px;border-radius:999px;border:1px solid var(--line);background:var(--card);color:var(--ink);text-decoration:none;font-weight:700;font-size:.92rem;box-shadow:var(--shadow)}
.link svg{width:20px;height:20px;color:var(--accent);flex:none}
.link:active{transform:scale(.97)}

.modal{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:50;display:flex;align-items:flex-end;justify-content:center}
.modal[hidden]{display:none}
.sheet{background:var(--card);width:100%;max-width:520px;border-radius:24px 24px 0 0;max-height:92vh;overflow:auto;position:relative;animation:up .22s ease-out;padding-bottom:env(safe-area-inset-bottom)}
@media(min-width:640px){.modal{align-items:center}.sheet{border-radius:24px}}
@keyframes up{from{transform:translateY(40px);opacity:0}}
.close{position:absolute;top:12px;inset-inline-end:12px;width:36px;height:36px;border-radius:50%;border:0;background:rgba(0,0,0,.55);color:#fff;font-size:1rem;cursor:pointer;z-index:2}
.sheet .big{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;background:var(--line)}
.sheet .body{padding:18px 20px 24px}
.sheet h3{font-size:1.4rem;font-weight:800}
.sheet .sdesc{color:var(--muted);margin:8px 0 14px}
.sheet .row{display:flex;justify-content:space-between;align-items:center}
.sheet .price{font-size:1.4rem}
