/* Add custom CSS styles below */ 
/* =====================================================
   القسم 1: الهيدر والقائمة العلوية
   ===================================================== */

/* إخفاء شعار المتجر (اللوجو) من على الصفحة بكل أشكاله */
.navbar-brand,
.store-logo,
.main-nav-container .navbar-brand,
header .navbar-brand img,
header a[href="/"] > img {
  display: none !important;
}

/* إخفاء زر الوضع الليلي (القمر والشمس) بكل أشكاله وأسمائه المحتملة */
.sicon-moon,
.sicon-sun,
[class*="moon"],
[class*="dark-mode"],
[class*="darkmode"],
[class*="theme-toggle"],
[class*="theme-switch"],
[class*="mode-toggle"],
salla-theme-toggle,
button:has(.sicon-moon),
a:has(.sicon-moon),
li:has(> button .sicon-moon),
li:has(> a .sicon-moon) {
  display: none !important;
}

/* تحويل أيقونة الحساب إلى أيقونة شخص (SVG) بيضاء بحجم 28px بلا إطار
   (تم ترميز < و > داخل الـ SVG ليعمل في كل المتصفحات) */
a[href*="login"] img,
a[href*="profile"] img,
a[href*="account"] img,
a[href*="customer"] img {
  content: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4.4 3.6-8 8-8s8 3.6 8 8'/%3E%3C/svg%3E") !important;
  width: 28px !important;
  height: 28px !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  object-fit: contain !important;
}

/* الكمبيوتر فقط: تحريك قائمة المستخدم لجهة اليسار بمقدار 78% من عرض الشاشة */
@media (min-width: 769px) {
  salla-user-menu {
    transform: translateX(-78vw) !important;
  }
}


/* =====================================================
   القسم 2: الصفحة الرئيسية
   ===================================================== */

/* بنرات العرض الكامل: إلغاء الهوامش الجانبية لتمتد على كامل العرض
   (تصحيح: كانت تنقص النقطة قبل اسم الكلاس فلم يكن التنسيق يُطبَّق) */
.s-block--full-width-banners {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* الفيديو (عام): عرض كامل وارتفاع تلقائي حسب نسبة الفيديو الأصلية، بدون قص */
video {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
}

/* حاوية البنر: جعل الحاوية التي فيها الفيديو مرجعاً للتموضع وقص ما يخرج عنها
   (تصحيح: كان اسم الكلاس مؤقتاً ".اسم-حاوية-البنر"،
    وتم استبداله بتحديد تلقائي لأي عنصر يحتوي فيديو مباشرة) */
*:has(> video) {
  position: relative !important;
  overflow: hidden !important;
}

/* الفيديو في الجوال */
@media (max-width: 768px) {
  /* نسبة طولية 3:4 ويملأ المساحة مع قص الزوائد */
  video {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 3 / 4 !important;
    object-fit: cover !important;
  }

  /* فك أي ارتفاع ثابت في الحاوية المحيطة بالفيديو */
  *:has(> video) {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
  }
}

/* الفيديو في الكمبيوتر */
@media (min-width: 769px) {
  /* ارتفاع 85% من الشاشة ويملأ المساحة
     (تصحيح: كان الكود مقطوعاً عند "none !" وبدون إغلاق الأقواس) */
  video {
    width: 100% !important;
    height: 85vh !important;
    object-fit: cover !important;
  }

  /* فك أي ارتفاع ثابت في الحاوية المحيطة بالفيديو */
  *:has(> video) {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
  }
}

/* التقييمات: عرض التقييمات في أعمدة متجاورة بنص من اليمين لليسار */
.reviews-row salla-reviews {
  display: block;
  direction: rtl;
}

/* حاوية التقييمات: شبكة أعمدة تتكيف مع العرض (200px كحد أدنى للعمود)
   وإلغاء أي حد للارتفاع أو قص */
.reviews-row salla-reviews > div,
.reviews-row salla-reviews .s-reviews-container {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  overflow: visible !important;
  max-height: none !important;
}

/* كل تقييم: بدون خلفية أو ظل، محاذاة يمين، وخط فاصل وردي بين التقييمات */
.reviews-row salla-reviews .s-reviews-testimonial,
.reviews-row salla-reviews [class*="review"] {
  padding: 0 20px;
  text-align: right;
  border-inline-start: 1px solid #e3a8a8;
  background: transparent;
  box-shadow: none;
}

/* أول تقييم: إلغاء الخط الفاصل منه */
.reviews-row salla-reviews [class*="review"]:first-child {
  border-inline-start: 0;
}

/* لون النجوم أحمر داكن */
.reviews-row salla-reviews [class*="star"] {
  color: #b94a48;
}

/* الجوال: التقييمات في عمود واحد */
@media (max-width: 768px) {
  .reviews-row salla-reviews > div {
    grid-template-columns: 1fr !important;
  }
}


/* =====================================================
   القسم 3: البحث
   (تصحيح الخلل: القواعد القديمة كانت تستهدف كل عنصر "أب" فيه حقل البحث
    بحد 3 مستويات، فكانت تطال الهيدر نفسه وقائمته، فيصبح شفافاً ويتقلص
    ويختفي أثناء التمرير. الآن تُطبَّق على صندوق البحث ونتائجه فقط
    وتستثني الهيدر والقوائم.)
   ===================================================== */

/* شفافية صندوق البحث (جوال وكمبيوتر): خلفية بيضاء نصف شفافة مع تأثير ضبابي،
   مقصورة على مكوّن البحث ونتائجه، ولا تمس الهيدر أو القائمة الرئيسية */
salla-search .s-search-container,
salla-search .s-search-results,
salla-search [class*="search-results"],
.s-search-modal .s-modal-body {
  background: rgba(255, 255, 255, 0.35) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  backdrop-filter: blur(8px) !important;
}

/* نافذة نتائج البحث في الجوال: ارتفاع أقصى 60% من الشاشة
   وحواف سفلية مدورة وتمرير داخلي عند كثرة النتائج */
@media (max-width: 768px) {
  salla-search .s-search-results,
  salla-search [class*="search-results"] {
    max-height: 60vh !important;
    height: auto !important;
    border-radius: 0 0 20px 20px !important;
    overflow-y: auto !important;
  }
}

/* نافذة نتائج البحث في الكمبيوتر: ارتفاع أقصى 45% من الشاشة
   وحواف سفلية مدورة وتمرير داخلي */
@media (min-width: 769px) {
  salla-search .s-search-results,
  salla-search [class*="search-results"] {
    max-height: 45vh !important;
    height: auto !important;
    border-radius: 0 0 24px 24px !important;
    overflow-y: auto !important;
  }
}


/* =====================================================
   القسم 4: المنتجات والنافذة المنبثقة
   ===================================================== */

/* المنتجات في الجوال: عمودان وهوامش صغيرة ليكبر الكرت */
@media (max-width: 768px) {
  /* شبكة المنتجات: منتجان في الصف */
  .amira-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 0 6px !important;
  }

  /* كرت المنتج: يملأ عرض الخلية بدون هوامش */
  .amira-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* صورة المنتج: نسبة طولية 3:4 مع قص الزوائد */
  .amira-card img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 3 / 4 !important;
    object-fit: cover !important;
  }

  /* عنوان المنتج: حجم 17px وتباعد أسطر مريح */
  .amira-card h2,
  .amira-card h3,
  .amira-card h4 {
    font-size: 17px !important;
    line-height: 1.6 !important;
  }

  /* القوائم والأزرار داخل الكرت: عرض كامل وحجم خط وحشوة أكبر */
  .amira-card select,
  .amira-card button {
    width: 100% !important;
    font-size: 16px !important;
    padding: 12px 8px !important;
  }
}

/* المنتجات في الكمبيوتر: عمودان بمسافة أكبر */
@media (min-width: 769px) {
  .amira-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
  }

  .amira-card {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* زر النافذة والشارة: ترتيب طبقات عالٍ وحركة انتقال ناعمة */
.fdcp-open-popup-button,
.fdcp-marketing-phrase-badge {
  z-index: 90006 !important;
  transition: all 0.25s ease !important;
}

/* عند فتح نافذة منبثقة: إخفاء زر النافذة بإنزاله وتشفيفه وتعطيل النقر عليه */
html:has(.s-modal-body.s-modal-entering) .fdcp-open-popup-button,
html:has(.s-modal-body.s-modal-entered) .fdcp-open-popup-button,
html:has(.s-modal-wrapper:focus-within) .fdcp-open-popup-button {
  bottom: -80px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

/* عند فتح نافذة منبثقة: إخفاء شارة العبارة التسويقية وتعطيل النقر عليها */
html:has(.s-modal-body.s-modal-entering) .fdcp-marketing-phrase-badge,
html:has(.s-modal-body.s-modal-entered) .fdcp-marketing-phrase-badge,
html:has(.s-modal-wrapper:focus-within) .fdcp-marketing-phrase-badge {
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: 1 !important;
}
/* ===== بنر بعرض كامل + تقليل هامش اليسار (الصفحات الخمس فقط) ===== */

/* الكمبيوتر */
html:has(link[rel="canonical"]:is([href*="c2079112804"],[href*="c914351214"],[href*="c452366897"],[href*="c614438981"],[href*="c587892521"])) img[src*="/homepage/"]{
  display:block !important;
  float:none !important;
  width:100% !important;
  max-width:100% !important;
  height:auto !important;
  margin:0 !important;
  border-radius:12px;
}

/* مسار التنقل وعنوان التصنيف */
html:has(link[rel="canonical"]:is([href*="c2079112804"],[href*="c914351214"],[href*="c452366897"],[href*="c614438981"],[href*="c587892521"])) .breadcrumbs{
  margin-top:4px !important;
  margin-bottom:8px !important;
}
html:has(link[rel="canonical"]:is([href*="c2079112804"],[href*="c914351214"],[href*="c452366897"],[href*="c614438981"],[href*="c587892521"])) h1{
  margin-top:12px !important;
  margin-bottom:12px !important;
}

/* الجوال: عرض الصورة = عرض الشاشة ناقص 32px، وتتمدد نحو اليسار فقط */
@media (max-width:768px){
  html:has(link[rel="canonical"]:is([href*="c2079112804"],[href*="c914351214"],[href*="c452366897"],[href*="c614438981"],[href*="c587892521"])) img[src*="/homepage/"]{
    width:calc(100vw - 32px) !important;
    min-width:calc(100vw - 32px) !important;
    max-width:none !important;
    height:auto !important;
    margin:0 !important;
  }
  html:has(link[rel="canonical"]:is([href*="c2079112804"],[href*="c914351214"],[href*="c452366897"],[href*="c614438981"],[href*="c587892521"])) .breadcrumbs{
    margin-bottom:4px !important;
  }
  html:has(link[rel="canonical"]:is([href*="c2079112804"],[href*="c914351214"],[href*="c452366897"],[href*="c614438981"],[href*="c587892521"])) h1{
    margin-top:8px !important;
    margin-bottom:8px !important;
  }
}
/* =====================================================
   إلغاء شريط التنقل السفلي في الجوال (الشريط البني)
   ===================================================== */

/* إخفاء الشريط نفسه (لا يطال html أو body حتى لا تختفي الصفحة) */
footer.mobile-nav-outer,
.mobile-nav-outer,
div.mobile-nav,
nav.mobile-nav,
salla-bottom-navigation,
footer[class*="mobile-nav"],
div[class*="mobile-nav-outer"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* إزالة المساحة الفارغة التي يحجزها القالب أسفل الصفحة لأجل الشريط */
:root,
body {
  --mobile-nav-height: 0px !important;
  --mobile-nav-inner-height: 0px !important;
}

body {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}
/* =====================================================
   تقليل الجوانب الفارغة وجعلها متساوية يميناً ويساراً
   في صفحتين فقط (دون تغيير حجم الصورة أو نسبتها):
   - 3 بلوفرات بـ 115 ريال   (c1735697032)
   - طقمين بناتيه بـ 115 ريال (c54452362)
   سبب اختلاف الفراغين: العناصر المحيطة بالصورة في القالب تحمل
   هوامش وحشوات مختلفة لكل جهة، فنوحّدها كلها على قيمة واحدة.
   ===================================================== */

/* 1) حاوية الصفحة الرئيسية: بعرض كامل وحشوة 12px متساوية من الجهتين
      (حاويات الهيدر والفوتر مستثناة) */
html:has(link[rel="canonical"]:is([href*="c1735697032"],[href*="c54452362"])) .container:not(header .container):not(footer .container) {
  box-sizing: border-box !important;
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* 2) كل عنصر يحتوي صورة البنر (الأغلفة الداخلية):
      تصفير الهوامش والحشوات الجانبية وإلغاء الحد الأقصى للعرض،
      فيتساوى الفراغ على الجهتين (الصور من /homepage/، وصور الفوتر مستثناة) */
html:has(link[rel="canonical"]:is([href*="c1735697032"],[href*="c54452362"])) :is(div, section, figure, picture, a):has(img[src*="/homepage/"]):not(.container):not(header *):not(footer *) {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  float: none !important;
}

/* 3) صورة البنر نفسها: توسيط متماثل فقط بدون أي تغيير في مقاسها
      (لا width ولا height ولا قص ولا حواف) */
html:has(link[rel="canonical"]:is([href*="c1735697032"],[href*="c54452362"])) img[src*="/homepage/"]:not(footer *) {
  display: block !important;
  float: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
/* =====================================================
   إصلاح انضغاط الصفحة على اليمين عند الوصول لأعلى الصفحة (الكمبيوتر فقط)
   (نسخة معدّلة: لا تلمس الهيدر إطلاقاً، فيبقى موضع أيقونة الحساب
    والسلة كما كان. حُذفت منها قواعد الهيدر وحاويته.)
   ===================================================== */

@media (min-width: 769px) {

  /* إلغاء أي إزاحة أو تحجيم على الصفحة نفسها ومنع التمرير الأفقي الناتج عنه */
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
    translate: none !important;
    overflow-x: hidden !important;
  }

  /* أغلفة المحتوى الرئيسية (بدون الهيدر): عرض كامل وبدون إزاحة */
  #app,
  .app-inner,
  main,
  .main-content {
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    translate: none !important;
  }
}
/* ===== فراغ 30px أسفل آخر بنر في الصفحة قبل الذيل ===== */
a[href*="c587892521"] {
  display: block !important;
  margin-bottom: 30px !important;
}
.category-header,
.s-block--banner,
.banner--fixed,
.main-content .banner {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  float: none !important;
  display: block !important;
}

.category-header img,
.s-block--banner img,
.banner--fixed img,
.main-content .banner img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 auto !important;
  border-radius: 16px;
}
/* ===== بنر بعرض كامل + تقليل هامش اليسار (9 صفحات) ===== */

/* الكمبيوتر */
html:has(link[rel="canonical"]:is([href*="c2079112804"],[href*="c914351214"],[href*="c452366897"],[href*="c614438981"],[href*="c587892521"],[href*="c298794261"],[href*="c2094507562"],[href*="c1983924806"],[href*="c2090080195"])) img[src*="/homepage/"]{
  display:block !important;
  float:none !important;
  width:100% !important;
  max-width:100% !important;
  height:auto !important;
  margin:0 !important;
  border-radius:12px;
}

/* مسار التنقل وعنوان التصنيف */
html:has(link[rel="canonical"]:is([href*="c2079112804"],[href*="c914351214"],[href*="c452366897"],[href*="c614438981"],[href*="c587892521"],[href*="c298794261"],[href*="c2094507562"],[href*="c1983924806"],[href*="c2090080195"])) .breadcrumbs{
  margin-top:4px !important;
  margin-bottom:8px !important;
}
html:has(link[rel="canonical"]:is([href*="c2079112804"],[href*="c914351214"],[href*="c452366897"],[href*="c614438981"],[href*="c587892521"],[href*="c298794261"],[href*="c2094507562"],[href*="c1983924806"],[href*="c2090080195"])) h1{
  margin-top:12px !important;
  margin-bottom:12px !important;
}

/* الجوال: عرض الصورة = عرض الشاشة ناقص 32px، وتتمدد نحو اليسار فقط */
@media (max-width:768px){
  html:has(link[rel="canonical"]:is([href*="c2079112804"],[href*="c914351214"],[href*="c452366897"],[href*="c614438981"],[href*="c587892521"],[href*="c298794261"],[href*="c2094507562"],[href*="c1983924806"],[href*="c2090080195"])) img[src*="/homepage/"]{
    width:calc(100vw - 32px) !important;
    min-width:calc(100vw - 32px) !important;
    max-width:none !important;
    height:auto !important;
    margin:0 !important;
  }
  html:has(link[rel="canonical"]:is([href*="c2079112804"],[href*="c914351214"],[href*="c452366897"],[href*="c614438981"],[href*="c587892521"],[href*="c298794261"],[href*="c2094507562"],[href*="c1983924806"],[href*="c2090080195"])) .breadcrumbs{
    margin-bottom:4px !important;
  }
  html:has(link[rel="canonical"]:is([href*="c2079112804"],[href*="c914351214"],[href*="c452366897"],[href*="c614438981"],[href*="c587892521"],[href*="c298794261"],[href*="c2094507562"],[href*="c1983924806"],[href*="c2090080195"])) h1{
    margin-top:8px !important;
    margin-bottom:8px !important;
  }
}