/* assets/js/header.js */
function toggleMenu() {
    if (window.innerWidth <= 1024) {
        const sidebar = document.getElementById('sidebar');
        const overlay = document.getElementById('menuOverlay');
        
        sidebar.classList.toggle('active');
        overlay.classList.toggle('active');
        
        if (sidebar.classList.contains('active')) {
            document.body.style.overflow = 'hidden';
        } else {
            document.body.style.overflow = 'auto';
        }
    }
}

window.addEventListener('resize', function() {
    if (window.innerWidth > 1024) {
        document.getElementById('sidebar').classList.remove('active');
        document.getElementById('menuOverlay').classList.remove('active');
        document.body.style.overflow = 'auto';
    }
});