/* ==========================================================================
   1. RESET & CORE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    overflow-x: hidden;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

img {
    max-width: 100%;
    display: block;
    height: auto;
}

/* ==========================================================================
   2. DESIGN SYSTEM VARIABLES
   ========================================================================== */
:root {
    --primary: #10b981;       
    --primary-hover: #059669;
    --accent: #f97316;        
    --accent-hover: #ea580c;
    --dark: #0f172a;          
    --slate-600: #475569;
    --slate-100: #f1f5f9;
    --border: #e2e8f0;
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    
    --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   3. TOP BAR
   ========================================================================== */
.top-bar {
    background: var(--dark);
    color: #f8fafc;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

@media (max-width: 991px) {
    .top-bar { display: none; }
}

/* ==========================================================================
   4. HEADER MIDDLE
   ========================================================================== */
.header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.header-inner {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.logo img {
    display: block;
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

.search-box {
    flex: 1;
    max-width: 500px;
    display: flex;
    position: relative;
}

.search-box input {
    width: 100%;
    height: 48px;
    border: 2px solid var(--primary);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    padding: 0 18px;
    outline: none;
    font-size: 18px;
    font-family: inherit;
    color: var(--dark);
    transition: all 0.3s;
}

.search-box input:focus {
    background: #fafafa;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.05);
}

.search-box button {
    width: 90px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.search-box button:hover {
    background: var(--primary-hover);
}

.contact {
    display: flex;
    gap: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ecfdf5;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-icon svg {
    width: 20px;
    height: 20px;
}

.contact-label {
    font-size: 11px;
    color: var(--slate-600);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.contact-value {
    color: var(--dark);
    font-weight: 700;
    margin-top: 1px;
    font-size: 14px;
}

.mobile-btn {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    color: var(--dark);
}

.mobile-btn svg {
    width: 26px;
    height: 26px;
}

.mobile-btn:active {
    background: var(--slate-100);
    color: var(--primary);
}

/* ==========================================================================
   5. MAIN NAVIGATION (DESKTOP)
   ========================================================================== */
.navbar {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 99;
    box-shadow: var(--shadow-md);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 65px;
}

.menu {
    display: flex;
    align-items: center;
}

.menu > li {
    position: relative;
}

.menu > li > a {
    height: 65px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    gap: 6px;
    text-transform: uppercase;
}

.menu > li > a svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
    transition: transform 0.2s;
}

.menu > li:hover > a {
    background: var(--primary-hover);
}

.menu > li:hover > a svg {
    transform: translateY(2px);
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: #ffffff;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s var(--transition), transform 0.25s var(--transition), visibility 0.25s;
    z-index: 1000;
}

.menu li:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li {
    position: relative;
}

.submenu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    color: var(--dark);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.submenu a svg {
    width: 14px;
    height: 14px;
    color: #94a3b8;
}

.submenu a:hover {
    background: #f0fdf4;
    color: var(--primary);
    padding-left: 24px;
}

.submenu a:hover > svg {
    color: var(--primary);
}

.submenu .submenu {
    top: -8px;
    left: 100%;
    border-radius: var(--radius-md);
}

.auth {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    height: 65px;
    text-transform: uppercase;
}

.auth a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 4px;
}

.auth a:hover {
    color: var(--dark);
}

/* ==========================================================================
   6. MOBILE NAVIGATION & DRAWERS (Tối ưu cho cấu trúc Tách biệt Vùng Bấm)
   ========================================================================== */
.mobile-search {
    display: none;
    padding: 4px 0 16px;
    animation: slideDown 0.2s var(--transition);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-search.active { display: block; }
.mobile-search-wrap { display: flex; }

.mobile-search input {
    width: 100%;
    height: 44px;
    border: 2px solid var(--primary);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    padding: 0 14px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
}

.mobile-search button {
    width: 74px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-weight: 700;
    font-size: 14px;
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0.3s;
}

.mobile-overlay.active {
    visibility: visible;
    pointer-events: auto;
}

.mobile-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active .mobile-backdrop { opacity: 1; }

.mobile-sidebar {
    width: 310px;
    max-width: 85%;
    height: 100%;
    background: #ffffff;
    position: relative;
    z-index: 2;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    will-change: transform;
}

.mobile-overlay.active .mobile-sidebar { transform: translateX(0); }

.mobile-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-header .logo { font-size: 22px; }

.close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--slate-600);
}

.close-btn:active { background: var(--slate-100); }

.mobile-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    -webkit-overflow-scrolling: touch;
}

/* Khối bọc ngang bảo vệ hàng lối */
.menu-item-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
}

/* Thẻ Link Chữ Điều hướng gốc (Cấp 1) */
.mobile-link {
    display: block;
    padding: 12px 20px;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    transition: background-color 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Nút kích hoạt mở rộng Mũi tên gốc (Cấp 1) */
.mobile-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

/* HIỆU ỨNG TRẠM (TOUCH FEEDBACK) CHO RIÊNG TỪNG PHẦN TỬ KHI BẤM */
@media (hover: none) {
    .mobile-link:active {
        background-color: rgba(16, 185, 129, 0.05) !important;
        color: var(--primary) !important;
    }
    
    .mobile-trigger:active {
        background-color: rgba(16, 185, 129, 0.08) !important;
        transform: scale(0.92); /* Tạo cảm giác đàn hồi riêng nút bấm */
    }

    .mobile-trigger:active .arrow {
        color: var(--primary) !important;
    }
}

/* Fallback khi rê chuột trên thiết bị Test giả lập Desktop */
.mobile-link:hover { color: var(--primary); }
.mobile-trigger:hover .arrow { color: var(--primary); }

/* Khối Submenu cuộn đóng mở */
.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    background: #f8fafc;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}

.mobile-submenu.active {
    max-height: 1200px; 
    transition: max-height 0.35s ease-in-out;
}

/* ---- XỬ LÝ PHÂN BẬC THỤT LỀ THEO CHUẨN CẤU TRÚC MỚI ---- */

/* Menu Cấp 2 (Con của Submenu đầu tiên) */
.mobile-submenu > li .mobile-link {
    padding-left: 36px !important; 
    font-size: 14px !important;
    font-weight: 600;
    color: var(--dark);
}

/* Menu Cấp 3 (Lồng sâu bên trong cấp 2) */
.mobile-submenu .mobile-submenu > li .mobile-link {
    padding-left: 56px !important;
    font-size: 13.5px !important;
    font-weight: 500;
    color: var(--slate-600);
}

.arrow {
    display: flex;
    transition: transform 0.25s var(--transition);
    color: #94a3b8;
}

.arrow svg { width: 18px; height: 18px; }
.arrow.rotate {
    transform: rotate(180deg);
    color: var(--primary);
}

.mobile-footer {
    border-top: 1px solid var(--border);
    padding: 22px 20px;
    background: #f8fafc;
}

.mobile-info-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--slate-600);
}

.mobile-info-line:last-child { margin-bottom: 0; }
.mobile-info-line svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

/* ==========================================================================
   7. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1199px) {
    .menu > li > a { padding: 0 16px; }
    .contact { gap: 18px; }
}

@media (max-width: 991px) {
    .contact { display: none; }
    .search-box { max-width: 380px; }
}

@media (max-width: 767px) {
    .header-inner { min-height: 72px; }
    .search-box, .menu { display: none; }
    .mobile-btn { display: flex; }
    .logo { font-size: 22px; }

    .nav-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 50px;
        gap: 10px;
    }

    .nav-text-mobile {
        display: block !important;
        color: #ffffff;
        font-size: 16px;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .auth {
        display: flex !important;
        gap: 6px;
        font-size: 12px;
        white-space: nowrap;
        height: auto;
    }
    
    .auth a {
        height: auto;
    }
}

.nav-text-mobile {
    display: none;
}

/* Trên máy tính (màn hình lớn hơn 1024px), biến link thành văn bản thường, không cho click */
@media (min-width: 1024px) {
    .phone-link {
        pointer-events: none; /* Khóa sự kiện click */
        cursor: default;       /* Đổi trỏ chuột thành dạng text thông thường */
        color: inherit;        /* Giữ nguyên màu chữ của thẻ cha */
        text-decoration: none; /* Bỏ gạch chân nếu có */
    }
}