/* ========== MOBILE NAVIGATION IMPROVEMENTS ========== */
/* Only applies to mobile devices - desktop remains unchanged */

@media (max-width: 768px) {
    /* ===== MOBILE HEADER IMPROVEMENTS ===== */
    header {
        position: sticky;
        top: 0;
        z-index: 1000;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 15px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    /* Logo adjustments for mobile - keep on sides */
    .logo-left {
        width: 50px !important;
        height: 50px !important;
        flex-shrink: 0;
        order: 1;
    }
    
    .logo-right {
        width: 50px !important;
        height: 50px !important;
        flex-shrink: 0;
        order: 3;
    }
    
    .logo {
        max-width: 50px !important;
        max-height: 50px !important;
    }
    
    /* Title container in center between logos */
    .title {
        order: 2;
        flex-grow: 1;
        flex-shrink: 1;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* Title text styling */
    header h1,
    .title h1 {
        font-size: 1.3rem !important;
        margin: 0 10px !important;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* ===== HAMBURGER MENU BUTTON ===== */
    .mobile-menu-toggle {
        display: block !important;
        position: fixed;
        top: 12px;
        right: 12px;
        z-index: 2000;
        background: #2e7d32;
        border: none;
        border-radius: 8px;
        padding: 12px;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        transition: all 0.3s ease;
        width: 48px;
        height: 48px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }
    
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 24px;
        height: 20px;
        justify-content: space-between;
    }
    
    .hamburger span {
        display: block;
        width: 100%;
        height: 3px;
        background: white;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    /* Hamburger animation when menu is open */
    .mobile-menu-toggle.active .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }
    
    .mobile-menu-toggle.active .hamburger span:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }
    
    .mobile-menu-toggle.active .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    /* ===== MOBILE NAVIGATION OVERLAY ===== */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
        padding: 80px 0 20px 0;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        overflow-y: auto;
        z-index: 1500;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        padding: 0;
        margin: 0;
        width: 100%;
    }
    
    .main-nav li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        list-style: none;
    }
    
    /* Support for both ul/li and direct <a> structures */
    .main-nav a,
    .main-nav > a {
        display: block;
        width: 100%;
        padding: 18px 25px !important;
        margin: 0 !important;
        color: white !important;
        background: transparent !important;
        border-radius: 0 !important;
        text-align: left;
        font-size: 1.1rem;
        transition: all 0.3s ease;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-decoration: none;
    }
    
    .main-nav a:hover,
    .main-nav a.active,
    .main-nav > a:hover,
    .main-nav > a.active {
        background: rgba(255, 255, 255, 0.15) !important;
        padding-left: 35px !important;
    }
    
    /* ===== SUB-NAVIGATION MOBILE ===== */
    .sub-nav {
        position: relative;
        background: #f5f5f5;
        padding: 10px 0;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        max-height: 200px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .sub-nav ul {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        padding: 0 10px;
        white-space: nowrap;
    }
    
    .sub-nav li {
        display: inline-block;
    }
    
    .sub-nav a {
        display: inline-block !important;
        padding: 8px 15px !important;
        margin: 0 5px !important;
        background: white !important;
        border-radius: 20px !important;
        font-size: 0.85rem !important;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        white-space: nowrap;
    }
    
    .sub-nav a:hover,
    .sub-nav a.active {
        background: #2e7d32 !important;
        color: white !important;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    
    /* ===== OVERLAY BACKDROP ===== */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1400;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* ===== SMOOTH SCROLLING ===== */
    html {
        scroll-behavior: smooth;
    }
    
    /* ===== PREVENT BODY SCROLL WHEN MENU OPEN ===== */
    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    header h1,
    .title h1 {
        font-size: 1.1rem !important;
    }
    
    .logo-left,
    .logo-right {
        width: 40px !important;
        height: 40px !important;
    }
    
    .logo {
        max-width: 40px !important;
        max-height: 40px !important;
    }
    
    .main-nav {
        width: 85%;
    }
    
    .main-nav a {
        font-size: 1rem;
        padding: 15px 20px !important;
    }
    
    .sub-nav a {
        font-size: 0.8rem !important;
        padding: 6px 12px !important;
    }
}

/* ===== DESKTOP: HIDE MOBILE ELEMENTS ===== */
@media (min-width: 769px) {
    .mobile-menu-toggle,
    .mobile-overlay {
        display: none !important;
    }
}
