/* ===================================================
FLORIFT — Custom JS (نهائي v5)
=================================================== */
/* ──────────────────────────────────────────────────
1. ديسكتوب — هيدر (كل الصفحات)
────────────────────────────────────────────────── */
(function () {
var ID = "florift-desktop-header";
if (window.innerWidth < 992) return;
if (document.getElementById(ID)) return;
var style = document.createElement("style");
style.innerHTML = `
@media (min-width:992px){
body{ margin:0; font-family:'Cairo',sans-serif !important; }
header,.header,.main-header,.top-navbar,.site-header,
.navbar,.nav-wrapper,.header-wrapper,.store-header,.s-header,
.s-search,.search-wrapper,.search-bar,.search-input-wrapper,
footer,.s-footer,.store-footer,.main-footer{ display:none !important; }
#${ID} *{ box-sizing:border-box; }
#${ID} a{ text-decoration:none; color:inherit; }
#${ID} .container{ width:min(1240px,calc(100% - 32px)); margin:0 auto; }
#${ID} .florift-topbar{ background:rgba(255,255,255,.95);border-bottom:1px solid rgba(107,31,43,.08);backdrop-filter:blur(14px);position:sticky;top:0;z-index:9999;box-shadow:0 10px 30px rgba(0,0,0,.03); }
#${ID} .florift-topbar-inner{ min-height:88px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:18px; }
#${ID} .florift-topbar-right,#${ID} .florift-topbar-left{ display:flex;align-items:center;gap:18px; }
#${ID} .florift-topbar-right{ justify-content:flex-start; }
#${ID} .florift-topbar-left{ justify-content:flex-end; }
#${ID} nav{ display:flex;align-items:center;gap:28px;flex-wrap:wrap; }
#${ID} nav a{ color:#2b1a1e;font-weight:700;font-size:1.04rem;position:relative;transition:.25s ease; }
#${ID} nav a::after{ content:'';position:absolute;bottom:-12px;right:0;width:0;height:2px;background:#6b1f2b;border-radius:999px;transition:.25s ease; }
#${ID} nav a:hover,#${ID} nav a.active{ color:#6b1f2b; }
#${ID} nav a:hover::after,#${ID} nav a.active::after{ width:100%; }
#${ID} .florift-brand{ display:flex;align-items:center;justify-content:center; }
#${ID} .florift-brand img{ height:85px;object-fit:contain;display:block;transition:all .3s ease; }
#${ID} .florift-brand img:hover{ transform:scale(1.05); }
#${ID} .florift-search-mini{ background:#fff;border:1px solid #eadbdd;border-radius:999px;padding:12px 18px;min-width:180px;color:#7a5a60;font-weight:500;cursor:pointer; }
#${ID} .florift-actions{ display:flex;align-items:center;gap:10px; }
#${ID} .florift-icon-btn{ width:44px;height:44px;border-radius:50%;background:#fff;border:1px solid #eadbdd;display:grid;place-items:center;font-size:1rem;text-decoration:none;color:inherit;transition:.2s; }
#${ID} .florift-icon-btn:hover{ background:#fdf1f4;border-color:#d4a0aa; }
}
`;
document.head.appendChild(style);
var div = document.createElement("div");
div.id = ID;
div.innerHTML = `
🔍 ابحث عن باقة أو هدية...
`;
document.body.prepend(div);
var path = window.location.pathname;
div.querySelectorAll("nav a").forEach(function (a) {
if (a.getAttribute("href") === path) a.classList.add("active");
});
var st = document.getElementById("florift-search-trigger");
if (st) st.addEventListener("click", function () {
var s = document.querySelector('[data-role="search-btn"],.s-search-btn,[data-open="search"]');
if (s) s.click(); else window.location.href = "/search";
});
})();
/* ──────────────────────────────────────────────────
2. ديسكتوب — هيرو (الرئيسية فقط)
────────────────────────────────────────────────── */
(function () {
var ID = "florift-desktop-home";
if (window.innerWidth < 992) return;
if (document.getElementById(ID)) return;
var path = window.location.pathname;
if (path !== "/" && path !== "/index" && path !== "") return;
var style = document.createElement("style");
style.innerHTML = `
@media (min-width:992px){
body{ background:radial-gradient(circle at top right,rgba(243,230,232,.8) 0,transparent 20%),radial-gradient(circle at bottom left,rgba(239,227,215,.35) 0,transparent 25%),linear-gradient(180deg,#fff,#faf7f7) !important; }
#${ID} *{ box-sizing:border-box; }
#${ID} a{ text-decoration:none; color:inherit; }
#${ID} .container{ width:min(1240px,calc(100% - 32px));margin:0 auto; }
#${ID} .florift-hero{ padding:28px 0 20px; }
#${ID} .florift-hero-wrap{ display:grid;grid-template-columns:1.02fr .98fr;align-items:stretch;background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(255,247,249,.94));border:1px solid rgba(107,31,43,.08);border-radius:36px;overflow:hidden;box-shadow:0 18px 50px rgba(107,31,43,.08); }
#${ID} .florift-hero-copy{ padding:64px 52px;display:flex;flex-direction:column;justify-content:center; }
#${ID} .florift-eyebrow{ display:inline-flex;width:fit-content;gap:8px;align-items:center;background:linear-gradient(135deg,#fff,#fdf1f4);border:1px solid #eadbdd;color:#6b1f2b;padding:9px 16px;border-radius:999px;font-weight:700;margin-bottom:20px; }
#${ID} .florift-hero-copy h1{ font-size:clamp(2.5rem,4.5vw,4.6rem);line-height:1.05;margin:0 0 18px;color:#2b1a1e;transition:opacity .25s ease; }
#${ID} .florift-hero-copy p{ font-size:1.12rem;color:#7a5a60;line-height:2;margin:0 0 28px;max-width:580px; }
#${ID} .florift-hero-buttons{ display:flex;gap:12px;flex-wrap:wrap;margin-bottom:28px; }
#${ID} .florift-main-btn,#${ID} .florift-ghost-btn{ border:none;cursor:pointer;font-family:inherit;transition:.25s ease;display:inline-flex;align-items:center;justify-content:center;text-decoration:none; }
#${ID} .florift-main-btn{ background:linear-gradient(135deg,#6b1f2b,#4e141d);color:#fff;padding:14px 24px;border-radius:999px;font-weight:800;box-shadow:0 12px 30px rgba(107,31,43,.15); }
#${ID} .florift-ghost-btn{ background:#fff;border:1px solid #eadbdd;color:#6b1f2b;padding:13px 20px;border-radius:999px;font-weight:800; }
#${ID} .florift-main-btn:hover,#${ID} .florift-ghost-btn:hover{ transform:translateY(-2px); }
#${ID} .florift-hero-stats{ display:grid;grid-template-columns:repeat(3,1fr);gap:14px;max-width:620px; }
#${ID} .florift-hero-stat{ background:rgba(255,255,255,.88);border:1px solid #eadbdd;border-radius:20px;padding:18px 16px; }
#${ID} .florift-hero-stat strong{ display:block;color:#4e141d;font-size:1.15rem;margin-bottom:6px; }
#${ID} .florift-hero-stat span{ color:#7a5a60;font-size:.94rem;line-height:1.7; }
#${ID} .florift-hero-visual{ min-height:620px;background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.12)),url('https://media.zid.store/911df518-6a68-460b-b134-7eece54ca035/5a2e5de3-26d4-4766-a1ae-2b984c1aed17.jpg') center/cover;position:relative; }
#${ID} .florift-hero-card{ position:absolute;left:28px;bottom:28px;background:rgba(255,255,255,.94);border:1px solid rgba(255,255,255,.8);border-radius:24px;padding:20px 20px 16px;min-width:280px; }
#${ID} .florift-hero-card strong{ display:block;font-size:1.12rem;margin-bottom:6px;color:#2b1a1e; }
#${ID} .florift-hero-card span{ color:#7a5a60;font-size:.97rem;line-height:1.8; }
}
`;
document.head.appendChild(style);
var div = document.createElement("div");
div.id = ID;
div.innerHTML = `
أجمل تنسيقات الورد الفاخرة في مكان واحد
ورد فاخر
في فلوريفت نقدم تنسيقات ورد فاخرة مصممة بعناية لتناسب أجمل المناسبات.
توصيل اليومورد طازج يصل بسرعة ليصنع مفاجأة جميلة.
تغليف فاخرتغليف أنيق يضيف لمسة فخامة لكل هدية.
هدايا مميزةأضف شوكولاتة أو دبدوب ليصبح الورد هدية كاملة.
فلوريفت — تجربة ورد فاخرة
تنسيقات أنيقة • طلب سريع • هدية تبقى في الذاكرة
`;
var header = document.getElementById("florift-desktop-header");
header ? header.insertAdjacentElement("afterend", div) : document.body.prepend(div);
var titles = ["ورد فاخر","حب جميل","لحظة جميلة","هدية فاخرة","تنسيق فاخر"];
var i = 0;
var el = document.getElementById("floriftHeroTitle");
if (el) setInterval(function () {
i = (i + 1) % titles.length;
el.style.opacity = 0;
setTimeout(function () { el.textContent = titles[i]; el.style.opacity = 1; }, 250);
}, 2500);
})();
/* ──────────────────────────────────────────────────
3-5. ديسكتوب — step-2 / step-4 / step-5
────────────────────────────────────────────────── */
(function () {
var SECTION_ID = "florift-desktop-step-2";
if (window.innerWidth < 992) return;
if (document.getElementById(SECTION_ID)) return;
var _p = window.location.pathname;
if (_p !== "/" && _p !== "/index" && _p !== "") return;
function addStyle() {
if (document.getElementById("florift-step-2-style")) return;
var s = document.createElement("style"); s.id = "florift-step-2-style";
s.innerHTML = `@media (min-width:992px){#${SECTION_ID}{direction:rtl;width:min(1240px,calc(100% - 32px));margin:0 auto 36px;font-family:'Cairo',sans-serif;}#${SECTION_ID} *{box-sizing:border-box;}#${SECTION_ID} .florift-features{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:28px;}#${SECTION_ID} .florift-feature{background:linear-gradient(180deg,#fff,#fffafb);border:1px solid #eadbdd;border-radius:26px;padding:28px 22px;text-align:center;}#${SECTION_ID} .florift-feature-icon{width:58px;height:58px;margin:0 auto 14px;display:grid;place-items:center;font-size:1.5rem;border-radius:50%;background:linear-gradient(135deg,#fff,#f8e9ee);border:1px solid #eadbdd;}#${SECTION_ID} .florift-feature h3{margin:0 0 8px;font-size:1.5rem;color:#2b1a1e;font-family:'El Messiri','Cairo',sans-serif;font-weight:700;}#${SECTION_ID} .florift-feature p{margin:0;color:#7a5a60;line-height:1.9;font-size:1rem;}#${SECTION_ID} .florift-strip{display:grid;grid-template-columns:.82fr 1.18fr;gap:20px;}#${SECTION_ID} .florift-banner{min-height:355px;border-radius:30px;overflow:hidden;position:relative;border:1px solid #eadbdd;}#${SECTION_ID} .florift-banner::before{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,.08),rgba(43,26,30,.58));z-index:1;}#${SECTION_ID} .florift-banner.left{background:url('https://images.unsplash.com/photo-1468327768560-75b778cbb551?auto=format&fit=crop&w=1200&q=80') center/cover no-repeat;}#${SECTION_ID} .florift-banner.right{background:url('https://images.unsplash.com/photo-1490750967868-88aa4486c946?auto=format&fit=crop&w=1400&q=80') center/cover no-repeat;}#${SECTION_ID} .florift-banner-content{position:absolute;inset:auto 28px 28px 28px;z-index:2;color:#fff;}#${SECTION_ID} .florift-banner h3{margin:0 0 10px;font-size:2.35rem;line-height:1.2;font-family:'El Messiri','Cairo',sans-serif;font-weight:700;}#${SECTION_ID} .florift-banner p{margin:0 0 18px;line-height:1.9;color:rgba(255,255,255,.93);}#${SECTION_ID} .florift-btn{display:inline-flex;align-items:center;padding:14px 24px;border-radius:999px;font-weight:800;text-decoration:none;border:none;cursor:pointer;}#${SECTION_ID} .florift-btn-primary{background:linear-gradient(135deg,#6b1f2b,#4e141d);color:#fff;}#${SECTION_ID} .florift-btn-light{background:#fff;color:#6b1f2b;}}`;
document.head.appendChild(s);
}
function createSection() {
var root = document.createElement("section"); root.id = SECTION_ID;
root.innerHTML = `🚚
توصيل سريع داخل المدينة
اطلب الآن وسيصل الورد خلال ساعات.
🎁
تغليف وهدايا إضافية
أضف شوكولاتة أو دبدوب أو بطاقة تهنئة.
💎
ستايل فاخر للبراند
تصميم أنيق يعكس هوية متجر فاخر.
📲
طلب مباشر عبر واتساب
اطلب بسهولة واحصل على خدمة سريعة.
هدايا مع الورد
إضافات ترفع قيمة الطلب وتزيد جاذبية المتجر.
شاهد الهداياباقات مصممة للمناسبات الراقية
من استقبال المواليد إلى أعياد الميلاد والتهاني.
استكشف المناسبات `;
return root;
}
function init() {
addStyle();
var tries = 0;
var timer = setInterval(function () {
tries++;
var hero = document.getElementById("florift-desktop-home");
if (hero && !document.getElementById(SECTION_ID)) { hero.insertAdjacentElement("afterend", createSection()); clearInterval(timer); }
else if (tries > 12) clearInterval(timer);
}, 400);
}
window.addEventListener("load", init);
})();
(function () {
var SECTION_ID = "florift-desktop-step-4";
if (window.innerWidth < 992) return;
var _p = window.location.pathname;
if (_p !== "/" && _p !== "/index" && _p !== "") return;
function addStyle() {
if (document.getElementById("florift-step-4-style")) return;
var s = document.createElement("style"); s.id = "florift-step-4-style";
s.innerHTML = `@media (min-width:992px){#${SECTION_ID}{direction:rtl;width:min(1240px,calc(100% - 32px));margin:48px auto 56px;font-family:'Cairo',sans-serif;}#${SECTION_ID} *{box-sizing:border-box;}#${SECTION_ID} .florift-banners{display:grid;grid-template-columns:1.35fr 1fr;gap:20px;margin-bottom:34px;}#${SECTION_ID} .florift-banner{min-height:320px;border-radius:30px;overflow:hidden;position:relative;border:1px solid #eadbdd;}#${SECTION_ID} .florift-banner::before{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,.08),rgba(43,26,30,.55));z-index:1;}#${SECTION_ID} .florift-banner.one{background:url('https://images.unsplash.com/photo-1468327768560-75b778cbb551?auto=format&fit=crop&w=1400&q=80') center/cover no-repeat;}#${SECTION_ID} .florift-banner.two{background:url('https://images.unsplash.com/photo-1490750967868-88aa4486c946?auto=format&fit=crop&w=1400&q=80') center/cover no-repeat;}#${SECTION_ID} .florift-banner-content{position:absolute;inset:auto 28px 28px 28px;z-index:2;color:#fff;}#${SECTION_ID} .florift-banner h3{margin:0 0 10px;font-size:2.2rem;line-height:1.2;font-family:'El Messiri','Cairo',sans-serif;font-weight:700;}#${SECTION_ID} .florift-banner p{margin:0 0 18px;line-height:1.9;color:rgba(255,255,255,.93);}#${SECTION_ID} .florift-btn{display:inline-flex;align-items:center;padding:14px 24px;border-radius:999px;font-weight:800;text-decoration:none;}#${SECTION_ID} .florift-btn-primary{background:linear-gradient(135deg,#6b1f2b,#4e141d);color:#fff;}#${SECTION_ID} .florift-btn-light{background:#fff;color:#6b1f2b;}#${SECTION_ID} .florift-title{text-align:center;margin-bottom:24px;}#${SECTION_ID} .florift-title h2{margin:0 0 8px;font-size:2.4rem;color:#2b1a1e;font-family:'El Messiri','Cairo',sans-serif;font-weight:700;}#${SECTION_ID} .florift-title p{margin:0;color:#7a5a60;}#${SECTION_ID} .florift-reviews{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;}#${SECTION_ID} .florift-review{background:#fff;border:1px solid #eadbdd;border-radius:24px;padding:24px;}#${SECTION_ID} .florift-stars{color:#f5b301;margin-bottom:14px;font-size:18px;}#${SECTION_ID} .florift-review p{margin:0 0 14px;color:#555;line-height:1.9;}#${SECTION_ID} .florift-review strong{color:#6b1f2b;}}`;
document.head.appendChild(s);
}
function createSection() {
var section = document.createElement("section"); section.id = SECTION_ID;
section.innerHTML = `باقات مصممة للمناسبات الراقية
من استقبال المواليد إلى أعياد الميلاد والتهاني.
استكشف المناسباتهدايا مع الورد
إضافات ترفع قيمة الطلب وتزيد جاذبية المتجر.
شاهد الهداياآراء عملائنا
تجارب حقيقية من عملائنا تعكس جودة خدمتنا
★★★★★
طلبت باقة ورد وكانت أجمل مما توقعت، التوصيل سريع والتغليف فخم.
سارة★★★★★
خدمة ممتازة وتعامل راقي، أكيد مو آخر مرة أطلب منكم.
محمد★★★★★
الورد طازج والتنسيق احترافي، أنصح فيهم بقوة.
نورة `;
return section;
}
function mount() {
if (document.getElementById(SECTION_ID)) return true;
var section = createSection();
var footer = document.querySelector("footer");
footer && footer.parentNode ? footer.parentNode.insertBefore(section, footer) : document.body.appendChild(section);
return true;
}
function init() { addStyle(); var t=0; var tmr=setInterval(function(){t++;if(mount()||t>10)clearInterval(tmr);},500); }
window.addEventListener("load", init);
})();
(function () {
var SECTION_ID = "florift-desktop-step-5";
if (window.innerWidth < 992) return;
var _p = window.location.pathname;
if (_p !== "/" && _p !== "/index" && _p !== "") return;
function addStyle() {
if (document.getElementById("florift-step-5-style")) return;
var s = document.createElement("style"); s.id = "florift-step-5-style";
s.innerHTML = `@media (min-width:992px){#${SECTION_ID}{direction:rtl;width:min(1240px,calc(100% - 32px));margin:48px auto 56px;font-family:'Cairo',sans-serif;}#${SECTION_ID} *{box-sizing:border-box;}#${SECTION_ID} .florift-head{margin-bottom:22px;}#${SECTION_ID} .florift-head h2{margin:0 0 8px;font-size:2.4rem;color:#2b1a1e;font-family:'El Messiri','Cairo',sans-serif;font-weight:700;}#${SECTION_ID} .florift-head p{margin:0;color:#7a5a60;line-height:1.9;}#${SECTION_ID} .florift-box{border-radius:28px;border:1px solid #eadbdd;background:linear-gradient(135deg,#fff,#fff7fa);padding:32px;}#${SECTION_ID} .florift-grid{display:grid;grid-template-columns:.78fr 1.22fr;gap:24px;align-items:stretch;}#${SECTION_ID} .florift-col{display:flex;flex-direction:column;gap:14px;justify-content:center;}#${SECTION_ID} .florift-card{background:#fff;border:1px solid #eadbdd;border-radius:22px;padding:22px;}#${SECTION_ID} .florift-card h3{margin:0 0 10px;font-size:1.4rem;color:#4e141d;font-family:'El Messiri','Cairo',sans-serif;}#${SECTION_ID} .florift-card p{margin:0 0 18px;color:#7a5a60;line-height:1.9;}#${SECTION_ID} .florift-actions{display:flex;flex-wrap:wrap;gap:10px;}#${SECTION_ID} .florift-btn{display:inline-flex;align-items:center;padding:14px 24px;border-radius:999px;font-weight:800;text-decoration:none;transition:.25s ease;}#${SECTION_ID} .florift-btn:hover{transform:translateY(-2px);}#${SECTION_ID} .florift-btn-primary{background:linear-gradient(135deg,#6b1f2b,#4e141d);color:#fff;}#${SECTION_ID} .florift-btn-light{background:#fff;border:1px solid #eadbdd;color:#6b1f2b;}#${SECTION_ID} .florift-image{min-height:420px;border-radius:24px;background:url('https://cdn.files.salla.network/theme/1500095161/6bf033b0-2e43-46aa-93bf-ab64af78c7c9.webp') center/cover no-repeat;position:relative;overflow:hidden;}#${SECTION_ID} .florift-image-card{position:absolute;inset:auto 24px 24px 24px;background:rgba(255,255,255,.94);border:1px solid #eadbdd;border-radius:20px;padding:18px;}#${SECTION_ID} .florift-image-card strong{display:block;font-size:1.2rem;color:#4e141d;margin-bottom:8px;font-family:'El Messiri','Cairo',sans-serif;}#${SECTION_ID} .florift-image-card span{color:#7a5a60;line-height:1.8;}}`;
document.head.appendChild(s);
}
function createSection() {
var section = document.createElement("section"); section.id = SECTION_ID;
section.innerHTML = `موقعنا
يمكنك زيارتنا في المتجر أو الطلب عبر الموقع وسيصلك الورد بسرعة.
موقعنا على الخريطة
الرياض — اضغط على الزر لفتح الموقع مباشرة في Google Maps.
⭐ تقييم المتجر4.9 من 5 بناءً على تقييمات العملاء — جودة عالية وخدمة سريعة.
زوروا متجر فلوريفتموقعنا في الرياض مع خدمة استقبال الطلبات والتنسيقات الخاصة داخل المتجر.
`;
return section;
}
function mount() {
if (document.getElementById(SECTION_ID)) return true;
var step4 = document.getElementById("florift-desktop-step-4");
var section = createSection();
step4 ? step4.insertAdjacentElement("afterend", section) : document.body.appendChild(section);
return true;
}
function init() { addStyle(); var t=0; var tmr=setInterval(function(){t++;if(mount()||t>10)clearInterval(tmr);},500); }
window.addEventListener("load", init);
})();
/* ──────────────────────────────────────────────────
6. ديسكتوب — فوتر (كل الصفحات)
────────────────────────────────────────────────── */
(function () {
var SECTION_ID = "florift-desktop-footer";
if (window.innerWidth < 992) return;
if (document.getElementById(SECTION_ID)) return;
function addStyle() {
var s = document.createElement("style");
s.innerHTML = `@media (min-width:992px){#${SECTION_ID}{direction:rtl;width:min(1240px,calc(100% - 32px));margin:0 auto 42px;font-family:'Cairo',sans-serif;}#${SECTION_ID} .florift-footer-wrap{background:linear-gradient(180deg,#fff,#fffafb);border:1px solid #eadbdd;border-radius:32px;padding:34px;display:grid;grid-template-columns:1.2fr .8fr .8fr .8fr;gap:22px;}#${SECTION_ID} h4{margin:0 0 14px;font-size:1.1rem;color:#2b1a1e;font-family:'El Messiri','Cairo',sans-serif;}#${SECTION_ID} p,#${SECTION_ID} li{color:#7a5a60;line-height:1.9;font-size:.97rem;}#${SECTION_ID} ul{list-style:none;padding:0;margin:0;}#${SECTION_ID} li+li{margin-top:8px;}#${SECTION_ID} .brand{display:flex;align-items:flex-start;margin-bottom:12px;}#${SECTION_ID} .brand img{height:74px;object-fit:contain;display:block;}#${SECTION_ID} .copyright{text-align:center;color:#7a5a60;margin-top:18px;font-size:.94rem;}}`;
document.head.appendChild(s);
}
function createSection() {
var section = document.createElement("section"); section.id = SECTION_ID;
section.innerHTML = `© 2026 فلوريفت — جميع الحقوق محفوظة
`;
return section;
}
function mount() {
if (document.getElementById(SECTION_ID)) return true;
document.body.appendChild(createSection());
return true;
}
function init() { addStyle(); var t=0; var tmr=setInterval(function(){t++;if(mount()||t>10)clearInterval(tmr);},500); }
window.addEventListener("load", init);
})();
/* ──────────────────────────────────────────────────
7. ديسكتوب — زر واتساب (كل الصفحات)
────────────────────────────────────────────────── */
(function () {
var ID = "florift-whatsapp-btn";
if (window.innerWidth < 992) return;
if (document.getElementById(ID)) return;
var btn = document.createElement("a");
btn.id = ID; btn.href = "https://wa.me/966550054483"; btn.target = "_blank";
btn.innerHTML = "💬 اطلب عبر واتساب";
document.body.appendChild(btn);
var s = document.createElement("style");
s.innerHTML = `#${ID}{position:fixed;bottom:24px;left:24px;z-index:9999;background:linear-gradient(135deg,#25D366,#1ebe5d);color:#fff;padding:14px 20px;border-radius:999px;font-weight:800;text-decoration:none;box-shadow:0 12px 30px rgba(0,0,0,.2);font-family:'Cairo',sans-serif;display:flex;align-items:center;gap:8px;transition:.3s;}#${ID}:hover{transform:scale(1.05);}`;
document.head.appendChild(s);
})();
/* ===================================================
جوال
=================================================== */
/* ─── Observer ─────────────────────────────────── */
(function () {
if (window.innerWidth > 767) return;
var HIDDEN = [
'header','.header','.main-header','.top-navbar',
'.site-header','.navbar','.nav-wrapper',
'.header-wrapper','.store-header','.s-header',
'.s-search','.search-wrapper','.search-bar','.search-input-wrapper',
'footer','.s-footer','.store-footer','.main-footer'
];
var PROTECTED = ['florift-mobile-home','florift-mobile-bottomnav'];
function isProtected(el) {
return PROTECTED.some(function(id){ return el.id===id || !!el.closest('#'+id); });
}
function hideElements() {
HIDDEN.forEach(function(sel){
try { document.querySelectorAll(sel).forEach(function(el){
if(isProtected(el)) return;
el.style.setProperty('display','none','important');
el.style.setProperty('visibility','hidden','important');
el.style.setProperty('pointer-events','none','important');
}); } catch(e){}
});
}
hideElements();
var observer = new MutationObserver(function(mutations){
var need=false;
mutations.forEach(function(m){ m.addedNodes.forEach(function(node){
if(node.nodeType!==1) return;
if(PROTECTED.indexOf(node.id||'')===-1) need=true;
});});
if(need) hideElements();
});
function startObserver(){
observer.observe(document.body||document.documentElement,{childList:true,subtree:true});
hideElements();
}
document.body ? startObserver() : document.addEventListener('DOMContentLoaded',startObserver);
var ticking=false;
function onEvent(){ if(ticking)return; ticking=true; requestAnimationFrame(function(){hideElements();ticking=false;}); }
window.addEventListener('scroll',onEvent,{passive:true});
window.addEventListener('resize',onEvent,{passive:true});
})();
/* ─── Bottom Nav — كل الصفحات ──────────────────── */
(function () {
if (window.innerWidth > 767) return;
if (document.getElementById('florift-mobile-bottomnav')) return;
function getHref(sels,fallback){ for(var i=0;i⌂
الرئيسية
🔍
اكتشف
♡
المفضلة
👤
حسابي
`;
function append(){ document.body.appendChild(nav); }
document.body ? append() : document.addEventListener('DOMContentLoaded',append);
})();
/* ─── Mobile Home — الرئيسية فقط ───────────────── */
(function () {
var ID = "florift-mobile-home";
var path = window.location.pathname;
if (path !== "/" && path !== "/index" && path !== "") return;
if (!window.matchMedia("(max-width: 767.98px)").matches) return;
function getHref(sels,fallback){ for(var i=0;i
✦ تنسيقات فاخرة • توصيل سريع داخل الرياض
ورد مصمم بذوق راقٍ
يليق بكل مناسبة
باقات مميزة، تغليف أنيق، وهدايا تكمل اللحظة بشكل أفخم.
🎁
عرض اليوم الخاصهدية أنيقة مجانية مع كل طلب فوق 400 ريال
اطلب الآن
تنسيقات فاخرة
لكل مناسبة
ورد طازج • تغليف أنيق • توصيل اليوم
تسوق الآن
طرق الدفع المتاحة
Apple Pay
Mastercard
Visa
مدى
`;
document.body.prepend(root);
/* ── نقل منتجات سلة قبل كارد التواصل ── */
window.addEventListener('load', function () {
setTimeout(function () {
var sallaSections = document.querySelectorAll(
'body > *:not(#florift-mobile-home):not(#florift-mobile-bottomnav)'
);
var productsEl = null;
sallaSections.forEach(function (el) {
if (productsEl) return;
if (el.querySelector('custom-salla-product-card, .s-product-card-entry, .s-product-card')) {
productsEl = el;
}
});
if (!productsEl) return;
var label = document.createElement('div');
label.className = 'fm-section-head';
label.innerHTML = 'عرض الكل ←';
var contactCard = root.querySelector('.fm-contact-card');
if (contactCard) {
root.insertBefore(label, contactCard);
root.insertBefore(productsEl, contactCard);
}
}, 1200);
});
/* السلايدر */
var slides=root.querySelectorAll(".fm-slide"),dots=root.querySelectorAll(".fm-dot"),idx=0;
if(slides.length>1) setInterval(function(){
slides[idx].classList.remove("active");dots[idx].classList.remove("active");
idx=(idx+1)%slides.length;
slides[idx].classList.add("active");dots[idx].classList.add("active");
},3500);
/* الكاتيجوري */
root.querySelectorAll(".fm-cat").forEach(function(cat){
cat.addEventListener("click",function(){
root.querySelectorAll(".fm-cat").forEach(function(c){c.classList.remove("active");});
cat.classList.add("active");
var href=cat.getAttribute("data-href");
if(href) window.location.href=href;
});
});
/* البحث */
var sb=document.getElementById("fm-search-bar");
if(sb) sb.addEventListener("click",function(){
var s=document.querySelector('[data-role="search-btn"],.s-search-btn,[data-open="search"]');
if(s) s.click(); else window.location.href="/search";
});
}
document.readyState==="loading" ? document.addEventListener("DOMContentLoaded",build) : build();
})();
/* ===================================================
FLORIFT — إصلاح البحث النهائي
أضفه في نهاية JS المخصص
=================================================== */
(function () {
function openSearch() {
/* سلة تستخدم salla-search inline — الهيدر مخفي عندنا
الحل: نأخذ قيمة الـ input إذا فيه نص ونبحث، وإلا نروح /search */
var input = document.querySelector('input.s-search-input');
if (input) {
var val = input.value.trim();
if (val) {
window.location.href = '/search?q=' + encodeURIComponent(val);
} else {
window.location.href = '/search';
}
} else {
window.location.href = '/search';
}
}
function bindSearch() {
/* ديسكتوب */
var ds = document.getElementById('florift-search-trigger');
if (ds) {
ds.onclick = null;
ds.addEventListener('click', openSearch);
}
/* جوال */
var ms = document.getElementById('fm-search-bar');
if (ms) {
ms.onclick = null;
ms.addEventListener('click', openSearch);
}
}
/* شغّل فوراً وبعد التحميل */
bindSearch();
window.addEventListener('load', function () {
setTimeout(bindSearch, 800);
});
})();