/* الخلفية الرئيسية */
body,
main,
.page-wrapper,
.app-inner,
section {
  background-color: #FAF7F1 !important;
}
.product-entry,
.product-card,
.card,
.s-block {
  background-color: #FFFDF9;
}

/* النصوص الرئيسية في الهيدر والقائمة */
.store-header,
.store-header a,
.main-menu a,
.navbar a,
.menu-item,
.nav-link {
  color: #1F2F2A !important;
}

/* الأيقونات العامة */
.store-header svg,
.store-header i,
.main-menu svg,
.navbar svg {
  color: #1F2F2A !important;
  fill: currentColor !important;
  stroke: currentColor !important;
}

/* أيقونة البحث */
.search-btn,
.search-icon,
button[aria-label*="بحث"],
button[aria-label*="Search"] {
  color: #1F2F2A !important;
}

/* أيقونات البحث إذا كانت SVG */
.search-btn svg,
.search-icon svg,
button[aria-label*="بحث"] svg,
button[aria-label*="Search"] svg {
  stroke: #1F2F2A !important;
  fill: none !important;
}

/* عند المرور بالماوس */
.store-header a:hover,
.main-menu a:hover,
.navbar a:hover,
.search-btn:hover,
.search-icon:hover {
  color: #A67C50 !important;
}

/* العنصر النشط */
.store-header a.active,
.main-menu a.active,
.navbar a.active {
  color: #A67C50 !important;
}

/* خلفية الهيدر الرئيسية */
header,
header .container,
header .inner,
header .navbar,
header .main-header,
header .header-inner,
header .flex.items-stretch.justify-between.relative {
  background-color: #FAF7F1 !important;
}
/* =========================
   SARAYA FEATURES SECTION
   ========================= */
   SARAYA - FEATURES 3 COLUMNS
   ===================================== */

/* خلفية القسم بنفس خلفية المتجر */
.s-block--features,
.s-block--features .container {
  background-color: #FAF7F1 !important;
}

/* فرض 3 أعمدة على الكمبيوتر والجوال */
.s-block--features .grid,
.s-block--features [class*="grid-cols-"] {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 24px !important;
  align-items: start !important;
}

/* كل ميزة */
.s-block--features__item {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  grid-column: auto !important;
  text-align: center !important;
  background: transparent !important;
  padding: 20px 10px !important;
}

/* الأيقونة */
.s-block--features__item .feature-icon {
  margin: 0 auto 14px !important;
}

/* العنوان */
.s-block--features__item h2 {
  margin: 0 0 10px !important;
  color: #1F2F2A !important;
  font-weight: 700 !important;
}

/* وصف الميزة */
.s-block--features__item p {
  width: 100% !important;
  max-width: 280px !important;
  margin: 0 auto !important;
  text-align: center !important;
  line-height: 1.7 !important;
}


/* =========================
   MOBILE
   ========================= */

@media (max-width: 767px) {

  .s-block--features .grid,
  .s-block--features [class*="grid-cols-"] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .s-block--features__item {
    padding: 12px 3px !important;
  }

  .s-block--features__item .feature-icon {
    transform: scale(0.78);
    margin-bottom: 7px !important;
  }

  .s-block--features__item h2 {
    font-size: 14px !important;
    margin-bottom: 6px !important;
  }

  .s-block--features__item p {
    max-width: 115px !important;
    font-size: 10px !important;
    line-height: 1.55 !important;
  }
}


/* شاشات الجوال الصغيرة جدًا */
@media (max-width: 380px) {

  .s-block--features__item h2 {
    font-size: 13px !important;
  }

  .s-block--features__item p {
    font-size: 9px !important;
    line-height: 1.5 !important;
  }
}
/* =========================
   MOBILE
   ========================= */

@media (max-width: 767px) {

  .s-block--features .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .s-block--features__item {
    padding: 14px 4px !important;
  }

  .s-block--features__item .feature-icon {
    margin-bottom: 8px !important;
    transform: scale(0.85);
  }

  .s-block--features__item h2 {
    font-size: 15px !important;
    margin-bottom: 5px !important;
  }

  .s-block--features__item p {
    font-size: 11px !important;
    line-height: 1.55 !important;
  }
}
/* =========================
   SARAYA GLOBAL BACKGROUNDS
   ========================= */

:root {
  --saraya-bg: #FAF7F1;
}

/* الخلفية العامة */
html,
body,
main,
.app-inner,
.page-wrapper,
.store-content,
.content,
section {
  background-color: var(--saraya-bg) !important;
}

/* بطاقات المنتجات ومحتواها */
.s-product-card-entry,
.s-product-card-content,
.s-product-card-content-main,
.s-product-card-content-sub,
.s-product-card-content-footer,
.product-card,
.product-entry {
  background-color: var(--saraya-bg) !important;
}


/* إزالة أي أبيض موروث داخل بطاقات المنتجات */
.s-product-card-entry *,
.s-product-card-content * {
  background-color: transparent;
}
.s-block--features__item p {
  max-width: 205px !important;
  margin: 0 auto !important;
}
/* =====================================
   SARAYA — FEATURES SECTION FINAL FIX
   ===================================== */

/* إجبار المزايا الثلاث على صف واحد */
.s-block--features .grid.grid-cols-\[repeat\(2\,minmax\(0\,1fr\)\)\] {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 24px !important;
}

/* جميع العناصر */
.s-block--features__item {
    width: 100% !important;
    min-width: 0 !important;
    text-align: center !important;
    background: transparent !important;
}

/* توحيد عرض النصوص */
.s-block--features__item p {
    width: 100% !important;
    max-width: 330px !important;
    margin: 0 auto !important;
    line-height: 1.8 !important;
    text-align: center !important;
}

/* الجودة تحديدًا — نجعل النص أضيق ليظهر في 3 أسطر */
.s-block--features__item:nth-child(1) p {
    max-width: 300px !important;
}

/* الجوال */
@media (max-width: 767px) {

    .s-block--features .grid.grid-cols-\[repeat\(2\,minmax\(0\,1fr\)\)\] {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .s-block--features__item {
        padding: 10px 3px !important;
    }

    .s-block--features__item h2 {
        font-size: 15px !important;
    }

    .s-block--features__item p {
        max-width: 110px !important;
        font-size: 10px !important;
        line-height: 1.6 !important;
    }
}
/* أيقونات المزايا — خلفية خضراء وأيقونة بيضاء */
.feature-icon {
  background: #0E5A4A !important;
  background-color: #0E5A4A !important;
  border-color: #0E5A4A !important;
}

/* رسم الأيقونة */
.feature-icon i,
.feature-icon i::before,
.feature-icon svg,
.feature-icon svg path {
  color: #FFFFFF !important;
  fill: #FFFFFF !important;
  stroke: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}
/* ========================
/* =========================================
   SARAYA FOOTER — FINAL
   ========================================= */

/* الفوتر بالكامل + الشريط السفلي */
footer.store-footer,
footer.store-footer .store-footer__inner,
footer.store-footer > .container.text-center {
  background: #123D35 !important;
  background-color: #123D35 !important;
  background-image: none !important;
}

/* إزالة أي خلفيات داخلية */
footer.store-footer .store-footer__inner > .container,
footer.store-footer .store-footer__inner > .container > div,
footer.store-footer salla-menu,
footer.store-footer salla-contacts,
footer.store-footer salla-social,
footer.store-footer salla-apps-icons,
footer.store-footer .s-menu-footer-list,
footer.store-footer .s-contacts-list {
  background: transparent !important;
  background-color: transparent !important;
}

/* =========================
   النصوص
   ========================= */

footer.store-footer h3 {
  color: #FAF7F1 !important;
}

footer.store-footer p,
footer.store-footer a,
footer.store-footer span,
footer.store-footer b,
footer.store-footer .s-menu-footer-item,
footer.store-footer .s-contacts-item {
  color: #FAF7F1 !important;
}

/* النص الثانوي */
footer.store-footer .copyright-text p {
  color: rgba(250,247,241,.72) !important;
}

/* الروابط عند المرور */
footer.store-footer a:hover,
footer.store-footer .s-menu-footer-item:hover {
  color: #A67C50 !important;
}

/* =========================
   الأيقونات
   ========================= */

footer.store-footer .s-social-icon svg path,
footer.store-footer .s-contacts-icon svg path {
  fill: #FAF7F1 !important;
}

/* دوائر التواصل */
footer.store-footer .s-contacts-icon {
  color: #FAF7F1 !important;
  border-color: rgba(250,247,241,.28) !important;
  background: rgba(250,247,241,.06) !important;
}

/* =========================
   السجل التجاري
   ========================= */

footer.store-footer .s-trust-badges-label,
footer.store-footer .s-trust-badges-number {
  color: #FAF7F1 !important;
}

/* =========================
   MOBILE — تجميع الفوتر
   ========================= */

@media (max-width: 767px) {

  footer.store-footer .store-footer__inner > .container {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 24px 14px !important;
    align-items: start !important;
  }

  /* بيانات سرايا والسجل بعرض كامل */
  footer.store-footer .store-footer__inner > .container > div:first-child {
    grid-column: 1 / -1 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* روابط مهمة */
  footer.store-footer .store-footer__inner > .container > div:nth-child(2) {
    grid-column: 1 !important;
    padding: 0 !important;
  }

  /* تواصل معنا */
  footer.store-footer .store-footer__inner > .container > div:nth-child(3) {
    grid-column: 2 !important;
    padding: 0 !important;
  }

  /* التطبيقات إن ظهرت */
  footer.store-footer .store-footer__inner > .container > salla-apps-icons {
    grid-column: 1 / -1 !important;
  }

  /* تقليل المسافات */
  footer.store-footer .s-menu-footer-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
  }

  footer.store-footer .s-menu-footer-item {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
  }

  footer.store-footer .s-contacts-item {
    font-size: 11px !important;
    gap: 6px !important;
    min-width: 0 !important;
  }

  footer.store-footer .s-contacts-item .unicode {
    font-size: 10px !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  footer.store-footer h3 {
    font-size: 16px !important;
    margin-bottom: 10px !important;
  }

  /* الشريط السفلي: الحقوق + الدفع */
  footer.store-footer > .container.text-center {
    padding-top: 16px !important;
    padding-bottom: 20px !important;
    border-top: 1px solid rgba(250,247,241,.12);
  }
}
/* =========================================
   SARAYA FOOTER — TIKTOK POSITION
   Mobile
   ========================================= */

@media (max-width: 767px) {

  /* القسم الأول من الفوتر:
     بيانات سرايا يمين + تيك توك يسار */
  footer.store-footer
  .store-footer__inner > .container > div:first-child {
    display: grid !important;
    grid-template-columns: 100px minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    column-gap: 18px !important;
    align-items: center !important;
  }

  /* اسم سرايا */
  footer.store-footer
  .store-footer__inner > .container > div:first-child > a {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  /* الوصف */
  footer.store-footer
  .store-footer__inner > .container > div:first-child > .max-w-sm {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }

  /* السجل التجاري */
  footer.store-footer
  .store-footer__inner > .container > div:first-child > .flex.gap-4 {
    grid-column: 2 !important;
    grid-row: 3 !important;
  }

  /* إظهار تيك توك الموجود أصلًا في هذا القسم على الجوال */
  footer.store-footer
  .store-footer__inner > .container > div:first-child > .hidden {
    display: flex !important;
    grid-column: 1 !important;
    grid-row: 1 / 4 !important;

    align-self: center !important;
    justify-self: center !important;

    margin: 0 !important;
  }

  /* قائمة السوشال */
  footer.store-footer
  [data-testid="store-footer-social"] .s-social-list {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  /* زر تيك توك الكبير */
  footer.store-footer
  [data-testid="store-footer-social"] .s-social-link a {
    width: 82px !important;
    height: 82px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border-radius: 50% !important;

    background: rgba(250, 247, 241, 0.08) !important;
    border: 1px solid rgba(250, 247, 241, 0.22) !important;

    margin: 0 !important;
  }

  /* تكبير شعار تيك توك نفسه */
  footer.store-footer
  [data-testid="store-footer-social"] .s-social-icon svg {
    width: 48px !important;
    height: 48px !important;
  }

  footer.store-footer
  [data-testid="store-footer-social"] .s-social-icon svg path {
    fill: #FAF7F1 !important;
  }

  /* حذف نسخة تيك توك الثانية من تحت "تواصل معنا" */
  footer.store-footer .contact-social {
    display: none !important;
  }
}
@media (max-width: 767px) {

  /* تيك توك في نفس صف السجل التجاري */
  footer.store-footer
  .store-footer__inner > .container > div:first-child > .hidden {
    grid-column: 1 !important;
    grid-row: 3 !important;

    align-self: center !important;
    justify-self: center !important;

    margin: 0 !important;
    padding: 0 !important;
  }

  /* نفس حجم أيقونة السجل التجاري */
  footer.store-footer
  [data-testid="store-footer-social"] .s-social-link a {
    width: 55px !important;
    height: 55px !important;
    min-width: 55px !important;
    min-height: 55px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border-radius: 50% !important;
    margin: 0 !important;
  }

  /* حجم شعار تيك توك داخل الدائرة */
  footer.store-footer
  [data-testid="store-footer-social"] .s-social-icon svg {
    width: 28px !important;
    height: 28px !important;
  }
}
(function () {
  const whatsappNumber = '966501905551';
  const displayNumber = '+966501905551';

  function addWhatsAppContact() {
    const contactsList = document.querySelector(
      '[data-testid="store-footer-contacts"] .s-contacts-list'
    );

    if (!contactsList) return false;

    /* منع التكرار */
    if (document.querySelector('.saraya-whatsapp-contact')) {
      return true;
    }

    const wrapper = document.createElement('div');
    wrapper.id = 'contact-slot';
    wrapper.className = 'saraya-whatsapp-contact';

    wrapper.innerHTML = `
      <a
        href="https://wa.me/${whatsappNumber}"
        target="_blank"
        rel="noopener"
        class="s-contacts-item saraya-whatsapp-link"
        aria-label="تواصل معنا عبر واتساب"
      >
        <span class="s-contacts-icon saraya-whatsapp-icon">
          <svg
            xmlns="http://www.w3.org/2000/svg"
            width="32"
            height="32"
            viewBox="0 0 24 24"
            aria-hidden="true"
          >
            <path d="M12.04 2C6.52 2 2.05 6.45 2.05 11.94c0 1.75.46 3.46 1.33 4.97L2 22l5.22-1.37a10.02 10.02 0 0 0 4.81 1.23h.01c5.51 0 9.99-4.45 9.99-9.94C22.03 6.45 17.55 2 12.04 2Zm5.83 14.05c-.25.7-1.46 1.34-2.01 1.42-.51.08-1.16.11-1.87-.12-.43-.14-.98-.32-1.69-.62-2.97-1.28-4.9-4.26-5.05-4.46-.15-.2-1.21-1.61-1.21-3.07 0-1.46.77-2.18 1.04-2.48.27-.3.59-.37.79-.37h.57c.18 0 .43-.07.67.51.25.6.84 2.05.91 2.2.08.15.13.33.03.53-.1.2-.15.33-.3.51-.15.18-.32.4-.46.54-.15.15-.3.31-.13.61.18.3.78 1.28 1.67 2.07 1.15 1.02 2.12 1.34 2.42 1.49.3.15.48.13.66-.08.18-.2.76-.89.96-1.19.2-.3.4-.25.67-.15.27.1 1.72.81 2.02.96.3.15.5.23.57.35.08.13.08.73-.17 1.43Z"/>
          </svg>
        </span>

        <span class="unicode">${displayNumber}</span>
      </a>
    `;

    contactsList.appendChild(wrapper);

    return true;
  }

  /* سلة قد تحمل المكونات بعد تحميل الصفحة */
  let tries = 0;

  const timer = setInterval(() => {
    tries++;

    if (addWhatsAppContact() || tries >= 20) {
      clearInterval(timer);
    }
  }, 500);
})();