erlay.style.animation = 'fadeIn 0.3s ease-out forwards';
        modal.style.animation = 'slideInFromRight 0.3s ease-out forwards';

        document.body.style.overflow = 'hidden';
    }

    document.getElementById('overlay').addEventListener('click', function () {
        const modal = document.getElementById('popupModal');
        const overlay = document.getElementById('overlay');

        // Apply closing animations
        modal.style.animation = 'slideOutToRight 0.3s ease-out forwards';
        over