/* Thiết lập font nền chung giống mẫu */
body {
    font-family: 'Roboto', sans-serif;
    color: #333;
    overflow-x: hidden;
    background-color: #f8f9fa;
}

/* 1. TOP BAR */
.top-bar {
    background-color: #b20a0a; /* Màu đỏ đô sẫm */
    font-size: 13px;
}
.top-bar a:hover {
    text-decoration: underline !important;
    opacity: 0.9;
}

/* 2. NAVBAR BRAND */
.font-brand-title { font-size: 16px; color: #b20a0a !important; font-weight: 700; }
.font-brand-subtitle { font-size: 15px; color: #b20a0a !important; font-weight: 700; margin-top: 1px; }
.navbar-nav .nav-link {
    color: #1a1a1a;
    font-size: 14.5px;
}
.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
    color: #b20a0a !important;
}

/* 3. HERO BANNER */
.hero-section {
    min-height: 520px;
    display: flex;
    align-items: center;
}
.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}
.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0.92) 40%, rgba(255,255,255,0.5) 70%, rgba(255,255,255,0.1) 100%);
    z-index: 2;
}
/* Đối với màn hình mobile/tablet nhỏ thì làm tối để dễ đọc chữ trắng */
@media (max-width: 991.98px) {
    .hero-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
    .hero-content-left h1, .hero-content-left h2 {
        color: #fff !important;
    }
    .hero-content-left p {
        color: #eaeaea !important;
    }
    .hero-content-left .text-dark-50 {
        color: #ddd !important;
    }
}
@media (min-width: 992px) {
    .hero-content-left h1 { color: #0d2757 !important; } /* Xanh tím than */
    .hero-content-left h2 { color: #d61c1c !important; } /* Đỏ tươi thương hiệu */
    .hero-content-left p { color: #444 !important; }
    .hero-content-left .text-dark-50 { color: #555 !important; }
}

.z-index-2 { position: relative; z-index: 3; }

/* Nút bấm Custom */
.btn-danger-custom {
    background-color: #d61c1c;
    color: white;
    border-radius: 4px;
}
.btn-danger-custom:hover { background-color: #b20a0a; color: white; }

.btn-blue-custom {
    background-color: #0c3987;
    color: white;
    border-radius: 4px;
}
.btn-blue-custom:hover { background-color: #062356; color: white; }

.btn-outline-light-custom {
    border: 1px solid #111;
    background-color: transparent;
    border-radius: 4px;
}
.btn-outline-light-custom:hover { background-color: #111; color: #fff !important; }

/* Biểu tượng thống kê nhỏ ở khối banner */
.stat-icon-wrapper {
    color: #d61c1c;
    font-size: 24px;
    margin-top: 4px;
}
.text-danger-custom {
    color: #d61c1c;
}
.text-navy {
    color: #0d2757;
}

/* 4. CARD TÌM KIẾM NGÀNH HỌC */
.search-card {
    border-top: 4px solid #d61c1c !important;
}
.bg-light-custom {
    background-color: #fdfdfd;
    border: 1px solid #e2e8f0;
    color: #555;
}
.search-card .btn-danger {
    background-color: #d61c1c;
    border: none;
}
.search-card .btn-danger:hover {
    background-color: #b20a0a;
}

/* 5. THANH THỐNG KÊ PHÍA DƯỚI (STATS BAR) */
.stats-bar-wrapper {
    margin-top: -40px; /* Đẩy thanh đè lên banner */
    z-index: 10;
}
.inner-stats-bar {
    border-bottom: 5px solid #d61c1c;
}
@media (min-width: 768px) {
    .border-end-md {
        border-right: 1px solid #e9ecef;
    }
}
.bottom-icon {
    font-size: 24px;
    opacity: 0.8;
}

/* ==========================================
   CSS CHO SECTION "TẠI SAO CHỌN NUTE?"
   ========================================== */

.why-choose-nute {
    padding-top: 5rem !important; /* Tạo khoảng cách an toàn với thanh Stats Bar phía trên */
}

/* Kiểu dáng tiêu đề chính và dấu gạch đỏ nhỏ phía dưới */
.section-title {
    font-size: 26px;
    letter-spacing: 0.5px;
}
.title-line-decor {
    width: 45px;
    height: 3px;
    background-color: #d61c1c; /* Đúng màu đỏ thương hiệu NUTE */
    border-radius: 2px;
}

/* Khối nội dung tính năng */
.feature-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    height: 100%;
}
/* Hiệu ứng nhấc nhẹ lên khi di chuột qua nhằm tăng trải nghiệm người dùng */
.feature-item:hover {
    transform: translateY(-5px);
}

/* Định dạng Icon kết hợp viền xanh navy mảnh như mẫu */
.feature-icon {
    font-size: 32px;
    color: #0c3987; /* Màu xanh thương hiệu chủ đạo */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 65px;
    border: 1.5px solid #0c3987;
    border-radius: 35% 65% 65% 35% / 40% 40% 60% 60%; /* Tạo dáng bo icon ngẫu nhiên nhẹ nhàng đầy nghệ thuật */
    background-color: #ffffff;
    transition: all 0.3s ease;
}
.feature-item:hover .feature-icon {
    background-color: #0c3987;
    color: #ffffff;
    border-radius: 50%;
}

/* Tùy chỉnh kích thước font chữ cho các khối nhỏ */
.feature-item h4 {
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700 !important;
}
.feature-item p {
    font-size: 13px;
    color: #555555;
    line-height: 1.4;
}
.feature-item p strong {
    color: #111111;
}

/* Tối ưu hóa hiển thị khi trên màn hình quá bé (Mobile dọc) */
@media (max-width: 375px) {
    .feature-item h4 {
        font-size: 13.5px;
    }
    .feature-item p {
        font-size: 11.5px;
    }
}

/* ==========================================
   CSS CHO SECTION "KHÁM PHÁ NGÀNH HỌC NỔI BẬT"
   ========================================== */

.featured-majors {
    background-color: #f4f6f9 !important; /* Màu nền xám nhạt làm nổi bật card trắng */
}

/* Đường gạch ngang nhỏ dưới tiêu đề góc trái */
.title-line-decor-left {
    width: 35px;
    height: 3px;
    background-color: #0c3987;
    border-radius: 2px;
}

/* Link Xem tất cả ngành */
.view-all-link {
    transition: color 0.2s ease;
}
.view-all-link:hover {
    color: #d61c1c !important;
}

/* Chia màn hình thành đúng 5 cột trên PC lớn (xl) */
@media (min-width: 1200px) {
    .col-xl-2\.4 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

/* Thiết lập ảnh trong Card */
.card-img-wrapper {
    height: 155px;
    overflow: hidden;
    background-color: #eaeaea;
}
.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.card:hover .card-img-top {
    transform: scale(1.06); /* Phóng nhẹ hình ảnh khi rê chuột */
}

/* Custom nhãn dán Hot màu đỏ bo tròn nhẹ góc */
.badge-hot {
    font-size: 11px;
    background-color: #d61c1c !important;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* Chữ trong phần nội dung Card */
.card-title {
    line-height: 1.4;
    transition: color 0.2s ease;
}
.card:hover .card-title {
    color: #d61c1c !important; /* Tiêu đề đổi màu khi hover */
}
.card-text {
    font-size: 13px;
    color: #666 !important;
    line-height: 1.45;
}

/* Link xem chi tiết */
.learn-more-btn {
    font-size: 13px;
    color: #0c3987;
    transition: gap 0.2s ease;
}
.learn-more-btn i {
    transition: transform 0.2s ease;
}
.card:hover .learn-more-btn i {
    transform: translateX(4px); /* Mũi tên dịch sang phải nhẹ khi hover */
}

/* TỐI ƯU TRÊN THIẾT BỊ DI ĐỘNG (Xoay vuốt ngang dạng chuỗi Slider) */
@media (max-width: 767.98px) {
    .overflow-x-auto-mobile {
        display: flex !important;
        overflow-x: auto !important;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    .overflow-x-auto-mobile::-webkit-scrollbar {
        height: 4px; /* Thanh cuộn mảnh trên mobile */
    }
    .overflow-x-auto-mobile::-webkit-scrollbar-thumb {
        background-color: #ccc;
        border-radius: 2px;
    }
    .major-card-item {
        flex: 0 0 auto;
    }
    .section-header-block {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 12px;
    }
}

/* Cấu trúc hai nút điều hướng trái/phải nằm hai bên sườn */
.slider-container {
    position: relative;
}
.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background-color: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}
.slider-nav-btn:hover {
    background-color: #0c3987;
    color: #ffffff;
    border-color: #0c3987;
}
.btn-prev {
    left: -18px;
}
.btn-next {
    right: -18px;
}

/* ==========================================
   CSS CHO SECTION "TIN TỨC & SỰ KIỆN"
   ========================================== */

.fs-7 { font-size: 14px; }
.bg-light-events { background-color: #f8fafc; }
.shadow-xs { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }

/* --- 1. PHẦN TIN TỨC --- */
.view-all-text {
    font-size: 13px;
    transition: color 0.2s ease;
}
.view-all-text:hover { color: #d61c1c !important; text-decoration: underline !important; }

/* Hiệu ứng phóng to nhẹ ảnh bài viết khi di chuột */
.img-hover-zoom {
    position: relative;
}
.img-hover-zoom img {
    transition: transform 0.4s ease;
}
.main-news-item:hover .img-hover-zoom img {
    transform: scale(1.04);
}
.main-news-title a {
    transition: color 0.2s ease;
}
.main-news-item:hover .main-news-title a {
    color: #d61c1c !important;
}

/* Các tin phụ nhỏ phía dưới */
.sub-news-img {
    width: 75px;
    height: 48px;
    background-color: #f1f5f9;
}
.sub-news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.border-top-dash {
    border-top: 1px dashed #e2e8f0;
}
.sub-news-title a {
    transition: color 0.2s ease;
}
.sub-news-item:hover .sub-news-title a {
    color: #d61c1c !important;
}

/* --- 2. PHẦN SỰ KIỆN --- */
/* Khối hiển thị lịch ngày tháng bên trái */
.date-badge {
    background-color: #fff2f2;
    min-width: 58px;
    border: 1px solid #ffe3e3;
}
.tracking-xs {
    letter-spacing: 0.2px;
}
.event-card-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #f1f5f9;
}
.event-card-item:hover {
    transform: translateX(4px); /* Dịch nhẹ sang phải khi di chuột giống cấu trúc UI chuyên nghiệp */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05) !important;
}
.event-title-link a {
    transition: color 0.2s ease;
}
.event-card-item:hover .event-title-link a {
    color: #d61c1c !important;
}

/* Custom Nút Đăng ký sự kiện */
.event-card-item .btn-outline-danger {
    color: #d61c1c;
    border-color: #ffcccc;
    font-size: 12px;
    background-color: #fff;
    transition: all 0.2s ease;
}
.event-card-item .btn-outline-danger:hover {
    background-color: #d61c1c;
    border-color: #d61c1c;
    color: #fff;
}

/* --- Tối ưu hóa cắt chữ khi tiêu đề quá dài (Line Clamp) --- */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

/* --- Điều chỉnh hiển thị Responsive cho màn hình rất nhỏ --- */
@media (max-width: 575.98px) {
    .event-card-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
    .event-card-item .btn-outline-danger {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================
   CSS CHO TIẾNG NÓI NUTE, ĐỐI TÁC & CHATBOT
   ========================================== */

/* Thẻ ý kiến sinh viên */
.testimonial-card {
    border-left: 4px solid #d61c1c !important; /* Điểm nhấn viền đỏ bên trái giống mẫu */
    min-height: 140px;
}
.avatar-wrapper {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #d61c1c; /* Vòng đỏ bao quanh avatar */
}
.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.italic-text {
    font-style: italic;
    line-height: 1.4;
}
.style-sub-text {
    font-size: 11px;
}
.quote-icon {
    right: 20px;
    bottom: 20px;
    font-size: 20px;
    color: #0c3987;
    opacity: 0.15;
}

/* Khối logo các đối tác */
.partner-logo {
    flex: 0 0 auto;
    width: 110px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.partner-logo img {
    max-width: 100%;
    max-height: 100%;
    filter: grayscale(20%); /* Giữ màu nguyên bản nhẹ */
    transition: filter 0.2s;
}
.partner-logo img:hover {
    filter: grayscale(0%);
}
.partner-slider-container .btn-prev { left: -15px; }
.partner-slider-container .btn-next { right: -15px; }

/* LAYOUT WIDGET AI CHATBOT (FIXED) */
.ai-chatbot-widget {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 290px;
    z-index: 9999;
}
.chat-box-card {
    border: 1px solid #e2e8f0 !important;
}
.chat-header {
    background: linear-gradient(135deg, #0c3987, #062356);
}
.bot-avatar {
    width: 32px;
    height: 32px;
    background-color: #fff;
    border-radius: 50%;
    padding: 3px;
}
.bot-avatar img {
    width: 100%;
    height: 100%;
}
.active-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border: 1.5px solid #fff;
    border-radius: 50%;
}

/* Bong bóng chat trợ lý */
.bot-msg-bubble {
    background-color: #f1f5f9;
    max-width: 85%;
    border-radius: 0 12px 12px 12px !important;
}

/* Nút bấm gợi ý */
.chat-suggestions .btn-outline-light-chat {
    font-size: 11.5px;
    color: #475569;
    border: 1px solid #cbd5e1;
    background-color: #fff;
    border-radius: 20px;
    padding: 5px 8px;
    text-align: center;
    display: block;
    transition: all 0.2s ease;
}
.chat-suggestions .btn-outline-light-chat:hover {
    color: #0c3987;
    border-color: #0c3987;
    background-color: #f8fafc;
}
.chat-footer input::placeholder {
    font-size: 12px;
}

/* Ẩn widget chatbot trên màn hình điện thoại siêu nhỏ để tránh che nội dung */
@media (max-width: 575.98px) {
    .ai-chatbot-widget {
        display: none !important;
    }
}

/* Style cho nút tròn mở chat */
.btn-chat-toggle {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #d61c1c, #b20a0a);
    color: white;
    border: none;
    position: absolute;
    bottom: 0;
    right: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-chat-toggle:hover {
    transform: scale(1.1);
    color: white;
}

/* Hiệu ứng hiển thị mượt mà cho hộp chat */
@keyframes popUp {
    from {
        transform: scale(0.8) translateY(50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.chat-box-card:not(.d-none) {
    animation: popUp 0.3s forwards ease-out;
}

/* ==========================================
   CSS CHO PHẦN MAIN FOOTER (CHÂN TRANG)
   ========================================== */

.main-footer {
    background-color: #920404; /* Màu đỏ sẫm nền móng của hệ thống nhận diện thương hiệu NUTE */
}

/* Kiểu chữ tiêu đề các cột */
.footer-title {
    font-size: 14px;
    letter-spacing: 0.5px;
    color: #ffffff;
    position: relative;
}

/* Định dạng các đường link trong Footer */
.footer-links-list li {
    margin-bottom: 9px;
}
.footer-links-list a {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 13px;
    display: inline-block;
}
.footer-links-list a:hover {
    color: #ffffff !important;
    transform: translateX(3px); /* Nhích nhẹ sang phải khi di chuột qua tạo sinh khí cho trang */
}

/* Khối viền phân tách các nhóm liên kết (Chỉ hiển thị trên PC lớn giống mẫu) */
@media (min-width: 1200px) {
    .border-start-custom {
        border-left: 1px solid rgba(255, 255, 255, 0.15);
        padding-left: 25px;
    }
    .border-end-custom {
        border-right: 1px solid rgba(255, 255, 255, 0.15);
        padding-right: 25px;
    }
    /* Chia tỉ lệ đặc biệt cho 6 cột */
    .col-xl-2\.5 { flex: 0 0 21%; max-width: 21%; }
    .col-xl-1\.8 { flex: 0 0 14%; max-width: 14%; }
    .col-xl-2 { flex: 0 0 16%; max-width: 16%; }
    .col-xl-2\.3 { flex: 0 0 21%; max-width: 21%; }
}

/* Các hộp vuông chứa icon MXH */
.social-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}
.social-box:hover {
    background-color: #ffffff;
    color: #920404;
    border-color: #ffffff;
}

/* Hộp Input đăng ký nhận tin bản tin */
.newsletter-form .input-group {
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.newsletter-form input {
    font-size: 13px;
}
.btn-danger-custom, .btn-danger-send {
    background-color: #d61c1c;
    border: none;
    border-radius: 4px !important;
    transition: background-color 0.2s;
}
.btn-danger-send:hover {
    background-color: #b20a0a;
}

/* Thanh Copyright dưới đáy */
.footer-bottom a:hover {
    text-decoration: underline !important;
}
.mb-2\.5 {
    margin-bottom: 10px;
}
.line-height-base {
    line-height: 1.5;
}

.edu-box {
    transition: all 0.2s ease;
    cursor: pointer;
}
.edu-box:hover {
    background-color: #0c3987 !important;
    border-color: #0c3987 !important;
}
.edu-box:hover h6, .edu-box:hover i {
    color: #ffffff !important;
}

/* ==========================================
   CSS CHO SECTION "THÀNH TỰU & KHEN THƯỞNG"
   ========================================== */

.achievement-card {
    background-color: #ffffff;
    border-color: #f1f5f9 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hiệu ứng nhấc card và đổi màu nhẹ bao quanh khi hover */
.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(13, 39, 87, 0.08) !important;
    border-color: rgba(214, 28, 28, 0.2) !important;
}

/* Vòng tròn chứa Icon */
.achievement-icon-box {
    width: 65px;
    height: 65px;
    background-color: #fff5f5;
    border: 1px solid #ffe3e3;
    transition: all 0.3s ease;
}

/* Đổi màu vòng tròn icon khi hover vào card mẹ */
.achievement-card:hover {
    background-color: #fdfdfd;
}

.achievement-card:hover .achievement-icon-box {
    background-color: #d61c1c;
    color: #ffffff !important;
    transform: rotateY(180deg); /* Hiệu ứng lật icon 3D nhẹ đầy ấn tượng */
}

.achievement-card h5 {
    transition: color 0.2s ease;
}

.achievement-card:hover h5 {
    color: #d61c1c !important;
}

.achievement-card p {
    line-height: 1.5;
    color: #64748b !important;
}

/* ==========================================
   CSS CHO THANH TIỆN ÍCH DỌC BÊN SƯỜN PHẢI
   ========================================== */

.sticky-quick-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%); /* Căn giữa dọc màn hình */
    width: 75px;
    z-index: 9995; /* Nằm dưới widget chatbot một chút */
    background: linear-gradient(to bottom, #d61c1c, #920404); /* Đỏ tươi xuống đỏ đô sẫm theo mẫu */
}

/* Các thành phần liên kết bên trong */
.sidebar-item-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-item-link:hover {
    background-color: rgba(0, 0, 0, 0.15);
    padding-right: 12px !important; /* Hiệu ứng nhô nhẹ ra khi hover */
}

/* Biểu tượng Icon */
.sidebar-icon {
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chữ mô tả nhỏ phía dưới */
.sidebar-text {
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.2;
    display: block;
}

/* Đường gạch đứt phân chia màu trắng mờ */
.border-bottom-dash-white {
    border-bottom: 1px dashed rgba(255, 255, 255, 0.25);
}

/* Custom riêng cho nút Messenger có icon màu trắng */
.text-messenger {
    color: #ffffff;
}

/* Tự chế Icon tròn Zalo như mẫu */
.zalo-dot {
    background-color: #ffffff;
    color: #0068ff; /* Màu xanh Zalo gốc */
    font-size: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ô dưới cùng - Lên đầu trang màu tối hơn */
.bg-dark-red {
    background-color: #700202 !important;
}

/* Tối ưu hóa: Ẩn hoàn toàn trên Mobile (dưới 768px) để tránh đè chữ, 
   trên màn hình vừa phải thì đẩy dịch vị trí lên tránh đè nút chat */
@media (max-width: 991.98px) {
    .sticky-quick-sidebar {
        top: 40%;
    }
}

/* --- KHÔI PHỤC VÀ SỬA LỖI HOVER MENU 3 CẤP --- */
@media (min-width: 1200px) {
    /* 1. MẶC ĐỊNH: Ẩn tất cả các menu con (Cấp 2 và Cấp 3) để chuẩn bị cho hiệu ứng */
    .navbar-nav .dropdown-menu {
        display: block !important; /* Bắt buộc dùng block để chạy hiệu ứng transition */
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.25s ease-in-out;
    }

    /* 2. CẤP 1 HOVER -> HIỂN THỊ CẤP 2 */
    /* Chỉ hiển thị đúng menu con trực tiếp của Cấp 1, không làm ảnh hưởng tới Cấp 3 */
    .navbar-nav .nav-item.dropdown:hover > .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* 3. ĐỊNH VỊ MENU CẤP 3 (SUB-MENU) */
    /* Đẩy vị trí menu cấp 3 sang hẳn bên phải của menu cấp 2 */
    .dropdown-submenu {
        position: relative;
    }

        .dropdown-submenu .dynamic-submenu {
            top: 0;
            left: 100%;
            margin-top: -1px;
            margin-left: 2px;
            transform: translateX(10px) !important; /* Đẩy nhẹ sang phải để làm hiệu ứng trượt */
        }

        /* 4. CẤP 2 HOVER -> HIỂN THỊ CẤP 3 */
        /* Khi đưa chuột vào mục li của cấp 2, chỉ hiển thị đúng menu cấp 3 trực thuộc nó */
        .dropdown-submenu:hover > .dynamic-submenu {
            opacity: 1;
            visibility: visible;
            transform: translateX(0) !important;
        }

        /* 5. ĐỔI HƯỚNG MŨI TÊN TAM GIÁC CỦA CẤP 2 */
        /* Biến mũi tên chỉ xuống thành mũi tên chỉ sang bên phải */
        .dropdown-submenu .dropdown-toggle::after {
            border-top: 0.3em solid transparent;
            border-left: 0.3em solid;
            border-bottom: 0.3em solid transparent;
            border-right: 0;
            margin-left: auto; /* Đẩy sát mũi tên về rìa bên phải */
        }
}

/* --- ĐẢM BẢO HIỂN THỊ TRÊN MOBILE (DƯỚI 1200PX) --- */
@media (max-width: 1199px) {
    .navbar-nav .dropdown-menu {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    .dropdown-submenu .dynamic-submenu {
        position: relative;
        left: 0;
        top: 0;
        margin-left: 15px; /* Thụt lề vào trong để phân biệt cấp */
        box-shadow: none !important;
        border-left: 2px solid #E2E8F0 !important;
        border-radius: 0;
    }
}

/* Custom CSS sửa lỗi tràn dòng Header trên các thiết bị di động nhỏ */
@media (max-width: 576px) {
    .navbar-brand img {
        height: 40px !important; /* Thu nhỏ bớt chiều cao logo trên mobile */
    }

    .logo-text-wrapper strong.font-brand-subtitle {
        font-size: 11px !important; /* Thu nhỏ cỡ chữ tên công ty để khít trên 1 dòng */
    }

    .logo-text-wrapper strong.font-brand-title {
        font-size: 9px !important;
    }

    /* Tinh chỉnh khoảng cách cho vùng menu con khi bấm xổ ra trên mobile */
    .navbar-collapse .navbar-nav .nav-link {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* Fix lỗi viền xanh mặc định khi bấm nút Toggler của Bootstrap trên một số trình duyệt di động */
.navbar-toggler:focus {
    box-shadow: none !important;
    outline: none;
}