@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap");
:root{--bg:#fff;--fg:#1d1a14;--muted:#7a7263;--accent:#b8892d;--gold2:#d9b15c;--border:#eadfc8;--soft:#fbf7ef;--radius:14px;--font:"Tajawal",system-ui,sans-serif;color-scheme:light}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--fg);font-family:var(--font);direction:rtl}
button,input,select,textarea{font:inherit}
.wrap{max-width:78rem;margin:0 auto;padding:0 1rem}
header.top{position:sticky;top:0;z-index:20;background:#fff;border-bottom:1px solid var(--border)}
.top .wrap{display:flex;align-items:center;gap:.75rem;padding:.5rem 1rem;flex-wrap:wrap}
.logo{height:56px;width:auto;object-fit:contain}
.brand{font-weight:800;font-size:1.25rem;flex:1}
.btn{border:1px solid var(--accent);background:var(--accent);color:#fff;border-radius:999px;padding:.55rem 1.1rem;cursor:pointer;font-weight:700}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn-secondary,.btn.ghost{background:#fff;color:var(--accent)}
.btn.sm{padding:.3rem .7rem;font-size:.85rem}
.btn.danger{background:#fff;color:#b3261e;border-color:#e3b3ae}
.cartbtn{position:relative}
.count{position:absolute;top:-6px;left:-6px;background:var(--fg);color:#fff;border-radius:999px;font-size:.75rem;min-width:20px;height:20px;display:grid;place-items:center}
.hero{background:linear-gradient(135deg,#fffaf0,#f6ead0);border-bottom:1px solid var(--border)}
.hero .wrap{display:grid;gap:1.5rem;padding:2.5rem 1rem;align-items:center}
@media(min-width:800px){.hero .wrap{grid-template-columns:1.3fr 1fr}}
.hero h1{font-size:clamp(2rem,5vw,3.2rem);margin:0 0 .5rem;color:var(--fg)}
.hero h1 span{color:var(--accent)}
.hero img{width:100%;max-height:320px;object-fit:contain}
.cats{display:grid;grid-template-columns:repeat(2,1fr);gap:.75rem;margin:1.5rem 0}
@media(min-width:800px){.cats{grid-template-columns:repeat(5,1fr)}}
.cat{border:1px solid var(--border);background:#fff;border-radius:var(--radius);padding:1rem;cursor:pointer;font-weight:700;text-align:center}
.cat.on{background:var(--accent);color:#fff;border-color:var(--accent)}
h2{font-size:1.5rem;margin:2rem 0 1rem;border-right:4px solid var(--accent);padding-right:.6rem}
.tools{display:flex;gap:.5rem;flex-wrap:wrap}
.input,select.input,textarea.input{border:1px solid var(--border);border-radius:10px;padding:.6rem .8rem;background:#fff;width:100%}
.tools .input{flex:1;min-width:180px;width:auto}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:1rem}
.card{border:1px solid var(--border);border-radius:var(--radius);background:#fff;overflow:hidden;display:flex;flex-direction:column}
.card .img{aspect-ratio:1;background:var(--soft);display:grid;place-items:center;color:var(--muted)}
.card .img img{width:100%;height:100%;object-fit:cover}
.card .body{padding:.8rem;display:flex;flex-direction:column;gap:.35rem;flex:1}
.price{color:var(--accent);font-weight:800;font-size:1.2rem}
.badge{display:inline-block;border:1px solid var(--border);border-radius:999px;padding:.1rem .55rem;font-size:.78rem;background:var(--soft);margin-left:.25rem}
.badge.out{background:#fbe9e7;color:#b3261e;border-color:#f0c3bd}
.muted,.hint{color:var(--muted);font-size:.9rem}
.ads{display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
.ad{border-radius:var(--radius);background:linear-gradient(135deg,#1d1a14,#3b2f18);color:#fff;padding:1.2rem;display:flex;gap:1rem;align-items:center}
.ad img{width:96px;height:96px;object-fit:cover;border-radius:10px}
.ad h3{margin:0;color:var(--gold2)}
.panel{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:50;display:flex;justify-content:flex-start}
.sheet{background:#fff;width:min(560px,100%);height:100%;overflow:auto;padding:1.2rem}
.modal{background:#fff;margin:auto;width:min(720px,94%);max-height:92vh;overflow:auto;border-radius:var(--radius);padding:1.2rem}
.line{display:flex;gap:.7rem;align-items:center;border-bottom:1px solid var(--border);padding:.6rem 0}
.line img,.thumb{width:60px;height:60px;object-fit:cover;border-radius:8px;background:var(--soft)}
.qty{display:flex;align-items:center;gap:.4rem}
.qty button{width:30px;height:30px;border-radius:50%;border:1px solid var(--border);background:#fff;cursor:pointer}
.sum{background:var(--soft);border:1px solid var(--border);border-radius:var(--radius);padding:1rem}
.sum div{display:flex;justify-content:space-between;padding:.2rem 0}
.sum .tot{font-weight:800;font-size:1.15rem;border-top:1px solid var(--border);margin-top:.4rem;padding-top:.5rem}
.field{display:flex;flex-direction:column;gap:.3rem;margin-bottom:.8rem}
.field label{font-weight:700;font-size:.9rem}
.opts{display:flex;flex-wrap:wrap;gap:.5rem}
.opt{border:1px solid var(--border);border-radius:10px;padding:.6rem .9rem;cursor:pointer;background:#fff}
.opt.on{border-color:var(--accent);background:#fbf3e0;font-weight:700}
.stack{display:flex;flex-direction:column;gap:.75rem}
.row{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}
footer{background:#1d1a14;color:#e8dcc2;margin-top:3rem}
footer .wrap{padding:2rem 1rem;display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
footer a{color:var(--gold2)}
footer img.cr{max-width:160px;border-radius:8px}
.wa{position:fixed;bottom:18px;left:18px;background:#25d366;color:#fff;border-radius:999px;padding:.75rem 1.1rem;font-weight:800;text-decoration:none;z-index:30;box-shadow:0 6px 20px rgba(0,0,0,.2)}
.stars button{background:none;border:none;font-size:1.8rem;cursor:pointer;color:#d8cfbd}
.stars button.on{color:var(--accent)}
.alert{padding:.7rem 1rem;border-radius:10px;margin:.5rem 0}
.alert-error{background:#fbe9e7;color:#8c1d18}
.alert-ok{background:#eef7ea;color:#24561a}
.loading{display:flex;gap:.6rem;align-items:center;padding:2rem;justify-content:center}
.spinner{width:20px;height:20px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:sp 1s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
.empty{text-align:center;padding:2rem;color:var(--muted);border:1px dashed var(--border);border-radius:var(--radius)}
.empty-title{font-weight:700;color:var(--fg)}
.tabs{display:flex;gap:.4rem;flex-wrap:wrap;margin:1rem 0}
.box{border:1px solid var(--border);border-radius:var(--radius);padding:1rem;margin-bottom:1rem;background:#fff}
.two{display:grid;gap:.8rem}
@media(min-width:700px){.two{grid-template-columns:1fr 1fr}}
.list-item{border-bottom:1px solid var(--border);padding:.6rem 0}
.stats{display:grid;grid-template-columns:repeat(2,1fr);gap:.8rem;margin-bottom:1rem}
@media(min-width:800px){.stats{grid-template-columns:repeat(3,1fr)}}
.stat{border:1px solid var(--border);background:var(--soft);border-radius:var(--radius);padding:1rem;cursor:pointer;display:flex;flex-direction:column;gap:.2rem;text-align:right}
.stat .n{font-size:2rem;font-weight:800;color:var(--accent)}
.field label input,.field label select,.field label textarea{font-weight:400}
.field label{display:flex;flex-direction:column;gap:.3rem}
.imgbox{position:relative}
.imgbox img{width:84px;height:84px;object-fit:cover;border-radius:10px;border:1px solid var(--border)}
.imgbox .x{position:absolute;top:-6px;left:-6px;width:24px;height:24px;border-radius:50%;border:none;background:#b3261e;color:#fff;cursor:pointer}
.log{white-space:pre-wrap;background:var(--soft);border:1px solid var(--border);border-radius:10px;padding:.6rem;font-family:inherit;font-size:.85rem;margin:0}
.tabs .cat{padding:.5rem .9rem}
