/* =====================================================================
   متجر العز — ملف تخصيص التصميم (Custom Theme)
   منصة: زد (Zid) | قالب Tailwind
   ---------------------------------------------------------------------
   • يحافظ بالكامل على ألوان متجركم لأنه يستخدم متغيّرات الثيم نفسها:
       --primary   #0B0A09  (الأسود الأساسي)
       --accent    #A89C90  (البيج الذهبي)
       --secondary #F6F5F4  (الأوف-وايت)
       --background / --foreground / --border-light
     فلا حاجة لتعديل أي لون — يتبع لوحة ألوانكم تلقائياً.
   • مكان اللصق في زد: لوحة التحكم ← متجري ← تخصيص الواجهة ←
     إعدادات متقدمة / CSS مخصص ← الصق الكود كاملاً واحفظ.
   ===================================================================== */

/* ===== 1) هيدر ثابت أعلى الصفحة ===== */
header.bg-secondary {
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(11, 10, 9, .06);
  backdrop-filter: saturate(1.05);
}

/* ===== 2) عناوين الأقسام: توسيط + فاصل زخرفي بمعيّن في الوسط =====
   (لمسة بصرية مميزة لعناوين الأقسام) */

/* تحويل صف العنوان من (عنوان يمين / رابط يسار) إلى عمود موسّط */
.section-products .flex.items-center.justify-between {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  text-align: center;
}

/* العنوان نفسه: أكبر وأعرض مع مساحة للفاصل أسفله */
.section-products h2 {
  position: relative;
  display: block;
  width: 100%;
  text-align: center;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--foreground);
  padding-bottom: 22px;
  margin: 0 auto;
}

/* الخط الأفقي للفاصل */
.section-products h2::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  max-width: 62%;
  height: 2px;
  background: linear-gradient(90deg,
              transparent,
              var(--accent) 18%,
              var(--accent) 82%,
              transparent);
}

/* المعيّن (الماسة) الزخرفية في منتصف الفاصل */
.section-products h2::before {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 3px solid var(--background);
  box-shadow: 0 0 0 2px var(--accent);
  z-index: 1;
}

/* رابط "جميع المنتجات" يتحوّل إلى زر دائري موسّط أسفل العنوان */
.section-products .flex.items-center.justify-between > a {
  border: 1px solid var(--accent);
  border-radius: 9999px;
  padding: .55rem 1.4rem !important;
  font-weight: 600;
  color: var(--foreground);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.section-products .flex.items-center.justify-between > a:hover {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* ===== 3) إيقاع الأقسام: تبديل خلفية بين الأبيض والأوف-وايت ===== */
.section-products:nth-of-type(even) {
  background: var(--secondary);
}

/* ===== 4) بطاقات المنتجات: إطار + ظل + رفع عند المرور ===== */
.section-products .group.relative.flex.h-full.flex-col.gap-4 {
  background: var(--background);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 10px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.section-products .group.relative.flex.h-full.flex-col.gap-4:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 34px rgba(11, 10, 9, .12);
  border-color: var(--accent);
}

/* تكبير الصورة بلطف عند المرور */
.section-products .group .relative.block.w-full.overflow-hidden.rounded {
  border-radius: 12px;
}
.section-products .group img {
  transition: transform .45s ease;
}
.section-products .group:hover img {
  transform: scale(1.06);
}

/* عنوان المنتج أوضح قليلاً */
.section-products h3.text-foreground {
  font-weight: 600;
  font-size: .95rem;
}

/* ===== 5) شارة الخصم: حبة ممتلئة بلون العلامة (أبرز من الافتراضي) ===== */
.section-products .absolute.top-4 > span {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-foreground) !important;
  font-weight: 700 !important;
  padding: .28rem .7rem !important;
  box-shadow: 0 4px 10px rgba(11, 10, 9, .18);
}
.section-products .absolute.top-4 > span svg path {
  fill: currentColor;
}

/* ===== 6) الأزرار: حواف أنعم + حضور أقوى ===== */
.section-products .btn-outlined {
  border-width: 1.5px;
  border-color: var(--primary);
  color: var(--primary);
  border-radius: 10px;
  font-weight: 700;
  transition: background .2s ease, color .2s ease;
}
.section-products .btn-outlined:hover {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn-filled {
  border-radius: 10px;
  font-weight: 700;
}

/* زر الإضافة للسلة (الأيقونة) داخل البطاقة */
.section-products .btn-icon {
  border-radius: 10px;
  backdrop-filter: blur(6px);
}

/* ===== 7) مسافات أكبر بين الأقسام لتنفّس التصميم ===== */
.section-products {
  padding-top: clamp(2rem, 1rem + 3vw, 4rem);
  padding-bottom: clamp(2rem, 1rem + 3vw, 4rem);
}

/* ===== 8) الفوتر: خلفية غامقة + محتوى فاتح بنفس الهوية =====
   نعيد تعريف متغيّرات الثيم داخل الفوتر فقط، فيتحوّل كل نص/رابط/فاصل
   تلقائياً للون الفاتح المناسب مع الإبقاء على لمسة البيج (--accent) */
footer.bg-secondary {
  background: #6B5618 !important;          /* ذهبي غامق */
  color: #FFFFFF;
  border-top: 3px solid var(--accent);
  --foreground: #FFFFFF;
  --color-foreground: #FFFFFF;
  --muted: #E8E2D5;
  --muted-foreground: #E8E2D5;
  --color-muted-foreground: #E8E2D5;
  --border-light: rgba(255, 255, 255, .18);
  --border: rgba(255, 255, 255, .26);
}
footer.bg-secondary a:hover { color: var(--accent) !important; }

/* ===== 10) الجوال: عرض منتجَين في كل صف (عمودين) =====
   يشمل كل شبكات المنتجات (الرئيسية + القسم + البحث) أياً كان عدد
   الأعمدة المختار (grid / four / two ...) ما عدا وضع القائمة (list) */
@media (max-width: 767px) {
  [data-grid-root]:not([data-grid="list"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.25rem 0.6rem !important;       /* تقارب أفقي أقل بين العمودين */
  }
  /* مقاسات أنسب للبطاقة المصغّرة داخل العمودين */
  [data-grid-root]:not([data-grid="list"]) .group.relative.flex.h-full.flex-col.gap-4 {
    padding: 6px;
    border-radius: 12px;
  }
  [data-grid-root]:not([data-grid="list"]) h3.text-foreground { font-size: .85rem; }
  [data-grid-root]:not([data-grid="list"]) .btn-outlined,
  [data-grid-root]:not([data-grid="list"]) .btn-filled { font-size: .8rem; padding-left: .5rem; padding-right: .5rem; }
}

/* ===== 11) شريط تمرير أفقي أنعم لكاروسيل المنتجات ===== */
.section-products ::-webkit-scrollbar { height: 6px; }
.section-products ::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 9999px;
}

/* =====================================================================
   صفحة المنتج — تصميم متوافق مع الصفحة الرئيسية
   (أقسام المنتجات المقترحة أسفل الصفحة تتنسّق تلقائياً عبر قواعد
    .section-products أعلاه، فيظهر العنوان الموسّط والبطاقات نفسها)
   ===================================================================== */

/* ===== 12) معرض صور المنتج: زوايا ناعمة وإطار خفيف ===== */
.product-gallery-column img { border-radius: 16px; }
.product-gallery-column .relative.overflow-hidden {
  border-radius: 16px;
  border: 1px solid var(--border-light);
}

/* ===== 13) عنوان المنتج: أكبر وأعرض (متناسق مع عناوين الرئيسية) ===== */
.product-details-column h1 {
  font-size: clamp(1.4rem, 1rem + 1vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -.01em;
}

/* فاصل خفيف أسفل كتلة العنوان والسعر */
.product-details-column .space-y-1 {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: .85rem;
}

/* ===== 14) السعر: كبير وبارز بلون العلامة + السعر القديم مشطوب باهت ===== */
.product-details-column p.text-lg.font-semibold {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.product-details-column .line-through,
.product-details-column del {
  color: var(--muted-foreground);
  font-weight: 500;
}

/* ===== 15) شارة الخصم: حبة ممتلئة بلون العلامة (نفس أسلوب البطاقات) ===== */
#product-badges > span {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-foreground) !important;
  font-weight: 700 !important;
  padding: .3rem .7rem !important;
}
#product-badges > span svg path { fill: currentColor; }

/* ===== 16) أزرار خيارات المنتج (مثل: لحوح / خمير) ===== */
.product-options__label { font-weight: 700; color: var(--foreground); }
.product-options__list { display: flex; flex-wrap: wrap; gap: .5rem; }
.product-options__item {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .5rem 1.15rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--foreground);
  background: var(--background);
  transition: all .2s ease;
}
.product-options__item:hover { border-color: var(--primary); }
.product-options__item.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

/* ===== 17) محدّد الكمية ===== */
.qty-input {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.qty-input-btn { transition: background .2s ease; }
.qty-input-btn:hover { background: var(--secondary); }

/* ===== 18) زر "أضف للسلة" الرئيسي: حواف أنعم + ظل خفيف ===== */
.product-details-column .btn-filled.btn-lg {
  border-radius: 12px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(11, 10, 9, .15);
}

/* ===== 19) حقول الإدخال (تاريخ/وقت/نص) بحواف دائرية متناسقة ===== */
.product-details-column input[type="date"],
.product-details-column input[type="time"],
.product-details-column input[type="text"] { border-radius: 10px; }

/* ===== 20) الجوال: عمود واحد لصفحة المنتج (الصورة فوق التفاصيل) ===== */
@media (max-width: 639px) {
  .product-details-column .btn-filled.btn-lg { font-size: .95rem; }
}

/* ===== 21) الجوال: صورة المنتج بكامل عرض الكونتينر (إلغاء معاينة الشريحة التالية) ===== */
@media (max-width: 767px) {
  .product-gallery__slide {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  .product-gallery__container { gap: 0 !important; }
}

/* ===== 22) نسبة أبعاد صورة المنتج: 700×800 (نسبة 7:8) ===== */
/* تُحدَّد كنسبة أبعاد ليبقى العرض متجاوباً: 700×800 على الديسكتوب
   وتتقلّص بنفس النسبة على الجوال */
.product-gallery img,
.product-gallery__slide img {
  aspect-ratio: 7 / 8 !important;
  height: auto !important;
}

/* =====================================================================
   صفحة القسم / التصنيف — نفس تصميم الصفحة الرئيسية
   ===================================================================== */

/* ===== 23) عنوان القسم: موسّط مع الفاصل الزخرفي والمعيّن (مثل الرئيسية) ===== */
section.flex.items-center.overflow-hidden .theme-container {
  display: flex;
  justify-content: center;
}
section.flex.items-center.overflow-hidden .theme-container > div {
  align-items: center;
  text-align: center;
  max-width: 100%;
  width: 100%;
}
section.flex.items-center.overflow-hidden h1 {
  position: relative;
  display: block;
  width: 100%;
  text-align: center;
  font-size: clamp(1.6rem, 1rem + 1.8vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--foreground);
  padding-bottom: 22px;
}
section.flex.items-center.overflow-hidden h1::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  max-width: 62%;
  height: 2px;
  background: linear-gradient(90deg,
              transparent,
              var(--accent) 18%,
              var(--accent) 82%,
              transparent);
}
section.flex.items-center.overflow-hidden h1::before {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 3px solid var(--background);
  box-shadow: 0 0 0 2px var(--accent);
  z-index: 1;
}

/* ===== 24) بطاقات القسم: نفس بطاقات الرئيسية (إطار + ظل + رفع) =====
   تُطبَّق على أي شبكة منتجات (القسم/البحث) عبر [data-grid-root] */
[data-grid-root] .group.relative.flex.h-full.flex-col.gap-4 {
  background: var(--background);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 10px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
[data-grid-root] .group.relative.flex.h-full.flex-col.gap-4:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 34px rgba(11, 10, 9, .12);
  border-color: var(--accent);
}
[data-grid-root] .group .relative.block.w-full.overflow-hidden.rounded { border-radius: 12px; }
[data-grid-root] .group img { transition: transform .45s ease; }
[data-grid-root] .group:hover img { transform: scale(1.06); }

/* أزرار البطاقات في القسم */
[data-grid-root] .btn-outlined {
  border-width: 1.5px;
  border-color: var(--primary);
  color: var(--primary);
  border-radius: 10px;
  font-weight: 700;
  transition: all .2s ease;
}
[data-grid-root] .btn-outlined:hover {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* شارة الخصم داخل بطاقات القسم */
[data-grid-root] .absolute.top-4 > span {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-foreground) !important;
  font-weight: 700 !important;
  padding: .28rem .7rem !important;
}
[data-grid-root] .absolute.top-4 > span svg path { fill: currentColor; }

/* =====================================================================
   صفحة جميع التصنيفات (/categories) — نفس تصميم الرئيسية والقسم
   ===================================================================== */

/* ===== 25) عنوان "تسوق حسب التصنيفات": موسّط مع الفاصل والمعيّن ===== */
section.px-4.pb-16 .flex.flex-col.gap-6 > h2 {
  position: relative;
  display: block;
  width: 100%;
  text-align: center;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--foreground);
  padding-bottom: 22px;
}
section.px-4.pb-16 .flex.flex-col.gap-6 > h2::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  max-width: 62%;
  height: 2px;
  background: linear-gradient(90deg,
              transparent,
              var(--accent) 18%,
              var(--accent) 82%,
              transparent);
}
section.px-4.pb-16 .flex.flex-col.gap-6 > h2::before {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 3px solid var(--background);
  box-shadow: 0 0 0 2px var(--accent);
  z-index: 1;
}

/* ===== 26) بطاقات التصنيفات: زوايا دائرية + إطار + رفع عند المرور ===== */
a.group.flex.flex-col.gap-4 > .aspect-square {
  border-radius: 16px !important;
  border: 1px solid var(--border-light);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
a.group.flex.flex-col.gap-4:hover > .aspect-square {
  transform: translateY(-6px);
  box-shadow: 0 16px 34px rgba(11, 10, 9, .12);
  border-color: var(--accent);
}
a.group.flex.flex-col.gap-4 h3 { font-weight: 700; }

/* ===== 27) بانر عنوان صفحات الأقسام والتصنيفات: خلفية غامقة + محتوى فاتح =====
   نفس معالجة الفوتر، فيظهر العنوان أبيض والوصف فاتح والفاصل بلون البيج */
section.flex.items-center.overflow-hidden {
  background: #6B5618 !important;          /* ذهبي غامق */
  color: #FFFFFF;
  --foreground: #FFFFFF;
  --color-foreground: #FFFFFF;
  --muted: #E8E2D5;
  --muted-foreground: #E8E2D5;
  --color-muted-foreground: #E8E2D5;
}
/* المعيّن في منتصف الفاصل: حلقته تأخذ لون الخلفية الغامقة لتندمج */
section.flex.items-center.overflow-hidden h1::before {
  border-color: #6B5618;
}

/* ===== 28) تحديد عدد منتجات قسم الرئيسية بـ 4 (CSS فقط — بدون JavaScript) =====
   يُخفي ما زاد عن 4 منتجات في كل قسم بالرئيسية. زر "جميع المنتجات"
   الموجود في كل قسم (المنسّق ككبسولة تحت العنوان) يعمل كزر "المزيد"
   وينقل لصفحة كل منتجات القسم.
   لتغيير العدد: غيّر الرقم في n+5 (= العدد المطلوب + 1). */
.section-products [data-grid-root] > *:nth-child(n+9) {
  display: none !important;
}