/* ============================================================
   Resh Center — أبو الريش سنتر
   Design System / Brand Tokens
   مُشتق من الهوية البصرية الرسمية للعلامة
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=El+Messiri:wght@400;500;600;700&family=Tajawal:wght@300;400;500;700;800&family=Jost:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&display=swap');

:root {
  /* ---- ألوان العلامة الأساسية ---- */
  --brand:            #b71f8f;   /* ماجنتا العلامة الرئيسي */
  --brand-strong:     #d80c9e;   /* ماجنتا مشبع (تفاعلات/تأكيد) */
  --brand-deep:       #5e1049;   /* بنفسجي/ماجنتا غامق */
  --plum:             #3a122e;   /* بنفسجي عميق (نصوص العناوين/الهيدر) */
  --plum-ink:         #1a1420;   /* شبه أسود بنفسجي (نص أساسي) */

  /* ---- أسطح ووردي ---- */
  --blush-1:          #fbf7f4;   /* خلفية كريمية */
  --blush-2:          #f6e1ef;   /* وردي فاتح */
  --blush-3:          #ead3e2;   /* وردي متوسط */
  --blush-line:       #e4c6da;   /* حدود وردية */

  /* ---- محايدات ---- */
  --ink:              #2a1f27;   /* نص أساسي */
  --muted:            #8a6c7c;   /* رمادي موڤ (نص ثانوي) */
  --surface:          #ffffff;
  --surface-2:        #faf6f8;

  /* ---- دلالية ---- */
  --red:              #e11d48;   /* دائرة عدّاد السلة */
  --success:          #1f8a5b;
  --warning:          #c9821f;
  --danger:           #b4324f;
  --info:             var(--brand-deep);

  /* ---- تدرّجات ---- */
  --grad-brand: linear-gradient(135deg, #d80c9e 0%, #b71f8f 45%, #5e1049 100%);
  --grad-soft:  linear-gradient(160deg, #fbf7f4 0%, #f6e1ef 100%);

  /* ---- خطوط ---- */
  --font-display: 'El Messiri', 'Tajawal', serif;   /* عناوين عربية */
  --font-body:    'Tajawal', system-ui, sans-serif; /* نصوص عربية */
  --font-latin:   'Jost', 'Playfair Display', sans-serif;
  --font-num:     'Jost', system-ui, sans-serif;

  /* ---- مقاسات ونظام ---- */
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(58,18,46,.06), 0 2px 8px rgba(58,18,46,.05);
  --shadow:    0 4px 14px -6px rgba(58,18,46,.18), 0 12px 30px -18px rgba(58,18,46,.30);
  --shadow-brand: 0 10px 28px -10px rgba(183,31,143,.45);
  --container: 1200px;
  --step: 8px;

  /* ---- سلّم z-index موحّد (لا أرقام عشوائية) ---- */
  --z-header:  40;
  --z-cartbar: 60;
  --z-navbar:  70;
  --z-modal:  100;
  --z-toast:  200;
}

/* ============================================================
   القاعدة / RTL
   ============================================================ */
* { box-sizing: border-box; }
*::placeholder { font-family: inherit; opacity: .75; }
html { direction: rtl; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--blush-1);
  -webkit-font-smoothing: antialiased;
}
/* المحتوى يتمدّد ليدفع الفوتر للأسفل دائماً */
body > main { flex: 1 0 auto; }
body > footer.site { flex-shrink: 0; }
/* كل عناصر النماذج ترث الخط (المتصفّح لا يورّثها افتراضياً) */
button, input, select, textarea, optgroup, option,
[type="button"], [type="submit"], [type="reset"], [type="search"] {
  font-family: inherit;
  font-feature-settings: inherit;
  letter-spacing: inherit;
}
/* الأرقام اللاتينية داخل النصوص العربية بخط الأرقام */
input[type="number"], input[type="tel"], input[inputmode="tel"], .num, .num * { font-family: var(--font-num); }
/* عناوين فرعية غير مغطّاة */
h5, h6, legend, caption, th, summary { font-family: var(--font-display); }
h1,h2,h3,h4 { font-family: var(--font-display); color: var(--plum); line-height: 1.3; margin: 0; text-wrap: balance; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ============================================================
   الأزرار
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  padding: 12px 22px; border-radius: var(--radius-pill);
  border: 1.5px solid transparent; cursor: pointer; transition: .18s ease;
  line-height: 1;
}
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); color:#fff; }
.btn-outline { background: transparent; color: var(--brand-deep); border-color: var(--blush-line); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); background: var(--blush-2); }
.btn-ghost { background: var(--blush-2); color: var(--brand-deep); }
.btn-ghost:hover { background: var(--blush-3); }

/* ============================================================
   البطاقات والشارات
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--blush-line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill);
}
.badge-brand   { background: var(--blush-2); color: var(--brand-deep); }
.badge-success { background: #e4f4ec; color: var(--success); }
.badge-warning { background: #fbf0dc; color: var(--warning); }
.badge-danger  { background: #f8e0e6; color: var(--danger); }

/* ============================================================
   إدخالات النماذج
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--blush-line);
  border-radius: var(--radius-sm); padding: 11px 14px; width: 100%; transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(183,31,143,.12); outline: none; }

/* ============================================================
   الهيدر / الشعار
   ============================================================ */
.brand-logo { display: inline-flex; align-items: center; gap: 12px; }
.brand-logo img { height: 46px; width: auto; }

/* أدوات مساعدة */
.text-brand { color: var(--brand); }
.text-muted { color: var(--muted); }
.bg-soft { background: var(--grad-soft); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }

.icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; flex: none; }
.icon-sm { width: 16px; height: 16px; }

/* ============================================================
   الحركة والتفاعل (Motion)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  /* ظهور تدريجي عند التمرير */
  .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s cubic-bezier(.22,1,.36,1), transform .6s cubic-bezier(.22,1,.36,1); }
  .reveal.in { opacity: 1; transform: none; }

  /* ظهور الصفحة */
  main { animation: pageIn .5s ease both; }
  @keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* رفع البطاقة عند المرور */
.card { transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s ease; }
a.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
a.card:hover img { transform: scale(1.04); }
.card img { transition: transform .4s cubic-bezier(.22,1,.36,1); }

/* لمعان الزر الأساسي */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
}
.btn-primary:hover::after { transform: translateX(120%); transition: transform .7s ease; }
.btn:active { transform: translateY(1px) scale(.99); }

/* نبض شارة السلة عند التحديث */
@keyframes badgePop { 0%{ transform: scale(1);} 40%{ transform: scale(1.5);} 100%{ transform: scale(1);} }
.cart-badge.pop { animation: badgePop .45s ease; }

/* ============================================================
   النوافذ (Modals)
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(26,20,32,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .28s ease, visibility .28s;
}
.modal-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-card {
  background: var(--surface); border-radius: var(--radius-lg);
  width: min(460px, 100%); max-height: min(86vh, 760px);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(58,18,46,.6);
  transform: translateY(18px) scale(.97); transition: transform .32s cubic-bezier(.22,1,.36,1);
}
.modal-overlay.show .modal-card { transform: none; }
.modal-card.modal-wide { width: min(880px, 100%); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--blush-line); flex: none; }
.modal-header h3 { font-size: 19px; }
.modal-close { background: var(--surface-2); border: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; color: var(--muted); display: grid; place-items: center; transition: .15s; }
.modal-close:hover { background: var(--blush-2); color: var(--brand); }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal-footer { border-top: 1px solid var(--blush-line); padding: 16px 22px; background: var(--surface-2); flex: none; }
.foot-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.foot-row b { font-size: 19px; color: var(--brand-deep); }

.cart-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--surface-2); animation: lineIn .35s ease both; }
@keyframes lineIn { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none; } }
.cart-line img { width: 62px; height: 78px; object-fit: cover; border-radius: 10px; background: var(--grad-soft); flex: none; }
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .info h5 { font-size: 14.5px; margin: 0 0 3px; }
.cart-line .meta { font-size: 12px; color: var(--muted); }
.cart-line .price { color: var(--brand-deep); font-weight: 800; font-family: var(--font-num); margin-top: 4px; font-size: 14px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--blush-line); border-radius: 8px; overflow: hidden; margin-top: 6px; }
.stepper button { width: 30px; height: 30px; border: none; background: var(--surface-2); cursor: pointer; color: var(--brand-deep); display: grid; place-items: center; transition: .15s; }
.stepper button:hover { background: var(--blush-2); color: var(--brand); }
.stepper button .icon-sm { width: 14px; height: 14px; }
.stepper span { min-width: 30px; text-align: center; font-weight: 700; font-family: var(--font-num); font-size: 13px; }
.line-remove { background: none; border: none; color: var(--muted); cursor: pointer; align-self: flex-start; padding: 4px; transition: .15s; }
.line-remove:hover { color: var(--danger); }

.empty-block { text-align: center; padding: 50px 20px; color: var(--muted); }
.em-icon { width: 54px; height: 54px; margin: 0 auto 12px; color: var(--blush-line); stroke-width: 1.5; }
.empty-block .em-icon { color: var(--blush-3); }

/* ============================================================
   هيكل الصفحة الواحدة (SPA)
   ============================================================ */
.page { display: none; }
.page.page-active { display: block; animation: pageIn .38s ease both; }

.topbar { background: var(--plum); color: #f3d9ea; font-size: 12.5px; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 38px; gap: 12px; }
.topbar .branch { display: flex; align-items: center; gap: 7px; }
.topbar button.link { background: none; border: none; color: #f6c8e6; cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; transition: .15s; }
.topbar button.link:hover { background: rgba(255,255,255,.12); color: #fff; }
@media (max-width: 640px){ .topbar .tb-note { display: none; } }

header.site { position: sticky; top: 0; z-index: var(--z-header); background: rgba(255,255,255,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--blush-line); }
header.site .container { display: flex; align-items: center; justify-content: space-between; height: 74px; gap: 16px; }
nav.main { display: flex; gap: 24px; }
nav.main a { color: var(--plum); font-weight: 600; font-size: 15px; position: relative; padding: 4px 0; }
nav.main a::after { content:''; position:absolute; bottom:-2px; inset-inline-start:0; width:0; height:2px; background:var(--brand); transition:width .25s ease; }
nav.main a:hover, nav.main a.active { color: var(--brand); }
nav.main a:hover::after, nav.main a.active::after { width: 100%; }
/* زر أيقونة (السلة) — بلا نص */
.icon-btn {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  background: var(--blush-2); border: 1.5px solid var(--blush-line); color: var(--brand-deep);
  display: grid; place-items: center; cursor: pointer; transition: .18s; flex: none;
}
.icon-btn:hover { background: var(--blush-3); border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.95); }

/* دائرة العدد الحمراء — تختفي تماماً عند الفراغ عبر [hidden] */
.count-badge {
  position: absolute; top: -5px; inset-inline-end: -5px;
  background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 800; font-family: var(--font-num);
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(225,29,72,.45);
}
.count-badge[hidden] { display: none; }

.hero .hero-in { display: grid; grid-template-columns: 1.1fr .9fr; gap: 34px; align-items: center; padding-block: clamp(30px, 5vw, 60px); }
.hero h1 { font-size: clamp(30px, 5vw, 50px); margin: 12px 0 12px; }
.hero p { font-size: 17px; max-width: 44ch; }
.hero-art { display: grid; place-items: center; }
.hero-art img { max-height: 240px; filter: drop-shadow(0 20px 40px rgba(183,31,143,.22)); }
@media (max-width: 820px){ .hero .hero-in { grid-template-columns: 1fr; } .hero-art { display: none; } }

/* أقسام رئيسية */
.sections { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 6px; scrollbar-width: thin; }
.sections::-webkit-scrollbar { height: 5px; }
.sections::-webkit-scrollbar-thumb { background: var(--blush-line); border-radius: 3px; }
.section-tab {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; flex: none;
  background: var(--surface); border: 1.5px solid var(--blush-line); color: var(--plum);
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  padding: 10px 20px; border-radius: var(--radius-pill); cursor: pointer; transition: .18s;
}
.section-tab:hover { border-color: var(--brand); color: var(--brand); }
.section-tab.active { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: var(--shadow-brand); }
.sec-count { font-family: var(--font-num); font-size: 11px; background: rgba(0,0,0,.08); padding: 1px 7px; border-radius: 999px; }
.section-tab.active .sec-count { background: rgba(255,255,255,.25); }

/* فئات فرعية */
.subcats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; padding-top: 4px; }
.subcat-chip {
  background: var(--blush-2); border: 1px solid transparent; color: var(--brand-deep);
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  padding: 7px 15px; border-radius: var(--radius-pill); cursor: pointer; transition: .15s;
}
.subcat-chip:hover { background: var(--blush-3); }
.subcat-chip.active { background: var(--brand-deep); color: #fff; }

/* شريط البحث والفرز */
.browse-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 240px; display: flex; align-items: center; }
.search-box > .icon-sm { position: absolute; inset-inline-start: 14px; color: var(--muted); pointer-events: none; }
.search-box input {
  width: 100%; font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--blush-line); border-radius: var(--radius-pill);
  padding: 12px 42px; transition: .15s;
}
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(183,31,143,.12); outline: none; }
.s-clear { position: absolute; inset-inline-end: 10px; background: var(--surface-2); border: none; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.s-clear:hover { background: var(--blush-2); color: var(--brand); }
.sort-select { width: auto; min-width: 160px; border-radius: var(--radius-pill); padding-block: 11px; cursor: pointer; }
.result-count { font-size: 13px; margin-bottom: 16px; }
.load-more-wrap { text-align: center; margin-top: 30px; }
#loadMore { min-width: 200px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.p-card { background: var(--surface); border: 1px solid var(--blush-line); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s; }
.p-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.p-card .ph { aspect-ratio: 3/4; background: var(--grad-soft); display: grid; place-items: center; overflow: hidden; }
.p-card .ph img { transition: transform .4s cubic-bezier(.22,1,.36,1); }
.p-card:hover .ph img { transform: scale(1.05); }
.p-card .body { padding: 13px 15px; display: flex; flex-direction: column; gap: 5px; }
.p-card h4 { font-size: 16px; }
.p-card .price { color: var(--brand-deep); font-weight: 800; font-family: var(--font-num); font-size: 17px; margin-top: 2px; }

/* اختيارات المنتج داخل النافذة */
.opt-row { margin-bottom: 16px; }
.opt-row .lbl { font-weight: 700; margin-bottom: 8px; font-size: 14.5px; }
.color-dot { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--blush-line); cursor: pointer; transition: .15s; }
.color-dot.on { outline: 3px solid var(--brand); outline-offset: 1px; }
.size-chip { min-width: 48px; padding: 9px 14px; border-radius: 10px; border: 1.5px solid var(--blush-line); background: #fff; cursor: pointer; font-weight: 700; font-family: var(--font-body); transition: .15s; }
.size-chip.on { border-color: var(--brand); background: var(--blush-2); color: var(--brand-deep); }
.size-chip:disabled { opacity: .35; cursor: not-allowed; }

.pay-opt { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--blush-line); background: #fff; border-radius: 10px; padding: 12px; cursor: pointer; margin-bottom: 8px; font-size: 14.5px; }
.pay-opt.on { border-color: var(--brand); background: var(--blush-2); }
.co-summary { background: var(--surface-2); border: 1px solid var(--blush-line); border-radius: var(--radius-sm); padding: 14px; font-size: 14px; }
.co-error { background: #f8e0e6; color: var(--danger); border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13.5px; font-weight: 600; }

footer.site { background: var(--plum); color: #f3d9ea; padding-block: 34px; margin-top: auto; }
footer.site .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
footer.site small { color: #c99ebb; }

/* ============================================================
   الشريط السفلي — إحساس التطبيق على الجوال
   ============================================================ */
.nav-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: var(--z-navbar);
  background: rgba(255,255,255,.94); backdrop-filter: blur(20px);
  border-top: 1px solid var(--blush-line);
  display: none; justify-content: space-around;
  padding: 9px 0 calc(9px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 22px -8px rgba(58,18,46,.18);
}
.nav-bar .nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-family: var(--font-body); font-size: 11px; font-weight: 700;
  padding: 4px 0; transition: color .2s;
}
.nav-bar .nav-item .icon { width: 23px; height: 23px; transition: transform .2s; }
.nav-bar .nav-item.active { color: var(--brand); }
.nav-bar .nav-item.active .icon { transform: translateY(-2px); }
.nav-bar .nav-item::after { display: none; }
.nav-cart-icon { position: relative; display: grid; place-items: center; }
.nav-bar .count-badge { border-color: #fff; }

/* الجوال: أظهر الشريط السفلي وأخفِ روابط سطح المكتب */
@media (max-width: 767px) {
  .nav-bar { display: flex; }
  nav.main.desktop-nav { display: none; }   /* يفوق تخصيص nav.main */
  /* على الجوال: main يخلّص الشريط العائم، والفوتر يخلّص الشريط السفلي الثابت — بلا فراغ أبيض */
  body { padding-bottom: 0; }
  body > main { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  footer.site { margin-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal-card { max-height: 88vh; width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-card.modal-wide { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  header.site .container { height: 64px; }
  .brand-logo img { height: 38px; }
}
@media (min-width: 768px) { .nav-bar { display: none; } }

/* ============================================================
   الشريط العائم لإتمام الدفع (Floating Cart Bar)
   ============================================================ */
.cart-bar {
  position: fixed; bottom: 18px; left: 50%;
  transform: translate(-50%, 140%); opacity: 0; pointer-events: none;
  width: min(680px, calc(100% - 28px));
  background: var(--plum); color: #fff; z-index: var(--z-cartbar);
  border-radius: var(--radius-pill); padding: 9px 9px 9px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  box-shadow: 0 14px 40px -10px rgba(58,18,46,.6);
  transition: transform .42s cubic-bezier(.22,1,.36,1), opacity .3s ease;
}
.cart-bar.active { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.cart-bar.bounce { animation: cartBounce .45s ease; }
/* عند فتح أي نافذة: ينسحب الشريط للأسفل بدل أن يظهر تحت الطبقة المعتمة */
body.modal-open .cart-bar,
body.modal-open .cart-bar.active { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; animation: none; }
@keyframes cartBounce { 0%,100%{ transform: translate(-50%,0);} 35%{ transform: translate(-50%,-8px);} }
.cb-info { display: flex; align-items: center; gap: 12px; background: none; border: none; color: #fff; cursor: pointer; font: inherit; padding: 4px; }
.cb-icon { position: relative; display: grid; place-items: center; }
.cb-icon .icon { color: #f6c8e6; }
.cb-badge { position: absolute; top: -8px; inset-inline-end: -8px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; min-width: 19px; height: 19px; border-radius: 999px; display: grid; place-items: center; font-family: var(--font-num); padding: 0 4px; border: 2px solid var(--plum); }
.cb-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.cb-text b { font-size: 16px; font-family: var(--font-num); }
.cb-text small { color: #d5a9c6; font-size: 11.5px; }
.cb-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--grad-brand); color: #fff; font-weight: 800; font-size: 15px; padding: 13px 24px; border-radius: var(--radius-pill); white-space: nowrap; box-shadow: var(--shadow-brand); transition: filter .15s, transform .15s; }
.cb-btn:hover { filter: brightness(1.06); color: #fff; }
.cb-btn:active { transform: scale(.98); }
.cb-btn span { font-family: var(--font-num); }
@media (max-width: 520px){ .cb-text small { display: none; } .cart-bar { padding-inline-start: 14px; } }

/* ============================================================
   إشعارات Toast
   ============================================================ */
.toast-wrap { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 24px); }
.toast {
  display: flex; align-items: center; gap: 10px; background: var(--plum); color: #fff;
  padding: 13px 20px; border-radius: var(--radius-pill); box-shadow: var(--shadow-brand);
  font-weight: 600; font-size: 14.5px; animation: toastIn .4s cubic-bezier(.22,1,.36,1) both;
}
.toast.success { background: linear-gradient(135deg, #1f8a5b, #14724a); }
.toast.error { background: linear-gradient(135deg, #b4324f, #8f2340); }
.toast .icon { color: #fff; }
.toast.hide { animation: toastOut .35s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-18px) scale(.95);} to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px) scale(.96);} }

/* ============================================================
   تجاوزات الجوال للشريط العائم
   لازم تأتي بعد تعريف .cart-bar الأساسي — الـ media query
   لا تضيف تخصيصاً، فالترتيب هو الحاسم.
   ============================================================ */
@media (max-width: 767px) {
  .cart-bar {
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: calc(100% - 24px);
    padding: 8px 8px 8px 16px;
  }
  .cb-text b { font-size: 15px; }
  .cb-text small { display: none; }
  .cb-btn { padding: 12px 18px; font-size: 14px; }
}

/* ============================================================
   الجوال: أهداف لمس في المتجر (≥44px)
   ============================================================ */
@media (max-width: 767px) {
  .s-clear { width: 34px; height: 34px; inset-inline-end: 8px; }
  .search-box input { font-size: 16px; padding-block: 14px; min-height: 50px; }
  .sort-select { font-size: 16px; min-height: 48px; width: 100%; }
  .browse-bar { gap: 10px; }
  .section-tab { padding: 12px 18px; min-height: 46px; }
  .subcat-chip { padding: 10px 16px; min-height: 40px; }
  .topbar button.link { padding: 6px 10px; min-height: 30px; }
  .cb-info { min-height: 48px; padding: 6px 8px; }
  .cb-btn { min-height: 48px; }
  .icon-btn { width: 48px; height: 48px; }
  .nav-bar .nav-item { min-height: 52px; }
  .stepper button { width: 38px; height: 38px; }
  .color-dot { width: 44px; height: 44px; }
  .size-chip { min-height: 44px; min-width: 54px; }
  .btn { min-height: 46px; }
  .input, .select, .textarea { font-size: 16px; min-height: 46px; }
}

@media (max-width: 767px) {
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
  .s-clear { width: 38px; height: 38px; }
  .topbar button.link { min-height: 38px; padding: 8px 12px; }
  .pay-opt { min-height: 52px; }
}

/* منع التمرير الأفقي في المتجر على الجوال */
@media (max-width: 767px) {
  html, body { overflow-x: hidden; max-width: 100%; }
}

/* ============ دوائر الفئات (v2) ============ */
.cat-circles { display: grid; grid-auto-flow: column; grid-template-rows: 1fr; gap: 6px 14px; overflow-x: auto; padding: 6px 2px 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cat-circles::-webkit-scrollbar { display: none; }
.cat-circle { border: none; background: none; cursor: pointer; text-align: center; width: 84px; flex: none; padding: 0; }
.cat-circle .cc-img { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 7px; border-radius: 50%; background: var(--blush-2, #f6e1ef); border: 2px solid transparent; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.cat-circle .cc-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-circle .cc-img.cc-all { color: var(--brand); }
.cat-circle .cc-img.cc-all svg { width: 30px; height: 30px; }
.cat-circle .cc-name { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-circle.active .cc-img { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(183,31,143,.15); }
.cat-circle.active .cc-name { color: var(--brand); }

/* ============ تبويبات المجموعات ============ */
.collection-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: none; }
.collection-tabs::-webkit-scrollbar { display: none; }
.coll-tab { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--blush-line); background: var(--surface); color: var(--ink); font-family: inherit; font-size: 13.5px; font-weight: 700; padding: 9px 16px; border-radius: 99px; cursor: pointer; white-space: nowrap; flex: none; transition: all .15s; }
.coll-tab svg { color: var(--muted); }
.coll-tab.active { background: var(--grad-brand, linear-gradient(135deg,#b71f8f,#5e1049)); color: #fff; border-color: transparent; }
.coll-tab.active svg { color: #fff; }

/* ============ بطاقة المنتج v2: خصم + مفضّلة + مشاركة ============ */
.p-card { position: relative; }
.p-card .ph { position: relative; }
.off-badge { position: absolute; top: 10px; inset-inline-start: 10px; background: var(--brand); color: #fff; font-family: var(--font-num); font-size: 12.5px; font-weight: 800; padding: 4px 10px; border-radius: 99px; z-index: 2; }
.card-acts { position: absolute; top: 10px; inset-inline-end: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.act-btn { width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255,255,255,.92); color: var(--plum); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(58,18,46,.14); transition: transform .12s, color .12s; }
.act-btn:active { transform: scale(.88); }
.act-btn svg { width: 17px; height: 17px; }
.act-btn.wished { color: #e11d48; }
.act-btn.wished svg { fill: #e11d48; stroke: #e11d48; }
.price-row { display: flex; align-items: baseline; gap: 8px; }
.price-old { font-family: var(--font-num); font-size: 13px; color: var(--muted); text-decoration: line-through; }

/* ============ حالة «بلا صورة» (كتالوج قبل رفع الصور) ============ */
.ph-empty { display: grid; place-items: center; width: 100%; height: 100%; color: var(--brand); opacity: .28; }
.ph-empty svg { width: var(--s, 44px); height: var(--s, 44px); }
.p-card .ph { background: linear-gradient(160deg, #fdf6fa 0%, #f7e9f3 100%); }
/* الكود/الأوامر: خط برمجي مقصود (لسهولة النسخ) */
code, kbd, samp, pre { font-family: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', 'Roboto Mono', monospace; font-size: .92em; }

/* أهداف لمس مريحة لروابط الفوتر (كل المقاسات) */
footer.site .foot-nav a { display:inline-flex; align-items:center; min-height:38px; padding:6px 4px; }
