/* Add custom CSS styles below */ 
salla-products-list.main-products-list:not(:has(custom-salla-product-card, .s-products-list-placeholder)){
  display:block;
  min-height:100vh;
}
@media (max-width:767px){
  salla-products-list.main-products-list:is(
    [source-value="1430291110"],
    [source-value="621017034"],
    [source-value="852361507"],
    [source-value="562299807"]
  ):not(:has(custom-salla-product-card, .s-products-list-placeholder)){
    min-height:330px;
  }
}
/* RFCO: الكود 2 (v2). بطاقة المنتج: نقر كامل، زر إضافة ظاهر، إخفاء العنوان الفرعي، مسافات أقصر.
   الاسترجاع: احذف من هذا السطر حتى نهاية الكتلة واحفظ. */

/* 1) إطار رفيع بلون حدود هوية القالب، وزوايا مستديرة */
custom-salla-product-card{
  position:relative;display:block;height:100%;
  border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;background:#fff;
  transition:border-color .15s ease, box-shadow .15s ease;
}
@media (hover:hover){
  custom-salla-product-card:hover{border-color:#4aa4b5;box-shadow:0 2px 10px rgba(0,0,0,.06)}
}
custom-salla-product-card .product-entry__content{padding:0 10px 12px}

/* 2) البطاقة كلها رابط للمنتج (توسيع رابط العنوان) */
custom-salla-product-card .product-entry__title a::after{
  content:"";position:absolute;inset:0;z-index:1;
}

/* 3) العناصر التفاعلية فوق طبقة الرابط */
custom-salla-product-card .product-popup-trigger,
custom-salla-product-card salla-button.btn--wishlist{z-index:2}
custom-salla-product-card salla-add-product-button,
custom-salla-product-card salla-button:not(.btn--wishlist),
custom-salla-product-card select,
custom-salla-product-card input{position:relative;z-index:2}

/* 4) زر الإضافة للسلة: ظاهر دائمًا، بعرض البطاقة، ارتفاع 44px (حد اللمس)، أيقونة حقيبة ونص.
   على الكمبيوتر يضع القالب الحاوية فوق الصورة ويظهرها عند المرور فقط؛ نعيدها تحت السعر كما في الجوال */
custom-salla-product-card .add-to-cart-conatiner{
  position:static !important;inset:auto !important;width:100%;
  opacity:1 !important;visibility:visible !important;transform:none !important;
}
custom-salla-product-card salla-add-product-button{display:block;width:100%;opacity:1 !important;visibility:visible !important;transform:none !important}
custom-salla-product-card salla-add-product-button .s-button-element{
  width:100% !important;height:44px !important;min-height:44px !important;border-radius:10px !important;
  display:inline-flex;align-items:center;justify-content:center;gap:6px;font-weight:600;font-size:14px;
}
custom-salla-product-card salla-add-product-button .sicon-add:before{content:"\ef36"}
html[lang="ar"] custom-salla-product-card salla-add-product-button[product-status="sale"] .s-button-text::after{content:"أضف للسلة"}
html[lang="en"] custom-salla-product-card salla-add-product-button[product-status="sale"] .s-button-text::after{content:"Add to cart"}
custom-salla-product-card salla-add-product-button .s-button-text{display:inline-flex;align-items:center;gap:6px}

/* 5) المفضلة والعرض السريع: في زاوية الصورة المقابلة للشارة، ومساحة لمس 44px */
custom-salla-product-card .product-popup-trigger,
custom-salla-product-card salla-button.btn--wishlist{
  position:absolute !important;top:auto !important;
  bottom:calc(100% + 8px) !important;
  inset-inline-end:8px !important;inset-inline-start:auto !important;
  opacity:1 !important;visibility:visible !important;transform:none !important;
}
custom-salla-product-card salla-button.btn--wishlist{bottom:calc(100% + 50px) !important}
custom-salla-product-card .product-popup-trigger.s-button-element,
custom-salla-product-card salla-button.btn--wishlist button.s-button-element{
  width:34px !important;height:34px !important;min-width:34px !important;
  box-shadow:0 1px 4px rgba(0,0,0,.12);
}
custom-salla-product-card .product-popup-trigger::before,
custom-salla-product-card salla-button.btn--wishlist button::before{
  content:"";position:absolute;inset:-5px;
}

/* 6) مؤشر تركيز واضح للوحة المفاتيح */
custom-salla-product-card a:focus-visible,
custom-salla-product-card button:focus-visible{outline:2px solid #4aa4b5;outline-offset:2px}

/* ===== v2: بطاقة أقصر للجوال، وزر حسب نوع المنتج ===== */
/* 7) إخفاء العنوان الفرعي من البطاقة فقط (يبقى في صفحة المنتج) */
custom-salla-product-card .product-entry__subtitle{display:none !important}
/* 8) ضبط المسافات */
custom-salla-product-card .product-entry__content{padding:8px 10px 10px !important;gap:6px}
custom-salla-product-card .product-entry__content > .flex.flex-col.gap-1{gap:2px}
custom-salla-product-card .product-entry__title{margin:0 !important;line-height:1.45}
custom-salla-product-card .product-entry__content > .mt-auto{gap:8px !important}
@media (max-width:767px){
  custom-salla-product-card .product-entry__title{font-size:13px}
  custom-salla-product-card salla-add-product-button .s-button-element{font-size:13px}
}
/* 9) منتج بخيارات: النص "اختر الخيارات" دون أيقونة الحقيبة (يضبطه سكربت code2-options.js) */
html[lang="ar"] custom-salla-product-card[data-rfco-opts="1"] salla-add-product-button[product-status="sale"] .s-button-text::after{content:"اختر الخيارات"}
html[lang="en"] custom-salla-product-card[data-rfco-opts="1"] salla-add-product-button[product-status="sale"] .s-button-text::after{content:"Choose options"}
custom-salla-product-card[data-rfco-opts="1"] salla-add-product-button .sicon-add{display:none}
/* 10) منتج نفدت كميته: الزر معطّل من سلة، فنكتب الحالة بدل أيقونة الحقيبة */
html[lang="ar"] custom-salla-product-card salla-add-product-button[product-status="out"] .s-button-text::after{content:"نفدت الكمية"}
html[lang="en"] custom-salla-product-card salla-add-product-button[product-status="out"] .s-button-text::after{content:"Out of stock"}
custom-salla-product-card salla-add-product-button[product-status="out"] .sicon-add{display:none}

/* RFCO: الكود 3 (v2، مسودة لم تُنشر). الهوية على البطاقة وصفحة المنتج والخيارات، والجوال أولًا.
   يُضاف بعد الكود 2 في نهاية خانة CSS. لا يغيّر إعدادات القالب ولا لون الهوية العام.
   الاسترجاع: احذف من هذا السطر حتى نهاية الكتلة واحفظ. */
:root{
  --rf-teal:#279DA7; --rf-deep:#1B6269; --rf-deep-hover:#154E54; --rf-soft:#DCEFF0;
  --rf-graphite:#3F404A; --rf-dgraphite:#25262D; --rf-steel:#6B7078; --rf-silver:#C5C8CE; --rf-lgray:#E5E7EB;
  /* سلّم الحواف: 8 للحاويات، و6 للأزرار والحقول، و4 للشارات. أقرب لحواف القالب (2px) من 10 و12 السابقة */
  --rf-r-box:8px; --rf-r-ctl:6px; --rf-r-tag:4px;
  /* ارتفاعات: 40 مرئي للبطاقة مع منطقة لمس 44، و44 للشريط والحقول */
  --rf-h-card:40px; --rf-h-ctl:44px;
}

/* 0) أيقونة السلة: عربة تسوق في الهيدر وزر البطاقة وزر صفحة المنتج (بدل الحقيبة) */
.sicon-shopping-bag:before{content:"\e96b" !important}
custom-salla-product-card salla-add-product-button .sicon-add:before{content:"\e96b" !important}

/* 1) بطاقة المنتج */
custom-salla-product-card{border-color:var(--rf-lgray);border-radius:var(--rf-r-box) !important}
@media (hover:hover){custom-salla-product-card:hover{border-color:var(--rf-teal)}}
custom-salla-product-card .product-entry__title,
custom-salla-product-card .product-entry__title a{color:var(--rf-graphite)}
/* حجز سطرين للعنوان: السعر والزر على خط واحد في كل البطاقات */
custom-salla-product-card .product-entry__title{min-height:2.9em}
custom-salla-product-card .starting-price-title{color:var(--rf-steel);font-size:12px}

/* الزر: 40px مرئي، ومنطقة لمس 44px عبر طبقة شفافة */
custom-salla-product-card salla-add-product-button .s-button-element{
  height:var(--rf-h-card) !important;min-height:var(--rf-h-card) !important;border-radius:var(--rf-r-ctl) !important;position:relative;
}
custom-salla-product-card salla-add-product-button .s-button-element::before{content:"";position:absolute;inset:-2px 0}
/* زر أساسي: أبيض على Deep Teal (تباين 7.0) */
custom-salla-product-card salla-add-product-button[product-status="sale"] .s-button-element{
  background:var(--rf-deep) !important;border-color:var(--rf-deep) !important;color:#fff !important;
}
@media (hover:hover){
  custom-salla-product-card salla-add-product-button[product-status="sale"] .s-button-element:hover{background:var(--rf-deep-hover) !important}
}
/* منتج بخيارات: زر ثانوي بإطار وسهم «انتقال» يوضّح أنه يفتح صفحة المنتج (الكود JS v3) */
custom-salla-product-card[data-rfco-opts="1"] salla-add-product-button[product-status="sale"] .s-button-element{
  background:#fff !important;color:var(--rf-deep) !important;border:1.5px solid var(--rf-deep) !important;
}
@media (hover:hover){
  custom-salla-product-card[data-rfco-opts="1"] salla-add-product-button[product-status="sale"] .s-button-element:hover{background:var(--rf-soft) !important}
}
custom-salla-product-card[data-rfco-opts="1"] salla-add-product-button[product-status="sale"] .s-button-text::before{
  font-family:sallaicons !important;content:"\e944";order:2;font-size:15px;line-height:1;
}
html[dir="ltr"] custom-salla-product-card[data-rfco-opts="1"] salla-add-product-button[product-status="sale"] .s-button-text::before{content:"\e946"}

/* الشارة: معلومة بلون Soft Teal ونص Deep Teal (تباين 5.9) بدل الأبيض على ‎#00a7bb‎ (2.9) */
custom-salla-product-card .promotion-badge{
  background:var(--rf-soft) !important;color:var(--rf-deep) !important;
  font-weight:600;border-radius:var(--rf-r-tag) !important;padding-inline:8px;
}

/* الجوال: إخفاء العرض السريع (البطاقة كلها تفتح المنتج)، وإبقاء المفضلة في موضع العين */
@media (max-width:767px){
  custom-salla-product-card .product-popup-trigger{display:none !important}
  custom-salla-product-card salla-button.btn--wishlist{bottom:calc(100% + 8px) !important}
}

/* 2) صفحة المنتج */
/* شارة الصورة: نفس شارة البطاقة بدل الوردي ‎#f87171‎ (2.77) */
.images-wrapper .promotion-title{
  background:var(--rf-soft) !important;color:var(--rf-deep) !important;
  border-radius:var(--rf-r-tag);margin:10px;font-weight:600;
}
/* أسهم المعرض: أبيض خفيف بدل الدوائر السوداء */
.images-wrapper .s-slider-nav-arrow{
  background:rgba(255,255,255,.95) !important;color:var(--rf-graphite) !important;
  box-shadow:0 1px 6px rgba(0,0,0,.15);
}
.images-wrapper .s-slider-nav-arrow *,
.images-wrapper .s-slider-nav-arrow::before,
.images-wrapper .s-slider-nav-arrow::after{color:var(--rf-graphite) !important}
.images-wrapper .s-slider-nav-arrow svg,
.images-wrapper .s-slider-nav-arrow svg *{fill:var(--rf-graphite) !important}
.images-wrapper .s-slider-nav-arrow.swiper-button-disabled{opacity:0 !important;pointer-events:none}

/* المفضلة: أيقونة قلب في سطر «متوفر» نفسه بدل سطر كامل بين السعر والخيار.
   النص يبقى لقارئ الشاشة (مخفي بصريًا فقط) */
ul.product-metadata{flex-direction:row !important;flex-wrap:wrap;align-items:center;justify-content:space-between}
ul.product-metadata > li.product-metadata__item-mini{margin-inline-start:auto}
.product-details-col salla-button.btn--wishlist button.s-button-element{
  width:40px;height:40px;min-width:40px;padding:0 !important;border-radius:50% !important;
  border:1px solid var(--rf-silver) !important;background:#fff !important;justify-content:center;position:relative;
}
.product-details-col salla-button.btn--wishlist button.s-button-element::after{content:"";position:absolute;inset:-2px}
.product-details-col salla-button.btn--wishlist .s-button-text{gap:0}
.product-details-col salla-button.btn--wishlist .s-button-text > span{
  position:absolute !important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;
}
.product-details-col salla-button.btn--wishlist i{font-size:19px;color:var(--rf-graphite);margin:0 !important}

/* شريط الشراء الثابت على الجوال: صف واحد (الكمية + أضف + اشترِ الآن) بدل صفين: من 130px إلى نحو 64px */
@media (max-width:767px){
  section.addtocart-bar{flex-direction:row !important;align-items:stretch;padding:10px 12px !important;gap:8px !important}
  section.addtocart-bar > .center-between{flex:0 0 104px;width:104px}
  section.addtocart-bar > .center-between,
  section.addtocart-bar salla-quantity-input,
  section.addtocart-bar .s-quantity-input-container,
  section.addtocart-bar .s-quantity-input-container > *,
  section.addtocart-bar > salla-add-product-button,
  section.addtocart-bar .s-add-product-button-main,
  section.addtocart-bar .s-add-product-button-main > salla-button{height:var(--rf-h-ctl) !important;min-height:0 !important}
  section.addtocart-bar salla-quantity-input,
  section.addtocart-bar .s-quantity-input-container{width:100%;border-radius:var(--rf-r-ctl);border-color:var(--rf-silver)}
  section.addtocart-bar .s-quantity-input-button{width:34px !important;min-width:34px}
  section.addtocart-bar > salla-add-product-button{flex:1 1 auto;min-width:0}
  section.addtocart-bar .s-add-product-button-main{gap:8px}
  section.addtocart-bar .s-add-product-button-main > salla-button{flex:1 1 auto;min-width:0}
  section.addtocart-bar salla-mini-checkout-widget{flex:0 0 auto;width:auto !important}
  section.addtocart-bar .s-button-element,
  section.addtocart-bar salla-mini-checkout-widget{height:var(--rf-h-ctl) !important;min-height:var(--rf-h-ctl) !important}
}
/* 6) الطبقة العائمة على الجوال والتابلت (الشريط السفلي + واتساب + الصعود للأعلى)
   المشكلة: الشريط شفاف فيظهر المحتوى خلفه، والزران العائمان يبقيان فوق العمود الأيمن أثناء التصفح،
   وزر الصعود (z-index 1) يتقاطع مع واتساب ومع عناصر البطاقة (z-index 2).
   الحل: الثلاثة تتبع سلوك الشريط في القالب. تختفي معًا عند التمرير للأسفل، وتظهر معًا عند الصعود فوق الشريط بعمود واحد */
custom-salla-product-card{isolation:isolate}
@media (max-width:1023px){
  nav.bottom-nav .bottom-nav__items,
  nav.bottom-nav .bottom-nav__search{background:rgba(255,255,255,.94) !important}
  .floating-contacts, #progress-scroll{
    z-index:20 !important;
    transition:bottom .3s ease, opacity .2s ease, transform .3s ease, visibility .3s !important;
  }
  body:not(.product-single):has(nav.bottom-nav) .floating-contacts{bottom:calc(80px + env(safe-area-inset-bottom,0px)) !important}
  body:not(.product-single):has(nav.bottom-nav) #progress-scroll{bottom:calc(136px + env(safe-area-inset-bottom,0px)) !important}
  body:not(.product-single):has(nav.bottom-nav--hidden) .floating-contacts,
  body:not(.product-single):has(nav.bottom-nav--hidden) #progress-scroll{
    opacity:0 !important;visibility:hidden !important;transform:translateY(24px) !important;pointer-events:none !important;
  }
}

/* 7) استجابة فورية عند لمس البطاقة (يضيف الصنف سكربت code2-options-v4.js).
   تحميل صفحة المنتج 2 إلى 5 ثوانٍ، وتمييز اللمس معطّل في القالب، فيعيد الزائر الضغط ظنًا أن اللمسة لم تُسجّل */
custom-salla-product-card.rfco-going{opacity:.65;transition:opacity .15s ease}
custom-salla-product-card.rfco-going::after{
  content:"";position:absolute;top:0;inset-inline:0;height:3px;z-index:3;
  background:linear-gradient(90deg,transparent,var(--rf-teal),transparent);background-size:200% 100%;
  animation:rfco-load 1s linear infinite;
}
@keyframes rfco-load{from{background-position:200% 0}to{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){custom-salla-product-card.rfco-going::after{animation:none;background:var(--rf-teal)}}

/* الأزرار العائمة في صفحة المنتج (جوال): واتساب فوق الشريط مباشرة، وإخفاء زر الصعود للأعلى المكرر فوقه */
@media (max-width:767px){
  body.product-single .floating-contacts{bottom:calc(76px + env(safe-area-inset-bottom,0px)) !important}
  body.product-single #progress-scroll{display:none !important}
}
section.addtocart-bar salla-add-product-button .s-button-element.s-button-primary{
  background:var(--rf-deep) !important;border-color:var(--rf-deep) !important;color:#fff !important;border-radius:var(--rf-r-ctl) !important;
}
section.addtocart-bar salla-add-product-button .s-button-element.s-button-primary .s-button-text::before{
  font-family:sallaicons !important;content:"\e96b";font-size:17px;line-height:1;margin-inline-end:6px;
}
section.addtocart-bar salla-mini-checkout-widget{border-radius:var(--rf-r-ctl) !important;border-color:var(--rf-deep) !important;color:var(--rf-deep) !important}

/* 3) الخيارات المصوّرة (thumbnail): إطار واضح بدل الغطاء الداكن الذي يخفي الصورة.
   CSS فقط: نفس عناصر radio الأصلية، فلا يتغير اختيار المتغير ولا السعر ولا الإضافة */
.s-product-options-thumbnails-wrapper label{
  border:1px solid var(--rf-lgray);border-radius:var(--rf-r-ctl);overflow:hidden;background:#fff;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.s-product-options-thumbnails-wrapper input:checked + label{
  border:2px solid var(--rf-deep);box-shadow:0 0 0 3px var(--rf-soft);
}
.s-product-options-thumbnails-wrapper input:checked + label::before{opacity:0 !important}
.s-product-options-thumbnails-wrapper input:checked + label .s-product-options-thumbnails-icon{
  top:4px !important;bottom:auto !important;inset-inline-start:auto !important;inset-inline-end:4px !important;
  background:var(--rf-deep) !important;color:#fff !important;
}
html[dir="rtl"] .s-product-options-thumbnails-wrapper input:checked + label .s-product-options-thumbnails-icon{left:4px !important;right:auto !important}
html[dir="ltr"] .s-product-options-thumbnails-wrapper input:checked + label .s-product-options-thumbnails-icon{right:4px !important;left:auto !important}
.s-product-options-thumbnails-wrapper input:checked + label .s-product-options-thumbnails-icon svg,
.s-product-options-thumbnails-wrapper input:checked + label .s-product-options-thumbnails-icon svg *{fill:#fff !important}
.s-product-options-thumbnails-wrapper input:checked ~ p{color:var(--rf-deep);font-weight:700}
.s-product-options-thumbnails-wrapper input:focus-visible + label{outline:2px solid var(--rf-teal);outline-offset:2px}

/* 4) الألوان (color): المختار نقطة بيضاء صغيرة فقط. حلقة Deep Teal ونص بارز، ولمس 44px */
.s-product-options-colors-wrapper{display:flex;flex-wrap:wrap;gap:10px}
.s-product-options-colors-item label{min-width:44px;display:flex;flex-direction:column;align-items:center;gap:4px;cursor:pointer}
.s-product-options-colors-item label span{
  width:34px !important;height:34px !important;border:2px solid #fff !important;
  box-shadow:0 0 0 1px var(--rf-silver) !important;transition:box-shadow .15s ease;
}
.s-product-options-colors-item input:checked + label span{box-shadow:0 0 0 2px var(--rf-deep) !important}
.s-product-options-colors-item input:checked + label div{color:var(--rf-deep);font-weight:700}
.s-product-options-colors-item input:focus-visible + label span{outline:2px solid var(--rf-teal);outline-offset:3px}

/* 5) الخيارات النصية (single-option): تبقى القائمة الأصلية في هذه المرحلة، بارتفاع 44px وتركيز واضح.
   تحويلها إلى أزرار ظاهرة يحتاج JS ومرحلة مستقلة */
salla-product-options select{
  min-height:var(--rf-h-ctl);border:1px solid var(--rf-silver) !important;border-radius:var(--rf-r-ctl) !important;
  color:var(--rf-graphite);font-size:15px;
}
salla-product-options select:focus{border-color:var(--rf-deep) !important;box-shadow:0 0 0 3px var(--rf-soft) !important;outline:none}

/* خيار المنتج: إخفاء «اختر» المكررة تحت اسم الخيار (تبقى داخل القائمة) */
salla-product-options .s-product-options-option-label small{display:none}