/* css/mobile-menu.css */

/* Mobile menu toggle button - base styles (Desktop: hidden by default) */
.mobile-menu-toggle {
    display: none; /* Hide on desktop by default */
    background: none;
    border: none;
    padding: 0; /* Padding can be added here to increase tap area */
    cursor: pointer;
    /* Consider adding a clear tap area with padding if the icon itself is small */
    /* For example: padding: 8px; */
}

/* Mobile menu specific styles */
@media screen and (max-width: 960px) {
    .header-content {
        justify-content: space-between; /* Ensures logo is left, toggle is right */
        padding: 0 15px; /* Adjusted padding for mobile */
        position: relative; 
        z-index: 1000; 
        height: 100%; /* Ensure header-content fills the main-header height */
    }

    /* Hamburger button - Show and style for mobile */
    .mobile-menu-toggle {
        display: block; /* Make it visible on mobile */
        width: 32px; /* Slightly wider button */
        height: 32px; /* Slightly taller button */
        position: relative; 
        z-index: 1010; 
        /* Add padding if you want a larger tap area around the icon */
        /* padding: 4px; */
    }

    /* Styles for the hamburger icon lines */
    .mobile-menu-toggle span {
        display: block;
        width: 22px; /* Adjusted width of the lines */
        height: 3px; /* Slightly thicker lines */
        background-color: #FFFFFF; 
        position: absolute;
        left: 50%; /* Center lines horizontally */
        transform: translateX(-50%); /* Adjust for centering */
        transition: transform 0.3s ease, opacity 0.3s ease;
        border-radius: 1.5px; /* Rounded ends for lines */
    }

    .mobile-menu-toggle span:nth-child(1) {
        top: 8px; 
    }

    .mobile-menu-toggle span:nth-child(2) {
        top: 14px; 
    }

    .mobile-menu-toggle span:nth-child(3) {
        top: 20px; 
    }

    /* Animated hamburger to X when menu is active */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateX(-50%) translateY(6px) rotate(45deg); 
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0; 
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateX(-50%) translateY(-6px) rotate(-45deg); 
    }
    
    .mobile-menu-toggle.active {
        position: fixed; 
        top: 19px; /* Adjust to align with your 70px header height & padding */
        right: 15px; /* Consistent with header-content padding */
    }


    /* Mobile navigation menu panel */
    .nav-menu {
        position: fixed; 
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh; 
        background-color: var(--color-primary, #474747); 
        padding: 70px 30px 30px; /* Top padding to avoid overlap with fixed header/toggle */
        
        display: flex; 
        flex-direction: column;
        align-items: center; 
        justify-content: flex-start; 
        
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px); 
        transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
        overflow-y: auto; 
        z-index: 1005; 
    }

    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0); 
    }

    /* Navigation items within the mobile menu */
    .nav-menu .nav-item {
        display: block; 
        width: 100%; 
        text-align: center; 
        font-size: 20px; 
        padding: 15px 0;
        color: var(--color-text-light, #FFFFFF);
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
        transition: color 0.3s ease, background-color 0.3s ease;
    }
    
    .nav-menu .nav-item:last-child {
        border-bottom: none; 
    }

    .nav-menu .nav-item:hover,
    .nav-menu .nav-item:focus {
        color: var(--color-accent, #AB8B3C);
        background-color: rgba(255,255,255,0.05); 
    }

    /* Dropdown styles within mobile menu */
    .nav-menu .nav-dropdown {
        width: 100%; 
    }

    .nav-menu .dropdown-menu {
        display: none; 
        position: static; 
        background: transparent; 
        width: 100%;
        padding: 10px 0 0 0; 
        border: none; 
        box-shadow: none; 
    }

    .nav-menu .nav-dropdown.active .dropdown-menu { 
        display: block;
    }

    .nav-menu .dropdown-menu li {
        list-style: none;
    }

    .nav-menu .dropdown-menu a {
        display: block;
        color: var(--color-text-light, #FFFFFF);
        text-decoration: none;
        padding: 12px 20px; 
        font-size: 16px; 
        background-color: rgba(0,0,0,0.1); 
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .nav-menu .dropdown-menu li:last-child a {
        border-bottom: none;
    }

    .nav-menu .dropdown-menu a:hover,
    .nav-menu .dropdown-menu a:focus {
        color: var(--color-accent, #AB8B3C);
        background-color: rgba(0,0,0,0.2);
    }

    /* When menu is active, prevent body scroll */
    body.menu-active {
        overflow: hidden;
    }
}
