(function () {

    // ✅ تحقق من URL المنتج
    if (!window.location.pathname.includes('/product/')) {
        return;
    }

    const header = document.getElementById('siteHeader');
    if (!header) return;

    let isScrolled = false;

    function onScroll() {
        const y = window.scrollY || document.documentElement.scrollTop;

        if (y > 10 && !isScrolled) {
            header.classList.add('scrolled');
            isScrolled = true;
        }

        if (y === 0 && isScrolled) {
            header.classList.remove('scrolled');
            isScrolled = false;
        }
    }

    window.addEventListener('scroll', onScroll);

})();

