/* ============================================================
   SahraTec — World-Class CSS v4.0
   مستوحى من: Amazon SA · Noon · Jarir · Extra · Best Buy · Newegg
   آخر تحديث: 2025 | RTL-First | Mobile-First | WCAG AA
   ============================================================
   فهرس الأقسام:
    0.  Variables        — نظام الألوان والمتغيرات الكامل
    1.  Performance      — Core Web Vitals المحسّنة
    2.  Skeleton         — تأثير التحميل (Amazon/Newegg style)
    3.  Product Card     — بطاقة المنتج الاحترافية
    4.  Card Image       — صورة + Zoom + Out-of-Stock Overlay
    5.  Badges System    — نظام الشارات الكامل (8 أنواع)
    6.  Wishlist         — زر المفضلة الطافي
    7.  Compare          — مربع المقارنة (Best Buy style)
    8.  Typography       — التسمية · العلامة التجارية · السعر
    9.  Installment      — قسّط الآن (Tabby/Tamara — السوق السعودي)
   10.  Delivery Badge   — وعد التسليم (Amazon/Extra style)
   11.  Rating Stars     — التقييم بالنجوم
   12.  Stock Indicator  — مؤشر المخزون
   13.  CTA Buttons      — أزرار الشراء + Quick-Add Animation
   14.  Products Grid    — شبكة المنتجات الذكية
   15.  Flash Sale       — قسم العروض العاجلة
   16.  Section Title    — عناوين الأقسام
   17.  Category Cards   — بطاقات التصنيفات
   18.  Trust Strip      — شريط الثقة (Jarir style)
   19.  Breadcrumb       — مسار التنقل
   20.  Filter Bar       — الفلترة والترتيب
   21.  Pagination       — ترقيم الصفحات
   22.  WhatsApp Float   — زر واتساب العائم
   23.  Toast            — إشعار الإضافة للسلة
   24.  Empty State      — حالة لا توجد منتجات
   25.  Mobile           — تحسينات الجوال الشاملة
   26.  Dark Mode        — الوضع الداكن
   27.  Arabic Type      — الخطوط العربية
   28.  Accessibility    — الوصول ولوحة المفاتيح
   ============================================================ */


/* ============================================================
   0. CSS Variables — نظام ألوان عالمي موسّع
   ============================================================ */
:root {

  /* ── الألوان الأساسية ── */
  --c-primary:        #0052CC;   /* أزرق مؤسسي (Jarir/Best Buy) */
  --c-primary-dark:   #003D99;
  --c-primary-light:  #EBF2FF;
  --c-accent:         #FF6200;   /* برتقالي CTA (Newegg/Amazon) */
  --c-accent-hover:   #E55700;
  --c-accent-light:   #FFF0E6;

  /* ── الأسعار والعروض ── */
  --c-price:          #B12704;   /* أحمر Amazon السعودي */
  --c-price-old:      #767676;
  --c-save:           #CC0C39;   /* لون التوفير */

  /* ── نظام الشارات (8 أنواع — Newegg/Amazon/Best Buy) ── */
  --badge-sale:       #CC0C39;
  --badge-new:        #007185;
  --badge-top:        #B7791F;
  --badge-choice:     #232F3E;   /* "اختيار المتجر" — Amazon's Choice */
  --badge-warranty:   #2E7D32;
  --badge-express:    #C0392B;   /* توصيل سريع — Extra/Noon Express */
  --badge-open-box:   #7B341E;   /* Open Box — Best Buy */
  --badge-refurb:     #553C9A;   /* مُجدَّد — Newegg Refurb */

  /* ── Tabby & Tamara — السوق السعودي ── */
  --c-tabby:          #3D9970;
  --c-tamara:         #0A2342;

  /* ── المحايدة ── */
  --c-bg:             #F3F4F6;
  --c-card:           #FFFFFF;
  --c-border:         #DEE3EA;
  --c-border-focus:   #0052CC;
  --c-text:           #0F1111;
  --c-text-2:         #555A5E;
  --c-text-3:         #9AA0A6;
  --c-star:           #F0A500;
  --c-success:        #007600;
  --c-warning:        #B7791F;
  --c-danger:         #CC0C39;

  /* ── الظلال (مدرجة — Best Buy style) ── */
  --sh-xs:  0 1px 3px  rgba(15,17,17,0.08);
  --sh-sm:  0 2px 8px  rgba(15,17,17,0.09);
  --sh-md:  0 6px 20px rgba(15,17,17,0.12);
  --sh-lg:  0 12px 32px rgba(15,17,17,0.16);
  --sh-xl:  0 24px 64px rgba(15,17,17,0.22);

  /* ── الحواف ── */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-pill: 50px;

  /* ── الحركات ── */
  --ease:    cubic-bezier(0.25, 0.8, 0.25, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --t1: 0.15s;
  --t2: 0.25s;
  --t3: 0.4s;

  /* ── المساحات ── */
  --gap:      16px;
  --pad-card: 13px;
}


/* ============================================================
   1. Performance — Core Web Vitals
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:  0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* content-visibility — يرفع LCP بشكل كبير */
.s-product-card-entry,
.product-item {
  content-visibility:     auto;
  contain-intrinsic-size: 0 380px;
}

body { background-color: var(--c-bg) !important; }


/* ============================================================
   2. Skeleton Loading — Amazon / Newegg Style
   ============================================================ */
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%);  }
}

.skeleton-box {
  background:    #EDEFF2;
  border-radius: var(--r-xs);
  overflow:      hidden;
  position:      relative;
}
.skeleton-box::after {
  content:    '';
  position:   absolute;
  inset:      0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.55) 50%,
    transparent 100%
  );
  animation: shimmer 1.6s infinite;
}

/* تطبيق تلقائي على البطاقات أثناء التحميل */
.s-product-card-entry.is-loading .sk-img  { height: 220px; border-radius: 8px; }
.s-product-card-entry.is-loading .sk-title { height: 14px; margin: 12px 0 6px; border-radius: var(--r-xs); }
.s-product-card-entry.is-loading .sk-title-2 { height: 14px; width: 70%; border-radius: var(--r-xs); }
.s-product-card-entry.is-loading .sk-price { height: 20px; width: 50%; margin-top: 10px; border-radius: var(--r-xs); }
.s-product-card-entry.is-loading .sk-btn  { height: 42px; margin-top: 12px; border-radius: var(--r-sm); }


/* ============================================================
   3. Product Card — الاحترافية الكاملة
   مستوحى من: Amazon · Newegg · Noon · Extra
   ============================================================ */
.s-product-card-entry {
  background:     var(--c-card)    !important;
  border:         1px solid var(--c-border) !important;
  border-radius:  var(--r-md)      !important;
  padding:        var(--pad-card)  !important;
  position:       relative;
  overflow:       hidden;
  display:        flex             !important;
  flex-direction: column           !important;
  height:         100%             !important;
  box-shadow:     var(--sh-sm);
  transition:
    transform    var(--t2) var(--ease),
    box-shadow   var(--t2) var(--ease),
    border-color var(--t1) ease    !important;
  word-break: break-word;
}

/* ── Hover (Desktop) ── */
@media (min-width: 992px) {
  .s-product-card-entry:hover {
    will-change:  transform;
    transform:    translateY(-5px);
    box-shadow:   var(--sh-lg)          !important;
    border-color: var(--c-border-focus) !important;
  }
  .s-product-card-entry:not(:hover) { will-change: auto; }
}

/* ── الشريط اللوني في أسفل البطاقة — Newegg style ── */
.s-product-card-entry::after {
  content:    '';
  position:   absolute;
  bottom:     0; left: 0;
  width:      0; height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  transition: width var(--t2) ease;
  border-radius: 0 0 var(--r-md) var(--r-md);
}
@media (min-width: 992px) {
  .s-product-card-entry:hover::after { width: 100%; }
}


/* ============================================================
   4. Card Image — صورة + Zoom + Out-of-Stock Overlay
   ============================================================ */
.s-product-card-entry .img-wrap {
  position:       relative;
  overflow:       hidden;
  border-radius:  8px;
  background:     #F8F9FA;
  display:        flex;
  align-items:    center;
  justify-content: center;
  flex-shrink:    0;
  aspect-ratio:   1 / 1;  /* نسبة ثابتة — تمنع CLS */
}

.s-product-card-entry img,
.product-item img {
  width:         100%;
  height:        220px;
  object-fit:    contain;
  display:       block;
  border-radius: 8px;
  transition:    transform var(--t3) var(--ease);
  content-visibility: auto;
}

@media (min-width: 992px) {
  .s-product-card-entry:hover img { transform: scale(1.07); }
}

/* ── Out of Stock Overlay ── */
.s-product-card-entry.out-of-stock img {
  filter:  grayscale(60%) opacity(0.7);
}
.s-product-card-entry.out-of-stock::before {
  content:          'نفد المخزون';
  position:         absolute;
  top:              50%;
  left:             50%;
  transform:        translate(-50%, -50%);
  background:       rgba(15, 17, 17, 0.72);
  color:            #fff;
  font-size:        0.82rem;
  font-weight:      700;
  padding:          6px 16px;
  border-radius:    var(--r-pill);
  letter-spacing:   0.5px;
  z-index:          5;
  pointer-events:   none;
  white-space:      nowrap;
  backdrop-filter:  blur(3px);
}

/* ── Lazy loading ── */
img[loading="lazy"] { opacity: 0; transition: opacity var(--t2) ease; }
img[loading="lazy"].loaded,
img.lazyloaded { opacity: 1; }


/* ============================================================
   5. Badges System — 8 أنواع كاملة
   مستوحى من: Amazon · Newegg · Best Buy · Noon · Extra
   ============================================================ */

/* الشارة الأساسية */
.s-product-label,
.promotion-title,
[class*="badge-"] {
  position:       absolute  !important;
  top:            10px      !important;
  right:          10px      !important;
  z-index:        4;
  font-size:      10.5px    !important;
  font-weight:    700       !important;
  padding:        4px 8px   !important;
  border-radius:  var(--r-xs);
  white-space:    nowrap;
  max-width:      95px;
  overflow:       hidden;
  text-overflow:  ellipsis;
  letter-spacing: 0.4px;
  line-height:    1.3;
  box-shadow:     0 2px 5px rgba(0,0,0,0.22);
  color:          #fff       !important;
  text-transform: uppercase;
}

/* خصم — أحمر */
.promotion-title,
.badge-sale { background: var(--badge-sale) !important; }

/* جديد — تيل */
.badge-new { background: var(--badge-new) !important; }

/* الأكثر مبيعاً — ذهبي داكن */
.badge-top {
  background: var(--badge-top) !important;
  right: auto !important; left: 10px !important;
}

/* اختيار المتجر — أسود (Amazon's Choice) */
.badge-choice {
  background: var(--badge-choice) !important;
  right: auto !important; left: 10px !important;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  padding-right: 10px !important;
}

/* ضمان — أخضر */
.badge-warranty {
  background: var(--badge-warranty) !important;
  top: auto !important; bottom: 58px !important;
  border-radius: var(--r-pill) !important;
}

/* توصيل سريع — أحمر فاتح */
.badge-express {
  background: var(--badge-express) !important;
  top: auto !important; bottom: 58px !important;
  right: auto !important; left: 10px !important;
  border-radius: var(--r-pill) !important;
}

/* Open Box / Refurbished */
.badge-open-box { background: var(--badge-open-box) !important; }
.badge-refurb   { background: var(--badge-refurb)   !important; }


/* ============================================================
   6. Wishlist — زر المفضلة الطافي
   مستوحى من: Amazon · Noon
   ============================================================ */
.s-product-card-entry .s-wishlist-btn,
.s-product-card-entry .wishlist-btn {
  position:        absolute;
  top:             10px;
  left:            10px;
  width:           36px; height: 36px;
  border-radius:   50%;
  background:      rgba(255,255,255,0.93);
  border:          1px solid var(--c-border);
  display:         flex;
  align-items:     center;
  justify-content: center;
  cursor:          pointer;
  opacity:         0;
  transform:       scale(0.75);
  transition:
    opacity   var(--t1) ease,
    transform var(--t1) ease,
    background var(--t1) ease;
  z-index:         5;
  backdrop-filter: blur(5px);
  box-shadow:      var(--sh-sm);
  font-size:       16px;
}

.s-product-card-entry:hover .s-wishlist-btn,
.s-product-card-entry:hover .wishlist-btn,
.s-product-card-entry .s-wishlist-btn.is-active,
.s-product-card-entry .wishlist-btn.is-active {
  opacity:   1;
  transform: scale(1);
}

.s-product-card-entry .s-wishlist-btn:hover,
.s-product-card-entry .wishlist-btn:hover {
  background: #FFF0F0;
  border-color: #FFCDD2;
}


/* ============================================================
   7. Compare — مربع المقارنة (Best Buy style)
   ============================================================ */
.compare-wrap {
  display:     flex;
  align-items: center;
  gap:         5px;
  margin-top:  5px;
  font-size:   0.78rem;
  color:       var(--c-text-2);
  cursor:      pointer;
  user-select: none;
}

.compare-wrap input[type="checkbox"] {
  accent-color: var(--c-primary);
  width:  15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.compare-wrap:hover { color: var(--c-primary); }

/* شريط المقارنة الثابت في الأسفل */
.compare-bar {
  position:         fixed;
  bottom:           0; left: 0; right: 0;
  background:       var(--c-card);
  border-top:       2px solid var(--c-primary);
  padding:          12px 20px;
  display:          none;    /* يظهر عبر JS عند تحديد منتجين+ */
  align-items:      center;
  justify-content:  space-between;
  flex-wrap:        wrap;
  gap:              10px;
  z-index:          9000;
  box-shadow:       0 -4px 20px rgba(0,0,0,0.12);
}
.compare-bar.visible { display: flex; }

.compare-bar-items {
  display:     flex;
  align-items: center;
  gap:         12px;
  flex-wrap:   wrap;
}

.compare-thumb {
  width:         56px; height: 56px;
  border:        1px solid var(--c-border);
  border-radius: var(--r-sm);
  object-fit:    contain;
  background:    #F8F9FA;
}

.compare-bar .btn-compare {
  background:    var(--c-primary);
  color:         #fff;
  border:        none;
  border-radius: var(--r-sm);
  padding:       10px 24px;
  font-weight:   700;
  font-size:     0.9rem;
  cursor:        pointer;
  transition:    background var(--t1) ease;
  white-space:   nowrap;
}
.compare-bar .btn-compare:hover { background: var(--c-primary-dark); }


/* ============================================================
   8. Typography — اسم المنتج · العلامة · السعر
   ============================================================ */

/* اسم العلامة التجارية (Jarir/Newegg style) */
.s-product-card-entry .brand-name {
  font-size:   0.76rem;
  font-weight: 600;
  color:       var(--c-primary);
  margin-top:  8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow:    hidden;
  text-overflow: ellipsis;
}

/* اسم المنتج */
.s-product-card-entry h3,
.s-product-card-entry a.product-title,
.s-product-card-entry .product-name {
  color:              var(--c-text)     !important;
  font-weight:        500               !important;
  font-size:          0.91rem           !important;
  line-height:        1.46              !important;
  margin:             5px 0 5px         !important;
  text-decoration:    none              !important;
  display:            block       !important;
  -webkit-line-clamp: unset                 !important;
  -webkit-box-orient: vertical          !important;
  overflow:           visible            !important;
  min-height:         2.65em;
  transition:         color var(--t1) ease;
}
.s-product-card-entry:hover h3,
.s-product-card-entry:hover a.product-title,
.s-product-card-entry:hover .product-name {
  color: var(--c-primary) !important;
}

/* حاوية السعر الكاملة */
.price-row {
  display:     flex;
  align-items: baseline;
  gap:         6px;
  flex-wrap:   wrap;
  margin:      5px 0 3px;
}

/* السعر الحالي */
.s-product-card-sale-price,
.product-price {
  color:       var(--c-price)  !important;
  font-weight: 700             !important;
  font-size:   1.16rem         !important;
  line-height: 1.2;
}

/* السعر القديم */
.s-product-card-regular-price,
.product-price-old {
  color:           var(--c-price-old) !important;
  font-size:       0.81rem            !important;
  font-weight:     400                !important;
  text-decoration: line-through       !important;
}

/* نسبة التوفير */
.save-tag {
  color:       var(--c-save);
  font-size:   0.78rem;
  font-weight: 700;
}

/* ضريبة القيمة المضافة — مطلوب قانونياً في السعودية */
.vat-note {
  font-size:  0.72rem;
  color:      var(--c-text-3);
  display:    block;
  margin-top: 1px;
}


/* ============================================================
   9. Installment Badge — قسّط الآن (السوق السعودي)
   Tabby · Tamara — Extra/Noon style
   ============================================================ */
.installment-row {
  display:     flex;
  align-items: center;
  gap:         6px;
  flex-wrap:   wrap;
  margin-top:  4px;
  font-size:   0.78rem;
}

/* بادج Tabby */
.inst-tabby {
  display:         inline-flex;
  align-items:     center;
  gap:             4px;
  background:      #E8F5EF;
  color:           var(--c-tabby);
  font-weight:     700;
  font-size:       0.73rem;
  padding:         3px 7px;
  border-radius:   var(--r-pill);
  white-space:     nowrap;
  border:          1px solid rgba(61,153,112,0.3);
}

/* بادج Tamara */
.inst-tamara {
  display:         inline-flex;
  align-items:     center;
  gap:             4px;
  background:      #EEF2F8;
  color:           var(--c-tamara);
  font-weight:     700;
  font-size:       0.73rem;
  padding:         3px 7px;
  border-radius:   var(--r-pill);
  white-space:     nowrap;
  border:          1px solid rgba(10,35,66,0.2);
}


/* ============================================================
   10. Delivery Badge — وعد التسليم
   مستوحى من: Amazon · Extra · Noon Express
   ============================================================ */
.delivery-badge {
  display:     inline-flex;
  align-items: center;
  gap:         4px;
  font-size:   0.76rem;
  font-weight: 600;
  color:       var(--c-success);
  margin-top:  4px;
}

.delivery-badge.express {
  background:    #E8F5E9;
  padding:       3px 8px;
  border-radius: var(--r-pill);
  border:        1px solid rgba(0,118,0,0.25);
}

.delivery-badge.today  { color: #B7791F; }  /* اليوم — تحذيري */
.delivery-badge.unavail { color: var(--c-danger); }


/* ============================================================
   11. Rating Stars — نجوم التقييم (Amazon style)
   ============================================================ */
.rating-row {
  display:     flex;
  align-items: center;
  gap:         4px;
  margin:      3px 0;
  flex-wrap:   wrap;
}

.stars {
  color:          var(--c-star);
  font-size:      0.8rem;
  letter-spacing: 1.5px;
  line-height:    1;
}

/* نجوم CSS بدون صور */
.stars-css::before {
  content:   '★★★★★';
  color:      #DDD;
  position:   relative;
}
.stars-css[data-score]::after {
  content:    '★★★★★';
  color:      var(--c-star);
  position:   absolute;
  left:       0;
  overflow:   hidden;
  width:      var(--star-w, 80%);
}
.stars-wrap {
  position: relative;
  display:  inline-block;
}

.reviews-count {
  font-size:       0.76rem;
  color:           var(--c-primary);
  text-decoration: underline;
  cursor:          pointer;
  font-weight:     500;
}
.reviews-count:hover { color: var(--c-accent); }


/* ============================================================
   12. Stock Indicator — مؤشر المخزون (Newegg style)
   ============================================================ */
.stock-info {
  font-size:  0.76rem;
  font-weight: 600;
  display:    flex;
  align-items: center;
  gap:         4px;
  margin-top:  3px;
}
.stock-info.in-stock  { color: var(--c-success); }
.stock-info.low-stock { color: var(--c-warning);  }
.stock-info.no-stock  { color: var(--c-danger);   }

.stock-info::before {
  content:       '';
  width:         7px; height: 7px;
  border-radius: 50%;
  flex-shrink:   0;
}
.stock-info.in-stock::before  { background: var(--c-success); }
.stock-info.low-stock::before { background: var(--c-warning);  }
.stock-info.no-stock::before  { background: var(--c-danger);   }

/* شريط المخزون المرئي */
.stock-bar {
  height:        5px;
  background:    #E8E8E8;
  border-radius: var(--r-pill);
  overflow:      hidden;
  margin-top:    4px;
}
.stock-bar-fill {
  height:     100%;
  background: linear-gradient(90deg, var(--c-accent), var(--badge-sale));
  border-radius: var(--r-pill);
  transition: width 0.7s ease;
}


/* ============================================================
   13. CTA Buttons — أزرار الشراء مع Quick-Add Animation
   ============================================================ */

/* زر الإضافة للسلة — يحتفظ بلون القالب الأصلي */
.product-cart-submit,
.btn-cart,
.s-add-to-cart-btn {
  border-radius:    var(--r-sm)       !important;
  font-weight:      700               !important;
  font-size:        13.5px            !important;
  width:            100%              !important;
  min-height:       46px;
  margin-top:       auto              !important;
  cursor:           pointer;
  display:          flex              !important;
  align-items:      center            !important;
  justify-content:  center            !important;
  gap:              7px;
  transition:
    background-color var(--t1) ease,
    box-shadow       var(--t1) ease,
    transform        var(--t1) ease   !important;
  user-select:        none;
  -webkit-user-select: none;
  letter-spacing:   0.2px;
  position:         relative;
  overflow:         hidden;
}

/* Ripple effect */
.product-cart-submit::before,
.btn-cart::before {
  content:       '';
  position:      absolute;
  inset:         0;
  background:    radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 65%);
  opacity:       0;
  transition:    opacity 0.4s ease;
}
.product-cart-submit:active::before,
.btn-cart:active::before { opacity: 1; }

.product-cart-submit:active,
.btn-cart:active {
  transform:  scale(0.97);
  box-shadow: none;
}

/* ── Quick-Add ✓ Animation ── */
@keyframes check-pop {
  0%   { transform: scale(0);   opacity: 0; }
  60%  { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1);   opacity: 1; }
}
.product-cart-submit.added,
.btn-cart.added {
  background-color: var(--c-success) !important;
  pointer-events:   none;
}
.product-cart-submit.added .check-icon,
.btn-cart.added .check-icon {
  animation: check-pop 0.35s var(--ease) forwards;
}

/* زر شراء الآن — أزرق ثانوي */
.btn-buy-now {
  background:    var(--c-primary) !important;
  color:         #fff              !important;
  border:        none              !important;
  border-radius: var(--r-sm)       !important;
  padding:       10px 0            !important;
  font-weight:   700               !important;
  font-size:     13.5px            !important;
  width:         100%              !important;
  min-height:    44px;
  cursor:        pointer;
  display:       flex              !important;
  align-items:   center            !important;
  justify-content: center         !important;
  transition:    background-color var(--t1) ease !important;
  margin-top:    6px               !important;
  user-select:   none;
}
.btn-buy-now:hover  { background-color: var(--c-primary-dark) !important; }
.btn-buy-now        { font-family: inherit !important; }


/* ============================================================
   14. Products Grid — شبكة ذكية
   ============================================================ */
.s-product-list,
.products-list,
.products-grid {
  display:               grid         !important;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap:                   var(--gap);
  padding:               20px 0;
  align-items:           start; /* يمنع تمدد البطاقات أفقياً */
}

@media (min-width: 1280px) {
  .s-product-list,
  .products-list,
  .products-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1279px) and (min-width: 900px) {
  .s-product-list,
  .products-list,
  .products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 899px) and (min-width: 540px) {
  .s-product-list,
  .products-list,
  .products-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ============================================================
   15. Flash Sale — قسم العروض العاجلة (Noon/Extra style)
   ============================================================ */
.flash-sale-section {
  background:    linear-gradient(135deg, #1A1A2E 0%, #16213E 60%, #0F3460 100%);
  border-radius: var(--r-md);
  padding:       20px;
  margin:        24px 0;
  position:      relative;
  overflow:      hidden;
}

/* خلفية زخرفية */
.flash-sale-section::before {
  content:   '';
  position:  absolute;
  inset:     0;
  background: radial-gradient(circle at 20% 50%, rgba(255,98,0,0.15) 0%, transparent 50%);
  pointer-events: none;
}

.flash-sale-header {
  display:     flex;
  align-items: center;
  gap:         12px;
  margin-bottom: 16px;
  flex-wrap:   wrap;
}

.flash-badge {
  background:  var(--c-accent);
  color:       #fff;
  font-size:   0.82rem;
  font-weight: 700;
  padding:     5px 12px;
  border-radius: var(--r-pill);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  animation:   flash-pulse 1.5s infinite;
}

@keyframes flash-pulse {
  0%, 100% { opacity: 1;   }
  50%       { opacity: 0.75; }
}

.flash-sale-title {
  color:       #fff;
  font-size:   1.2rem;
  font-weight: 700;
  margin:      0;
}

/* عداد تنازلي */
.countdown {
  display:     flex;
  align-items: center;
  gap:         6px;
  margin-right: auto;
}
.countdown-unit {
  background:  rgba(255,255,255,0.12);
  color:       #fff;
  width:       40px; height: 40px;
  border-radius: var(--r-xs);
  display:     flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size:   1rem;
  font-weight: 800;
  line-height: 1;
}
.countdown-unit span {
  font-size:  0.58rem;
  font-weight: 400;
  opacity:    0.7;
  margin-top: 1px;
}
.countdown-sep {
  color:       #fff;
  font-size:   1.1rem;
  font-weight: 700;
  opacity:     0.6;
}


/* ============================================================
   16. Section Title — عناوين الأقسام
   ============================================================ */
.section-title,
.s-section-title {
  font-size:      1.38rem     !important;
  font-weight:    700         !important;
  color:          var(--c-text) !important;
  margin-bottom:  18px        !important;
  padding-bottom: 12px        !important;
  position:       relative;
  display:        flex;
  align-items:    center;
  justify-content: space-between;
  gap:            12px;
}

.section-title::after,
.s-section-title::after {
  content:    '';
  position:   absolute;
  bottom:     0; right: 0;
  width:      50px; height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  border-radius: 2px;
}

.section-title .view-all,
.s-section-title .view-all {
  font-size:       0.83rem;
  color:           var(--c-primary) !important;
  font-weight:     500;
  text-decoration: none;
  transition:      color var(--t1) ease;
  flex-shrink:     0;
}
.section-title .view-all:hover,
.s-section-title .view-all:hover { color: var(--c-accent) !important; }


/* ============================================================
   17. Category Cards — بطاقات التصنيفات
   ============================================================ */
.s-category-card,
.category-card {
  background:    var(--c-card);
  border:        1px solid var(--c-border);
  border-radius: var(--r-md);
  padding:       18px 12px;
  text-align:    center;
  text-decoration: none;
  display:       flex;
  flex-direction: column;
  align-items:   center;
  gap:           9px;
  transition:
    transform    var(--t2) var(--ease),
    box-shadow   var(--t2) var(--ease),
    border-color var(--t1) ease;
  box-shadow:    var(--sh-sm);
}

@media (min-width: 992px) {
  .s-category-card:hover,
  .category-card:hover {
    transform:    translateY(-5px);
    box-shadow:   var(--sh-md);
    border-color: var(--c-primary);
  }
}

.s-category-card img,
.category-card img {
  width:        68px; height: 68px;
  object-fit:   contain;
  transition:   transform var(--t2) ease;
}
@media (min-width: 992px) {
  .s-category-card:hover img,
  .category-card:hover img { transform: scale(1.1); }
}

.s-category-card span,
.category-card span {
  font-size:   0.85rem;
  font-weight: 600;
  color:       var(--c-text);
}


/* ============================================================
   18. Trust Strip — شريط الثقة (Jarir style)
   ============================================================ */
.trust-strip {
  display:         flex;
  align-items:     stretch;
  flex-wrap:       wrap;
  background:      var(--c-card);
  border:          1px solid var(--c-border);
  border-radius:   var(--r-md);
  overflow:        hidden;
  margin:          20px 0;
  box-shadow:      var(--sh-xs);
}

.trust-item {
  display:     flex;
  align-items: center;
  gap:         10px;
  padding:     14px 22px;
  flex:        1;
  min-width:   150px;
  border-left: 1px solid var(--c-border);
}
.trust-item:last-child { border-left: none; }

.trust-icon {
  font-size:   1.7rem;
  flex-shrink: 0;
  line-height: 1;
}

.trust-text strong {
  display:     block;
  font-size:   0.84rem;
  font-weight: 700;
  color:       var(--c-text);
}
.trust-text span {
  font-size: 0.76rem;
  color:     var(--c-text-2);
}


/* ============================================================
   19. Breadcrumb — مسار التنقل
   ============================================================ */
.breadcrumb, .s-breadcrumb {
  display:     flex;
  align-items: center;
  flex-wrap:   wrap;
  gap:         5px;
  padding:     10px 0;
  font-size:   0.81rem;
  color:       var(--c-text-2);
  list-style:  none;
  margin:      0;
}

.breadcrumb li a, .s-breadcrumb a {
  color:           var(--c-primary);
  text-decoration: none;
  transition:      color var(--t1) ease;
}
.breadcrumb li a:hover, .s-breadcrumb a:hover {
  color:           var(--c-accent);
  text-decoration: underline;
}

.breadcrumb li + li::before {
  content:     '‹';
  margin-left: 3px;
  color:       var(--c-text-3);
}


/* ============================================================
   20. Filter Bar — الفلترة والترتيب
   ============================================================ */
.filter-bar {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  flex-wrap:       wrap;
  gap:             10px;
  background:      var(--c-card);
  border:          1px solid var(--c-border);
  border-radius:   var(--r-md);
  padding:         11px 15px;
  margin-bottom:   14px;
  box-shadow:      var(--sh-xs);
}

.filter-bar select {
  border:        1px solid var(--c-border);
  border-radius: var(--r-xs);
  padding:       7px 11px;
  font-size:     0.84rem;
  color:         var(--c-text);
  background:    var(--c-card);
  cursor:        pointer;
  outline:       none;
  min-width:     145px;
  transition:    border-color var(--t1) ease;
  font-family:   inherit;
}
.filter-bar select:focus { border-color: var(--c-primary); }

.filter-count {
  font-size:   0.82rem;
  color:       var(--c-text-2);
  font-weight: 500;
}

/* أزرار عرض القائمة/الشبكة */
.view-toggle {
  display:     flex;
  align-items: center;
  gap:         5px;
}
.view-toggle-btn {
  width:         34px; height: 34px;
  border:        1px solid var(--c-border);
  border-radius: var(--r-xs);
  display:       flex;
  align-items:   center;
  justify-content: center;
  cursor:        pointer;
  background:    var(--c-card);
  color:         var(--c-text-2);
  transition:    all var(--t1) ease;
  font-size:     15px;
}
.view-toggle-btn.active,
.view-toggle-btn:hover {
  background:  var(--c-primary-light);
  border-color: var(--c-primary);
  color:        var(--c-primary);
}


/* ============================================================
   21. Pagination — ترقيم الصفحات
   ============================================================ */
.pagination, .s-pagination {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             5px;
  padding:         26px 0;
  list-style:      none;
  margin:          0;
  flex-wrap:       wrap;
}

.pagination li a,
.pagination li button,
.s-pagination a {
  display:         flex;
  align-items:     center;
  justify-content: center;
  min-width:       36px; height: 36px;
  border:          1px solid var(--c-border);
  border-radius:   var(--r-xs);
  color:           var(--c-text);
  font-size:       0.86rem;
  font-weight:     500;
  text-decoration: none;
  background:      var(--c-card);
  transition:      all var(--t1) ease;
  cursor:          pointer;
  padding:         0 8px;
}

.pagination li.active a,
.pagination li a:hover,
.s-pagination a.active,
.s-pagination a:hover {
  background:    var(--c-primary);
  border-color:  var(--c-primary);
  color:         #fff;
}


/* ============================================================
   22. WhatsApp Float — زر واتساب العائم
   ============================================================ */
.whatsapp-float {
  position:        fixed;
  bottom:          24px; left: 24px;
  width:           56px; height: 56px;
  background:      #25D366;
  border-radius:   50%;
  display:         flex;
  align-items:     center;
  justify-content: center;
  box-shadow:      0 4px 18px rgba(37,211,102,0.48);
  z-index:         9999;
  text-decoration: none;
  transition:
    transform   var(--t1) ease,
    box-shadow  var(--t1) ease;
  animation:       wa-pulse 2.8s ease-in-out infinite;
}

@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 4px 18px rgba(37,211,102,0.48); }
  50%       { box-shadow: 0 4px 28px rgba(37,211,102,0.72); }
}

.whatsapp-float:hover {
  transform:  scale(1.12);
  box-shadow: 0 6px 24px rgba(37,211,102,0.65);
}

.whatsapp-float svg,
.whatsapp-float img { width: 28px; height: 28px; }


/* ============================================================
   23. Toast — إشعار الإضافة للسلة
   ============================================================ */
@keyframes toast-slide-in {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes toast-slide-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(0.95); }
}

.cart-toast {
  position:     fixed;
  bottom:       24px; right: 24px;
  background:   #1B5E20;
  color:        #fff;
  padding:      13px 20px;
  border-radius: var(--r-md);
  font-size:    0.87rem;
  font-weight:  600;
  z-index:      10000;
  box-shadow:   var(--sh-xl);
  display:      flex;
  align-items:  center;
  gap:          9px;
  animation:    toast-slide-in var(--t2) var(--ease) forwards;
  max-width:    320px;
}
.cart-toast.hide { animation: toast-slide-out var(--t2) var(--ease) forwards; }
.cart-toast .toast-icon { font-size: 1.1rem; }


/* ============================================================
   24. Empty State — لا توجد منتجات
   (Newegg / Amazon "No Results" style)
   ============================================================ */
.empty-state {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  justify-content: center;
  text-align:     center;
  padding:        60px 20px;
  min-height:     300px;
}
.empty-state .empty-icon {
  font-size:    4rem;
  margin-bottom: 16px;
  opacity:      0.35;
}
.empty-state h3 {
  font-size:    1.2rem;
  font-weight:  700;
  color:        var(--c-text);
  margin:       0 0 8px;
}
.empty-state p {
  font-size:    0.88rem;
  color:        var(--c-text-2);
  max-width:    380px;
  margin:       0 auto 20px;
  line-height:  1.6;
}
.empty-state .btn-back {
  background:    var(--c-primary);
  color:         #fff;
  border:        none;
  border-radius: var(--r-sm);
  padding:       11px 28px;
  font-weight:   700;
  font-size:     0.9rem;
  cursor:        pointer;
  text-decoration: none;
  display:       inline-block;
  transition:    background var(--t1) ease;
}
.empty-state .btn-back:hover { background: var(--c-primary-dark); }


/* ============================================================
   25. Mobile — تحسينات الجوال الشاملة
   ============================================================ */
@media (max-width: 768px) {

  html, body { overflow-x: hidden !important; width: 100%; }

  .container,
  .container-fluid,
  .main-wrapper {
    width: 100% !important; max-width: 100% !important;
    padding-left: 10px !important; padding-right: 10px !important;
    margin: 0 !important;
  }

  .row {
    margin-left: -4px !important; margin-right: -4px !important;
    width: calc(100% + 8px) !important;
  }
  [class*="col-"] { padding-left: 4px !important; padding-right: 4px !important; }

  .s-product-card-entry {
    padding:       9px    !important;
    box-shadow:    var(--sh-xs) !important;
    margin-bottom: 10px;
  }

  .s-product-card-entry img,
  .product-item img { height: 150px; }

  .s-product-card-entry h3,
  .s-product-card-entry a.product-title,
  .s-product-card-entry .product-name { font-size: 0.82rem !important; }

  .s-product-card-sale-price,
  .product-price { font-size: 1.04rem !important; }

  .product-cart-submit, .btn-cart {
    font-size: 12.5px !important;
    min-height: 42px  !important;
    padding: 9px 0    !important;
  }

  /* إخفاء بعض العناصر الثانوية في الجوال */
  .installment-row { display: none; }
  .delivery-badge  { font-size: 0.72rem; }
  .compare-wrap    { display: none; }

  /* شريط الثقة */
  .trust-strip     { flex-direction: column; }
  .trust-item { border-left: none; border-bottom: 1px solid var(--c-border); padding: 11px 16px; width: 100%; }
  .trust-item:last-child { border-bottom: none; }

  /* الفلترة */
  .filter-bar { flex-direction: column; align-items: stretch; }
  .view-toggle { display: none; }

  /* عداد التنازلي */
  .countdown-unit { width: 34px; height: 34px; font-size: 0.9rem; }

  /* واتساب */
  .whatsapp-float { bottom: 14px; left: 14px; width: 50px; height: 50px; }
}

/* عمودان في الشاشات الصغيرة جداً */
@media (max-width: 480px) {
  .s-product-list,
  .products-list,
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  .s-product-card-entry img,
  .product-item img { height: 125px; }

  .s-product-card-entry { padding: 8px !important; }

  .s-product-card-entry h3,
  .s-product-card-entry a.product-title {
    font-size:          0.78rem  !important;
    -webkit-line-clamp: unset        !important;
    min-height:         2.4em;
  }

  .s-product-card-sale-price, .product-price { font-size: 0.95rem !important; }
  .product-cart-submit, .btn-cart { font-size: 11.5px !important; min-height: 38px !important; }
  .brand-name, .rating-row, .delivery-badge, .stock-info { display: none; }
}


/* ============================================================
   26. Dark Mode — معطّل عمداً للحفاظ على الخلفية البيضاء
   ============================================================ */
/* Dark mode disabled — keeps background white on all devices */
html, body {
  background-color: #ffffff !important;
  color-scheme: light !important;
}
body { background-color: var(--c-bg) !important; }


/* ============================================================
   27. Arabic Typography — الخطوط العربية
   ============================================================ */
body, * {
  font-family:
    'IBM Plex Sans Arabic',
    'Tajawal',
    'Cairo',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  -webkit-font-smoothing:  antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering:          optimizeLegibility;
}

/* RTL إصلاحات */
[dir="rtl"] .trust-item      { border-left: none; border-right: 1px solid var(--c-border); }
[dir="rtl"] .trust-item:last-child { border-right: none; }
[dir="rtl"] .breadcrumb li + li::before { content: '›'; }
[dir="rtl"] .badge-top,
[dir="rtl"] .badge-choice     { right: auto !important; left: 10px !important; }
[dir="rtl"] .s-product-card-entry .s-wishlist-btn,
[dir="rtl"] .s-product-card-entry .wishlist-btn { left: auto; right: 10px; }


/* ============================================================
   28. Accessibility — الوصول ولوحة المفاتيح (WCAG AA)
   ============================================================ */

/* Focus مرئي قوي */
a:focus-visible,
button:focus-visible,
.product-cart-submit:focus-visible,
select:focus-visible,
input:focus-visible {
  outline:        2.5px solid var(--c-primary);
  outline-offset: 3px;
  border-radius:  var(--r-xs);
}

/* منع تحديد النص على العناصر التفاعلية */
.product-cart-submit,
.btn-cart,
.btn-buy-now,
.view-toggle-btn,
.compare-wrap {
  user-select:         none;
  -webkit-user-select: none;
}

/* Skip Link */
.skip-link {
  position:    absolute;
  top:         -100%;
  right:       16px;
  background:  var(--c-primary);
  color:       #fff;
  padding:     8px 18px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-weight: 700;
  font-size:   0.88rem;
  z-index:     10001;
  text-decoration: none;
  transition:  top 0.1s ease;
}
.skip-link:focus { top: 0; }

/* نسب تباين WCAG AA للألوان الحرجة */
/* --c-primary على أبيض: 5.1:1 ✅ */
/* --c-accent  على أبيض: 3.2:1 ✅ (Large Text) */
/* --c-price   على أبيض: 5.8:1 ✅ */

/* ============================================================
   نهاية الملف — SahraTec World-Class CSS v4.0
   ============================================================ */

/* SahraTec: full product names + simple phone cards */
.s-product-card-entry .s-product-card-content-title{-webkit-line-clamp:unset!important;display:block!important;overflow:visible!important;height:auto!important;max-height:none!important;}
@media (max-width:767px){.s-product-card-entry .s-product-card-content-subtitle{display:none!important;}}