/* =========================================================
   WE CARE - Dark Mode (نسخة آمنة)
   كل القواعد تشتغل فقط لما يكون الوضع داكن
   ========================================================= */

html[data-wecare-theme="dark"] {
  color-scheme: dark;
  background: #101a2b !important;
  scrollbar-color: #f47721 #101a2b;
  scrollbar-width: thin;
}

/* ---------- الخلفية العامة ---------- */
html[data-wecare-theme="dark"] body,
html[data-wecare-theme="dark"] main,
html[data-wecare-theme="dark"] header,
html[data-wecare-theme="dark"] footer {
  background-color: #101a2b !important;
  color: #e8edf5 !important;
}

/* ---------- أقسام الصفحة والبانرات: بدون خلفية بيضاء ---------- */
html[data-wecare-theme="dark"] section,
html[data-wecare-theme="dark"] .s-block,
html[data-wecare-theme="dark"] .s-block > div,
html[data-wecare-theme="dark"] [class*="s-block--"],
html[data-wecare-theme="dark"] [class*="s-block--"] .container,
html[data-wecare-theme="dark"] [class*="banner"]:not(img),
html[data-wecare-theme="dark"] .swiper,
html[data-wecare-theme="dark"] .swiper-slide,
html[data-wecare-theme="dark"] salla-slider {
  background-color: transparent !important;
}

/* ---------- العناصر البيضاء والرمادية الفاتحة (بدون الطبقات الشفافة) ---------- */
html[data-wecare-theme="dark"] .bg-white:not(.inset-0),
html[data-wecare-theme="dark"] .bg-gray-50:not(.inset-0),
html[data-wecare-theme="dark"] .bg-gray-100:not(.inset-0),
html[data-wecare-theme="dark"] .bg-gray-200:not(.inset-0),
html[data-wecare-theme="dark"] .bg-light:not(.inset-0),
html[data-wecare-theme="dark"] .s-product-card-entry,
html[data-wecare-theme="dark"] .sub-menu,
html[data-wecare-theme="dark"] .dropdown-menu {
  background-color: #172943 !important;
}

/* ---------- النصوص الغامقة تصير فاتحة ---------- */
html[data-wecare-theme="dark"] .text-gray-500,
html[data-wecare-theme="dark"] .text-gray-600,
html[data-wecare-theme="dark"] .text-gray-700,
html[data-wecare-theme="dark"] .text-gray-800,
html[data-wecare-theme="dark"] .text-gray-900,
html[data-wecare-theme="dark"] .text-black,
html[data-wecare-theme="dark"] .text-dark,
html[data-wecare-theme="dark"] .s-product-card-content-title,
html[data-wecare-theme="dark"] .s-product-card-content-title a,
html[data-wecare-theme="dark"] article p,
html[data-wecare-theme="dark"] .prose * {
  color: #e8edf5 !important;
}

/* ---------- الحدود ---------- */
html[data-wecare-theme="dark"] .border-gray-100,
html[data-wecare-theme="dark"] .border-gray-200,
html[data-wecare-theme="dark"] .border-gray-300 {
  border-color: #34445c !important;
}

/* ---------- حقول الإدخال والبحث ---------- */
html[data-wecare-theme="dark"] input,
html[data-wecare-theme="dark"] textarea,
html[data-wecare-theme="dark"] select {
  background-color: #202e43 !important;
  color: #ffffff !important;
  border-color: #40516a !important;
}
html[data-wecare-theme="dark"] input::placeholder,
html[data-wecare-theme="dark"] textarea::placeholder {
  color: #aab6c7 !important;
}
html[data-wecare-theme="dark"] input:focus,
html[data-wecare-theme="dark"] textarea:focus,
html[data-wecare-theme="dark"] select:focus {
  outline: none;
  border-color: #f47721 !important;
  box-shadow: 0 0 0 3px rgba(244, 119, 33, .25);
}

/* =========================================================
   القوائم والتصنيفات
   ========================================================= */

/* قائمة الجوال */
html[data-wecare-theme="dark"] nav#mobile-menu,
html[data-wecare-theme="dark"] #mobile-menu .sub-menu,
html[data-wecare-theme="dark"] #mobile-menu li > ul,
html[data-wecare-theme="dark"] #mobile-menu li > div,
html[data-wecare-theme="dark"] .mm-ocd__content,
html[data-wecare-theme="dark"] .mm-spn,
html[data-wecare-theme="dark"] .mm-spn ul {
  background-color: #172943 !important;
  color: #e8edf5 !important;
  border-color: #34445c !important;
}

html[data-wecare-theme="dark"] #mobile-menu a,
html[data-wecare-theme="dark"] #mobile-menu li,
html[data-wecare-theme="dark"] #mobile-menu span,
html[data-wecare-theme="dark"] .mm-spn a,
html[data-wecare-theme="dark"] .mm-spn li {
  color: #e8edf5 !important;
  border-color: #34445c !important;
  opacity: 1 !important;
}

html[data-wecare-theme="dark"] #mobile-menu a:hover,
html[data-wecare-theme="dark"] .mm-spn a:hover {
  background-color: #263750 !important;
  color: #f47721 !important;
}

/* القوائم المنسدلة (كمبيوتر) */
html[data-wecare-theme="dark"] header .sub-menu,
html[data-wecare-theme="dark"] header .sub-menu > ul,
html[data-wecare-theme="dark"] header .dropdown-menu {
  background-color: #172943 !important;
  border-color: rgba(255, 255, 255, .08) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45) !important;
}

html[data-wecare-theme="dark"] header .sub-menu a,
html[data-wecare-theme="dark"] header .dropdown-menu a {
  color: #e8edf5 !important;
}

html[data-wecare-theme="dark"] header .sub-menu a:hover,
html[data-wecare-theme="dark"] header .dropdown-menu a:hover {
  color: #f47721 !important;
}

/* =========================================================
   المنتجات والأسعار والأزرار
   ========================================================= */

/* السعر الحالي: أبيض */
html[data-wecare-theme="dark"] .s-product-card-price,
html[data-wecare-theme="dark"] .s-product-card-price span {
  color: #ffffff !important;
}

/* السعر السابق: برتقالي ومشطوب */
html[data-wecare-theme="dark"] .s-product-card-entry del,
html[data-wecare-theme="dark"] .s-product-card-entry s,
html[data-wecare-theme="dark"] [class*="regular-price"] {
  color: #f47721 !important;
  text-decoration: line-through !important;
  text-decoration-color: #f47721 !important;
}

/* زر أضف إلى السلة: برتقالي */
html[data-wecare-theme="dark"] .s-product-card-add-to-cart button:not(:disabled),
html[data-wecare-theme="dark"] .s-product-card-add-to-cart .s-button-element:not(:disabled),
html[data-wecare-theme="dark"] salla-add-product-button .s-button-element:not(:disabled),
html[data-wecare-theme="dark"] .s-add-to-cart-form .s-button-element:not(:disabled) {
  background-color: #f47721 !important;
  color: #ffffff !important;
  border-color: #f47721 !important;
}

html[data-wecare-theme="dark"] .s-product-card-add-to-cart button:not(:disabled) *,
html[data-wecare-theme="dark"] .s-product-card-add-to-cart .s-button-element:not(:disabled) *,
html[data-wecare-theme="dark"] salla-add-product-button .s-button-element:not(:disabled) * {
  color: #ffffff !important;
  fill: #ffffff !important;
}

html[data-wecare-theme="dark"] .s-product-card-add-to-cart .s-button-element:not(:disabled):hover,
html[data-wecare-theme="dark"] salla-add-product-button .s-button-element:not(:disabled):hover {
  background-color: #e86616 !important;
  border-color: #e86616 !important;
}

/* بطاقات المنتجات: ظل ولمسة برتقالية عند المرور */
html[data-wecare-theme="dark"] .s-product-card-entry {
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
  transition: transform .35s ease, box-shadow .35s ease;
}
@media (hover: hover) {
  html[data-wecare-theme="dark"] .s-product-card-entry:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .45), 0 0 0 1px rgba(244, 119, 33, .45);
  }
}

/* =========================================================
   أشياء متفرقة
   ========================================================= */

/* أيقونة الحساب */
html[data-wecare-theme="dark"] .s-user-menu-trigger {
  background-color: #263750 !important;
  color: #ffffff !important;
  border-color: #40516a !important;
}
html[data-wecare-theme="dark"] .s-user-menu-trigger svg,
html[data-wecare-theme="dark"] .s-user-menu-trigger i {
  color: #ffffff !important;
  fill: #ffffff !important;
}

/* إعلانات سلة العمودية */
html[data-wecare-theme="dark"] salla-vertical-ads,
html[data-wecare-theme="dark"] salla-vertical-ads .section-container {
  background-color: #17243a !important;
  color: #e8edf5 !important;
}

/* الشريط السفلي (جوال): واضح في الداكن */
html[data-wecare-theme="dark"] .wc-bottom-bar {
  border-top: 1px solid #3a5174 !important;
}
html[data-wecare-theme="dark"] .wc-bottom-bar > *,
html[data-wecare-theme="dark"] .wc-bottom-bar [class*="rounded"] {
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .45), 0 0 0 1px #3a5174 !important;
}
html[data-wecare-theme="dark"] .wc-bottom-bar a,
html[data-wecare-theme="dark"] .wc-bottom-bar span,
html[data-wecare-theme="dark"] .wc-bottom-bar i,
html[data-wecare-theme="dark"] .wc-bottom-bar svg {
  color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
}
html[data-wecare-theme="dark"] .wc-bottom-bar svg [stroke]:not([stroke="none"]) {
  stroke: #ffffff !important;
}
html[data-wecare-theme="dark"] .wc-bottom-bar svg [fill]:not([fill="none"]) {
  fill: #ffffff !important;
}
html[data-wecare-theme="dark"] .wc-bottom-bar img:not([src*="logo"]) {
  filter: brightness(0) invert(1) !important;
}

/* الفوتر: خط برتقالي */
html[data-wecare-theme="dark"] footer {
  border-top: 2px solid #f47721;
}

/* تحديد النص */
html[data-wecare-theme="dark"] ::selection {
  background: #f47721;
  color: #ffffff;
}

/* =========================================================
   زر الوضع الداكن
   ========================================================= */
#wecare-theme-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  padding: 0 !important;
  margin-inline: 6px !important;
  border-radius: 50% !important;
  border: 1px solid #dddddd !important;
  background: #ffffff !important;
  font-size: 18px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  z-index: 50 !important;
}
html[data-wecare-theme="dark"] #wecare-theme-toggle {
  background-color: #263750 !important;
  border-color: #40516a !important;
}

/* انتقال ناعم */
html[data-wecare-theme] body,
html[data-wecare-theme] header,
html[data-wecare-theme] footer {
  transition: background-color .3s ease, color .3s ease;
}