document.addEventListener('DOMContentLoaded', function () {
    'use strict';

    const scrollBtn = document.getElementById('sifency-scrollup-wrapper');
    if (!scrollBtn) return;
    window.addEventListener('scroll', () => {
        if (window.scrollY > 300) {
            scrollBtn.classList.add('sifency-scroll-visible');
        } else {
            scrollBtn.classList.remove('sifency-scroll-visible');
        }
    });
    scrollBtn.addEventListener('click', (e) => {
        e.preventDefault();
        window.scrollTo({
            top: 0,
            behavior: 'smooth'
        });
    });
});