document.querySelectorAll("h2.w-full.da-cp").forEach((h2) => { if (h2.textContent.trim() === "تسوق حسب نوع الفلتر") { h2.closest(".s-block--banners").classList.add("target-section"); } }); document.addEventListener("DOMContentLoaded", function () { document.querySelectorAll('.sub-title.text-sm').forEach(el => { const text = el.textContent.trim(); // الحالة 1: إذا يحتوي على قوس (سوناتا مثلًا) if (text.includes('(')) { const match = text.match(/^([^\(]+)(\(.*\))$/); if (match) { const before = match[1].trim(); const inside = match[2].trim(); el.innerHTML = `${before}
${inside}`; return; } } // الحالة 2: اسم + سنوات + cc + وقود (كامري وغيرها) const match = text.match(/^(.*?)(\s\d{4}(?:-\d{4})?\s\d+cc(?:\s[\w\d]+)?)(?:\s(بنزين|ديزل|HYBRID))?/i); if (match) { const name = match[1].trim(); const specs = match[2].trim(); const fuel = match[3] ? match[3].trim() : ''; let newText = `${name}
${specs}`; if (fuel) { newText += `
${fuel}`; } el.innerHTML = newText; } }); }); document.querySelectorAll('li').forEach(li => { if (li.textContent.includes('فروع')) { li.classList.add('highlight-furoo3'); } }); function makeLinksClickable() { document.querySelectorAll('.s-comments-item-content p').forEach(p => { if (!p.dataset.processed) { p.innerHTML = p.innerHTML.replace( /(https?:\/\/[^\s<]+)/g, '$1' ); p.dataset.processed = "true"; } }); } const observer = new MutationObserver(makeLinksClickable); observer.observe(document.body, { childList: true, subtree: true }); makeLinksClickable(); document.querySelectorAll('section.s-block--banners').forEach(section => { const heading = section.querySelector('h2'); if (heading && heading.textContent.includes('تسوق حسب ماركة السيارة')) { section.classList.add('car-brand-section'); } });