/* ============================================================
   GLOZIN — نظام تصميم مستقل (Design Tokens)
   الفكرة: متجر أزياء بهوية "بطاقة السعر" — كل منتج بيتعرض
   جوه بطاقة بزاوية مقصوصة زي بطاقات الأسعار الحقيقية (Swing Tag)،
   والسعر بيتكتب بخط Mono زي ما بيتطبع على الطبيعة.
   (الخطوط بقت بتتحمّل من includes/header.php بـ <link> مباشر
   بدل @import هنا — أسرع، ومش بيوقف تحميل باقي الملف ده لو الخط
   اتأخر أو الاستضافة قافلة على @import الخارجي.)
   ============================================================ */

:root {
  /* الألوان */
  --ink: #1b1a17;
  --paper: #f6f3ee;
  --stone: #e6e0d4;
  --stone-dark: #cfc6b2;
  --moss: #3f4d3a;
  --moss-dark: #2e3a2a;
  --mustard: #c1892f;
  --muted: #726c5f;
  --white: #ffffff;
  --danger: #a8402f;

  /* الخطوط */
  --font-display: 'Fraunces', 'Cairo', serif;
  --font-body: 'Inter', 'Cairo', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* مقاسات */
  --radius: 2px;
  --container: 1240px;
  --header-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* تصفير شكل الأزرار الافتراضي من المتصفح (زي اللون الأزرق أو الحواف
   اللي بتظهر في سفاري/آيفون لو مفيش appearance:none) — بيتطبق على كل
   زرار في الموقع كله عشان محدش يفضل شكله مختلف عن التصميم. */
button, input[type="submit"], input[type="button"] {
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.65;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 .5em;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 3px;
}

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

/* -------------------- الأزرار -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .04em;
  border-radius: var(--radius);
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--moss); border-color: var(--moss); color: #fff; }
.btn.btn-outline { background: transparent; color: var(--ink); }
.btn.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn.btn-block { width: 100%; }
.btn.btn-sm { padding: 9px 18px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.btn-danger { border-color: var(--danger); background: transparent; color: var(--danger); }
.btn.btn-danger:hover { background: var(--danger); color: #fff; }

/* -------------------- الهيدر -------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--stone-dark);
}
.header-top {
  display: block;
  background: var(--tb-bg, var(--ink));
  color: var(--tb-color, var(--stone));
  font-size: var(--tb-size, 12.5px);
  font-weight: var(--tb-weight, 400);
  text-align: center;
  padding: 7px 20px;
  letter-spacing: .03em;
}
.header-top-marquee { overflow: hidden; white-space: nowrap; padding: 0; }
a.header-top:hover { filter: brightness(1.08); }
/* وضع "رسايل بتتبدل" — كل رسالة تظهر لوحدها بـ fade */
.header-top-rotator { display: grid; }
.header-top-rotator span { grid-area: 1 / 1; opacity: 0; transition: opacity .5s; }
.header-top-rotator span.is-active { opacity: 1; }
.header-top-track { display: inline-flex; animation: header-marquee 22s linear infinite; }
.header-top-track span { padding: 7px 50px; white-space: nowrap; }
@keyframes header-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .header-top-track { animation: none; }
}
.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 20px;
  flex-wrap: wrap;
  padding-block: 10px;
}
.logo {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .02em;
  flex-shrink: 0;
}
.logo span { color: var(--moss); }

.main-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; row-gap: 8px; flex: 1; }
.main-nav a {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  padding: 6px 0;
}
.main-nav a::after {
  content: '';
  position: absolute;
  right: 0; left: 0; bottom: 0;
  height: 2px;
  background: var(--moss);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .25s ease;
}
.main-nav a:hover::after,
.main-nav a.active::after { transform: scaleX(1); }
.main-nav a.active { color: var(--moss); }

.nav-item-dropdown { position: relative; display: flex; align-items: center; }
.nav-item-dropdown > a { display: flex; align-items: center; gap: 4px; }
.nav-item-dropdown .caret { font-size: 10px; transition: transform .2s; }
.nav-item-dropdown:hover .caret { transform: rotate(180deg); }
.mega-dropdown {
  position: absolute;
  top: 100%;
  inset-inline-start: -16px;
  background: var(--white);
  border: 1px solid var(--stone-dark);
  box-shadow: 0 12px 28px rgba(27,26,23,.08);
  min-width: 200px;
  padding: 10px 0;
  display: none;
  flex-direction: column;
  z-index: 60;
}
.nav-item-dropdown:hover .mega-dropdown { display: flex; }
.mega-dropdown a { padding: 9px 20px; font-size: 13.5px; font-weight: 400; white-space: nowrap; }
.mega-dropdown a:hover { background: var(--paper); color: var(--moss); }
.mega-dropdown a::after { display: none; }

.mega-dropdown-grouped { flex-direction: row; padding: 22px 26px; gap: 34px; min-width: unset; inset-inline-start: 0; }
.mega-col { display: flex; flex-direction: column; min-width: 150px; }
.mega-col-title { font-weight: 700; font-size: 13.5px; padding: 0 0 10px !important; margin-bottom: 8px; border-bottom: 1px solid var(--stone); color: var(--ink) !important; }
.mega-col a { padding: 6px 0 !important; }

.header-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--stone-dark);
  border-radius: 50%;
  transition: border-color .2s, background .2s;
}
.icon-btn:hover { border-color: var(--moss); background: var(--white); }
.icon-btn svg { width: 18px; height: 18px; stroke: var(--ink); }
.cart-count {
  position: absolute;
  top: -6px; left: -6px;
  background: var(--moss);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.burger { display: none; width: 40px; height: 40px; border: 1px solid var(--stone-dark); border-radius: 50%; align-items:center; justify-content:center; }
.burger span, .burger span::before, .burger span::after {
  content: ''; display: block; width: 18px; height: 2px; background: var(--ink); position: relative;
}
.burger span::before { position:absolute; top:-6px; }
.burger span::after { position:absolute; top:6px; }

@media (max-width: 900px) {
  .main-nav { display: none; }
  .burger { display: flex; }
  /* على الموبايل النص العلوي (nav) مختفي خالص، فمفيش داعي للف — اللوجو
     والأيقونات لازم يفضلوا في سطر واحد مهما ضاقت الشاشة */
  .header-main { flex-wrap: nowrap; }
  .header-actions { gap: 8px; }
  .icon-btn, .burger { width: 36px; height: 36px; }
  .icon-btn svg { width: 16px; height: 16px; }
  .logo { font-size: 21px; }

  /* ترتيب زي أديداس: برجر + مفضلة على الشمال، اللوجو في النص بالظبط
     (مش تقريبي)، والباقي يمين — عن طريق Grid بعمود نص ثابت للوجو */
  .header-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
  .header-mobile-start { display: flex; align-items: center; gap: 8px; justify-self: start; }
  .logo { justify-self: center; }
  .header-actions { justify-self: end; }
  .header-actions .header-actions-wishlist { display: none; } /* بديلها ظاهر شمال بدل ما تتكرر */
}
@media (min-width: 901px) {
  .header-mobile-start { display: none; }
}

/* -------------------- الشريط السفلي الثابت (موبايل بس) -------------------- */
.mobile-bottom-bar { display: none; }
@media (max-width: 900px) {
  .mobile-bottom-bar {
    display: flex;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 150;
    background: var(--white);
    border-top: 1px solid var(--stone-dark);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  /* مساحة فاضية تحت الصفحة عشان الشريط الثابت مايغطيش آخر حاجة فيها */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0)); }
  body.nav-open .mobile-bottom-bar { display: none; } /* يتخفى وقت فتح قائمة الموبايل الكاملة */
}
.mbb-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 9px 4px 8px; border: none; background: none; cursor: pointer;
  font-size: 11px; font-weight: 700; color: var(--ink); font-family: var(--font-body);
}
.mbb-icon-wrap { position: relative; }
.mbb-icon-wrap svg { width: 22px; height: 22px; stroke: var(--ink); }
.mbb-badge {
  position: absolute; top: -7px; inset-inline-end: -9px;
  background: var(--ink); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); padding: 0 2px;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--paper);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-nav.open { display: flex; }
body.nav-open { overflow: hidden; }

.mobile-nav-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--stone-dark);
  position: sticky; top: 0; background: var(--paper); z-index: 1;
}
.mobile-nav-header .logo { font-size: 22px; }
.mobile-nav-close {
  width: 38px; height: 38px; border: 1px solid var(--stone-dark); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 18px; background: none;
}

.mobile-nav-body { padding-bottom: 30px; }
.mobile-nav a { padding: 16px 20px; border-bottom: 1px solid var(--stone); font-size: 15px; display: block; }
.mobile-nav-section-label { padding: 18px 20px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }

.mobile-cat-group { border-bottom: 1px solid var(--stone); }
.mobile-cat-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
}
.mobile-cat-group summary::-webkit-details-marker { display: none; }
.mobile-cat-group summary a { font-size: 15px; padding: 0; border-bottom: none; }
.mobile-cat-toggle { font-size: 11px; color: var(--muted); transition: transform .2s; }
.mobile-cat-group[open] .mobile-cat-toggle { transform: rotate(180deg); }
.mobile-subcat-list { display: flex; flex-direction: column; padding-bottom: 8px; background: var(--stone); }
.mobile-subcat-list a { padding: 10px 20px 10px 38px; font-size: 13.5px; color: var(--muted); border-bottom: none; }

.mobile-nav-footer {
  display: flex; border-top: 6px solid var(--stone); margin-top: 10px;
}
.mobile-nav-footer a { flex: 1; text-align: center; font-size: 13px; }

/* -------------------- Breadcrumb / Page header -------------------- */
.page-header {
  background: var(--stone);
  padding: 34px 0;
  margin-bottom: 40px;
}
.page-header h1 { font-size: 30px; margin-bottom: 6px; }
.breadcrumb { font-size: 13px; color: var(--muted); display:flex; gap:6px; }
.breadcrumb a:hover { color: var(--moss); }

/* -------------------- سلايدر البانرات (Hero) --------------------
   صور بس من غير نصوص. كل الشرايح فوق بعض في نفس الخانة (grid) فالارتفاع
   بياخد ارتفاع الصورة الطبيعي، والتبديل بـ fade (مايتلخبطش مع RTL). */
.hero-slider {
  position: relative; overflow: hidden; background: var(--stone);
  /* نسبة أبعاد ثابتة + أقصى ارتفاع: البانر مابياخدش الشاشة كلها على اللاب،
     والصورة بتتقص من الجوانب بدل ما تتمطّط. الأرقام بتتظبط من لوحة التحكم. */
  /* القيم اللي جاية من لوحة التحكم بتتحط في --hero-desk-* و --hero-mob-*
     عشان قاعدة الموبايل تحت تقدر تتغلب عليها (الـ inline style مالوش أولوية هنا) */
  --hero-ratio: var(--hero-desk-ratio, 1920 / 800);
  --hero-max: var(--hero-desk-max, 520px);
  /* الارتفاع على الحاوية نفسها (مش على الشريحة) عشان العرض يفضل 100% دايمًا */
  width: 100%; aspect-ratio: var(--hero-ratio); max-height: var(--hero-max);
}
/* الشرايح خارج تدفق الصفحة عشان صورة طويلة مش تكبّر البانر */
.hero-track { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
.hero-slide {
  grid-area: 1 / 1; display: block; width: 100%; height: 100%; min-height: 0; min-width: 0; overflow: hidden; opacity: 0; visibility: hidden;
  transition: opacity .6s ease, visibility 0s linear .6s;
}
.hero-slide.is-active { opacity: 1; visibility: visible; transition: opacity .6s ease; z-index: 1; }
.hero-slide > picture { display: block; width: 100%; height: 100%; min-height: 0; }
.hero-slide > picture img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.85); color: var(--ink); font-size: 28px; line-height: 1;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,.12);
  opacity: 0; transition: opacity .2s;
}
.hero-slider:hover .hero-arrow, .hero-arrow:focus-visible { opacity: 1; }
.hero-prev { inset-inline-start: 16px; }
.hero-next { inset-inline-end: 16px; }
[dir="rtl"] .hero-arrow { transform: translateY(-50%) scaleX(-1); }
.hero-dots { position: absolute; bottom: 14px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 8px; }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; border: none; padding: 0; cursor: pointer; background: rgba(255,255,255,.6); box-shadow: 0 0 0 1px rgba(0,0,0,.15); transition: width .25s, background .25s; }
.hero-dot.is-active { width: 24px; border-radius: 6px; background: var(--moss); box-shadow: none; }
@media (max-width: 768px) {
  .hero-arrow { display: none; }
  /* الموبايل: بانر طولي (4:5) بدل العريض، وبأقصى ارتفاع مناسب للشاشة */
  .hero-slider { --hero-ratio: var(--hero-mob-ratio, 1080 / 1350); --hero-max: var(--hero-mob-max, 64vh); }
}

/* بانر المنتج التلقائي — نفس نسبة أبعاد البانرات المرفوعة (1920×800 / موبايل 4:5) */
.hero-product {
  /* min-height:0 على الشريحة وعناصرها: من غيرها صورة المنتج الطويلة بتكبّر
     البانر من جوه وتطلع بره حدوده (كانت بتوصل 935px بدل 520px) */
  display: grid !important; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 0;
  height: 100%; min-height: 0; padding: 0;
  background: var(--hps-bg, var(--stone)); color: var(--hps-text, var(--ink)); overflow: hidden;
}
.hero-product > * { min-height: 0; min-width: 0; }
.hps-text { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; overflow: hidden; padding: 4% clamp(24px, 6vw, 96px); }
.hps-badge { background: var(--danger); color: #fff; font-weight: 700; font-size: 13px; padding: 4px 12px; border-radius: 20px; }
.hps-title { font-size: clamp(26px, 3.6vw, 54px); line-height: 1.15; margin: 0; color: inherit; }
.hps-tagline { margin: 0; opacity: .85; font-size: clamp(14px, 1.2vw, 18px); max-width: 44ch; }
.hps-price { font-size: clamp(20px, 2vw, 30px); font-weight: 700; }
.hps-price s { font-size: .65em; opacity: .55; font-weight: 400; margin-inline-start: 6px; }
.hps-btn { pointer-events: none; }
/* صورة المنتج: الافتراضي إنها تبان كاملة من غير قص (contain).
   تقدر تخليها تملا المساحة وتتقص من لوحة التحكم (cover). */
.hps-img { height: 100%; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: var(--hps-img-pad, 3% 4%); }
.hps-img img { height: 100%; width: 100%; object-fit: var(--hps-fit, contain); object-position: center; display: block; }
@media (max-width: 768px) {
  .hero-product { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.15fr) auto; padding: 0 0 30px; gap: 12px; text-align: center; }
  .hps-img { order: -1; padding: 0; min-height: 0; }
  .hps-text { align-items: center; padding: 0 20px; }
  .hps-title { font-size: clamp(20px, 6vw, 30px); }
  .hps-tagline { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hps-text { align-items: center; }
}
@media (prefers-reduced-motion: reduce) { .hero-slide { transition: none; } }


/* -------------------- التصنيفات -------------------- */
.section { padding: 64px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 34px;
  gap: 20px;
}
.section-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--muted);
  text-transform: uppercase;
  display:block;
  margin-bottom: 8px;
}
.section-head h2 { font-size: 28px; margin: 0; }
.section-head .link-more { font-size: 13.5px; font-weight: 600; border-bottom: 1px solid var(--ink); padding-bottom: 2px; white-space: nowrap; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.cat-card {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--stone);
}
.cat-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.cat-card:hover img { transform: scale(1.06); }
.cat-card .cat-label {
  position: absolute; inset: auto 0 0 0;
  padding: 18px;
  background: linear-gradient(to top, rgba(27,26,23,.85), transparent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }

/* -------------------- بطاقة المنتج (Signature element) -------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
}
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; } }
@media (max-width: 520px) { .product-grid { grid-template-columns: 1fr 1fr; } }

.product-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--stone-dark);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%);
}
.product-card .thumb {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--stone);
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.product-card:hover .thumb img { transform: scale(1.05); }

.tag-hole {
  position: absolute;
  top: 8px; left: 8px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--stone-dark);
  z-index: 2;
}
.badge {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 9px;
  letter-spacing: .04em;
}
.badge.sale { background: var(--danger); color: #fff; }
.badge.new { background: var(--moss); color: #fff; }

.quick-actions {
  position: absolute;
  bottom: 10px; left: 10px; right: 10px;
  display: flex; gap: 6px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s, transform .2s;
}
.product-card:hover .quick-actions { opacity: 1; transform: translateY(0); }
.quick-actions form { flex: 1; }
.quick-actions .btn { width: 100%; padding: 10px; font-size: 12px; }

/* على أجهزة اللمس مفيش hover، فلازم الأزرار تفضل ظاهرة دايمًا */
@media (hover: none), (max-width: 900px) {
  .quick-actions { opacity: 1; transform: translateY(0); position: static; margin-top: 10px; padding: 0 12px 12px; }
}

.product-card .info { padding: 16px 16px 18px; }
.product-card .cat-name { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.product-card .name { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.product-card .name a:hover { color: var(--moss); }
.price-tag {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--font-mono);
}
.price-tag .now { font-size: 15px; font-weight: 700; }
.price-tag .was { font-size: 12.5px; color: var(--muted); text-decoration: line-through; }
.rating-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.stars { color: var(--stone-dark); font-size: 12px; letter-spacing: 1px; }
.stars .full, .stars .half { color: var(--mustard); }

/* -------------------- صفحة المتجر -------------------- */

.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; gap: 12px; }
.toolbar select { padding: 9px 12px; border: 1px solid var(--stone-dark); background: var(--white); font-size: 13px; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.pagination a, .pagination span {
  width: 36px; height: 36px; display: flex; align-items:center; justify-content:center;
  border: 1px solid var(--stone-dark); font-family: var(--font-mono); font-size: 13px;
}
.pagination a:hover { border-color: var(--moss); color: var(--moss); }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

/* -------------------- صفحة المنتج -------------------- */
.product-single { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
@media (max-width: 900px) { .product-single { grid-template-columns: 1fr; gap: 30px; } }

.gallery-main { aspect-ratio: 3/4; overflow: hidden; background: var(--stone); margin-bottom: 12px; display: flex; align-items: center; justify-content: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 10px; }
.gallery-thumbs button { padding: 0; border: 2px solid transparent; width: 74px; height: 96px; overflow: hidden; background: none; }
.gallery-thumbs button.active { border-color: var(--moss); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.product-info .cat-name { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.product-info h1 { font-size: 30px; margin-bottom: 12px; }
.product-info .price-tag { font-size: 22px; margin-bottom: 16px; }
.product-info .price-tag .now { font-size: 24px; }
.product-info .short-desc { color: var(--muted); margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--stone); }

.opt-group { margin-bottom: 22px; }
.opt-group .opt-label { font-size: 12.5px; font-weight: 600; margin-bottom: 10px; display:block; text-transform: uppercase; letter-spacing: .04em; }
.swatch-row { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch-row input { display: none; }
.swatch-row .swatch {
  padding: 9px 16px; border: 1px solid var(--stone-dark); font-size: 13px; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.swatch-row input:checked + .swatch { border-color: var(--ink); background: var(--ink); color: #fff; }

.qty-input { display: inline-flex; align-items: center; border: 1px solid var(--stone-dark); }
.qty-input button {
  -webkit-appearance: none; appearance: none;
  width: 38px; height: 42px; background: none; border: none;
  font-size: 16px; color: var(--ink); cursor: pointer; font-family: inherit;
}
.qty-input input {
  -webkit-appearance: none; appearance: none;
  width: 46px; height: 42px; text-align: center; border: none; border-inline: 1px solid var(--stone-dark);
  font-family: var(--font-mono); background: transparent; color: var(--ink);
}

.add-to-cart-row { display: flex; gap: 12px; margin-top: 6px; }
.add-to-cart-row .btn { flex: 1; padding: 15px; }

.meta-list { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--stone); font-size: 13px; color: var(--muted); }
.meta-list div { margin-bottom: 6px; }
.meta-list strong { color: var(--ink); }

.tabs-nav { display: flex; gap: 30px; border-bottom: 1px solid var(--stone-dark); margin: 60px 0 30px; }
.tabs-nav button { background:none; border:none; padding: 14px 0; font-size: 14.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom:-1px; }
.tabs-nav button.active { color: var(--ink); border-color: var(--moss); }
.tab-panel { display: none; max-width: 760px; line-height: 1.9; color: var(--muted); }
.tab-panel.active { display: block; }

/* -------------------- السلة -------------------- */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: start; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-bottom: 14px; border-bottom: 1px solid var(--stone-dark); }
.cart-table td { padding: 20px 0; border-bottom: 1px solid var(--stone); vertical-align: middle; }
.cart-product { display: flex; gap: 16px; align-items: center; }
.cart-product img { width: 76px; height: 96px; object-fit: cover; }
.cart-product .name { font-weight: 600; margin-bottom: 4px; }
.cart-product .opts { font-size: 12.5px; color: var(--muted); }
.cart-price, .cart-total-cell { font-family: var(--font-mono); font-weight: 600; }
.remove-btn {
  -webkit-appearance: none; appearance: none;
  background: none; border: none; border-bottom: 1px solid var(--danger); border-radius: 0;
  padding: 0; margin-top: 6px; display: inline-block;
  color: var(--danger); font-size: 12.5px; font-family: inherit; cursor: pointer;
}

.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }

.summary-box { border: 1px solid var(--stone-dark); padding: 26px; background: var(--white); position: sticky; top: calc(var(--header-h) + 20px); }
.summary-box h3 { font-size: 16px; margin-bottom: 18px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 12px; }
.summary-row.total { font-weight: 700; font-size: 17px; font-family: var(--font-mono); border-top: 1px solid var(--stone); padding-top: 14px; margin-top: 6px; }

/* -------------------- الحساب / تسجيل الدخول -------------------- */
.auth-tabs { display: flex; margin-bottom: 30px; border-bottom: 1px solid var(--stone-dark); }
.auth-tabs button { flex: 1; background: none; border: none; padding: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.auth-tabs button.active { color: var(--ink); border-color: var(--moss); }
.auth-panel { display: none; max-width: 420px; margin: 0 auto; }
.auth-panel.active { display: block; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--stone-dark); background: var(--white);
  font-family: var(--font-body); font-size: 14px;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--moss); }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

.account-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; }
@media (max-width: 800px) { .account-layout { grid-template-columns: 1fr; } }
.account-menu a { display: block; padding: 12px 16px; font-size: 14px; border-inline-start: 2px solid transparent; }
.account-menu a.active, .account-menu a:hover { border-color: var(--moss); color: var(--moss); background: var(--white); }

.orders-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.orders-table th, .orders-table td { padding: 12px 10px; text-align: start; border-bottom: 1px solid var(--stone); }
.status-pill { font-family: var(--font-mono); font-size: 11px; padding: 3px 10px; background: var(--stone); }

/* -------------------- تنبيهات -------------------- */
.alert { padding: 14px 18px; margin-bottom: 22px; font-size: 14px; border-inline-start: 3px solid; }
.alert.success { background: #eef3ea; border-color: var(--moss); color: var(--moss-dark); }
.alert.error { background: #f7eae7; border-color: var(--danger); color: var(--danger); }

/* -------------------- النشرة البريدية -------------------- */
.newsletter { background: var(--ink); color: var(--paper); padding: 60px 0; text-align: center; }
.newsletter h2 { color: var(--paper); font-size: 26px; }
.newsletter p { color: var(--stone); margin-bottom: 24px; }
.newsletter form { display: flex; max-width: 440px; margin: 0 auto; gap: 10px; }
.newsletter input { flex: 1; padding: 13px 16px; border: 1px solid var(--stone-dark); background: var(--paper); font-family: var(--font-body); }
/* على الشاشات الصغيرة الزرار بينزل تحت بدل ما يطلع بره الشاشة */
.newsletter form { flex-wrap: wrap; }
.newsletter input { min-width: 0; flex: 1 1 200px; }
.newsletter .btn { flex: 0 1 auto; }
@media (max-width: 420px) { .newsletter input, .newsletter .btn { flex: 1 1 100%; } }

/* -------------------- الفوتر -------------------- */
.site-footer { background: var(--stone); border-top: 1px solid var(--stone-dark); padding: 56px 0 24px; margin-top: 60px; }
 /* أعمدة مرنة: لو عمود اتشال (زي "حسابي") الباقي بيوزّع نفسه من غير فراغ */
.footer-grid { display: flex; flex-wrap: wrap; gap: 32px; margin-bottom: 40px; }
.footer-grid > * { flex: 1 1 150px; min-width: 0; }
.footer-grid > *:first-child { flex: 1.4 1 240px; }
@media (max-width: 800px) { .footer-grid > * { flex: 1 1 40%; } }
.footer-grid h4 { font-size: 13.5px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 18px; }
.footer-grid ul li { margin-bottom: 10px; font-size: 13.5px; color: var(--muted); }
.footer-grid ul li a:hover { color: var(--moss); }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--stone-dark); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; gap: 10px; }
.footer-bottom { align-items: center; }
/* أيقونات السوشيال في الفوتر */
.footer-social { display: flex; gap: 10px; align-items: center; }
.footer-social a {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--ink); background: transparent; border: 1px solid var(--stone-dark);
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.footer-social a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-2px); }
.footer-social svg { width: 17px; height: 17px; }
@media (max-width: 600px) {
  .footer-bottom { justify-content: center; text-align: center; }
}

/* -------------------- عام -------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ═══ شريط الشحن المجاني ═══ */
.free-ship-bar { background: var(--stone); padding: 12px 16px; margin-bottom: 20px; border-radius: 6px; }
.free-ship-bar .fsb-text { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.free-ship-bar .fsb-track { height: 7px; background: rgba(0,0,0,.08); border-radius: 4px; overflow: hidden; }
.free-ship-bar .fsb-track span { display: block; height: 100%; background: var(--moss); border-radius: 4px; transition: width .5s ease; }
.free-ship-bar.is-done .fsb-track span { background: #2e9e5b; }

/* ═══ طرق الدفع ═══ */
.pay-methods { display: grid; gap: 10px; }
.pay-method { display: block; cursor: pointer; }
.pay-method input { position: absolute; opacity: 0; }
.pay-method .pm-box { display: block; border: 1.5px solid var(--stone-dark); padding: 12px 14px; border-radius: 6px; transition: border-color .15s, background .15s; }
.pay-method input:checked + .pm-box { border-color: var(--moss); background: color-mix(in srgb, var(--moss) 6%, transparent); }
.pay-method input:focus-visible + .pm-box { outline: 2px solid var(--moss); }
.pm-title { display: block; font-weight: 700; }
.pm-desc { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pay-box { border: 2px dashed var(--moss); padding: 18px; margin: 24px 0; border-radius: 8px; background: var(--paper); }
.pay-box h3 { margin: 0 0 6px; }
.pay-amount { font-size: 30px; font-weight: 800; color: var(--moss); margin-bottom: 6px; }
.pay-targets { list-style: none; padding: 0; margin: 10px 0; }
.pay-targets li { padding: 6px 0; font-size: 15px; }
.copy-me { cursor: pointer; border-bottom: 1px dashed currentColor; }

/* ═══ كوّن الباكدج ═══ */
.bundle-builder { margin: 10px 0 18px; }
.bundle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.bundle-item { border: 1.5px solid var(--stone-dark); border-radius: 8px; padding: 8px; text-align: center; background: var(--paper); position: relative; transition: border-color .15s; }
.bundle-item.picked { border-color: var(--moss); box-shadow: 0 0 0 1px var(--moss); }
.bundle-item.disabled { opacity: .45; }
.bundle-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; margin-bottom: 6px; }
.bundle-item .bi-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; min-height: 2.6em; }
.bundle-item .bi-price { font-size: 12px; color: var(--muted); }
.bundle-item .bi-ctrl { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; }
.bundle-item .bi-ctrl button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--stone-dark); background: var(--paper); cursor: pointer; font-size: 16px; line-height: 1; }
.bundle-item .bi-ctrl button:disabled { opacity: .35; cursor: default; }
.bundle-item .bi-count { min-width: 16px; font-weight: 700; }
.bundle-status { display: flex; justify-content: space-between; align-items: center; margin: 12px 0; padding: 10px 14px; background: var(--stone); border-radius: 6px; font-weight: 600; }
.bundle-status .bs-price { font-size: 18px; color: var(--moss); }

/* ═══ درجات خلصت ═══ */
.shade-item.sold-out { opacity: .4; cursor: not-allowed; position: relative; }
.shade-item.sold-out .shade-name::after { content: " ✕"; color: var(--danger); }

/* ═══ البحث ═══ */
.search-toggle { cursor: pointer; }
.search-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.45); display: none; align-items: flex-start; justify-content: center; padding: 70px 16px 16px; }
.search-overlay.open { display: flex; }
.search-panel { width: 100%; max-width: 620px; background: var(--paper); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.search-panel form { display: flex; border-bottom: 1px solid var(--stone); }
.search-panel input { flex: 1; border: none; padding: 16px 18px; font-size: 16px; background: transparent; color: var(--ink); outline: none; font-family: inherit; }
.search-panel .search-close { border: none; background: none; font-size: 22px; padding: 0 16px; cursor: pointer; color: var(--muted); }
.search-results { max-height: 60vh; overflow-y: auto; }
.search-results a.sr-item { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--stone); }
.search-results a.sr-item:hover, .search-results a.sr-item.focus { background: var(--stone); }
.sr-item img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.sr-item .sr-name { font-weight: 600; font-size: 14px; }
.sr-item .sr-price { font-size: 13px; color: var(--moss); font-weight: 700; }
.sr-item .sr-price s { color: var(--muted); font-weight: 400; margin-inline-start: 6px; }
.search-results .sr-empty, .search-results .sr-all { display: block; padding: 14px 16px; text-align: center; font-size: 13.5px; color: var(--muted); }
.search-results .sr-all { color: var(--moss); font-weight: 700; }

/* ═══ صور التقييمات ═══ */
.review-photos { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.review-photos img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.verified-badge { font-size: 11.5px; color: #2e7d4f; font-weight: 700; margin-inline-start: 8px; }
.review-gallery { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin: 12px 0 20px; }
.review-gallery img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; flex-shrink: 0; cursor: zoom-in; }
.img-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.img-lightbox img { max-width: 100%; max-height: 90vh; border-radius: 6px; }

/* ═══ النشرة البريدية ═══ */
.newsletter .nl-msg { margin-top: 10px; font-size: 14px; }

/* ═══ خطوات تتبع الطلب ═══ */
.track-steps { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 0; }
.track-steps li { display: flex; align-items: center; gap: 12px; padding: 0 0 18px; position: relative; color: var(--muted); font-size: 14px; }
.track-steps li:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: 15px; top: 30px; bottom: 2px; width: 2px; background: var(--stone-dark); }
.track-steps li.done:not(:last-child)::before { background: var(--moss); }
.track-steps .ts-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--stone); color: var(--muted); font-size: 13px; font-weight: 700; flex-shrink: 0; z-index: 1; }
.track-steps li.done { color: var(--ink); font-weight: 600; }
.track-steps li.done .ts-dot { background: var(--moss); color: #fff; }

/* ═══ محفزات الشراء ═══ */
.stock-urgency { margin: 0 0 10px; font-size: 13.5px; font-weight: 700; color: #c2410c; background: #fff4ed; border-radius: 6px; padding: 8px 12px; display: inline-block; }
.buy-now-btn { margin-top: 10px; }
.trust-strip { list-style: none; padding: 16px 0 0; margin: 14px 0 0; border-top: 1px solid var(--stone-dark); display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.trust-strip li { font-size: 13px; color: var(--muted); }
@media (max-width: 480px) { .trust-strip { grid-template-columns: 1fr; } }

/* شريط الشراء الثابت على الموبايل */
.sticky-buy {
  position: fixed; inset-inline: 0; bottom: var(--mobile-bar-h, 64px); z-index: 90;
  display: none; align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--paper); border-top: 1px solid var(--stone-dark); box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  transform: translateY(100%); transition: transform .25s ease;
}
.sticky-buy.show { transform: translateY(0); }
.sticky-buy .sb-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sticky-buy .sb-name { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-buy .sb-price { font-weight: 700; font-size: 15px; }
.sticky-buy .sb-price s { font-weight: 400; font-size: 12px; color: var(--muted); margin-inline-start: 6px; }
.sticky-buy .btn { padding: 12px 22px; white-space: nowrap; }
@media (max-width: 860px) { .sticky-buy { display: flex; } }

/* زرار واتساب العائم */
.wa-float {
  position: fixed; inset-inline-end: 18px; bottom: calc(var(--mobile-bar-h, 64px) + 14px); z-index: 95;
  width: 52px; height: 52px; border-radius: 50%; background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(37,211,102,.4);
  transition: transform .2s;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 28px; height: 28px; }
@media (min-width: 861px) { .wa-float { bottom: 24px; } }

/* هدية */
.gift-box { border: 1px dashed var(--stone-dark); border-radius: 8px; padding: 12px 14px; margin-top: 14px; }
.gift-box label { font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.gift-box textarea { margin-top: 10px; }


/* إخفاء آمن (فخ البوتات / نص للنسخ) — من غير ما يعمل تمرير أفقي */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ═══ تحسينات اللمس والقراءة على الموبايل ═══ */
/* مساحة اللمس للنقط: دايرة شفافة حوالين النقطة — شكل النقطة مابيتغيرش */
.hero-dot { position: relative; }
.hero-dot::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; }
@media (max-width: 860px) {
  /* لينكات الفوتر والقوائم تبقى أسهل في الضغط بالصباع */
  .footer-grid ul li { margin-bottom: 4px; }
  /* مساحة ضغط أكبر من غير ما نغيّر طريقة عرض اللينك (القائمة لازم تفضل تحت بعضها) */
  .footer-grid ul li a,
  .breadcrumb a { display: inline-block; padding: 9px 0; min-height: 22px; }
  .footer-grid ul li { font-size: 14px; }
  /* نص أصغر من 12px صعب يتقرا على الموبايل */
  .cat-name, .product-card .opts, .helper-text { font-size: 12.5px; }
  .eyebrow { font-size: 12px; }
  /* الأزرار والحقول: ارتفاع مريح ومنع تكبير الصفحة في iOS (16px) */
  .btn { min-height: 46px; }
  input, select, textarea { font-size: 16px; min-height: 46px; }
  textarea { min-height: 80px; }
  .qty-input button { min-width: 42px; min-height: 42px; }
}
@media (max-width: 420px) {
  /* شاشات صغيرة: مسافات أقل عشان المحتوى ياخد مساحته */
  .container { padding-inline: 16px; }
  .section { padding: 44px 0; }
}

/* لو شريط الشراء الثابت ظاهر، زرار الواتساب يطلع فوقه بدل ما يتغطى */
body:has(.sticky-buy.show) .wa-float { bottom: calc(var(--mobile-bar-h, 64px) + 78px); }

/* زرار الواتساب وشريط الشراء يختفوا وقت ما قائمة الموبايل أو طبقة البحث مفتوحة */
body.nav-open .wa-float,
body.nav-open .sticky-buy,
body.nav-open .mobile-bottom-bar { opacity: 0; pointer-events: none; }

/* ═══ قسم الصورة العريضة في الصفحة الرئيسية ═══ */
.home-image { position: relative; }
.home-image .hi-media { display: block; position: relative; height: var(--hi-h, 420px); overflow: hidden; }
.home-image picture, .home-image picture img { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-image .hi-media::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,var(--hi-overlay, .3)); }
.home-image .hi-content {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center;
  gap: 14px; padding: 0 clamp(24px, 7vw, 110px); color: #fff; text-align: center; align-items: center;
}
.home-image--start .hi-content { align-items: flex-start; text-align: start; }
.home-image--end .hi-content { align-items: flex-end; text-align: end; }
.home-image .hi-content h2 { color: #fff; font-size: clamp(24px, 3.4vw, 46px); margin: 0; line-height: 1.2; max-width: 20ch; }
.home-image .hi-content p { margin: 0; font-size: clamp(14px, 1.3vw, 18px); opacity: .92; max-width: 46ch; }
.home-image .hi-content .btn { background: #fff; color: var(--ink); border-color: #fff; }
.home-image .hi-content .btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (max-width: 768px) {
  .home-image .hi-media { height: min(var(--hi-h, 420px), 62vh); }
  .home-image .hi-content { padding: 0 22px; text-align: center; align-items: center; }
}

/* ═══════════════════════════════════════════════════════════════
   السلة الجانبية (Side Cart) — بتفتح من جنب الصفحة
   ملاحظة: كل الكلاسات هنا جديدة (cd-*) ومابتأثرش على أي حاجة قديمة.
   ═══════════════════════════════════════════════════════════════ */
.cart-drawer { position: fixed; inset: 0; z-index: 1200; pointer-events: none; }
.cart-drawer .cd-overlay {
  position: absolute; inset: 0; background: rgba(27, 26, 23, .45);
  opacity: 0; transition: opacity .28s ease; backdrop-filter: blur(1px);
}
.cart-drawer .cd-panel {
  position: absolute; top: 0; bottom: 0; inset-inline-end: 0;
  width: min(420px, 100%); background: var(--white);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(27, 26, 23, .18);
  transform: translateX(var(--cd-out, 102%));
  transition: transform .32s cubic-bezier(.3, .8, .3, 1);
  will-change: transform;
}
html[dir="rtl"] .cart-drawer .cd-panel { --cd-out: -102%; }
.cart-drawer.open { pointer-events: auto; }
.cart-drawer.open .cd-overlay { opacity: 1; }
.cart-drawer.open .cd-panel { transform: translateX(0); }
body.cd-open { overflow: hidden; }

.cd-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--stone);
  flex: 0 0 auto;
}
.cd-head h3 { margin: 0; font-size: 16px; letter-spacing: .04em; text-transform: uppercase; font-family: var(--font-body); font-weight: 700; }
.cd-head .cd-count {
  display: inline-block; min-width: 20px; height: 20px; line-height: 20px;
  text-align: center; background: var(--ink); color: var(--white);
  border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 6px;
  margin-inline-start: 6px; vertical-align: 2px;
}
.cd-close { background: none; border: none; padding: 6px; cursor: pointer; color: var(--ink); line-height: 0; }
.cd-close svg { width: 22px; height: 22px; }

.cd-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.cd-scroll { flex: 1 1 auto; overflow-y: auto; padding: 14px 18px; -webkit-overflow-scrolling: touch; }
.cd-scroll .free-ship-bar { margin: 0 0 14px; }

.cd-items { list-style: none; margin: 0; padding: 0; }
.cd-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--stone); }
.cd-item:first-child { padding-top: 0; }
.cd-thumb { flex: 0 0 76px; width: 76px; height: 92px; background: var(--paper); overflow: hidden; display: block; }
.cd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cd-info { flex: 1 1 auto; min-width: 0; }
.cd-name { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.cd-opts { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.cd-opts.cd-offer { color: var(--moss); font-weight: 600; }
.cd-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.cd-qty { display: inline-flex; align-items: center; border: 1px solid var(--stone-dark); }
.cd-qty .cd-q {
  width: 30px; height: 30px; background: none; border: none; cursor: pointer;
  font-size: 15px; color: var(--ink); line-height: 1;
}
.cd-qty .cd-q-val { min-width: 28px; text-align: center; font-size: 13px; font-weight: 600; font-family: var(--font-mono); }
.cd-qty-fixed { font-size: 12px; color: var(--muted); }
.cd-price { font-size: 13.5px; font-weight: 700; font-family: var(--font-mono); white-space: nowrap; }
.cd-remove {
  background: none; border: none; padding: 0; margin-top: 7px; cursor: pointer;
  font-size: 11.5px; color: var(--muted); text-decoration: underline;
}
.cd-remove:hover { color: var(--danger); }

.cd-foot { flex: 0 0 auto; border-top: 1px solid var(--stone); padding: 14px 18px 18px; background: var(--paper); }
.cd-total-row { display: flex; align-items: center; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.cd-total-row strong { font-family: var(--font-mono); font-size: 16px; }
.cd-total-row.cd-disc strong { color: var(--moss); }
.cd-note { font-size: 11.5px; color: var(--muted); margin: 4px 0 12px; }
.cd-view-cart { display: block; text-align: center; margin-top: 10px; font-size: 12.5px; color: var(--muted); text-decoration: underline; }

.cd-empty { text-align: center; padding: 48px 24px; margin: auto; }
.cd-empty-icon { font-size: 40px; margin-bottom: 10px; }
.cd-empty h4 { margin: 0 0 6px; font-size: 17px; }
.cd-empty p { color: var(--muted); font-size: 13px; margin: 0 0 18px; }

.cd-loading { position: absolute; inset: 0; background: rgba(255, 255, 255, .55); display: none; align-items: center; justify-content: center; }
.cart-drawer.is-busy .cd-loading { display: flex; }
.cd-spin { width: 26px; height: 26px; border: 2px solid var(--stone-dark); border-top-color: var(--ink); border-radius: 50%; animation: cd-spin .7s linear infinite; }
@keyframes cd-spin { to { transform: rotate(360deg); } }

.cd-toast {
  position: fixed; inset-inline: 16px; bottom: 24px; z-index: 1400;
  max-width: 380px; margin-inline: auto;
  background: var(--ink); color: var(--white); padding: 12px 16px;
  font-size: 13px; text-align: center; border-radius: 3px;
  opacity: 0; transform: translateY(10px); transition: opacity .25s ease, transform .25s ease;
}
.cd-toast.show { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .cart-drawer .cd-panel, .cart-drawer .cd-overlay, .cd-toast { transition: none; }
}
@media (max-width: 520px) {
  .cart-drawer .cd-panel { width: 100%; }
  .cd-thumb { flex-basis: 66px; width: 66px; height: 80px; }
}

/* ═══════════════════════════════════════════════════════════════
   شريط المنتجات الأفقي (Carousel) — بديل الشبكة في الصفحة الرئيسية
   ═══════════════════════════════════════════════════════════════ */
/* --rail-per-desk بيتحط inline من PHP، و--rail-per هو اللي الميديا كويري
   بتغيّره (مانحطّوش inline لأن الـ inline بيغلب أي ميديا كويري) */
.prod-rail { position: relative; --rail-gap: 24px; --rail-per: var(--rail-per-desk, 4); }
.rail-track {
  display: flex; gap: var(--rail-gap);
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.rail-track::-webkit-scrollbar { display: none; }
.rail-item {
  flex: 0 0 calc((100% - (var(--rail-per) - 1) * var(--rail-gap)) / var(--rail-per));
  min-width: 0; scroll-snap-align: start;
}
.rail-arrow {
  position: absolute; top: 38%; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--stone-dark);
  color: var(--ink); cursor: pointer; line-height: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(27, 26, 23, .12);
  transition: background .2s ease, color .2s ease, opacity .2s ease;
}
.rail-arrow:hover { background: var(--ink); color: var(--white); }
.rail-arrow svg { width: 18px; height: 18px; }
.rail-arrow[hidden] { display: none; }
.rail-prev { inset-inline-start: -18px; }
.rail-next { inset-inline-end: -18px; }
html[dir="rtl"] .rail-arrow svg { transform: scaleX(-1); }

@media (max-width: 1280px) {
  .rail-prev { inset-inline-start: 4px; }
  .rail-next { inset-inline-end: 4px; }
}
@media (max-width: 900px) {
  .prod-rail { --rail-gap: 14px; --rail-per: 2.2; }
  .rail-arrow { display: none; }
}
@media (max-width: 520px) {
  .prod-rail { --rail-per: 1.7; }
}

/* عدد المنتجات تحت اسم القسم */
.cat-card .cat-count { display: block; font-size: 11px; font-weight: 500; opacity: .85; margin-top: 2px; letter-spacing: .02em; }

/* ═══════════════════════════════════════════════════════════════
   شريط الضمانات (4 أعمدة)
   ═══════════════════════════════════════════════════════════════ */
.trust-band { background: var(--stone); padding: 26px 0; }
.trust-band-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.tb-item { display: flex; align-items: center; gap: 12px; }
.tb-item .tb-icon { flex: 0 0 auto; color: var(--moss); line-height: 0; }
.tb-item .tb-icon svg { width: 30px; height: 30px; }
.tb-item strong { display: block; font-size: 13.5px; line-height: 1.4; }
.tb-item span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
@media (max-width: 900px) {
  .trust-band { padding: 20px 0; }
  .trust-band-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
  .tb-item .tb-icon svg { width: 26px; height: 26px; }
  .tb-item strong { font-size: 12.5px; }
  .tb-item span { font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════════════
   ريلز قابلة للشراء (Shop the Reels)
   ═══════════════════════════════════════════════════════════════ */
.reels-rail { position: relative; --rail-gap: 18px; --rail-per: 5; }
.reels-rail .rail-item { flex: 0 0 calc((100% - (var(--rail-per) - 1) * var(--rail-gap)) / var(--rail-per)); }
.reel-card { display: block; position: relative; background: var(--paper); overflow: hidden; }
.reel-media { position: relative; aspect-ratio: 9 / 16; background: var(--stone); overflow: hidden; }
.reel-media video, .reel-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-play {
  position: absolute; inset-inline-end: 10px; top: 10px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%; background: rgba(27, 26, 23, .55);
  color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center;
  transition: opacity .2s ease;
}
.reel-card.is-playing .reel-play { opacity: 0; }
.reel-foot {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  background: var(--white); border: 1px solid var(--stone); border-top: none;
}
.reel-thumb { width: 34px; height: 42px; object-fit: cover; flex: 0 0 auto; background: var(--stone); }
.reel-meta { flex: 1 1 auto; min-width: 0; }
.reel-name { display: block; font-size: 12px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reel-price { display: block; font-size: 12px; font-family: var(--font-mono); color: var(--muted); margin-top: 1px; }
.reel-cta { flex: 0 0 auto; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-bottom: 1px solid var(--ink); }
@media (max-width: 1100px) { .reels-rail { --rail-per: 3.4; } }
@media (max-width: 760px) { .reels-rail { --rail-per: 2.3; --rail-gap: 12px; } }
@media (max-width: 480px) { .reels-rail { --rail-per: 1.6; } }
