/* ================================
    Mobile Menu Styles
================================ */

/* Hide mobile menu elements by default (desktop) */
.mobile-menu-toggle,
.mobile-menu-overlay {
    display: none;
}

/* Show on mobile devices (768px and below) */
@media screen and (max-width: 48rem) {

    /* Hamburger Button */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 6px;
        width: var(--spacing-lg);
        height: var(--spacing-lg);
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
    }

    .hamburger-line {
        width: 100%;
        height: 3px;
        background-color: var(--color-black);
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    /* Hide desktop navigation on mobile */
    .header__nav {
        display: none !important;
    }

    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        display: block; /* Override global display: none */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--color-white);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        overflow-y: auto;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Mobile Menu Container */
    .mobile-menu-container {
        padding: var(--spacing-md) var(--spacing-md);
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        width: 100%; /* Add explicit width */
        box-sizing: border-box; /* Ensure padding doesn't cause overflow */
    }

    /* Mobile Menu Header */
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 48px;
        background-color: var(--color-white);
        border-radius: var(--radius-xl);
        padding: 1.5rem;
        width: 100%; /* Add explicit width */
        box-sizing: border-box; /* Ensure padding doesn't cause overflow */
    }

    .mobile-menu-logo {
        height: 2rem;
        width: auto;
    }

    /* Close Button (X) */
    .mobile-menu-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: var(--spacing-lg);
        height: var(--spacing-lg);
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .close-icon {
        font-size: 40px; /* Larger to match burger menu visual weight */
        line-height: 1;
        color: var(--color-black);
        font-weight: 300;
    }

    /* Mobile Menu Navigation */
    .mobile-menu-nav {
        flex: 1;
    }

    .mobile-menu-list {
        list-style: none;
        margin: 1rem var(--spacing-lg);
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 27px;
    }

    .mobile-menu-list li {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mobile-menu-list a {
        font-family: var(--font-family);
        font-size: 1.5rem;
        font-weight: 500;
        line-height: 1.5rem;
        color: var(--color-black);
        text-decoration: none;
        transition: color 0.2s ease;
    }

    .mobile-menu-list a:hover,
    .mobile-menu-list .current-menu-item > a,
    .mobile-menu-list .current_page_item > a {
        color: var(--color-black);
    }

    /* Prevent body scroll when menu is open */
    body.mobile-menu-open {
        overflow: hidden;
    }
}
