/* Main Navigation Styles */
.site-header {
    position: relative;
}

.header-top {
    position: relative;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
}

.nav-item {
    position: relative;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap;
    cursor: pointer;
}

    .nav-link:hover {
        color: #007bff;
    }

.dropdown-icon {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    transition: transform 0.3s;
}

/* Header Actions - Buttons (chỉ hiển thị trên desktop) */
.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-left: auto;
}

.btn-header {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

    .btn-header i {
        font-size: 0.875rem;
    }

.btn-primary {
    background: #0066cc;
    color: #ffffff;
    border: 1px solid #0066cc;
}

    .btn-primary:hover {
        background: #0052a3;
        border-color: #0052a3;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
        color: #ffffff;
    }

.btn-success {
    background: #28a745;
    color: #ffffff;
    border: 1px solid #28a745;
}

    .btn-success:hover {
        background: #218838;
        border-color: #218838;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(40, 167, 69, 0.25);
        color: #ffffff;
    }

/* Nút Tra cứu kết quả riêng cho mobile - ẩn trên desktop */
.btn-tracuu-mobile {
    display: none;
    margin-left: auto;
    margin-right: 0.5rem;
}

    /* ✅ Fix: Ghi đè hover để giữ transform căn giữa, không bị lệch khi hover/active */
    .btn-tracuu-mobile:hover,
    .btn-tracuu-mobile:active,
    .btn-tracuu-mobile:focus {
        transform: translateX(-50%);
        box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
        background: #0052a3;
        border-color: #0052a3;
        color: #ffffff;
    }

/* Floating Contact Buttons */
.floating-contact-buttons {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.float-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

    .float-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    }

    .float-btn i {
        font-size: 26px;
    }

    .float-btn img {
        width: 35px;
        height: 35px;
        object-fit: contain;
    }

.float-btn-phone {
    background: linear-gradient(135deg, #f8f9fa 0%, #f8f9fa 100%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    }

    50% {
        box-shadow: 0 4px 20px rgba(255, 107, 107, 0.6);
    }
}

.float-btn-zalo {
    background: linear-gradient(135deg, #f8f9fa 0%, #f8f9fa 100%);
    padding: 12px;
}

.float-btn-facebook {
    background: linear-gradient(135deg, #f8f9fa 0%, #f8f9fa 100%);
}

/* ===== DROPDOWN MENU STYLES - CLICK TO TOGGLE ===== */
.nav-item.dropdown {
    position: static;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0 !important;
    right: 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    background: #fff;
    border-top: 3px solid #007bff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 2.5rem 0;
    z-index: 1000;
    list-style: none;
    pointer-events: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

/* Show dropdown when active class is added (via JavaScript) */
.nav-item.dropdown.active .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Rotate arrow when dropdown is active */
.nav-item.dropdown.active > .nav-link .dropdown-icon {
    transform: rotate(180deg);
}

/* Wrapper for dropdown content - Flexbox layout */
.dropdown-menu-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

/* Left side - Menu items (2 columns grid) */
.dropdown-menu-wrapper {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    column-gap: 3rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Right side - Featured image - CHỈ HIỂN THỊ TRÊN PC/LAPTOP */
.dropdown-menu-featured {
    display: block;
    flex: 0 0 440px;
    width: 440px;
}

    .dropdown-menu-featured img {
        width: 440px !important;
        height: 300px !important;
        object-fit: cover;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

/* Dropdown menu items */
.dropdown-menu-wrapper > li {
    margin: 0;
    padding: 0;
    list-style: none;
    list-style-type: none;
}

    .dropdown-menu-wrapper > li::before {
        content: none;
    }

    .dropdown-menu-wrapper > li > a {
        display: block;
        padding: 12px;
        color: #333;
        text-decoration: none;
        border-radius: 6px;
        transition: all 0.2s;
        font-size: 0.95rem;
        line-height: 1.5;
    }

        .dropdown-menu-wrapper > li > a:hover {
            background-color: #f8f9fa;
            color: #007bff;
            transform: translateX(5px);
        }

        .dropdown-menu-wrapper > li > a i {
            margin-right: 0.75rem;
            color: #666;
            width: 20px;
            text-align: center;
        }

/* ===== MOBILE QUICK ACTIONS ===== */
.mobile-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

.mobile-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.5rem;
    text-decoration: none;
    color: #ffffff;
    background-color: #1a56b0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background-color 0.2s ease;
    text-align: center;
    min-height: 70px;
}

    .mobile-action-card:hover {
        background-color: #154a9e;
        color: #ffffff;
    }

    .mobile-action-card .action-icon {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        border: 2px solid rgba(255, 255, 255, 0.8);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0.5rem;
        font-size: 1.2rem;
    }

    .mobile-action-card .action-text {
        font-size: 0.8rem;
        font-weight: 500;
        line-height: 1.3;
    }

/* Màu riêng cho từng ô nếu cần phân biệt */
.mobile-action-register {
    background-color: #1a56b0;
}

.mobile-action-package {
    background-color: #1a56b0;
}

.mobile-action-service {
    background-color: #1a56b0;
}

.mobile-action-specialty {
    background-color: #1a56b0;
}

/* Responsive */

/* Desktop lớn - Giữ nguyên kích thước 440x300 */
@media (min-width: 1281px) {
    .dropdown-menu-featured {
        display: block;
        flex: 0 0 440px;
        width: 440px;
    }

        .dropdown-menu-featured img {
            width: 440px !important;
            height: 300px !important;
        }

    .btn-tracuu-mobile {
        display: none !important;
    }
}

/* Desktop nhỏ - Vẫn hiển thị nhưng thu nhỏ */
@media (max-width: 1280px) and (min-width: 1025px) {
    .dropdown-menu-container {
        max-width: 1000px;
        gap: 2rem;
    }

    .dropdown-menu-wrapper {
        column-gap: 2rem;
    }

    .dropdown-menu-featured {
        display: block;
        flex: 0 0 440px;
        width: 440px;
    }

        .dropdown-menu-featured img {
            width: 440px !important;
            height: 300px !important;
        }

    .btn-tracuu-mobile {
        display: none !important;
    }
}

/* Tablet & Mobile - ẨN HOÀN TOÀN ẢNH ĐẠI DIỆN */
@media (max-width: 1024px) {
    .dropdown-menu {
        margin-left: 0;
        width: 100%;
        padding: 2rem 1rem;
    }

    .dropdown-menu-container {
        max-width: 900px;
        padding: 0 1rem;
        flex-direction: column;
        gap: 2rem;
    }

    .dropdown-menu-wrapper {
        grid-template-columns: 1fr;
        column-gap: 1.5rem;
    }

    .dropdown-menu-featured {
        display: none !important;
    }

    .header-actions {
        display: none;
    }

    /* Hiện nút tra cứu mobile - căn giữa tuyệt đối */
    .btn-tracuu-mobile {
        display: inline-flex;
        font-size: 16px;
        padding: 0.4rem 0.75rem;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
    }

        /* ✅ Fix: Giữ nguyên transform khi hover/active/focus trên mobile */
        .btn-tracuu-mobile:hover,
        .btn-tracuu-mobile:active,
        .btn-tracuu-mobile:focus {
            transform: translateX(-50%);
        }

    .floating-contact-buttons {
        right: 15px;
        bottom: 15px;
        gap: 10px;
    }

    .float-btn {
        width: 50px;
        height: 50px;
    }

        .float-btn i {
            font-size: 22px;
        }

        .float-btn img {
            width: 50px;
            height: 50px;
        }
}

/* Mobile */
@media (max-width: 768px) {
    .nav-list {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-item.dropdown {
        position: relative;
        width: 100%;
    }

    .dropdown-menu {
        position: relative;
        width: 100%;
        margin-left: 0;
        padding: 1rem 0;
        border: none;
        box-shadow: none;
        background: #f8f9fa;
    }

    .dropdown-menu-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .dropdown-menu-wrapper {
        grid-template-columns: 1fr;
        gap: 0;
    }

        .dropdown-menu-wrapper > li > a {
            padding: 0.75rem 1rem;
            border-radius: 0;
        }

    .dropdown-menu-featured {
        display: none !important;
    }

    .nav-link {
        width: 100%;
        justify-content: space-between;
    }

    .header-actions {
        display: none;
    }

    /* Căn giữa tuyệt đối trên mobile nhỏ */
    .btn-tracuu-mobile {
        display: inline-flex;
        font-size: 14px;
        padding: 0.35rem 0.65rem;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
    }

        /* ✅ Fix: Giữ nguyên transform khi hover/active/focus trên mobile nhỏ */
        .btn-tracuu-mobile:hover,
        .btn-tracuu-mobile:active,
        .btn-tracuu-mobile:focus {
            transform: translateX(-50%);
        }

    .floating-contact-buttons {
        right: 10px;
        bottom: 10px;
        gap: 8px;
    }

    .float-btn {
        width: 45px;
        height: 45px;
    }

        .float-btn i {
            font-size: 20px;
        }

        .float-btn img {
            width: 40px;
            height: 40px;
        }
}

/* Tablet trung bình */
@media (max-width: 992px) and (min-width: 769px) {
    .dropdown-menu-container {
        max-width: 700px;
    }

    .dropdown-menu-featured {
        display: none !important;
    }
}
