(() => { const catEl = document.querySelector('.products-index[data-category]'); if (!catEl) return; const raw = catEl.getAttribute('data-category') || ''; if (!raw.includes('"id":1422444643')) return; const appInner = document.querySelector('.app-inner.has-pattern'); if (!appInner) return; appInner.style.setProperty( '--pattern-bg', 'url("https://cdn.files.salla.network/homepage/345024266/b26919e8-572c-4d9a-b4fb-b68aaeed917a.webp")', 'important' ); appInner.style.setProperty('--pattern-opacity', '0.3', 'important'); })(); document.addEventListener("DOMContentLoaded", function () { const allowedCategoryIds = ["1806161486", "472646281"]; const featuresWrapper = document.querySelector(".product-features--wrapper"); const featureItem = document.querySelector(".product-features-item"); if (!featuresWrapper || !featureItem) return; let currentCategoryId = null; // نجيب category id من الـ breadcrumb const breadcrumbLinks = document.querySelectorAll(".breadcrumbs a"); breadcrumbLinks.forEach((link) => { const href = link.getAttribute("href") || ""; const match = href.match(/\/c(\d+)/); if (match && match[1]) { currentCategoryId = match[1]; } }); // لو المنتج مش داخل الأقسام المطلوبة نخفي البلوك كله if (!currentCategoryId || !allowedCategoryIds.includes(currentCategoryId)) { featuresWrapper.style.display = "none"; return; } // نخلي العنصر ياخد صف كامل const grid = featuresWrapper.querySelector(".grid"); if (grid) { grid.classList.remove("grid-cols-3"); grid.style.gridTemplateColumns = "1fr"; } // نستبدل المحتوى featureItem.innerHTML = ` سعر البوكيه لا يشمل كرت الإهداء، لإضافة كرت يرجى الضغط هُنا `; featureItem.style.display = "block"; featureItem.style.justifyContent = "center"; featureItem.style.textAlign = "center"; });