/* ========================================
   VNPT MOBILE MENU FIX - BOOTSTRAP ONLY
   CHỈ ÁP DỤNG CHO MOBILE - KHÔNG ẢNH HƯỞNG DESKTOP
   ======================================== */

/* MEDIA QUERY CHỈ CHO MOBILE - MAX-WIDTH 768PX */
@media only screen and (max-width: 768px) {

    /* ========================================
       RESET MOBILE HEADER - CLEAN SLATE
       ======================================== */

    .vnpt-header {
        background: white !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1030 !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
        border-bottom: none !important;
    }

    .vnpt-header .navbar {
        padding: 0.75rem 0 !important;
        min-height: 70px !important;
    }

    .vnpt-header .container {
        padding: 0 1rem !important;
    }

    /* ========================================
       MOBILE LAYOUT - 3 SECTIONS
       [MENU] [LOGO] [SEARCH + USER]
       ======================================== */

    .vnpt-header .navbar {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    /* HAMBURGER MENU - LEFT */
    .navbar-toggler {
        order: 1 !important;
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        border: 2px solid #e9ecef !important;
        border-radius: 8px !important;
        background: white !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-right: 1rem !important;
    }

    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(0,102,204,0.25) !important;
    }

    .navbar-toggler-icon {
        width: 20px !important;
        height: 2px !important;
        background: #0066CC !important;
        position: relative !important;
        transition: all 0.3s ease !important;
    }

    .navbar-toggler-icon::before,
    .navbar-toggler-icon::after {
        content: '' !important;
        position: absolute !important;
        width: 20px !important;
        height: 2px !important;
        background: #0066CC !important;
        transition: all 0.3s ease !important;
    }

    .navbar-toggler-icon::before {
        top: -6px !important;
    }

    .navbar-toggler-icon::after {
        bottom: -6px !important;
    }

    /* LOGO - CENTER */
    .vnpt-header .navbar-brand {
        order: 2 !important;
        flex: 1 !important;
        display: flex !important;
        justify-content: center !important;
        margin: 0 1rem !important;
    }

    .vnpt-logo {
        height: 40px !important;
        width: auto !important;
        max-width: 120px !important;
    }

    /* RIGHT SECTION - SEARCH + USER */
    .navbar-end {
        order: 3 !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        flex-shrink: 0 !important;
    }

    /* HIDE HOTLINE ON MOBILE */
    .hotline-info {
        display: none !important;
    }

    /* MOBILE SEARCH BOX */
    .mobile-search-container {
        flex: 1 !important;
        max-width: 120px !important;
        position: relative !important;
    }

    .mobile-search-input {
        width: 100% !important;
        height: 38px !important;
        border: 1px solid #dee2e6 !important;
        border-radius: 19px !important;
        padding: 0 35px 0 12px !important;
        font-size: 13px !important;
        background: #f8f9fa !important;
    }

    .mobile-search-input:focus {
        outline: none !important;
        border-color: #0066CC !important;
        background: white !important;
        box-shadow: 0 0 0 0.2rem rgba(0,102,204,0.25) !important;
    }

    .mobile-search-submit {
        position: absolute !important;
        right: 3px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 32px !important;
        height: 32px !important;
        border: none !important;
        border-radius: 16px !important;
        background: #0066CC !important;
        color: white !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 12px !important;
    }

    /* HIDE DESKTOP SEARCH BUTTON */
    .btn-search {
        display: none !important;
    }

    /* USER ICON */
    .btn-login {
        width: 38px !important;
        height: 38px !important;
        border-radius: 19px !important;
        background: #f8f9fa !important;
        border: 1px solid #dee2e6 !important;
        color: #0066CC !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-decoration: none !important;
        font-size: 14px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .btn-login:hover {
        background: #0066CC !important;
        color: white !important;
        border-color: #0066CC !important;
    }

    .btn-login .btn-text {
        display: none !important;
    }

    /* ========================================
       MOBILE MENU COLLAPSE - BOOTSTRAP NATIVE
       ======================================== */

    .navbar-collapse {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: white !important;
        border-top: 1px solid #dee2e6 !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
        z-index: 1020 !important;
        max-height: calc(100vh - 70px) !important;
        overflow-y: auto !important;
    }

    /* MOBILE NAVIGATION ITEMS */
    .navbar-nav {
        padding: 1rem 0 !important;
        display: block !important;
        width: 100% !important;
    }

    .nav-item {
        border-bottom: 1px solid #f8f9fa !important;
        margin: 0 !important;
    }

    .nav-item:last-child {
        border-bottom: none !important;
    }

    .nav-link {
        display: block !important;
        padding: 1rem 1.5rem !important;
        color: #212529 !important;
        font-weight: 600 !important;
        font-size: 16px !important;
        text-decoration: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        transition: all 0.2s ease !important;
    }

    .nav-link:hover,
    .nav-link:focus {
        background: #f8f9fa !important;
        color: #0066CC !important;
        padding-left: 2rem !important;
    }

    /* DROPDOWN ARROWS */
    .nav-link .fa-chevron-down {
        float: right !important;
        margin-top: 3px !important;
        font-size: 12px !important;
        color: #6c757d !important;
        transition: transform 0.2s ease !important;
    }

    .dropdown.show .nav-link .fa-chevron-down,
    .mega-dropdown.show .nav-link .fa-chevron-down {
        transform: rotate(180deg) !important;
        color: #0066CC !important;
    }

    /* ========================================
       MOBILE DROPDOWN & MEGA MENU
       ======================================== */

    .dropdown-menu,
    .mega-menu {
        position: static !important;
        width: 100% !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #f8f9fa !important;
        margin: 0 !important;
        padding: 0 !important;
        display: none !important;
    }

    .dropdown.show .dropdown-menu,
    .mega-dropdown.show .mega-menu {
        display: block !important;
    }

    /* MEGA MENU MOBILE LAYOUT */
    .mega-content {
        padding: 1rem 1.5rem !important;
    }

    .mega-content .row {
        display: block !important;
    }

    .mega-col {
        width: 100% !important;
        margin-bottom: 1.5rem !important;
        padding: 0 !important;
    }

    .mega-col:last-child {
        margin-bottom: 0 !important;
    }

    .mega-title {
        font-size: 16px !important;
        font-weight: 700 !important;
        color: #0066CC !important;
        margin-bottom: 0.75rem !important;
        padding-bottom: 0.5rem !important;
        border-bottom: 1px solid #dee2e6 !important;
    }

    .mega-links {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .mega-links li {
        margin-bottom: 3px !important;
    }

    .mega-links a {
        display: block !important;
        padding: 0.5rem 0 !important;
        color: #495057 !important;
        text-decoration: none !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        transition: all 0.2s ease !important;
    }

    .mega-links a:hover {
        color: #0066CC !important;
        padding-left: 0.5rem !important;
    }

    /* HIDE CATEGORY IMAGES ON MOBILE */
    .mega-category-image {
        display: none !important;
    }

    /* MOBILE SUB-DROPDOWN */
    .dropdown-item {
        display: block !important;
        padding: 0.75rem 1.5rem !important;
        color: #495057 !important;
        text-decoration: none !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        background: transparent !important;
        border: none !important;
        transition: all 0.2s ease !important;
    }

    .dropdown-item:hover {
        background: #e9ecef !important;
        color: #0066CC !important;
        padding-left: 2rem !important;
    }

    /* ========================================
       MOBILE SUBMENU (4TH LEVEL)
       ======================================== */

    .mega-submenu {
        position: static !important;
        width: 100% !important;
        background: #e9ecef !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 0.5rem 0 !important;
        margin: 0.5rem 0 !important;
        display: none !important;
    }

    .mega-submenu-item:hover .mega-submenu {
        display: block !important;
    }

    .mega-submenu a {
        padding: 0.5rem 2rem !important;
        font-size: 13px !important;
        color: #6c757d !important;
    }

    .mega-submenu a:hover {
        background: #dee2e6 !important;
        color: #0066CC !important;
    }

    /* ========================================
       BODY SCROLL LOCK WHEN MENU OPEN
       ======================================== */

    body.mobile-menu-open {
        overflow: hidden !important;
    }

    /* ========================================
       ANIMATION FIXES
       ======================================== */

    .navbar-collapse.collapsing {
        transition: height 0.35s ease !important;
    }

    .navbar-collapse.show {
        animation: slideDown 0.35s ease !important;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* ========================================
       SEARCH MODAL MOBILE FIXES
       ======================================== */

    #searchModal .modal-dialog {
        margin: 1rem !important;
        max-width: calc(100% - 2rem) !important;
    }

    #searchModal .modal-content {
        border-radius: 12px !important;
    }

    #searchModal .modal-header {
        padding: 1rem !important;
    }

    #searchModal .modal-title {
        font-size: 1.25rem !important;
    }

    #searchModal .modal-body {
        padding: 1.5rem !important;
    }

    .search-input-group {
        border-radius: 25px !important;
    }

    .search-input {
        padding: 0.875rem 1.25rem !important;
        font-size: 16px !important;
    }

    .search-btn {
        padding: 0.875rem 1.25rem !important;
        min-width: 50px !important;
    }

} /* END MOBILE MEDIA QUERY */

/* ========================================
   TABLET ADJUSTMENTS (769px - 991px)
   ======================================== */

@media only screen and (min-width: 769px) and (max-width: 991px) {

    .vnpt-header .container {
        padding: 0 1.5rem !important;
    }

    .mega-menu-wide {
        width: 95vw !important;
        max-width: 700px !important;
    }

    .mega-col {
        width: 50% !important;
        margin-bottom: 1rem !important;
    }

    .navbar-end {
        gap: 1rem !important;
    }

    .hotline-number {
        font-size: 15px !important;
    }
}
