:root{
  --bg:#efe2d1; --card:#fbf6ef; --ink:#3a2416; --muted:#806651; --line:#e0cfba;
  --coffee:#5a341c; --coffee-2:#3a2416; --accent:#a85f2c; --accent-soft:#f4e4d0;
  --ok:#2f7d4f; --ok-soft:#e5f2ea; --danger:#b4412f; --danger-soft:#f8e6e2;
  --radius:18px; --shadow:0 1px 2px rgba(42,29,21,.06),0 8px 24px rgba(42,29,21,.06);
  --font:"IBM Plex Sans Arabic",Tahoma,system-ui,sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:16px;line-height:1.55;padding-bottom:96px}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
img{max-width:100%;display:block}
[hidden]{display:none!important}
.num{font-variant-numeric:tabular-nums;direction:ltr;unicode-bidi:isolate}

/* الشريط العلوي */
.top{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;
  padding:12px 16px;background:rgba(239,226,209,.92);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:8px;text-decoration:none;color:var(--ink);font-weight:700;font-size:22px;letter-spacing:-.3px}
.brand-mark{width:30px;height:38px}
.brand-txt{display:flex;flex-direction:column;line-height:1.05}
.brand-txt small{font-size:11px;font-weight:700;letter-spacing:1.5px;color:var(--accent);font-family:system-ui,sans-serif}
.cart-btn{position:relative;width:46px;height:46px;border-radius:14px;border:1px solid var(--line);background:var(--card);display:grid;place-items:center}
.cart-btn svg{width:24px;height:24px}
.badge{position:absolute;top:-6px;left:-6px;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:var(--accent);color:#fff;font-size:12px;font-weight:700;display:grid;place-items:center}

main{max-width:1080px;margin:0 auto;padding:0 16px}

/* البطل */
.hero{padding:16px 0 4px}
.banner img{width:100%;height:auto;border-radius:22px;box-shadow:var(--shadow);aspect-ratio:1600/330;object-fit:cover}
@media(max-width:700px){.banner img{aspect-ratio:620/330}}
.hero-txt{padding:20px 4px 6px}
.eyebrow{margin:0;color:var(--accent);font-weight:600}
.hero h1{margin:0 0 6px;font-size:clamp(28px,6vw,42px);line-height:1.2;letter-spacing:-.5px}
.hero .sub{margin:0 0 16px;color:var(--muted);max-width:54ch}
.perks{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;list-style:none;margin:0;padding:0}
.perks li{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:12px 4px;font-size:13.5px;font-weight:600}
.perks svg{width:26px;height:26px;fill:none;stroke:var(--accent);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}

/* التصنيفات */
.chips{position:sticky;top:67px;z-index:10;display:flex;gap:8px;overflow-x:auto;padding:14px 0;background:var(--bg);scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;border:1px solid var(--line);background:var(--card);border-radius:999px;padding:8px 16px;font-weight:600;font-size:15px}
.chip[aria-pressed="true"]{background:var(--ink);color:#fff;border-color:var(--ink)}

/* المنتجات */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:16px;padding-bottom:24px}
.skeleton{height:430px;border-radius:var(--radius);background:linear-gradient(90deg,#efe7dc,#f6f0e8,#efe7dc);background-size:200% 100%;animation:sh 1.2s infinite}
@keyframes sh{to{background-position:-200% 0}}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);display:flex;flex-direction:column}
.card-img{position:relative;aspect-ratio:1/0.82;background:#f3e8da;overflow:hidden}
.card-img img{width:100%;height:100%;object-fit:cover}
.size{position:absolute;top:12px;right:12px;background:rgba(255,253,249,.94);border-radius:999px;padding:4px 12px;font-weight:700;font-size:14px}
.out{position:absolute;inset:0;display:grid;place-items:center;background:rgba(239,226,209,.75);font-weight:700;color:var(--danger)}
.card-body{padding:14px 14px 16px;display:flex;flex-direction:column;gap:12px;flex:1}
.card h3{margin:0;font-size:17px;line-height:1.4}
.card .desc{margin:-6px 0 0;color:var(--muted);font-size:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* اختيار حبة / كرتون */
.units{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.unit{border:1.5px solid var(--line);background:#fff;border-radius:14px;padding:9px 10px;text-align:right;display:flex;flex-direction:column;gap:1px;transition:border-color .15s,background .15s}
.unit b{font-size:14px}
.unit .price{font-weight:700;font-size:17px}
.unit small{color:var(--muted);font-size:12.5px}
.unit .save{color:var(--ok);font-weight:600}
.unit[aria-pressed="true"]{border-color:var(--coffee);background:var(--accent-soft)}
.unit:disabled{opacity:.4;cursor:not-allowed}

.buy{display:flex;gap:8px;margin-top:auto}
.stepper{display:flex;align-items:center;border:1.5px solid var(--line);border-radius:14px;background:#fff;overflow:hidden}
.stepper button{width:40px;height:48px;border:0;background:none;font-size:22px;font-weight:600;color:var(--coffee)}
.stepper input{width:42px;height:48px;border:0;text-align:center;font-weight:700;font-size:17px;background:none;-moz-appearance:textfield}
.stepper input::-webkit-inner-spin-button{-webkit-appearance:none}
.add{flex:1;border:0;border-radius:14px;background:var(--coffee);color:#fff;font-weight:700;font-size:15.5px;min-height:48px;padding:0 10px;transition:background .15s,transform .1s}
.add:active{transform:scale(.98)}
.add.added{background:var(--ok)}
.add:disabled{background:#c9bcae}

/* شريط السلة */
.cartbar{position:fixed;z-index:30;bottom:max(14px,env(safe-area-inset-bottom));left:16px;right:16px;max-width:560px;margin:0 auto;
  display:flex;align-items:center;gap:12px;border:0;border-radius:18px;background:var(--ink);color:#fff;padding:14px 16px;
  box-shadow:0 12px 30px rgba(42,29,21,.35);font-weight:700;animation:up .25s ease}
@keyframes up{from{transform:translateY(20px);opacity:0}}
.cb-count{background:var(--accent);border-radius:10px;min-width:30px;height:30px;display:grid;place-items:center;font-size:15px}
.cb-label{flex:1;text-align:right}
.cb-total{direction:ltr}

/* النافذة السفلية */
.sheet-wrap{position:fixed;inset:0;z-index:50;display:flex;align-items:flex-end;justify-content:center}
.sheet-backdrop{position:absolute;inset:0;background:rgba(30,20,14,.45);animation:fade .2s}
@keyframes fade{from{opacity:0}}
.sheet{position:relative;width:100%;max-width:560px;max-height:92vh;max-height:92dvh;background:var(--bg);border-radius:24px 24px 0 0;display:flex;flex-direction:column;animation:up .25s ease}
@media(min-width:700px){.sheet-wrap{align-items:center}.sheet{border-radius:24px;max-height:88vh}}
.sheet-head{display:flex;align-items:center;gap:8px;padding:14px 16px;border-bottom:1px solid var(--line)}
.sheet-head h2{flex:1;margin:0;font-size:19px}
.icon-btn{width:40px;height:40px;border-radius:12px;border:1px solid var(--line);background:var(--card);font-size:18px}
.sheet-body{overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px;flex:1}
.sheet-foot{padding:12px 16px max(14px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--card)}

.line{display:flex;gap:12px;align-items:center;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:10px}
.line img{width:64px;height:64px;border-radius:12px;object-fit:cover;background:#efe6da}
.line .info{flex:1;min-width:0}
.line .info b{display:block;font-size:15px}
.line .info small{color:var(--muted);font-size:13px}
.line .lt{font-weight:700;font-size:15px}
.line .stepper button{width:34px;height:38px;font-size:19px}
.line .stepper input{width:34px;height:38px;font-size:15px}
.rm{border:0;background:none;color:var(--danger);font-size:13px;font-weight:600;padding:4px 0}
.empty{text-align:center;color:var(--muted);padding:40px 10px}
.empty b{display:block;color:var(--ink);font-size:18px;margin-bottom:4px}

.primary{width:100%;border:0;border-radius:16px;background:var(--coffee);color:#fff;font-weight:700;font-size:17px;min-height:56px;display:flex;align-items:center;justify-content:center;gap:10px}
.primary:disabled{opacity:.6}
.primary .num{opacity:.9}
.foot-row{display:flex;justify-content:space-between;margin-bottom:10px;font-weight:600}

/* النموذج */
.field{display:flex;flex-direction:column;gap:6px}
.field>span{font-weight:600;font-size:15px}
.field input,.field select,.notes textarea{width:100%;border:1.5px solid var(--line);border-radius:14px;background:#fff;padding:13px 14px;font-size:16px;outline:none}
.field input:focus,.field select:focus,.notes textarea:focus{border-color:var(--coffee)}
.field .invalid{border-color:var(--danger)!important;background:var(--danger-soft)}
.phone{display:flex;align-items:stretch;border:1.5px solid var(--line);border-radius:14px;background:#fff;overflow:hidden;direction:ltr}
.phone span{display:grid;place-items:center;padding:0 12px;background:#f2ebe1;font-weight:600;color:var(--muted)}
.phone input{border:0!important;border-radius:0;direction:ltr;text-align:left}
.phone:focus-within{border-color:var(--coffee)}
.loc-btn{border:1.5px dashed var(--line);background:transparent;border-radius:14px;padding:12px;font-weight:600;color:var(--coffee)}
.loc-btn.ok{border-style:solid;border-color:var(--ok);color:var(--ok);background:var(--ok-soft)}
.loc-btn small{color:var(--muted);font-weight:400}
.notes summary{cursor:pointer;color:var(--coffee);font-weight:600;padding:2px 0}
.notes textarea{margin-top:8px;resize:vertical}
.pay{border:0;margin:4px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}
.pay legend{font-weight:600;font-size:15px;margin-bottom:6px;padding:0}
.pay label{display:flex;align-items:center;gap:12px;border:1.5px solid var(--line);border-radius:14px;background:#fff;padding:13px 14px;cursor:pointer}
.pay label:has(input:checked){border-color:var(--coffee);background:var(--accent-soft)}
.pay input{accent-color:var(--coffee);width:20px;height:20px;margin:0}
.pay .pt{flex:1}
.pay .pt b{display:block}
.pay .pt small{color:var(--muted)}
.pay .ico{font-size:22px}
.summary{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:12px 14px}
.summary div{display:flex;justify-content:space-between;padding:4px 0;font-size:15px}
.summary .tot{border-top:1px dashed var(--line);margin-top:6px;padding-top:10px;font-weight:700;font-size:17px}
.summary .free{color:var(--ok);font-weight:600}
.err{margin:0;background:var(--danger-soft);color:var(--danger);border-radius:12px;padding:10px 12px;font-weight:600;font-size:14.5px}

/* شاشة التأكيد */
.done{position:fixed;inset:0;z-index:60;background:var(--bg);overflow-y:auto;padding:24px 16px 40px}
.done .box{max-width:480px;margin:0 auto;text-align:center}
.done .mark{width:84px;height:84px;margin:24px auto 14px;border-radius:50%;display:grid;place-items:center;font-size:40px;background:var(--ok-soft);color:var(--ok)}
.done .mark.bad{background:var(--danger-soft);color:var(--danger)}
.done h2{margin:0 0 4px;font-size:26px}
.done .code{display:inline-block;margin:10px 0 18px;padding:8px 18px;border-radius:12px;background:var(--card);border:1px solid var(--line);font-size:20px;font-weight:700;letter-spacing:1px}
.steps{display:flex;justify-content:space-between;margin:8px 0 22px;position:relative}
.steps::before{content:"";position:absolute;top:13px;right:8%;left:8%;height:3px;background:var(--line)}
.steps div{position:relative;flex:1;font-size:12.5px;color:var(--muted)}
.steps i{display:block;width:28px;height:28px;margin:0 auto 6px;border-radius:50%;background:var(--line);border:4px solid var(--bg);font-style:normal}
.steps .on{color:var(--ink);font-weight:600}
.steps .on i{background:var(--ok)}
.done .items{text-align:right;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:12px 14px;margin-bottom:16px}
.done .items div span:last-child{white-space:nowrap}
.done .items div{display:flex;justify-content:space-between;gap:10px;padding:5px 0;font-size:14.5px}
.done .actions{display:flex;flex-direction:column;gap:10px}
.secondary{display:flex;align-items:center;justify-content:center;gap:8px;min-height:52px;border-radius:16px;border:1.5px solid var(--line);background:var(--card);font-weight:700;text-decoration:none;color:var(--ink)}
.secondary.wa{background:#1f9d55;border-color:#1f9d55;color:#fff}

.wa-float{position:fixed;z-index:25;bottom:max(16px,env(safe-area-inset-bottom));right:16px;width:54px;height:54px;border-radius:50%;background:#1f9d55;color:#fff;display:grid;place-items:center;box-shadow:0 8px 20px rgba(31,157,85,.35)}
.wa-float svg{width:30px;height:30px}
body.has-cart .wa-float{bottom:calc(max(14px,env(safe-area-inset-bottom)) + 76px)}

.toast{position:fixed;z-index:70;top:84px;left:50%;transform:translateX(-50%);background:var(--ink);color:#fff;border-radius:14px;padding:10px 18px;font-weight:600;box-shadow:var(--shadow);animation:fade .2s;max-width:calc(100% - 32px)}

@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* الجوال: بطاقة أفقية مختصرة لتقليل التمرير */
@media (max-width:560px){
  .grid{grid-template-columns:1fr;gap:12px}
  .card{display:grid;grid-template-columns:118px 1fr;grid-template-rows:auto 1fr}
  .card-img{aspect-ratio:auto;height:100%;min-height:150px;grid-row:1/3}
  .card-img .size{top:8px;right:8px;padding:2px 9px;font-size:12.5px}
  .card-body{padding:12px;gap:10px}
  .card h3{font-size:15.5px}
  .card .desc{display:none}
  .card .units{grid-template-columns:1fr 1fr;gap:6px}
  .unit{padding:7px 8px;border-radius:12px}
  .unit .price{font-size:15px}
  .unit small{font-size:11.5px}
  .buy{gap:6px}
  .stepper button{width:32px;height:44px}
  .stepper input{width:32px;height:44px;font-size:16px}
  .add{min-height:44px;font-size:14.5px}
  .skeleton{height:200px}
  .perks li{font-size:12px;padding:10px 2px}
}

/* الشاشات الكبيرة: البانر فيه المزايا أصلاً، فنختصر النص تحته */
@media (min-width:701px){
  .perks,.eyebrow{display:none}
  .hero-txt{padding:18px 4px 0}
  .hero h1{font-size:30px}
}

/* طريقة الاستلام: منزل / مكتب */
.dprice{font-weight:700;white-space:nowrap;font-size:15px}
.dtype label.off{opacity:.45;pointer-events:none}
.office-note{margin:0;background:var(--accent-soft);border-radius:12px;padding:10px 12px;font-size:14px;color:var(--coffee);font-weight:500}
.wa-opt{display:flex;align-items:flex-start;gap:10px;font-size:14px;color:var(--coffee);line-height:1.6;cursor:pointer}
.wa-opt input{width:20px;height:20px;margin-top:2px;accent-color:var(--coffee);flex:none}

.dpick{color:var(--muted);font-weight:500;font-size:12.5px}

.catalog-search,.store-policies{display:block;max-width:1100px;margin:20px auto;padding:0 20px}.catalog-search input{display:block;width:100%;padding:14px;border:1px solid var(--line);border-radius:12px;font:inherit;margin-top:8px}.card-img{border:0;width:100%;cursor:pointer;padding:0;font:inherit}.product-details{width:min(720px,94vw);max-height:90vh;border:1px solid var(--line);border-radius:20px;padding:22px;background:var(--bg,#fff);color:var(--text,#222)}.product-details::backdrop{background:#0008}.detail-photos{display:flex;gap:12px;overflow:auto}.detail-photos img{width:240px;height:240px;object-fit:contain}.product-details dl{display:grid;grid-template-columns:1fr 2fr;gap:10px}.product-details dd{margin:0}.store-policies p,.product-details p{white-space:pre-wrap}.store-policies details{padding:15px;border-bottom:1px solid var(--line)}

.catalog-filters{display:flex;gap:12px;max-width:1100px;margin:12px auto;padding:0 20px}.catalog-filters label{flex:1}.catalog-filters select{display:block;width:100%;padding:10px;margin-top:6px;border:1px solid var(--line);border-radius:10px;font:inherit}.product-details{color:var(--ink)}

.legal-info{display:flex;flex-wrap:wrap;gap:6px 16px;justify-content:center;padding:16px 0;color:var(--muted,#806651);font-size:13px;text-align:center}
