document.addEventListener('DOMContentLoaded', function () {
    const jewelry_market_button = document.querySelector('.scroll-top-button');
    const jewelry_market_link = document.querySelector('.scroll-top-button a');

    // Show/Hide button on scroll
    window.addEventListener('scroll', function () {
        if (document.documentElement.scrollTop > 100) {
            jewelry_market_button.style.display = "block";
        } else {
            jewelry_market_button.style.display = "none";
        }
    });

    // Scroll to top on click
    if (jewelry_market_link) {
        jewelry_market_link.addEventListener('click', function (jewelry_market_event) {
            jewelry_market_event.preventDefault();
            window.scrollTo({
                top: 0,
                behavior: 'smooth'
            });
        });
    }

});