/* WORKING MOBILE NAVIGATION CSS */

/* Prevent horizontal scrolling on mobile when menu is open */
@media screen and (max-width: 1024px) {
    body {
        overflow-x: hidden !important;
    }

    * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
}

/* Hide screen reader text */
.screen-reader-text {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Desktop Navigation - Default */
.main-navigation {
    position: relative;
}

.main-navigation .nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.main-navigation .nav-menu a {
    text-decoration: none;
    color: var(--qm-text-primary, #333);
    font-weight: 500;
    padding: 0.5rem 0;
}

.main-navigation .nav-menu a:hover {
    color: var(--qm-accent-color, #007cba);
}

/* Hide mobile toggle by default */
.menu-toggle {
    display: none;
}

/* MOBILE STYLES */
@media screen and (max-width: 1024px) {
    
    /* Show mobile toggle */
    .menu-toggle {
        display: block;
        background: var(--qm-accent-color, #007cba);
        border: none;
        padding: 12px;
        border-radius: 4px;
        cursor: pointer;
        position: relative;
        z-index: 1000;
    }
    
    /* Hamburger icon */
    .hamburger {
        width: 24px;
        height: 18px;
        position: relative;
    }
    
    .hamburger span {
        display: block;
        height: 2px;
        width: 100%;
        background: white;
        border-radius: 1px;
        position: absolute;
        left: 0;
        transition: all 0.3s ease;
    }
    
    .hamburger span:nth-child(1) {
        top: 0;
    }
    
    .hamburger span:nth-child(2) {
        top: 8px;
    }
    
    .hamburger span:nth-child(3) {
        top: 16px;
    }
    
    /* Animated hamburger when open */
    .menu-toggle[aria-expanded="true"] .hamburger span:nth-child(1) {
        transform: rotate(45deg);
        top: 8px;
    }
    
    .menu-toggle[aria-expanded="true"] .hamburger span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle[aria-expanded="true"] .hamburger span:nth-child(3) {
        transform: rotate(-45deg);
        top: 8px;
    }
    
    /* Mobile menu container */
    .menu-container {
        position: absolute;
        top: 100%;
        right: 0;
        background: white;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        z-index: 999;
        display: none;
        border-radius: 0 0 8px 8px;
        max-width: 95vw;
        box-sizing: border-box;
    }
    
    .menu-container.is-open {
        display: block;
    }
    
    /* Mobile menu items */
    .menu-container .nav-menu {
        flex-direction: column;
        gap: 0;
        padding: 0.75rem;
        margin: 0;
        list-style: none;
        min-width: 180px;
        width: auto;
        max-width: calc(100vw - 2rem);
        box-sizing: border-box;
    }
    
    .menu-container .nav-menu li {
        border-bottom: 1px solid var(--qm-border-color, #eee);
        width: 100%;
    }
    
    .menu-container .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .menu-container .nav-menu a {
        display: block;
        padding: 1.2rem 0;
        font-size: 1rem;
        color: var(--qm-text-primary, #333);
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s ease;
        width: 100%;
        white-space: nowrap;
    }
    
    .menu-container .nav-menu a:hover {
        color: var(--qm-accent-color, #007cba);
    }
}