/* =======================================================
   🔧 LABCARE MENU NAVIGATION - COMPLETE FIX
   Sửa tất cả vấn đề menu navigation
   ======================================================= */

/* RESET & BASE STYLES */
* {
    box-sizing: border-box !important;
}

/* MAIN MENU CONTAINER - FIXED STRUCTURE */
#menu1 {
    width: 100% !important;
    height: 41px !important;
    background: #0f3460 !important;
    border-top: 1px solid #0a2541 !important;
    border-bottom: 1px solid #0a2541 !important;
    position: relative !important;
    z-index: 1000 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* MENU WRAPPER - CENTERED */
#menu2 {
    width: 100% !important;
    max-width: 1200px !important;
    height: 41px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: relative !important;
}

/* HOME ICON - FIXED POSITION */
#home1 {
    flex-shrink: 0 !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 20px !important;
}

#home1 a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    transition: transform 0.3s ease !important;
}

#home1 a:hover {
    transform: scale(1.1) !important;
}

#home1 img {
    width: 24px !important;
    height: 24px !important;
    object-fit: contain !important;
}

/* MENU CONTENT - CENTERED */
#menu3 {
    flex: 1 !important;
    height: 41px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* NAVIGATION MENU - HORIZONTAL */
#menuthanh {
    width: 100% !important;
    height: 41px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nav {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 41px !important;
    gap: 0 !important;
    flex-wrap: nowrap !important;
}

.nav > li {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    height: 41px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nav > li > h2 {
    margin: 0 !important;
    padding: 0 !important;
    height: 41px !important;
    display: flex !important;
    align-items: center !important;
}

.nav > li > h2 > a {
    display: flex !important;
    align-items: center !important;
    height: 35px !important;
    padding: 0 15px !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    text-transform: none !important;
    transition: all 0.3s ease !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
    background: transparent !important;
    border-right: 1px solid rgba(255,255,255,0.2) !important;
}

.nav > li:last-child > h2 > a {
    border-right: none !important;
}

.nav > li > h2 > a:hover {
    background: rgba(255,255,255,0.1) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
}

.nav > li.activemenu > h2 > a {
    background: rgba(255,255,255,0.2) !important;
    color: #ffffff !important;
}

/* DROPDOWN MENUS - IMPROVED */
.nav li ul {
    position: absolute !important;
    top: 41px !important;
    left: 0 !important;
    background: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    border-radius: 4px !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    min-width: 200px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    z-index: 9999 !important;
    border: 1px solid #e0e0e0 !important;
    list-style: none !important;
}

.nav li:hover > ul {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.nav ul li {
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nav ul li h3 {
    margin: 0 !important;
    padding: 0 !important;
}

.nav ul li h3 a {
    display: block !important;
    padding: 10px 16px !important;
    color: #555 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border-left: 3px solid transparent !important;
}

.nav ul li:hover h3 a {
    background: #f8f9fa !important;
    color: #0f3460 !important;
    border-left: 3px solid #0f3460 !important;
}

/* RESPONSIVE DESIGN - MOBILE FIRST */
@media (max-width: 1200px) {
    #menu2 {
        padding: 0 15px !important;
    }
    
    .nav > li > h2 > a {
        padding: 0 12px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 992px) {
    #menu2 {
        flex-direction: column !important;
        height: auto !important;
        padding: 10px 15px !important;
    }
    
    #home1 {
        order: 1 !important;
        margin: 0 0 10px 0 !important;
    }
    
    #menu3 {
        order: 2 !important;
        width: 100% !important;
    }
    
    .nav {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 5px !important;
    }
    
    .nav > li > h2 > a {
        padding: 8px 12px !important;
        font-size: 12px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.2) !important;
    }
    
    .nav > li:last-child > h2 > a {
        border-bottom: none !important;
    }
}

@media (max-width: 768px) {
    #menu1 {
        height: auto !important;
        min-height: 41px !important;
    }
    
    #menu2 {
        padding: 8px 10px !important;
    }
    
    .nav {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: #0f3460 !important;
        flex-direction: column !important;
        padding: 10px 0 !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
        z-index: 9999 !important;
    }
    
    .nav.mobile-open {
        display: flex !important;
    }
    
    .nav > li {
        width: 100% !important;
        height: auto !important;
    }
    
    .nav > li > h2 {
        width: 100% !important;
        height: auto !important;
    }
    
    .nav > li > h2 > a {
        width: 100% !important;
        height: 45px !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
        text-align: left !important;
    }
    
    .nav > li:last-child > h2 > a {
        border-bottom: none !important;
    }
    
    /* Mobile menu toggle button */
    .mobile-menu-toggle {
        display: block !important;
        background: none !important;
        border: 2px solid #ffffff !important;
        color: #ffffff !important;
        padding: 8px 15px !important;
        border-radius: 4px !important;
        cursor: pointer !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        transition: all 0.3s ease !important;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(255,255,255,0.1) !important;
    }
    
    .mobile-menu-toggle.active {
        background: rgba(255,255,255,0.2) !important;
    }
    
    /* Mobile dropdowns */
    .nav li ul {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: rgba(0,0,0,0.1) !important;
        margin: 5px 0 0 0 !important;
        border-radius: 0 !important;
    }
    
    .nav ul li h3 a {
        padding: 8px 30px !important;
        font-size: 12px !important;
        color: rgba(255,255,255,0.8) !important;
        border-left: none !important;
    }
    
    .nav ul li:hover h3 a {
        background: rgba(255,255,255,0.1) !important;
        color: #ffffff !important;
    }
}

@media (max-width: 480px) {
    #menu2 {
        padding: 5px 8px !important;
    }
    
    .nav > li > h2 > a {
        padding: 10px 15px !important;
        font-size: 13px !important;
    }
    
    .mobile-menu-toggle {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
}

/* STICKY MENU BEHAVIOR */
#menu1.sticky {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
}

body.menu-sticky {
    padding-top: 41px !important;
}

/* ANIMATIONS */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav li ul {
    animation: slideDown 0.3s ease-out;
}

/* ACCESSIBILITY */
.nav > li > h2 > a:focus,
.nav ul li h3 a:focus {
    outline: 2px solid #ffffff !important;
    outline-offset: 2px !important;
}

/* OVERRIDE CONFLICTING STYLES */
#menu1, #menu2, #menu3, #menuthanh, .nav {
    box-sizing: border-box !important;
}

/* PRINT STYLES */
@media print {
    #menu1 {
        position: relative !important;
        box-shadow: none !important;
    }
    
    .nav li ul {
        display: none !important;
    }
}

/* PERFORMANCE OPTIMIZATIONS */
.nav > li > h2 > a,
.nav ul li h3 a {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* CLEARFIX FOR MENU CONTAINER */
#canh_menu1 {
    clear: both !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}


