/* Mobile Menu Base Styles */
.mobile-menu {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--primary);
    cursor: pointer;
    padding: 10px;
    z-index: 1000;
    transition: color 0.3s ease;
}

.mobile-menu:hover {
    color: var(--secondary);
}

/* Screen reader text for accessibility */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Navigation Menu Styles */
.nav-menu {
    transition: transform 0.3s ease-in-out;
}

.nav-menu .menu-items {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .mobile-menu {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 80px; /* Header height */
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        z-index: 999;
        padding: 20px;
        transform: translateX(100%);
        visibility: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu.active {
        transform: translateX(0);
        visibility: visible;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .nav-menu .menu-items {
        flex-direction: column;
        gap: 10px;
    }

    .nav-menu .menu-items li {
        width: 100%;
        margin: 0;
    }

    .nav-menu .menu-items a {
        display: block;
        padding: 15px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        font-size: 1.1rem;
        text-align: left;
    }

    /* Submenu styles */
    .menu-item-has-children {
        position: relative;
    }

    .submenu-toggle {
        position: absolute;
        right: 0;
        top: 0;
        padding: 15px;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--primary);
        cursor: pointer;
        z-index: 2;
    }

    .submenu-toggle::after {
        content: '+';
        display: block;
        transition: transform 0.3s ease;
    }

    .submenu-active > .submenu-toggle::after {
        transform: rotate(45deg);
    }

    .sub-menu {
        display: none;
        padding-left: 20px;
        background: rgba(0, 0, 0, 0.02);
    }

    .submenu-active > .sub-menu {
        display: block;
    }

    /* Animation */
    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateX(100%);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .nav-menu.active {
        animation: slideIn 0.3s ease-out forwards;
    }

    /* Ensure header content stays above menu */
    .header-content {
        position: relative;
        z-index: 1001;
    }

    /* Style adjustments for buttons in menu */
    .nav-menu .menu-items .btn {
        margin: 10px 15px;
        text-align: center;
    }
}