/* ----------------------------------------------------
   6. Bariq Hybrid Layout v12 (التصنيفات المخصصة)
---------------------------------------------------- */
@media (max-width: 768px) {
   .bariq-hybrid-nav { display: flex!important; flex-direction: column!important; align-items: center!important; width: 100%!important; background: #ffffff; padding: 15px 0!important; }
    section.s-block--categories { display: none!important; }
   .bariq-hybrid-title { font-size: 20px!important; font-weight: 800!important; color: #000; margin-bottom: 15px!important; text-align: center; width: 100%!important; }
    
   .bariq-premium-row { display: flex!important; gap: 12px; margin-bottom: 20px; padding: 0 10px!important; width: 100%!important; justify-content: center!important; }
   .premium-item { flex: 1; position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.08); }
   .premium-item img { width: 100%; height: 100%; object-fit: cover; }
   .premium-item::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 40%, transparent 100%); z-index: 1; }
   .premium-item span { position: absolute; bottom: 15px; right: 12px; color: #fff; z-index: 2; font-weight: 800; font-size: 15px; }

   .bariq-pills-slider { display: flex!important; overflow-x: auto!important; gap: 8px!important; padding: 5px 15px!important; width: 100%!important; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
   .bariq-pills-slider::-webkit-scrollbar { display: none; }
   .pill-item { flex: 0 0 auto!important; background: #f8f8f8; padding: 6px 16px!important; border-radius: 50px!important; border: 1px solid #f0f0f0; white-space: nowrap!important; }
}
/* =========================
   🧠 Typography
========================= */
h1,h2,h3,h4,h5,h6,
.s-product-card-content-title{
  font-family:var(--font-heading)!important;
  font-weight:800!important;
  letter-spacing:-0.3px;
}

body,p,span,a,button,.btn{
  font-family:var(--font-body)!important;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}


/* =========================
   🛒 إصلاح عرض المنتجات (2 فقط)
========================= */

@media(max-width:768px){

  /* نحافظ على نظام سلة بدون كسره */
  salla-products-slider .swiper-wrapper{
    display:flex !important;
  }

  salla-products-slider .swiper-slide{
    width:50% !important;
    flex:0 0 50% !important;
    max-width:50% !important;
  }

}


/* =========================
   ⚡ تحسين الأداء (GPU)
========================= */

.s-product-card-entry,
.swiper{
  will-change:transform;
  transform:translateZ(0);
}


/* =========================
   🎯 تحسين زر الشراء (CRO)
========================= */

.salla-button,
.btn--primary{
  font-weight:700;
  transition:transform .15s ease, box-shadow .15s ease;
}

.salla-button:active{
  transform:scale(0.97);
}

.salla-button:hover{
  box-shadow:0 4px 12px rgba(0,0,0,0.08);
}


/* =========================
   🧠 تحسين كرت المنتج (بدون تغيير جذري)
========================= */

.s-product-card-entry{
  transition:transform .2s ease, box-shadow .2s ease;
}

.s-product-card-entry:hover{
  transform:translateY(-3px);
  box-shadow:0 6px 18px rgba(0,0,0,.08);
}


/* =========================
   📌 تثبيت الهيدر بدون مشاكل
========================= */

.store-header{
  transition:all .3s ease;
}

.header-scrolled{
  background:rgba(255,255,255,.95) !important;
  backdrop-filter:blur(10px);
}


/* =========================
   🧼 إزالة الفراغات بدون كسر
========================= */

.s-block:first-of-type{
  margin-top:0 !important;
}

.banner.banner--fixed{
  margin-bottom:10px !important;
}


/* =========================
   🧩 حماية عامة (منع glitches)
========================= */

img{
  backface-visibility:hidden;
}

/* تخفيف الظلال */
.s-product-card-entry {
  box-shadow: 0 2px 6px rgba(0,0,0,0.04) !important;
}

/* تحسين الصور */
img {
  content-visibility: auto;
}

/* يعطي فخامة */
.banner.banner--fixed {
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
/* =========================
   🔥 Badge داخل السلايدر فقط
========================= */

/* استهداف المنتجات داخل السلايدر فقط */
salla-products-slider .s-product-card-entry{
  position:relative;
}

/* شارة الأكثر مبيعاً */
salla-products-slider .s-product-card-entry::before{
  content:"الأكثر مبيعاً";
  position:absolute;
  top:8px;
  left:8px;
  background:#111;
  color:#fff;
  font-size:11px;
  padding:4px 8px;
  border-radius:6px;
  z-index:2;
}

/* المنتجات المخفضة داخل السلايدر */
salla-products-slider .s-product-card-entry:has(.s-product-card-price-before)::before{
  content:"عرض خاص";
  background:#8b2323;
}

salla-products-slider .swiper-slide:nth-child(n+5) .s-product-card-entry::before{
  display:none;
}

/* Scoped Design Tokens */
.s-block--products-slider {
    --card-radius: 12px;
    --card-padding: 10px;
    --primary-color: #0b2037;
    --accent-gold: #D4AF37;
}
.s-product-card-entry {
    will-change: transform, opacity;
    backface-visibility: hidden; /* لمنع وميض الشاشة في Safari */
}

/* --- 1. ضغط الهوامش لرفع المحتوى للأعلى --- */
.breadcrumbs {
    padding-top: 5px!important;
    padding-bottom: 5px!important;
    font-size: 11px!important; /* حجم مسار تنقل مصغر ونظيف */
    color: #9ca3af!important;
}

/* --- 2. عنوان المنتج (وزن متوسط وفخامة) --- */
.product-single__title, h1.text-2xl {
    margin-top: 2px!important;
    margin-bottom: 10px!important;
    font-size: 18px!important; /* حجم أنيق غير ضخم */
    font-weight: 600!important; /* وزن متوسط يبرز النص بنعومة */
    line-height: 1.2!important;
    color: #18181b!important;
}
/* FIX FONT (SAFE) */
body {
  font-family: 'Almarai', sans-serif;
}

h1,h2,h3,h4,h5,h6 {
  font-family: 'Alexandria', sans-serif;
}
salla-quantity-input::part(container),
.s-quantity-input-container {
 font-size: 13px!important; 
    margin-bottom: 1px!important; /* مسافة نحيفة ونظيفة */
}

#page-main-title { font-size: 16px!important; color: var(--color-primary)!important; }
#product-filter.form-input { height: 38px!important; padding-right: 12px!important;}


/* --- [رابعاً] ترويسة التصنيف (عدد المنتجات والفلتر) --- */
.main-content.mb-4.flex.justify-between.items-center {
  padding: 10px 15px!important;
  background: #ffffff;
  border-radius: var(--radius-standard);
  margin-bottom: 25px!important;
  border: 1px solid var(--color-border);
}

#page-main-title { font-size: 16px!important; color: var(--color-primary)!important; }
#product-filter.form-input { height: 38px!important; padding-right: 12px!important;}
/* تحسين شكل الهيدر بدون كسر */
.main-content.mb-4.flex.justify-between.items-center {
  align-items: center !important;
}

/* لو بقي رقم صغير مخفي */
.main-content.mb-4 *:contains("منتج") {
  display: none !important;
}
/* --- [ثالثاً] صفحة المنتج: العناوين، الحقول، والوصف [37، 38] --- */
/* [ضبط خاص] عناوين الحقول (الاسم، اللون، هل تريد كرت..) لتكون بارزة جداً */
.s-product-options-label, 
.s-product-options-option-label b,
.product-option-title,
.profile-field-item label {
  font-family: var(--font-heading)!important;
  font-size: 15px!important; /* الحجم المطلوب لعناوين الحقول */
  font-weight: 800!important;
  color: var(--color-primary)!important;
  margin-bottom: 12px!important;
  display: block;
}
.product-single__description li {
    margin-bottom: 10px!important;
    line-height: 1.8!important;
    color: #4b5563!important;
}
.product-single__price {
    color: #8b2323!important;
    font-size: 22px!important;
}
.s-form-control:focus {
    box-shadow: 0 10px 15px -3px rgba(11, 32, 55, 0.1)!important;
    transform: translateY(-1px);
}
/* =========================================================
   التصميم المعتمد لصفحة المنتج (السهولة، الراحة، والوضوح)
   ========================================================= */

/* ---------------------------------------------------------
   1. مسار التنقل (مألوف ومريح للعين)
--------------------------------------------------------- */
body nav.s-breadcrumb {
    padding: 10px 15px !important;
    background: transparent !important;
    margin-bottom: 15px !important;
}

body nav.s-breadcrumb ul {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

body nav.s-breadcrumb a,
body nav.s-breadcrumb span {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #6B7280 !important; /* رمادي مريح للقراءة */
    white-space: nowrap !important;
    text-decoration: none !important;
}

body nav.s-breadcrumb span[aria-current="page"] {
    color: #1a1a1a !important; /* إبراز المنتج الحالي بلون أغمق */
}

/* أسهم تنقل ناعمة ومألوفة */
body nav.s-breadcrumb li::after,
body nav.s-breadcrumb .sicon-keyboard_arrow_left::before {
    content: "\e92e" !important; /* أيقونة السهم الافتراضية المألوفة */
    font-size: 14px !important;
    color: #9CA3AF !important;
    margin: 0 6px !important;
}

/* ---------------------------------------------------------
   2. حقول الطلب والتخصيص (واضحة، صريحة، وسهلة الاستخدام)
--------------------------------------------------------- */
body .s-product-options-wrapper label, 
body .product-option-name, 
body .s-form-group label {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #333333 !important;
    margin-bottom: 8px !important;
    display: block !important;
}

/* مربعات إدخال واضحة بإطار ناعم وزوايا مريحة */
body .s-form-control, 
body .form-control {
    border: 1px solid #D1D5DB !important; /* إطار رمادي واضح ولكنه غير مزعج */
    border-radius: 8px !important; /* زوايا دائرية مريحة للعين والإصبع */
    padding: 12px 15px !important; /* مساحة كبيرة ومريحة للكتابة */
    font-size: 14px !important;
    background-color: #ffffff !important; /* خلفية بيضاء نقية */
    color: #1a1a1a !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important; /* ظل خفيف جداً يعطي عمقاً */
    transition: all 0.2s ease !important;
}

/* توجيه العميل عند الضغط على المربع للكتابة */
body .s-form-control:focus, 
body .form-control:focus {
    border-color: #1a1a1a !important; /* يتغير الإطار للأسود لتأكيد الاختيار */
    box-shadow: 0 0 0 1px #1a1a1a !important; 
    outline: none !important;
}

/* ---------------------------------------------------------
   3. وصف المنتج (مريح للقراءة كبطاقة مستقلة)
--------------------------------------------------------- */
body .s-product-description,
body .product__description {
    margin-top: 20px !important;
    padding: 20px 15px !important;
    background-color: #ffffff !important; /* صندوق أبيض مريح ومألوف */
    border-radius: 10px !important; /* زوايا دائرية متناسقة مع الحقول */
    box-shadow: 0 2px 8px rgba(0,0,0,0.03) !important; /* فصل ناعم عن خلفية المتجر */
    border: 1px solid #F3F4F6 !important;
}

/* نصوص متباعدة لعدم إرهاق العين */
body .s-product-description p,
body .s-product-description span,
body .s-product-description div {
    font-size: 14px !important;
    line-height: 1.8 !important; /* مساحة ممتازة بين الأسطر */
    color: #4B5563 !important; /* لون رمادي داكن يمنع زغللة العين */
    font-weight: 400 !important;
}