// Mobile menu toggle
function toggleMenu() {
    const menu = document.querySelector('.menu');
    menu.classList.toggle('show'); // matches CSS
}

// Dropdown toggle
function toggleDropdown(element) {
    const isActive = element.classList.contains('active');

    // Close all other dropdowns
    document.querySelectorAll('.menu-item').forEach(item => {
        if (item !== element) {
            item.classList.remove('active');
            const dropdown = item.querySelector('.dropdownsk');
            if (dropdown) dropdown.style.display = 'none';
        }
    });

    // Toggle current dropdown
    element.classList.toggle('active');
    const dropdown = element.querySelector('.dropdownsk');
    if (dropdown) {
        dropdown.style.display = element.classList.contains('active') ? 'block' : 'none';
    }
}

// Close dropdowns when clicking outside
document.addEventListener('click', function(e) {
    if (!e.target.closest('.menu-item') && !e.target.closest('.menu')) {
        document.querySelectorAll('.menu-item').forEach(item => {
            item.classList.remove('active');
            const dropdown = item.querySelector('.dropdownsk');
            if (dropdown) dropdown.style.display = 'none';
        });
    }
});
