/* ============================================================================
   Brand Spot — ستايل المتجر ولوحة التحكم
   بالِت اللوجو: كورال دافي / نعناع فاتح / أبيض كريمي
   موبايل أولاً، RTL، من غير مكتبات خارجية
   ========================================================================== */

@font-face { font-family: 'Cairo'; font-weight: 400; font-display: swap; src: url('fonts/cairo-400.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Cairo'; font-weight: 600; font-display: swap; src: url('fonts/cairo-600.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Cairo'; font-weight: 800; font-display: swap; src: url('fonts/cairo-800.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Cairo'; font-weight: 400; font-display: swap; src: url('fonts/cairo-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cairo'; font-weight: 600; font-display: swap; src: url('fonts/cairo-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cairo'; font-weight: 800; font-display: swap; src: url('fonts/cairo-latin-800.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Archivo Black'; font-weight: 400; font-display: swap; src: url('fonts/archivo-black.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --bg: #FDF7F2;
  --surface: #FFFFFF;
  --ink: #2A2320;
  --ink-soft: #4C423B;
  --muted: #83736A;
  --line: #F0E2D6;
  --line-strong: #E3D2C3;
  --coral: #F0907A;
  --coral-strong: #B84F38;
  --coral-soft: #FDEFEA;
  --mint: #A9D8CB;
  --mint-soft: #EAF6F2;
  --mint-ink: #2F6E5E;
  --ok: #2F7A5F;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(42, 35, 32, .05);
  --shadow-md: 0 18px 34px -26px rgba(42, 35, 32, .55);
  --maxw: 560px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Cairo', 'Noto Kufi Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font-family: inherit; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wordmark { font-family: 'Archivo Black', 'Cairo', sans-serif; letter-spacing: -.4px; direction: ltr; unicode-bidi: isolate; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(253, 247, 242, .9);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.brand img { width: 38px; height: 38px; flex: none; }
.brand { padding: 8px 0; }
.brand-logo { width: auto !important; height: 54px !important; flex: none; display: block; }
@media (min-width: 980px) { .topbar .wrap { height: 84px; } .brand-logo { height: 60px !important; } }
.brand-text { min-width: 0; }
.brand-text b { display: block; font-size: 15px; line-height: 1.1; }
.brand-text small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; letter-spacing: .2px; }

.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center; border: 1px solid var(--line);
  background: #fff; color: var(--ink); text-decoration: none; flex: none;
}
.icon-btn svg { width: 23px; height: 23px; stroke-width: 2; }
.icon-btn { border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.97); }
.cart-count {
  position: absolute; top: -6px; left: -6px; min-width: 19px; height: 19px;
  border-radius: 999px; background: var(--coral-strong); color: #fff;
  font-size: 11px; font-weight: 800; display: grid; place-items: center;
  padding: 0 5px; border: 2px solid var(--bg);
}
.cart-count[hidden] { display: none; }

/* --------------------------------------------------------------- demo strip */
.demo-banner {
  background: var(--mint-soft); border-bottom: 1px solid #D6EDE5;
  color: var(--mint-ink); font-size: 11.5px; font-weight: 600;
  text-align: center; padding: 7px 16px; line-height: 1.5;
}
.demo-banner[hidden] { display: none; }

/* --------------------------------------------------------------------- hero */
.hero { padding: 26px 0 4px; position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  color: var(--coral-strong); background: var(--coral-soft);
  border-radius: 999px; padding: 5px 12px; margin: 0 0 12px;
}
h1 { font-size: 26px; line-height: 1.42; font-weight: 800; letter-spacing: -.3px; margin: 0 0 8px; }
.hero .lead { font-size: 13.5px; line-height: 1.85; color: var(--muted); margin: 0; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 24px 0 10px; }
.section-head h2 { font-size: 15px; font-weight: 800; margin: 0; }
.section-head span { font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------------- grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 0 28px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card {
  display: block; text-decoration: none; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
}
.card:active { transform: scale(.985); }
.card-media { position: relative; aspect-ratio: 4 / 5; background: #F6EDE6; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 10px 12px 12px; }
.card-title { font-size: 13px; font-weight: 600; line-height: 1.55; margin: 0 0 3px; min-height: 2.9em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 11.5px; color: var(--muted); margin: 0 0 7px; }
.card-price { font-size: 14px; font-weight: 800; margin: 0; }
.card-sold .card-media img { filter: saturate(.5); opacity: .6; }
.card-sold .card-price { color: var(--muted); }

.badge-sold { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(253, 247, 242, .35); }
.badge-sold span {
  background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 6px 15px; border-radius: 999px; box-shadow: 0 8px 20px -12px rgba(0, 0, 0, .6);
}

.noimg {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--coral-soft), var(--mint-soft));
}
.noimg img { width: 44%; opacity: .35; }

/* ----------------------------------------------------------------- back link */
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted);
  text-decoration: none; padding: 16px 0 2px; }
.back svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------- product page */
.pdp-media { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #F6EDE6; box-shadow: var(--shadow-md); }
.pdp-media img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.pdp-body { padding: 16px 0 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  padding: 5px 11px; border-radius: 999px; background: #F4EAE1; color: #6E5B4F; }
.chip-coral { background: var(--coral-soft); color: var(--coral-strong); }
.chip-mint { background: var(--mint-soft); color: var(--mint-ink); }
.chip-out { background: #F1E9E2; color: var(--muted); }
.pdp-title { font-size: 21px; font-weight: 800; line-height: 1.45; margin: 4px 0 8px; }
.pdp-price { font-size: 20px; font-weight: 800; color: var(--coral-strong); margin: 0 0 14px; }
.pdp-desc { font-size: 13.5px; line-height: 1.9; color: var(--ink-soft); margin: 0 0 16px; white-space: pre-line; }

.note { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.75;
  color: var(--ink-soft); background: var(--mint-soft); border: 1px solid #D9EEE7;
  border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; }
.note svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--mint-ink); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; padding: 0 18px; border-radius: 14px;
  font-size: 15px; font-weight: 700; border: 0; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.99); }
.btn svg { width: 19px; height: 19px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--coral-strong); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line-strong); color: var(--ink); }
.btn-mint { background: var(--mint-soft); color: var(--mint-ink); border: 1px solid #D9EEE7; }
.btn-sm { min-height: 40px; font-size: 12.5px; border-radius: 11px; width: auto; padding: 0 14px; }
.btn-block { width: 100%; }

.actionbar {
  position: sticky; bottom: 0; z-index: 30;
  background: rgba(253, 247, 242, .95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); margin-top: 8px;
}
.actionbar .wrap { display: flex; align-items: center; gap: 12px; }
.actionbar .ab-price { flex: none; }
.actionbar .ab-price small { display: block; font-size: 11px; color: var(--muted); }
.actionbar .ab-price b { font-size: 16px; font-weight: 800; }
.actionbar .btn { flex: 1; }

/* --------------------------------------------------------------------- cart */
.cart-list { border-top: 1px solid var(--line); }
.cart-row { display: grid; grid-template-columns: 74px 1fr auto; gap: 12px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-thumb { width: 74px; height: 92px; border-radius: 12px; overflow: hidden; background: #F6EDE6; border: 1px solid var(--line); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-name { font-size: 13.5px; font-weight: 700; line-height: 1.5; margin: 0 0 3px; }
.cart-meta { font-size: 11.5px; color: var(--muted); margin: 0 0 6px; }
.cart-price { font-size: 13.5px; font-weight: 800; margin: 0; }
.cart-remove { background: none; border: 0; font-size: 12px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px 4px; }

.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; margin: 18px 0; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13.5px; color: var(--ink-soft); padding: 10px 0; }
.summary-row + .summary-row { border-top: 1px dashed var(--line); }
.summary-row.total { font-size: 15px; font-weight: 800; color: var(--ink); }
.summary-row.total b { font-size: 18px; color: var(--coral-strong); }

/* -------------------------------------------------------------------- forms */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px 6px; margin: 0 0 14px; }
.form-card > h2 { font-size: 14px; font-weight: 800; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.form-card > h2 .num { width: 22px; height: 22px; border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 11.5px; display: grid; place-items: center; flex: none; }

.field { margin: 0 0 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin: 0 0 6px; }
.field .opt { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
  width: 100%; font-size: 15px; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease; appearance: none;
}
.field input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--coral-strong); }
.field select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2383736A' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; background-size: 18px; padding-left: 38px;
}
.field textarea { min-height: 88px; resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(240, 144, 122, .2); }
.field .err { display: none; font-size: 11.5px; font-weight: 600; color: #B3261E; margin: 6px 0 0; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #D9584F; }
.field.invalid .err { display: block; }
.hint-line { font-size: 11.5px; color: var(--muted); margin: -6px 0 12px; line-height: 1.7; }

/* ------------------------------------------------------------------ payment */
.pay { display: grid; gap: 10px; margin: 0 0 6px; }
.pay label { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 14px; background: #fff; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.pay input { appearance: none; width: 19px; height: 19px; border: 1.5px solid #CBB9AC; border-radius: 999px;
  margin: 2px 0 0; flex: none; background: #fff; }
.pay input:checked { border-color: var(--coral-strong); border-width: 5px; }
.pay label:has(input:checked) { border-color: var(--coral); background: #FFF9F6; box-shadow: 0 0 0 3px rgba(240, 144, 122, .12); }
.pay-title { font-size: 13.5px; font-weight: 700; }
.pay-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.65; }

.instapay { display: none; margin: 12px 0 0; }
.instapay.show { display: block; }
.copy-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px dashed var(--line-strong);
  border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; }
.copy-row .lbl { font-size: 10.5px; color: var(--muted); display: block; }
.copy-row code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; font-weight: 600; direction: ltr; display: inline-block; }
.copy-row .btn-sm { margin-inline-start: auto; flex: none; }
.steps { margin: 0; padding: 0 18px 0 0; font-size: 12.5px; line-height: 1.95; color: var(--ink-soft); }

/* ------------------------------------------------------------------ preview */
.preview { margin: 20px 0 4px; }
.preview h2 { font-size: 14px; font-weight: 800; margin: 0 0 4px; }
.preview .hint { font-size: 12px; color: var(--muted); margin: 0 0 10px; line-height: 1.7; }
.wa-bubble { background: #fff; border: 1px solid #D9EEE7; border-inline-start: 4px solid var(--mint);
  border-radius: 6px 14px 14px 14px; padding: 12px 14px; font-size: 12.5px; line-height: 2;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink);
  box-shadow: 0 10px 26px -24px rgba(0, 0, 0, .9); margin: 0; }

/* --------------------------------------------------------------------- done */
.done { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px; margin: 18px 0 0; text-align: center; box-shadow: var(--shadow-md); }
.done.show { display: block; }
.done .ok-mark { width: 46px; height: 46px; border-radius: 999px; background: var(--mint-soft); color: var(--mint-ink);
  display: grid; place-items: center; margin: 0 auto 12px; }
.done h2 { font-size: 16px; font-weight: 800; margin: 0 0 6px; }
.done p { font-size: 12.5px; color: var(--muted); line-height: 1.85; margin: 0 0 16px; }
.done .btn + .btn { margin-top: 10px; }

/* -------------------------------------------------------------------- empty */
.empty { text-align: center; padding: 60px 24px 72px; }
.empty .emoji { width: 64px; height: 64px; border-radius: 999px; background: #F6EDE6;
  display: grid; place-items: center; margin: 0 auto 16px; font-size: 26px; }
.empty h2 { font-size: 17px; font-weight: 800; margin: 0 0 6px; }
.empty p { font-size: 13px; color: var(--muted); line-height: 1.85; margin: 0 0 20px; }

/* ------------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--line); margin-top: 26px; padding: 24px 0 calc(30px + env(safe-area-inset-bottom, 0px));
  text-align: center; font-size: 12px; color: var(--muted); line-height: 2; }
.footer img { width: 46px; margin: 0 auto 8px; }
.footer b { color: var(--ink); font-weight: 800; }
.footer a { color: var(--ink); text-decoration: none; font-weight: 700; }
.footer .foot-links { display: flex; gap: 16px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }

/* -------------------------------------------------------------------- toast */
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(14px); background: var(--ink); color: #fff; font-size: 12.5px;
  font-weight: 600; padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease; z-index: 90; white-space: nowrap;
  max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------- skeletons */
.skel { background: linear-gradient(100deg, #F4EAE1 20%, #FBF4EE 40%, #F4EAE1 60%);
  background-size: 220% 100%; animation: shimmer 1.3s infinite linear; border-radius: 12px; }
@keyframes shimmer { to { background-position: -220% 0; } }
.skel-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; }
.skel-card .skel-media { aspect-ratio: 4 / 5; }
.skel-card .skel-line { height: 12px; margin: 10px 12px; }
.skel-card .skel-line.short { width: 50%; }

/* ==========================================================================
   لوحة التحكم
   ========================================================================== */

.admin-body { background: #FBF3EC; }
.adm-head { position: sticky; top: 0; z-index: 40; background: rgba(253, 247, 242, .92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.adm-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 10px; }
.adm-head .t { display: flex; align-items: center; gap: 9px; min-width: 0; }
.adm-head .t img { width: 32px; height: 32px; }
.adm-head .t b { font-size: 13.5px; font-weight: 800; display: block; line-height: 1.2; }
.adm-head .t small { font-size: 10.5px; color: var(--muted); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar .inner { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar button { background: none; border: 0; padding: 9px 0 8px; display: grid; justify-items: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; font-weight: 700; cursor: pointer; }
.tabbar button svg { width: 21px; height: 21px; }
.tabbar button.active { color: var(--coral-strong); }
.tabbar button.active .dot { background: var(--coral-strong); }
.tabbar .dot { width: 4px; height: 4px; border-radius: 999px; background: transparent; }

.adm-main { padding: 14px 16px calc(92px + env(safe-area-inset-bottom, 0px)); }
.adm-view[hidden] { display: none; }

.adm-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 12px; }
.adm-title h1 { font-size: 18px; font-weight: 800; margin: 0; letter-spacing: 0; }
.adm-title .count { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.pill-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.pill-row::-webkit-scrollbar { display: none; }
.pill { flex: none; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
  font-size: 12px; font-weight: 700; padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.a-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.a-prod { display: grid; grid-template-columns: 64px 1fr; gap: 12px; }
.a-thumb { width: 64px; height: 80px; border-radius: 10px; overflow: hidden; background: #F6EDE6; border: 1px solid var(--line); flex: none; }
.a-thumb img { width: 100%; height: 100%; object-fit: cover; }
.a-prod h3 { font-size: 13.5px; font-weight: 700; margin: 0 0 3px; line-height: 1.5; }
.a-prod .meta { font-size: 11.5px; color: var(--muted); margin: 0 0 6px; }
.a-prod .price { font-size: 13.5px; font-weight: 800; margin: 0; }
.a-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.a-actions .btn { min-height: 36px; font-size: 12px; border-radius: 10px; }
.a-actions .btn { flex: 1; }

.toggle-sold { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #E4D5C8; border: 0; cursor: pointer; flex: none; transition: background .18s ease; }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 999px; background: #fff; transition: inset-inline-start .18s ease; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch[aria-checked="true"] { background: var(--coral-strong); }
.switch[aria-checked="true"]::after { inset-inline-start: 19px; }

.order-card .o-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.order-card .o-name { font-size: 14px; font-weight: 800; margin: 0; }
.order-card .o-time { font-size: 11px; color: var(--muted); margin: 2px 0 0; }
.order-card .o-items { margin: 8px 0; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.9; color: var(--ink-soft); }
.order-card .o-items li { display: flex; justify-content: space-between; gap: 10px; }
.order-card .o-total { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 800;
  border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; }
.order-card .o-contact { font-size: 12.5px; line-height: 1.9; color: var(--ink-soft); margin: 8px 0 0; }
.order-card .o-contact b { font-weight: 700; color: var(--ink); }
.order-card .o-foot { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.order-card .o-foot .btn { flex: 1 1 44%; min-height: 38px; font-size: 12px; border-radius: 10px; }

.status-select { font-size: 12px; font-weight: 700; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 30px 6px 12px; background-color: #fff; appearance: none; color: var(--ink);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2383736A' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 10px center; background-size: 14px; }
.status-new { color: var(--coral-strong); border-color: #F2C3B5; background-color: var(--coral-soft); }
.status-done { color: var(--ok); border-color: #C6E6D8; background-color: #EDF8F2; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px; text-align: center; }
.stat b { display: block; font-size: 17px; font-weight: 800; }
.stat span { font-size: 11.5px; color: var(--muted); font-weight: 700; }

/* ------------------------------------------------------------ sheet / modal */
.sheet { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: none; overflow-y: auto;
  -webkit-overflow-scrolling: touch; }
.sheet.show { display: block; }
.sheet-head { position: sticky; top: 0; z-index: 5; background: rgba(253, 247, 242, .96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.sheet-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 10px; }
.sheet-head h2 { font-size: 15px; font-weight: 800; margin: 0; }
.sheet-body { padding: 16px 16px 120px; }
.sheet-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 85; background: rgba(253, 247, 242, .96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); }
.sheet-foot .wrap { display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }

.img-pick { position: relative; border: 2px dashed var(--line-strong); border-radius: var(--radius);
  background: #fff; overflow: hidden; margin-bottom: 6px; }
.img-pick .ph { display: grid; place-items: center; gap: 8px; aspect-ratio: 16 / 9; max-height: 190px; color: var(--muted);
  font-size: 12.5px; font-weight: 600; text-align: center; padding: 16px; }
.img-pick .ph svg { width: 34px; height: 34px; color: var(--coral); }
.img-pick img { width: 100%; max-height: 240px; aspect-ratio: 16 / 10; object-fit: cover; }
.img-pick input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.img-pick .clear { position: absolute; top: 8px; left: 8px; background: rgba(42,35,32,.72); color: #fff;
  border: 0; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 6px 11px; cursor: pointer; }

/* --------------------------------------------------------------- login card */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-wrap[hidden] { display: none; }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line);
  border-radius: 22px; padding: 26px 22px 22px; box-shadow: var(--shadow-md); }
.login-card img { width: 62px; margin: 0 auto 14px; }
.login-card h1 { font-size: 19px; text-align: center; margin: 0 0 4px; }
.login-card p.sub { font-size: 12.5px; color: var(--muted); text-align: center; margin: 0 0 20px; line-height: 1.8; }

.alert { font-size: 12.5px; line-height: 1.8; border-radius: 12px; padding: 11px 13px; margin: 0 0 14px; }
.alert-warn { background: #FFF6E6; border: 1px solid #F2DFB4; color: #7A5A12; }
.alert-err { background: #FDECEA; border: 1px solid #F5C6C0; color: #A32B1E; }
.alert-info { background: var(--mint-soft); border: 1px solid #D9EEE7; color: var(--mint-ink); }
.alert[hidden] { display: none; }

.mode-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800;
  padding: 3px 9px; border-radius: 999px; background: #FFF6E6; color: #8A6512; border: 1px solid #F2DFB4; }
.mode-badge.live { background: #EDF8F2; color: var(--ok); border-color: #C6E6D8; }
.mode-badge i { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* ------------------------------------------------------------- dark mode */


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

/* ==========================================================================
   الحركة — خفيفة على المعالج: transform و opacity بس
   ========================================================================== */

/* انتقال ناعم بين الصفحات في المتصفحات اللي بتدعمه */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .18s ease both; }
::view-transition-new(root) { animation: vt-in .22s ease both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* ظهور تدريجي للقطع */
.reveal {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity .4s ease, transform .45s cubic-bezier(.22, .61, .36, 1);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* دخول الهيرو */
.hero > * { animation: rise .5s cubic-bezier(.22, .61, .36, 1) both; }
.hero > *:nth-child(2) { animation-delay: .06s; }
.hero > *:nth-child(3) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 12px, 0); } }

/* نبضة عدّاد السلة */
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.38); } 100% { transform: scale(1); } }
.cart-count.pop { animation: pop .45s cubic-bezier(.34, 1.56, .64, 1); }

/* لمسة الزراير */
.btn:active { transform: scale(.97); }
.icon-btn:active { transform: scale(.94); }
.btn { transition: transform .12s ease, background .18s ease, color .18s ease, opacity .15s ease; }

/* زرار اتحول لتأكيد */
.btn.is-done { background: var(--mint-soft); color: var(--mint-ink); border: 1px solid #D9EEE7; }

/* الصفحة الداخلية */
.pdp-media { animation: rise .45s cubic-bezier(.22, .61, .36, 1) both; }
.pdp-body { animation: rise .5s cubic-bezier(.22, .61, .36, 1) .06s both; }

/* على الأجهزة البطيئة أو توفير البيانات: مفيش حركة */
body.perf-lite .reveal,
body.perf-lite .hero > *,
body.perf-lite .pdp-media,
body.perf-lite .pdp-body { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
body.perf-lite .skel { animation: none; background: #F4EAE1; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1 !important; transform: none !important; }
  .hero > *, .pdp-media, .pdp-body { animation: none !important; }
  @view-transition { navigation: none; }
}

/* ==========================================================================
   عروض: سلايدر + شريط عروض + سعر مشطوب + كوبون
   ========================================================================== */

[hidden] { display: none !important; }

/* السلايدر */
.slider { position: relative; margin: 14px 0 2px; border-radius: 20px; overflow: hidden; }
.slides {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.slides::-webkit-scrollbar { display: none; }
.slide {
  position: relative; flex: 0 0 100%; scroll-snap-align: center;
  aspect-ratio: 16 / 9; display: block; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #F79C86 0%, #EC8069 46%, #9BD3C4 100%);
}
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-art {
  position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center;
  gap: 10px; padding: 14px 18px; direction: ltr; z-index: 1;
}
.slide-art img {
  position: static; width: 27%; max-width: 170px; height: auto; aspect-ratio: 4 / 5;
  object-fit: cover; border-radius: 16px; background: #fff;
  box-shadow: 0 18px 34px -20px rgba(42, 35, 32, .75);
  transform: rotate(calc((var(--i) - 1) * -4deg));
}
.slide-art img:nth-child(3) { display: none; }
.slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(42, 35, 32, 0) 28%, rgba(42, 35, 32, .52) 100%);
}
.slide-txt { position: absolute; inset-inline-start: 16px; inset-inline-end: 16px; bottom: 24px; z-index: 2; max-width: calc(100% - 32px); }
.slide-txt b { display: block; font-size: 18px; font-weight: 800; line-height: 1.45; text-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
.slide-txt span { display: block; font-size: 12px; opacity: .95; margin-top: 3px; line-height: 1.6; }
.dots { position: absolute; bottom: 12px; left: 14px; display: flex; gap: 5px; z-index: 3; }
.dots i { width: 6px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .55); transition: width .2s ease, background .2s ease; }
.dots i.on { width: 16px; background: #fff; }

/* شريط العروض */
.rail { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 8px; margin: 0 -16px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-card {
  flex: 0 0 44%; max-width: 180px; scroll-snap-align: start;
  display: block; text-decoration: none; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.rail-card .card-media { aspect-ratio: 1 / 1; }
.rail-card .card-title { min-height: 0; -webkit-line-clamp: 1; font-size: 12.5px; }
.rail-card .card-price { font-size: 13.5px; }

.off-badge {
  position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2;
  background: var(--coral-strong); color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 999px; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .6);
}

/* سعر قبل الخصم */
.card-price s, .pdp-price s {
  font-size: 11.5px; color: var(--muted); font-weight: 600;
  margin-inline-start: 4px; text-decoration-thickness: 1.5px;
}
.pdp-price s { font-size: 14px; margin-inline-start: 10px; }

/* الكوبون */
.coupon-row { display: flex; gap: 8px; margin-bottom: 6px; }
.coupon-row input {
  flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 11px 14px; font-size: 15px; font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase; background: #fff; color: var(--ink); outline: none;
}
.coupon-row input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(240, 144, 122, .18); }
.coupon-row .btn { flex: none; min-width: 92px; }
.coupon-msg { font-size: 12px; font-weight: 600; margin: 0 0 12px; min-height: 18px; }
.coupon-msg.good { color: var(--ok); }
.coupon-msg.bad { color: #B3261E; }

/* لوحة التحكم: العروض */
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 10px; }
.sub-head h2 { font-size: 13.5px; font-weight: 800; margin: 0; }
.sub-head .btn { width: auto; }

/* سطر التفعيل */
label.toggle-sold { gap: 8px; font-size: 13px; color: var(--ink-soft); }
label.toggle-sold input { accent-color: var(--coral-strong); width: 18px; height: 18px; }

/* تحقق حقول الدفع */
.pay-title, .pay-sub { display: block; }
.wa-bubble { text-align: right; }



.slide:not(:has(img))::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 84% 20%, rgba(255, 255, 255, .38), transparent 42%),
    radial-gradient(circle at 10% 88%, rgba(255, 255, 255, .22), transparent 38%);
}


/* كارت البانر في اللوحة */
.a-banner { display: flex; gap: 12px; align-items: flex-start; }
.a-banner .a-thumb { width: 88px; height: 60px; }
.a-banner-txt { flex: 1; min-width: 0; }
.a-banner-txt h3 { font-size: 13.5px; font-weight: 700; margin: 0 0 3px; line-height: 1.55; }
.a-banner-txt p { font-size: 11.5px; color: var(--muted); margin: 0; line-height: 1.65; }
.a-banner-txt p.st { font-weight: 700; color: var(--ink-soft); margin-top: 3px; }

/* ------------------------------------------------ اختيار المقاس (حالة مختارة) */
.chip.chip-on {
  background: var(--coral-strong); color: #fff; opacity: 1;
  box-shadow: 0 6px 14px -8px rgba(200, 84, 60, .8);
}
.chip.chip-on:disabled { opacity: 1; }

/* ------------------------------------------------ فلترة التصنيفات في الرئيسية */
.cat-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin: 0 -2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cat-row::-webkit-scrollbar { display: none; }
.cat-btn {
  flex: none; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
  font: inherit; font-size: 12.5px; font-weight: 700; padding: 7px 14px; border-radius: 999px;
  cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.cat-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat-btn:active { transform: scale(.98); }

.size-row { padding-bottom: 10px; }
.size-btn { font-size: 11.5px; padding: 5px 12px; background: transparent; border-style: dashed; }
.size-btn.on { background: var(--coral-strong); border-color: var(--coral-strong); color: #fff; border-style: solid; }

/* ------------------------------------------------ سطر الشحن تحت السعر */
.ship-line { font-size: 12px; font-weight: 600; color: var(--muted); margin: -8px 0 14px; }

/* ================================================ شاشات الكمبيوتر (١٢٠٠ بكسل) */
@media (min-width: 980px) {
  :root { --maxw: 1200px; }
  .wrap { padding: 0 24px; }
  .topbar .wrap { padding: 0 24px; }

  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .card-title { font-size: 14.5px; }
  .card-meta { font-size: 12.5px; }

  .rail { padding: 0 24px 10px; margin: 0 -24px; gap: 14px; }
  .rail-card { flex: 0 0 23.4%; max-width: none; }

  .slider { border-radius: 24px; }
  .slide { aspect-ratio: 2.6 / 1; }
  .slide-txt b { font-size: 26px; }
  .slide-txt span { font-size: 15px; }

  .section-head h2 { font-size: 20px; }

  [data-pdp] { display: grid; grid-template-columns: 1.02fr .98fr; gap: 36px; align-items: start; }
  .pdp-media { position: sticky; top: 86px; }
  .pdp-body { padding-top: 4px; align-self: center; }
  .pdp-title { font-size: 28px; }
  .pdp-price { font-size: 26px; }
  .pdp-desc { font-size: 15px; }
  .actionbar { background: transparent; border-top: 0; padding: 4px 0 28px; }
  .actionbar .wrap {
    max-width: 880px; background: #fff; border: 1px solid var(--line);
    border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow-md);
  }
  .slide-art { align-items: center; justify-content: flex-start; padding: 20px 26px; }
  .slide-art img { width: 28%; max-width: 210px; }
  .slide-art img:nth-child(3) { display: block; }

  body[data-page="cart"] main,
  body[data-page="checkout"] main { max-width: 800px; }

  .cat-row { flex-wrap: wrap; overflow: visible; }
  .cat-btn { font-size: 13px; padding: 8px 16px; }

  body.admin-body { --maxw: 780px; }
  .login-card { max-width: 420px; }
}
