/* عيبال | Ebal — storefront styles. Tokens mirror the Ebal design system. */
:root{
  --olive-900:#1F3016;--olive-700:#2F4A22;--olive-500:#4F7231;--olive-300:#9CC46B;--olive-100:#E6EEDC;
  --stone-50:#F7F6F2;--stone-200:#ECE8DF;--stone-400:#B9B1A1;--sun-500:#F2A516;--pomegranate-600:#C0283B;--night-900:#12150F;
  --bg:var(--stone-50);--surface:#FFFFFF;--surface-2:var(--stone-200);--line:#DDD7CA;--ink:#1C2117;--ink-muted:#5E6557;
  --brand:var(--olive-700);--brand-ink:#FFFFFF;--brand-soft:var(--olive-100);--deal:var(--pomegranate-600);--deal-ink:#FFFFFF;
  --flash:var(--sun-500);--flash-ink:#1C2117;--success:#1F7A52;--focus:var(--olive-500);
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-6:24px;--space-8:32px;
  --radius-sm:10px;--radius-md:14px;--radius-lg:20px;--radius-pill:999px;
  --shadow-card:0 1px 2px rgba(28,33,23,.06),0 8px 24px rgba(28,33,23,.08);
  --font:"Readex Pro","Segoe UI",Tahoma,system-ui,sans-serif;
  color-scheme:light dark;
}
@media (prefers-color-scheme:dark){:root{
  --bg:var(--night-900);--surface:#1B2016;--surface-2:#252B1F;--line:#333A2A;--ink:#EEF0E8;--ink-muted:#A3AA98;
  --brand:var(--olive-300);--brand-ink:var(--night-900);--brand-soft:#243320;--deal:#FF6B7D;--deal-ink:var(--night-900);
  --flash:#FFBE3D;--flash-ink:var(--night-900);--success:#4CC38A;--focus:var(--olive-300);
  --shadow-card:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.35);
}}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-padding-top:80px}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:15px;line-height:1.6;-webkit-font-smoothing:antialiased;padding-bottom:calc(72px + env(safe-area-inset-bottom,0px))}
@media (min-width:900px){body{padding-bottom:0}}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
button,input,select{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--focus);outline-offset:2px;border-radius:6px}
h1,h2,h3{margin:0;line-height:1.3}
.wrap{max-width:1200px;margin:0 auto;padding:0 var(--space-4)}
.muted{color:var(--ink-muted)}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.num{font-variant-numeric:tabular-nums}

/* header */
.top{position:sticky;top:0;z-index:30;background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-bottom:1px solid var(--line);padding-top:env(safe-area-inset-top,0px)}
.top .row{display:flex;align-items:center;gap:var(--space-3);padding:10px 0;flex-wrap:wrap}
.logo{display:flex;align-items:center;gap:8px;font-weight:700;font-size:22px;letter-spacing:-.2px}
.logo svg{width:36px;height:36px}
.mark .b{fill:var(--brand)}.mark .h{fill:none;stroke:var(--brand);stroke-width:3.6;stroke-linecap:round}.mark .s{fill:var(--sun-500)}
.search{flex:1;min-width:0;display:flex;align-items:center;gap:8px;height:46px;padding:0 6px 0 16px;background:var(--surface);border:1.5px solid var(--line);border-radius:var(--radius-pill)}
[dir=rtl] .search{padding:0 16px 0 6px}
.search:focus-within{border-color:var(--brand)}
.search input{flex:1;min-width:0;border:0;background:none;outline:none;height:100%}
.search button{height:36px;padding:0 16px;border:0;border-radius:var(--radius-pill);background:var(--brand);color:var(--brand-ink);font-weight:600;cursor:pointer}
.chip-link{display:inline-flex;align-items:center;justify-content:center;min-width:42px;height:42px;padding:0 12px;border-radius:12px;border:1px solid var(--line);background:var(--surface);font-weight:600;font-size:14px}
@media (max-width:700px){.top .search{order:5;flex-basis:100%}.top .spacer{flex:1}}
.catbar{display:flex;gap:var(--space-2);overflow-x:auto;padding:0 0 10px;scrollbar-width:none}
.catbar::-webkit-scrollbar{display:none}
.catbar a{flex:none;font-size:14px;padding:6px 14px;border-radius:var(--radius-pill);border:1px solid var(--line);background:var(--surface);white-space:nowrap}
.catbar a[aria-current=page]{background:var(--ink);color:var(--bg);border-color:var(--ink)}

/* sections */
main{padding-bottom:var(--space-8)}
section{margin-top:var(--space-8)}
.sh{display:flex;align-items:baseline;justify-content:space-between;gap:var(--space-3);margin-bottom:var(--space-3)}
.sh h2{font-size:20px;font-weight:600}
.more{color:var(--brand);font-weight:500;font-size:14px}
.crumbs{display:flex;flex-wrap:wrap;gap:6px;font-size:13px;color:var(--ink-muted);margin-top:var(--space-4)}
.crumbs a:hover{color:var(--brand)}

/* hero */
.hero{position:relative;overflow:hidden;margin-top:var(--space-4);border-radius:var(--radius-lg);background:var(--olive-900);color:#F7F6F2;padding:28px 24px;min-height:200px;display:flex;flex-direction:column;justify-content:flex-end}
.hero h1{font-size:clamp(26px,5vw,44px);font-weight:700;letter-spacing:-.5px;max-width:15ch;position:relative}
.hero p{margin:8px 0 16px;max-width:40ch;opacity:.8;position:relative}
.hero .cta{position:relative;align-self:flex-start}
.hero .ridge{position:absolute;inset-inline-end:0;bottom:0;width:min(60%,440px);height:auto}
.hero .ridge .sun{fill:var(--sun-500)}.hero .ridge .h1{fill:var(--olive-500)}.hero .ridge .h2{fill:var(--olive-700)}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);height:46px;padding:0 20px;border-radius:var(--radius-md);border:1px solid transparent;font-weight:600;cursor:pointer;background:var(--brand);color:var(--brand-ink)}
.btn.secondary{background:var(--surface);color:var(--ink);border-color:var(--stone-400)}
.btn.flash{background:var(--flash);color:var(--flash-ink)}
.btn.sm{height:36px;padding:0 14px;border-radius:var(--radius-sm);font-size:14px}
.btn[disabled]{background:var(--surface-2);color:var(--ink-muted);border-color:var(--line);cursor:not-allowed}

/* categories */
.cats{display:grid;grid-template-columns:repeat(6,1fr);gap:var(--space-3)}
@media (max-width:700px){.cats{grid-template-columns:repeat(3,1fr)}}
.cat{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);padding:16px 8px;text-align:center;font-size:14px;font-weight:500}
.cat .dot{width:44px;height:44px;border-radius:50%;margin:0 auto 8px}

/* flash deals */
.flash-box{background:var(--flash);color:var(--flash-ink);border-radius:var(--radius-lg);padding:var(--space-4)}
.flash-box .sh h2{font-weight:700;font-size:22px}
.cd{display:flex;gap:4px;direction:ltr}
.cd b{min-width:36px;padding:4px 6px;border-radius:8px;background:#1C2117;color:#F7F6F2;text-align:center;font-variant-numeric:tabular-nums}
.cd i{font-style:normal;font-weight:700;align-self:center}

/* product cards */
.rail{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(160px,180px);gap:var(--space-3);overflow-x:auto;padding-bottom:4px;scrollbar-width:none}
.rail::-webkit-scrollbar{display:none}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(165px,1fr));gap:var(--space-3)}
.card{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);overflow:hidden}
.flash-box .card{border-color:transparent}
.card .img{position:relative;aspect-ratio:1/1;background:var(--surface-2)}
.card .img img{width:100%;height:100%;object-fit:cover}
.off{position:absolute;top:var(--space-2);inset-inline-start:var(--space-2);background:var(--deal);color:var(--deal-ink);font-size:12px;font-weight:600;line-height:16px;padding:2px 8px;border-radius:var(--radius-pill)}
.card .body{display:flex;flex-direction:column;gap:4px;padding:10px 12px 12px;flex:1}
.card h3{font-size:14px;font-weight:500;line-height:20px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:40px}
.price{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;font-variant-numeric:tabular-nums}
.price b{font-size:18px;line-height:24px}
.price s{font-size:12px;color:var(--ink-muted)}
.meta{font-size:12px;line-height:16px;color:var(--ink-muted)}
.star{color:var(--flash)}
.pill{display:inline-block;font-size:12px;font-weight:500;line-height:16px;padding:3px 10px;border-radius:var(--radius-pill);background:var(--surface-2)}
.pill.brand{background:var(--brand-soft);color:var(--brand)}
.pill.ok{background:var(--brand-soft);color:var(--success)}
.pill.deal{background:color-mix(in srgb,var(--deal) 14%,transparent);color:var(--deal)}

/* placeholder tiles (no photo yet) */
.ph{display:grid;place-items:center;width:100%;height:100%}
.ph svg{width:38%;opacity:.3}
.ph .b{fill:var(--ink)}.ph .h{fill:none;stroke:var(--ink);stroke-width:3.6;stroke-linecap:round}
.tint-0{background:#E6EEDC}.tint-1{background:#E6EEDC}.tint-2{background:#F6E3E1}.tint-3{background:#ECE8DF}.tint-4{background:#FBEFD6}.tint-5{background:#E3ECF2}
@media (prefers-color-scheme:dark){.tint-0,.tint-1,.tint-2,.tint-3,.tint-4,.tint-5{background:var(--surface-2)}.ph .b{fill:var(--ink-muted)}.ph .h{stroke:var(--ink-muted)}}

/* stores & brands */
.stores{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:var(--space-3)}
.store{display:flex;align-items:center;gap:var(--space-3);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-3)}
.slogo{flex:none;width:52px;height:52px;border-radius:var(--radius-md);background:var(--brand-soft);color:var(--brand);display:grid;place-items:center;font-weight:700;font-size:20px;overflow:hidden}
.slogo img{width:100%;height:100%;object-fit:cover}
.brands{display:flex;flex-wrap:wrap;gap:var(--space-2)}
.brands a{padding:10px 16px;border-radius:12px;background:var(--surface);border:1px solid var(--line);font-weight:600}

/* listing layout */
.listing{display:grid;grid-template-columns:240px 1fr;gap:var(--space-6);margin-top:var(--space-4);align-items:start}
@media (max-width:900px){.listing{grid-template-columns:1fr}}
.filters{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-4)}
.filters summary{font-weight:600;cursor:pointer;list-style:none}
.filters summary::-webkit-details-marker{display:none}
.filters fieldset{border:0;padding:0;margin:var(--space-4) 0 0}
.filters legend{font-size:13px;color:var(--ink-muted);margin-bottom:6px;padding:0}
.filters label{display:flex;align-items:center;gap:8px;font-size:14px;padding:3px 0;cursor:pointer}
.filters input[type=checkbox],.filters input[type=radio]{accent-color:var(--brand);width:18px;height:18px}
.inp{width:100%;height:42px;border:1.5px solid var(--line);border-radius:var(--radius-sm);background:var(--surface);padding:0 12px;outline:none}
.inp:focus{border-color:var(--brand)}
.two-inp{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-2)}
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);flex-wrap:wrap;margin-bottom:var(--space-3)}
.toolbar select{width:auto;min-width:190px}
.subcats{display:flex;gap:var(--space-2);flex-wrap:wrap;margin:var(--space-3) 0 0}
.empty{text-align:center;padding:48px 16px;background:var(--surface);border:1px dashed var(--line);border-radius:var(--radius-md)}

/* product page */
.pp{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-8);margin-top:var(--space-4)}
@media (max-width:860px){.pp{grid-template-columns:1fr;gap:var(--space-4)}}
.gallery .main{aspect-ratio:1/1;border-radius:var(--radius-lg);overflow:hidden;background:var(--surface-2)}
.gallery .main img{width:100%;height:100%;object-fit:cover}
.thumbs{display:flex;gap:var(--space-2);margin-top:var(--space-2);overflow-x:auto}
.thumbs button{flex:none;width:68px;height:68px;border-radius:12px;overflow:hidden;border:2px solid transparent;padding:0;background:var(--surface-2);cursor:pointer}
.thumbs button[aria-current=true]{border-color:var(--brand)}
.thumbs img{width:100%;height:100%;object-fit:cover}
.pp h1{font-size:24px;font-weight:600}
.bigprice{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin:var(--space-3) 0;font-variant-numeric:tabular-nums}
.bigprice b{font-size:30px;line-height:36px}
.opt{margin-top:var(--space-4)}
.opt .lbl{font-size:13px;color:var(--ink-muted);margin-bottom:6px}
.opts{display:flex;flex-wrap:wrap;gap:var(--space-2)}
.opts button{min-width:44px;height:40px;padding:0 14px;border-radius:var(--radius-pill);border:1.5px solid var(--line);background:var(--surface);cursor:pointer}
.opts button[aria-pressed=true]{border-color:var(--brand);background:var(--brand-soft);color:var(--brand);font-weight:600}
.opts button:disabled{opacity:.4;text-decoration:line-through;cursor:not-allowed}
.box{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-4)}
.kv{display:flex;justify-content:space-between;gap:var(--space-3);padding:6px 0;font-size:14px}
.kv span:first-child{color:var(--ink-muted)}
.qty{display:inline-flex;align-items:center;border:1.5px solid var(--line);border-radius:12px;height:46px}
.qty button{width:40px;height:100%;border:0;background:none;font-size:20px;cursor:pointer}
.qty output{min-width:28px;text-align:center;font-variant-numeric:tabular-nums}
.buy{display:flex;gap:var(--space-2);margin-top:var(--space-4);align-items:center;flex-wrap:wrap}
.buy .btn{flex:1;min-width:140px}
.note{font-size:13px;color:var(--ink-muted);margin-top:var(--space-2)}
.specs{width:100%;border-collapse:collapse;font-size:14px}
.specs td{padding:10px 0;border-bottom:1px solid var(--line);vertical-align:top}
.specs td:first-child{color:var(--ink-muted);width:40%}
.desc{white-space:pre-line;max-width:70ch}
.rev{padding:var(--space-3) 0;border-bottom:1px solid var(--line)}
.rev:last-child{border-bottom:0}
.cols{display:grid;grid-template-columns:1.4fr 1fr;gap:var(--space-6)}
@media (max-width:860px){.cols{grid-template-columns:1fr}}

/* store header */
.shead{display:flex;align-items:center;gap:var(--space-4);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);padding:var(--space-4);margin-top:var(--space-4)}
.shead .slogo{width:72px;height:72px;font-size:28px}

/* pagination */
.pager{display:flex;justify-content:center;gap:6px;margin-top:var(--space-6);flex-wrap:wrap}
.pager a,.pager span{min-width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;padding:0 10px;border-radius:var(--radius-sm);border:1px solid var(--line);background:var(--surface);font-variant-numeric:tabular-nums}
.pager [aria-current=page]{background:var(--brand);color:var(--brand-ink);border-color:var(--brand)}
.pager .off-page{opacity:.45}

/* footer & bottom nav */
.foot{margin-top:var(--space-8);border-top:1px solid var(--line);padding:var(--space-6) 0;font-size:14px;color:var(--ink-muted)}
.foot .row{display:flex;justify-content:space-between;gap:var(--space-4);flex-wrap:wrap}
.bn{position:fixed;inset-inline:0;bottom:0;z-index:30;background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom,0px);display:grid;grid-template-columns:repeat(4,1fr)}
@media (min-width:900px){.bn{display:none}}
.bn a{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 0 10px;font-size:11.5px;color:var(--ink-muted)}
.bn a[aria-current=page]{color:var(--brand);font-weight:600}
.bn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.toast{position:fixed;left:50%;bottom:calc(88px + env(safe-area-inset-bottom,0px));transform:translate(-50%,16px);background:var(--ink);color:var(--bg);padding:10px 18px;border-radius:12px;font-size:14px;opacity:0;pointer-events:none;transition:.2s;z-index:50;max-width:90vw;text-align:center}
.toast.show{opacity:1;transform:translate(-50%,0)}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
