/* ==========================================================================
   1. ĐỊNH DẠNG CHUNG & GIAO DIỆN MÁY TÍNH (DESKTOP)
   ========================================================================== */
.agency-header-v2 {
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.ah-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-sizing: border-box;
}

.ah-logo img {
    max-height: 80px;
    width: auto;
    display: block;
}

.ah-logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #000000;
    text-decoration: none;
}

/* Ẩn các linh kiện di động khi xem bằng máy tính */
.ah-mobile-menu-toggle,
.ah-search-container,
.ah-mobile-languages,
.ah-mobile-dropdown {
    display: none;
}

/* Cấu trúc 2 tầng cột bên phải Desktop */
.ah-right-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

/* Tầng trên Desktop: Hotline & Cờ */
.ah-top-bar {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ah-languages {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ah-flag img,
.agency-pll-flags li img {
    width: 32px !important;
    height: auto !important;
    display: block;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 2px;
}

.agency-pll-flags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agency-pll-flags li a {
    display: block;
    line-height: 0;
}

/* Nút Hotline đen */
.ah-hotline-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #111111;
    color: #ffffff;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.ah-hotline-btn:hover {
    background-color: #333333;
}

/* Tầng dưới Desktop: Menu ngang */
.ah-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 35px;
}

.ah-menu-list a {
    text-decoration: none;
    color: #000000;
    font-size: 16px;
    font-weight: 600;
    text-transform: capitalize;
    transition: color 0.3s ease;
}

.ah-menu-list a:hover {
    color: #ff0000;
}


/* ==========================================================================
   2. GIAO DIỆN ĐIỆN THOẠI CHUẨN MẪU (MOBILE - Chiều rộng < 850px)
   ========================================================================== */
@media (max-width: 850px) {
    /* Ẩn cột Desktop */
    .ah-right-wrapper {
        display: none !important;
    }

    /* Hiển thị các khối di động */
    .ah-mobile-menu-toggle,
    .ah-search-container,
    .ah-mobile-languages {
        display: flex;
    }

    /* Đưa toàn bộ lên 1 hàng ngang cân đối */
    .ah-container {
        padding: 12px 15px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        box-sizing: border-box;
        width: 100%;
    }

    /* Co nhỏ logo khớp tỷ lệ hình di động */
    .ah-logo img {
        max-height: 48px;
        width: auto;
    }

    /* NÚT 3 VẠCH HAMBURGER (Đặt sát Logo) */
    .ah-mobile-menu-toggle {
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 15px;
        outline: none;
        flex-shrink: 0;
        margin-left: 2px;
    }

    .ah-mobile-menu-toggle .bar {
        display: block;
        width: 100%;
        height: 2.5px;
        background-color: #000000;
        border-radius: 1px;
        transition: all 0.3s ease;
    }

    /* Hiệu ứng chuyển động mượt thành dấu X khi ấn mở */
    .ah-mobile-menu-toggle.active .bar:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    .ah-mobile-menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .ah-mobile-menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-6.5px) rotate(-45deg);
    }

    /* HỘP TÌM KIẾM BO TRÒN MÀU XÁM NHẠT (Nằm ở giữa) */
    .ah-search-container {
        flex-grow: 1; /* Tự động giãn khít khoảng trống ở giữa */
        display: flex;
        align-items: center;
    }

    .ah-search-form {
        width: 100%;
        position: relative;
        display: flex;
        align-items: center;
    }

    .ah-search-input {
        width: 100%;
        height: 40px;
        background-color: #f1f2f4; /* Màu nền xám nhạt */
        border: none;
        border-radius: 20px; /* Bo tròn hoàn toàn 2 đầu */
        padding: 0 15px 0 38px;
        font-size: 14px;
        color: #333333;
        outline: none;
        box-sizing: border-box;
    }

    /* Kính lúp đặt chuẩn xác trong hộp tìm kiếm */
    .ah-search-icon {
        position: absolute;
        left: 14px;
        display: flex;
        align-items: center;
        pointer-events: none;
        z-index: 2;
    }

    /* CỜ NGÔN NGỮ ĐẶT SÁT CẠNH NHAU (Góc phải cùng) */
    .ah-mobile-languages {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    /* Cờ Polylang trượt ngang khít nhau */
    .agency-pll-flags-mobi {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        gap: 2px; /* Ghép sát nhau như hình */
    }

    .agency-pll-flags-mobi li a {
        display: block;
        line-height: 0;
    }

    .agency-pll-flags-mobi li img,
    .fallback-flags-mobi img {
        width: 28px !important;
        height: 18px !important;
        display: block;
        border-radius: 0 !important; /* Vuông góc chuẩn mẫu */
        object-fit: cover;
    }

    .fallback-flags-mobi {
        display: flex;
        gap: 2px;
    }

    /* MENU SỔ XUỐNG DƯỚI HEADER KHI CLICK HAMBURGER (CHỈ HIỂN THỊ LINK CHỮ) */
    .ah-mobile-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 8px 16px rgba(0,0,0,0.08);
        display: none;
        flex-direction: column;
        padding: 15px 20px;
        border-top: 1px solid #f5f5f5;
        box-sizing: border-box;
        z-index: 999;
    }

    .ah-mobile-dropdown.open {
        display: flex;
    }

    .ah-mobile-menu-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .ah-mobile-menu-list li {
        border-bottom: 1px solid #f9f9f9;
        padding: 12px 0;
    }

    .ah-mobile-menu-list li:last-child {
        border-bottom: none;
    }

    .ah-mobile-menu-list li a {
        text-decoration: none;
        color: #111111;
        font-size: 16px;
        font-weight: 600;
        display: block;
    }
}
/* Ẩn hoàn toàn Header mặc định của Hello Elementor */
header.site-header, 
#site-header, 
.site-header {
    display: none !important;
}

/* Ẩn hoàn toàn Footer mặc định của Hello Elementor */
footer.site-footer,
#site-footer,
.site-footer {
    display: none !important;
}