/* Add custom Js styles below */ document.addEventListener("DOMContentLoaded", function () { /* =============================== STYLE =============================== */ const style = document.createElement("style"); style.innerHTML = ` .branches-section { padding: 80px 20px; background: #ffffff; direction: rtl; text-align: center; } .branches-title { font-size: 28px; font-weight: 800; margin-bottom: 45px; color: #000; } .branches-grid { max-width: 1200px; margin: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; } .branch-card { display: block; background: #000; border-radius: 18px; padding: 28px 22px; text-decoration: none; box-shadow: 0 15px 35px rgba(0,0,0,0.25); transition: all 0.35s ease; position: relative; overflow: hidden; cursor: pointer; } .branch-card::after { content: ""; position: absolute; inset: 0; border: 2px solid #E6BC71; border-radius: 18px; opacity: 0.6; pointer-events: none; } .branch-card:hover { transform: translateY(-10px) scale(1.05); box-shadow: 0 25px 55px rgba(0,0,0,0.45); } .branch-city { font-size: 22px; font-weight: 800; margin-bottom: 14px; color: #E6BC71; } .branch-list { font-size: 15px; font-weight: 600; color: #ffffff; line-height: 1.8; } .branch-list span { display: block; } @media (max-width: 992px) { .branches-grid { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 480px) { .branches-grid { grid-template-columns: 1fr; } } `; document.head.appendChild(style); /* =============================== HTML =============================== */ const branchesSection = document.createElement("section"); branchesSection.className = "branches-section"; branchesSection.innerHTML = `

فروعنا

الطائف
الواحة بلازا
الباحة
الباحة مول
خميس مشيط
موجان
أبها
أبها بلازا الراشد مول لافندا بارك
جيزان
الراشد مول الكادي مول
الرياض
حياة مول
مكة
مكة مول
سراة عبيدة
الواحة مول
`; /* =============================== INSERT BEFORE FEATURES =============================== */ const observer = new MutationObserver(function () { const featuresSection = document.querySelector(".features-section"); if (featuresSection && !document.querySelector(".branches-section")) { featuresSection.parentNode.insertBefore(branchesSection, featuresSection); observer.disconnect(); } }); observer.observe(document.body, { childList: true, subtree: true }); }); document.addEventListener("DOMContentLoaded", function () { // إنشاء السكشن بالكامل const section = document.createElement("section"); section.className = "features-section"; section.innerHTML = `

مميزات متجرنا

شحن سريع

سرعة وصول منتجاتكم هي أولويتنا

تسوق آمن

نضمن لكم تسوقًا محميًا وآمنًا

خيارات دفع متعددة

اختاروا من بين طرق الدفع لدينا

جودة عالية

أفضل جودة من خامات مختارة

`; // إدخال السكشن قبل الفوتر مباشرة const footer = document.querySelector("footer"); if (footer) { footer.parentNode.insertBefore(section, footer); } }); document.addEventListener("DOMContentLoaded", function () { const section = document.createElement("section"); section.className = "reviews-section"; const footer = document.querySelector("footer"); if (footer) { footer.parentNode.insertBefore(section, footer); } }); document.addEventListener("DOMContentLoaded", function () { const targetSection = document.querySelector( ".s-block.s-block--fixed-banner.wide-placeholder" ); if (!targetSection) return; const section = document.createElement("section"); section.className = "category-cards"; section.innerHTML = ` طرح نقاب عبايات `; targetSection.insertAdjacentElement("afterend", section); }); document.addEventListener("DOMContentLoaded", function () { // منع التكرار if (document.querySelector(".custom-footer")) return; const footer = document.createElement("div"); footer.className = "custom-footer"; footer.innerHTML = ` `; document.body.insertAdjacentElement("beforeend", footer); }); function fixFirstBannerOffset() { const header = document.querySelector(".store-header"); const firstBanner = document.querySelector( ".s-block.s-block--fixed-banner.wide-placeholder" ); if (!header || !firstBanner) return; const headerHeight = header.getBoundingClientRect().height; const isMobile = window.innerWidth <= 768; let offset; if (isMobile) { offset = headerHeight + 10; // موبايل: كامل الهيدر + أمان } else { offset = headerHeight + 15; // ديسكتوب } firstBanner.style.marginTop = offset + "px"; } /* أول تحميل */ document.addEventListener("DOMContentLoaded", function () { fixFirstBannerOffset(); /* إعادة الحساب بعد استقرار الصفحة */ setTimeout(fixFirstBannerOffset, 300); setTimeout(fixFirstBannerOffset, 800); }); /* عند تغيير المقاس أو تدوير الجوال */ window.addEventListener("resize", fixFirstBannerOffset);