* { margin:0; padding:0; box-sizing:border-box; }
:root {
  --bg:#0f1115; --card:#1a1d24; --card2:#22262f; --text:#f2f3f5; --muted:#9aa0ab;
  --gold:#e8b94a; --gold2:#c9952f; --green:#25d366; --red:#e05252;
  --border:#2a2e38; --on-accent:#171205; --on-green:#06130a; --fb:#7aa2f7;
  --radius:14px;
}
body { font-family:'Cairo',system-ui,sans-serif; background:var(--bg); color:var(--text); min-height:100vh; display:flex; flex-direction:column; }
.container { max-width:1000px; margin:0 auto; padding:0 16px; }
a { color:var(--gold); text-decoration:none; }
.site-header { background:var(--card); border-bottom:1px solid var(--border); position:sticky; top:0; z-index:10; }
.header-inner { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; }
.brand { display:flex; align-items:center; gap:10px; }
.brand-logo { width:44px; height:44px; border-radius:50%; object-fit:cover; display:block; }
.brand-mark { font-weight:900; font-size:26px; letter-spacing:2px; color:var(--gold); }
.brand-sub { color:var(--muted); font-size:14px; }
.header-links { display:flex; gap:14px; font-weight:600; font-size:15px; }
.fb-link { color:var(--fb); }
.wa-link { color:var(--green); }
.hero { padding:36px 0 20px; text-align:center; }
.hero h1 { font-size:30px; font-weight:900; margin-bottom:8px; }
.hero p { color:var(--muted); font-size:16px; }
.cats { display:flex; gap:8px; flex-wrap:wrap; padding:18px 16px 6px; }
.cats button { background:var(--card); color:var(--text); border:1px solid var(--border); border-radius:999px; padding:7px 16px; font-family:inherit; font-size:14px; font-weight:600; cursor:pointer; }
.cats button.active { background:var(--gold); color:var(--on-accent); border-color:var(--gold); }
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(105px,1fr)); gap:8px; padding:14px 10px 30px; }
.card { background:var(--card); border-radius:var(--radius); overflow:hidden; border:1px solid var(--border); cursor:pointer; transition:transform .12s; }
.card:hover { transform:translateY(-3px); }
.card img { width:100%; aspect-ratio:1; object-fit:cover; background:var(--card2); display:block; }
.card .ph { width:100%; aspect-ratio:1; display:flex; align-items:center; justify-content:center; color:var(--muted); background:var(--card2); font-size:40px; font-weight:900; }
.card-body { padding:8px; }
.card-body h3 { font-size:13px; font-weight:700; margin-bottom:4px; line-height:1.4; }
.price { color:var(--gold); font-weight:900; font-size:15px; }
.old-price { color:var(--muted); text-decoration:line-through; font-size:13px; margin-inline-start:6px; font-weight:400; }
.empty { text-align:center; color:var(--muted); padding:60px 0; font-size:17px; }
.modal[hidden] { display:none; }
.modal { position:fixed; inset:0; background:rgba(0,0,0,.7); display:flex; align-items:center; justify-content:center; padding:16px; z-index:20; }
.modal-card { background:var(--card); border-radius:var(--radius); max-width:480px; width:100%; max-height:90vh; overflow:auto; position:relative; padding:20px; }
.modal-close { position:absolute; top:10px; inset-inline-start:10px; background:var(--card2); color:var(--text); border:none; border-radius:50%; width:32px; height:32px; cursor:pointer; font-size:14px; }
.modal-card img { width:100%; border-radius:10px; margin-bottom:14px; background:var(--card2); }
.modal-card h2 { font-size:20px; margin-bottom:8px; }
.modal-card .desc { color:var(--muted); font-size:14px; line-height:1.7; margin:10px 0; white-space:pre-wrap; }
.chips { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.chip { background:var(--card2); border-radius:8px; padding:4px 10px; font-size:13px; }
.order-btn { display:block; text-align:center; background:var(--green); color:var(--on-green); font-weight:900; font-size:17px; border-radius:12px; padding:13px; margin-top:16px; }
.site-footer { margin-top:auto; background:var(--card); border-top:1px solid var(--border); padding:22px 0; text-align:center; color:var(--muted); font-size:14px; }
.f-brand { color:var(--gold); font-weight:900; font-size:18px; margin-bottom:6px; }

/* Admin */
.admin-wrap { max-width:860px; margin:0 auto; padding:24px 16px 60px; }
.admin-wrap h1 { font-size:24px; margin-bottom:4px; }
.admin-wrap .sub { color:var(--muted); margin-bottom:22px; font-size:14px; }
.panel { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:18px; margin-bottom:18px; }
.panel h2 { font-size:17px; margin-bottom:14px; color:var(--gold); }
label { display:block; font-size:13px; color:var(--muted); margin:10px 0 4px; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width:100%; background:var(--card2); border:1px solid var(--border); color:var(--text);
  border-radius:10px; padding:10px 12px; font-family:inherit; font-size:14px;
}
textarea { min-height:90px; resize:vertical; }
.btn { background:var(--gold); color:var(--on-accent); border:none; border-radius:10px; padding:10px 18px; font-family:inherit; font-weight:700; font-size:14px; cursor:pointer; margin-top:12px; }
.btn.secondary { background:var(--card2); color:var(--text); border:1px solid var(--border); }
.btn.danger { background:transparent; color:var(--red); border:1px solid var(--red); }
.btn.small { padding:6px 12px; font-size:13px; margin-top:0; }
.row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.row > * { flex:1; }
.msg { margin-top:10px; font-size:14px; min-height:18px; }
.msg.ok { color:var(--green); } .msg.err { color:var(--red); }
.list-item { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 0; border-bottom:1px solid var(--border); }
.list-item:last-child { border-bottom:none; }
.list-item .name { font-weight:600; font-size:14px; }
.list-item .meta { color:var(--muted); font-size:12px; }
.list-item .actions { display:flex; gap:6px; }
.thumb { width:48px; height:48px; border-radius:8px; object-fit:cover; background:var(--card2); }
.badge-off { color:var(--red); font-size:12px; }
.topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; }
.login-card { max-width:380px; margin:80px auto; }
img.preview { width:100%; max-width:220px; border-radius:10px; margin-top:10px; background:var(--card2); }
.hint { font-size:12px; color:var(--muted); margin-top:4px; }

/* ---------- cart & checkout ---------- */
.cart-btn { position:relative; background:none; border:none; font-size:22px; cursor:pointer; padding:2px 6px; }
.cart-count { position:absolute; top:-4px; inset-inline-start:-2px; background:var(--gold); color:var(--on-accent); border-radius:50%; font-size:11px; font-weight:700; min-width:18px; height:18px; line-height:18px; text-align:center; }
.cart-drawer { position:fixed; inset:0; background:rgba(0,0,0,.7); z-index:30; display:flex; justify-content:flex-start; }
.cart-drawer[hidden] { display:none; }
.cart-panel { background:var(--bg); width:100%; max-width:430px; height:100%; overflow-y:auto; padding:18px; border-inline-end:1px solid var(--border); }
.cart-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.cart-head h2 { font-size:20px; }
.cart-close { background:var(--card2); color:var(--text); border:none; border-radius:50%; width:32px; height:32px; cursor:pointer; font-size:14px; }
.cart-item { display:flex; align-items:center; gap:10px; background:var(--card); border-radius:10px; padding:10px; margin-bottom:10px; }
.cart-item img, .ci-ph { width:56px; height:56px; border-radius:8px; object-fit:cover; background:var(--card2); flex:0; display:flex; align-items:center; justify-content:center; font-size:10px; color:var(--muted); }
.ci-info { flex:1; min-width:0; }
.ci-name { font-size:14px; font-weight:600; }
.ci-price { color:var(--gold); font-size:13px; }
.ci-qty { display:flex; align-items:center; gap:8px; }
.ci-qty button { width:26px; height:26px; border-radius:6px; border:none; background:var(--card2); color:var(--text); font-size:15px; cursor:pointer; }
.ci-del { background:none; border:none; color:var(--red); cursor:pointer; font-size:13px; }
.cart-total-row { font-size:16px; margin:12px 0; }
.co-title { font-size:16px; margin:16px 0 6px; }
.hp { position:absolute !important; left:-9999px !important; opacity:0 !important; height:0 !important; }
.modal-actions { display:flex; flex-direction:column; gap:10px; margin-top:14px; }
.cart-add-btn { background:var(--gold); color:var(--on-accent); border:none; cursor:pointer; }
.secondary-btn { background:var(--card2); color:var(--text); border:none; cursor:pointer; margin-top:10px; }
.msg.err { color:var(--red); }
.msg.ok { color:var(--green); }

/* ---------- admin orders ---------- */
.badge { background:var(--gold); color:var(--on-accent); border-radius:20px; font-size:12px; font-weight:700; padding:2px 10px; }
.order-card { background:var(--card2); border-radius:10px; padding:14px; margin-bottom:12px; }
.order-card.done { opacity:.55; }
.o-head { display:flex; flex-wrap:wrap; gap:10px; align-items:baseline; margin-bottom:8px; }
.o-items { font-size:14px; color:var(--text); margin-bottom:6px; }
.o-total { color:var(--gold); font-weight:700; margin-bottom:6px; }
.o-addr, .o-notes { font-size:13px; color:var(--muted); margin-bottom:4px; }

.ship-item{display:flex;align-items:center;gap:12px;padding:6px 0;border-bottom:1px solid var(--border)}
.ship-item .ship-gov{flex:1;font-weight:600}
.ship-item input{max-width:140px}
select#co-gov{margin-top:8px}
.o-ship{color:var(--muted);font-size:14px;margin-top:4px}

/* ---------- themes ---------- */
body[data-theme=light] {
  --bg:#f4f5f7; --card:#ffffff; --card2:#eceef2; --text:#1d2126; --muted:#68707c;
  --gold:#b3861c; --gold2:#96700f; --border:#dfe3e9; --on-accent:#241a02; --fb:#3b6fd4;
}
body[data-theme=bold] {
  --bg:#0e1a2b; --card:#16273e; --card2:#1f3350; --text:#f3f7fc; --muted:#9db1c9;
  --gold:#ff7a1a; --gold2:#e2620a; --border:#29415f; --on-accent:#221000; --fb:#6ea8ff;
}
body[data-theme=soft] {
  --bg:#faf4ec; --card:#ffffff; --card2:#f3e9dc; --text:#3e332a; --muted:#98897a;
  --gold:#c96f4a; --gold2:#b05a36; --border:#eaddd0; --on-accent:#fff7f2; --fb:#4a7fc9;
}

/* ---------- theme picker (admin) ---------- */
.theme-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px;margin-top:8px}
.theme-card{border:2px solid var(--border);border-radius:12px;padding:12px;cursor:pointer;background:var(--card2)}
.theme-card.active{border-color:var(--gold)}
.theme-card .tc-name{font-weight:700;font-size:14px;margin-bottom:8px}
.tc-sw{display:flex;gap:6px}
.tc-sw span{width:22px;height:22px;border-radius:6px;display:block}
/* ---------- multi-image ---------- */
.thumbs{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.thumb-box{position:relative;width:76px;height:76px}
.thumb-box img{width:100%;height:100%;object-fit:cover;border-radius:8px;background:var(--card2)}
.thumb-del{position:absolute;top:-6px;inset-inline-start:-6px;background:var(--red);color:#fff;border:none;border-radius:50%;width:20px;height:20px;font-size:11px;cursor:pointer;line-height:1}
.main-badge{position:absolute;bottom:2px;inset-inline-start:2px;background:var(--gold);color:var(--on-accent);font-size:9px;font-weight:700;border-radius:6px;padding:1px 5px}
.gal-thumbs{display:flex;gap:8px;margin:8px 0 4px;overflow-x:auto}
.gal-thumbs img{width:60px;height:60px;object-fit:cover;border-radius:8px;cursor:pointer;border:2px solid transparent;flex:0}
.gal-thumbs img.active{border-color:var(--gold)}

/* Product modal gallery: keep the main photo modest instead of full-width */
#gal-main { display:block; width:auto; max-width:100%; max-height:240px; object-fit:contain; margin:0 auto 14px; border-radius:10px; background:var(--card2); }

.search-box { width:100%; box-sizing:border-box; background:var(--card); border:1px solid var(--border); color:var(--text); border-radius:999px; padding:10px 18px; font-family:inherit; font-size:15px; margin-top:10px; }
.search-box:focus { outline:2px solid var(--gold); border-color:var(--gold); }
.search-box::placeholder { color:var(--muted); }

.desc.clamped { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.desc-toggle { background:none; border:none; color:var(--gold); font-family:inherit; font-size:14px; font-weight:700; cursor:pointer; padding:2px 0; margin-bottom:8px; }

.tabs { display:flex; gap:8px; margin:16px 0 18px; }
.tab-btn { flex:1; background:var(--card); color:var(--text); border:1px solid var(--border); border-radius:10px; padding:12px 6px; font-family:inherit; font-size:15px; font-weight:700; cursor:pointer; }
.tab-btn.active { background:var(--gold); color:#14161c; border-color:var(--gold); }
.tab-page[hidden] { display:none; }
