/* =========================================================
   Header toàn trang (Views/Shared/Components/Partial/_HeaderTop.cshtml)
   Dòng trên .hd-top: logo + liên hệ · Dòng dưới .hd-nav: menu + tìm tin tức (dính đầu trang)
   Điện thoại (< 992px): .hd-top dính đầu trang, menu thành ngăn kéo trượt từ phải
   Màu: #174095 (xanh đậm), #008fe2 (xanh nước), #e2541b (cam nhấn)
   ========================================================= */

/* Header cũ dùng position: fixed + body padding-top trên điện thoại → bỏ */
@media (max-width: 992px) { body { padding-top: 0 !important; } }

/* ---------- Dòng trên ---------- */
.hd-top { background: #fff; border-bottom: 1px solid #edf0f5; }
.hd-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 10px; padding-bottom: 10px; }
.hd-logo { display: flex; align-items: center; gap: 12px; color: #174095; flex-shrink: 0; }
.hd-logo:hover { text-decoration: none; color: #174095; }
.hd-logo img { width: 64px; height: 64px; object-fit: contain; }
.hd-brand { display: flex; flex-direction: column; line-height: 1.25; }
.hd-brand b { font-size: 19px; font-weight: 700; letter-spacing: .3px; color: #174095; }
.hd-brand small { font-size: 12.5px; color: #6b7487; margin-top: 2px; }

.hd-contacts { display: flex; align-items: center; gap: 22px; }
.hd-contact { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hd-contact-icon {
    flex: 0 0 40px; height: 40px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #e6f4fd; color: #008fe2; font-size: 16px;
}
.hd-contact-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.hd-contact-text small { font-size: 12px; color: #8a93a6; }
.hd-contact-text a, .hd-contact-text > span { font-size: 14px; font-weight: 700; color: #1d2b4f; }
.hd-contact-text a:hover { color: #008fe2; text-decoration: none; }
.hd-sep { color: #b0b9c9; margin: 0 4px; font-weight: 400; }
.hd-contact-address .hd-contact-text > span {
    max-width: 230px; font-weight: 600; font-size: 13.5px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hd-cta {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 30px; white-space: nowrap;
    background: linear-gradient(120deg, #f26a2e, #e2541b); color: #fff; font-weight: 700; font-size: 14px;
    box-shadow: 0 6px 16px rgba(226, 84, 27, .28); transition: transform .2s, box-shadow .2s;
}
.hd-cta:hover { color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(226, 84, 27, .35); }
.hd-mobile-actions { display: none; }

/* ---------- Dòng dưới: thanh menu ---------- */
.hd-nav {
    position: sticky; top: 0; z-index: 1000;
    background: linear-gradient(90deg, #174095, #1b4fae);
    transition: box-shadow .2s;
}
.hd-nav.is-stuck { box-shadow: 0 6px 20px rgba(10, 30, 80, .25); }
.hd-nav-inner { display: flex; align-items: center; justify-content: space-between; }
.mn-head, .mn-search, .mn-foot, .mn-mobile-only, .mn-toggle, .mn-ico { display: none; }
.mn-list { display: flex; list-style: none; margin: 0; padding: 0; }
.mn-item { position: relative; }
.mn-item > a {
    display: block; padding: 0 13px; line-height: 50px; color: #fff; font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .2px; white-space: nowrap; transition: background .2s;
    border-bottom: 3px solid transparent;
}
.mn-item > a:hover, .mn-item:hover > a, .mn-item:focus-within > a { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.mn-item.active > a { border-bottom-color: #5cc8ff; background: rgba(255, 255, 255, .08); }
.mn-item.has-sub > a::after { content: "\f107"; font-family: "Font Awesome 5 Free"; font-weight: 900; margin-left: 6px; font-size: 12px; opacity: .8; }

/* Menu con thả xuống */
.mn-item .sub {
    position: absolute; top: 100%; left: 0; z-index: 20; min-width: 270px; padding: 8px;
    background: #fff; border-radius: 0 0 12px 12px; box-shadow: 0 14px 34px rgba(10, 30, 80, .18);
    opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s, transform .18s, visibility .18s;
}
.mn-item:hover .sub, .mn-item:focus-within .sub { opacity: 1; visibility: visible; transform: none; }
.mn-item .sub a {
    display: block; padding: 9px 12px; border-radius: 8px; color: #33405e; font-size: 14px; line-height: 1.4;
    border-bottom: 0; transition: background .15s, color .15s;
}
.mn-item .sub a:hover { background: #f4f8fd; color: #008fe2; text-decoration: none; }
.mn-item .sub-wide { display: grid; grid-template-columns: 1fr 1fr; column-gap: 4px; width: 560px; }

/* Nút tìm kiếm + ô tìm */
.hd-nav-right { display: flex; align-items: center; gap: 6px; }
.hd-nav-btn {
    display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 0; border-radius: 20px;
    background: rgba(255, 255, 255, .14); color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .2s;
}
.hd-nav-btn:hover, .hd-search-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .26); color: #fff; text-decoration: none; }
.hd-search { position: absolute; left: 0; right: 0; top: 100%; background: #fff; box-shadow: 0 14px 30px rgba(10, 30, 80, .16); padding: 14px 0; }
.hd-search[hidden] { display: none; }
.hd-search-form { display: flex; align-items: center; gap: 10px; border: 2px solid #008fe2; border-radius: 12px; padding: 4px 4px 4px 16px; }
.hd-search-form > i { color: #8a93a6; }
.hd-search-form input { flex: 1; border: 0; outline: 0; font-size: 16px; padding: 8px 0; min-width: 0; }
.hd-search-form button[type=submit] { border: 0; border-radius: 8px; padding: 10px 20px; background: #008fe2; color: #fff; font-weight: 700; cursor: pointer; }
.hd-search-form button[type=submit]:hover { background: #174095; }
.hd-search-close { border: 0; background: none; color: #8a93a6; font-size: 18px; width: 40px; height: 40px; cursor: pointer; }

/* Màn hình laptop nhỏ: ẩn địa chỉ, thu gọn menu */
@media (min-width: 992px) and (max-width: 1199px) {
    .hd-contact-address { display: none; }
    .mn-item > a { padding: 0 9px; font-size: 12px; }
    .hd-search-btn span { display: none; }
}

/* ---------- Điện thoại / máy tính bảng ---------- */
@media (max-width: 991px) {
    .hd-top { position: sticky; top: 0; z-index: 1001; box-shadow: 0 2px 12px rgba(10, 30, 80, .08); }
    .hd-top-inner { padding-top: 8px; padding-bottom: 8px; gap: 10px; }
    .hd-logo img { width: 46px; height: 46px; }
    .hd-brand b { font-size: 15.5px; }
    .hd-brand small { font-size: 11.5px; }
    .hd-contacts { display: none; }
    .hd-mobile-actions { display: flex; align-items: center; gap: 6px; }
    .hd-icon-btn {
        width: 42px; height: 42px; border: 0; border-radius: 12px; background: #f1f6fc; color: #174095;
        display: inline-flex; align-items: center; justify-content: center; font-size: 17px; cursor: pointer;
    }
    .hd-icon-btn:hover { color: #008fe2; text-decoration: none; }
    .hd-burger { flex-direction: column; gap: 4px; background: #174095; }
    .hd-burger span { display: block; width: 20px; height: 2.5px; border-radius: 2px; background: #fff; }

    /* Thanh menu biến thành ngăn kéo */
    .hd-nav { position: static; background: none; height: 0; }
    .hd-nav-right, .hd-search { display: none !important; }
    .mn {
        position: fixed; top: 0; right: 0; bottom: 0; z-index: 10010; width: min(88vw, 370px);
        display: flex; flex-direction: column; background: #fff; overflow-y: auto; -webkit-overflow-scrolling: touch;
        transform: translateX(105%); transition: transform .3s ease; box-shadow: -10px 0 30px rgba(10, 30, 80, .2);
        visibility: hidden;
    }
    body.mn-open { overflow: hidden; }
    body.mn-open .mn { transform: none; visibility: visible; }
    .mn-overlay { position: fixed; inset: 0; z-index: 10005; background: rgba(10, 20, 40, .5); backdrop-filter: blur(2px); }
    .mn-overlay[hidden] { display: none; }
    body.mn-open .zalo-chat-widget, body.mn-open #quickToolsModal, body.mn-open #quickToolsToggle { display: none !important; }

    .mn-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 12px 16px; border-bottom: 1px solid #edf0f5; }
    .mn-head .hd-logo img { width: 40px; height: 40px; }
    .mn-head .hd-logo b { font-size: 15px; }
    .mn-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #f1f6fc; color: #174095; font-size: 18px; cursor: pointer; }

    .mn-search { display: flex; margin: 14px 16px 6px; border: 1.5px solid #dbe4f0; border-radius: 12px; overflow: hidden; }
    .mn-search:focus-within { border-color: #008fe2; }
    .mn-search input { flex: 1; border: 0; outline: 0; padding: 11px 14px; font-size: 15.5px; min-width: 0; }
    .mn-search button { border: 0; width: 48px; background: #008fe2; color: #fff; font-size: 16px; }

    .mn-list { display: block; padding: 6px 0; }
    .mn-mobile-only { display: block; }
    .mn-item { display: flex; flex-wrap: wrap; align-items: center; border-bottom: 1px solid #f1f4f9; }
    .mn-item > a {
        flex: 1; display: flex; align-items: center; gap: 12px; padding: 13px 16px; line-height: 1.35;
        color: #1d2b4f; font-size: 15px; font-weight: 600; text-transform: none; letter-spacing: 0;
        border-bottom: 0; border-left: 3px solid transparent; white-space: normal;
    }
    .mn-item > a:hover, .mn-item:hover > a, .mn-item:focus-within > a { background: #f4f8fd; color: #008fe2; }
    .mn-item.active > a { color: #008fe2; background: #f4f8fd; border-left-color: #008fe2; }
    .mn-item.has-sub > a::after { content: none; }
    .mn-ico { display: inline-block; width: 22px; text-align: center; color: #008fe2; font-size: 16px; }
    .mn-toggle {
        display: inline-flex; align-items: center; justify-content: center; width: 52px; align-self: stretch;
        border: 0; border-left: 1px solid #f1f4f9; background: none; color: #6b7487; font-size: 18px; cursor: pointer;
    }
    .mn-toggle i { transition: transform .25s; }
    .mn-item.sub-open .mn-toggle i { transform: rotate(180deg); color: #008fe2; }
    .mn-item .sub, .mn-item .sub-wide {
        position: static; flex-basis: 100%; width: auto; min-width: 0; display: none; padding: 4px 0 8px;
        border-radius: 0; box-shadow: none; background: #f7f9fc; opacity: 1; visibility: visible; transform: none;
    }
    .mn-item.sub-open .sub { display: block; }
    .mn-item .sub a { padding: 10px 16px 10px 53px; border-radius: 0; font-size: 14px; color: #4a5568; }

    .mn-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding: 16px; background: #f7f9fc; border-top: 1px solid #edf0f5; }
    .mn-call {
        display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px;
        background: linear-gradient(120deg, #008fe2, #174095); color: #fff; font-weight: 700; font-size: 15px;
    }
    .mn-call-alt { background: #fff; color: #174095; border: 1.5px solid #dbe4f0; }
    .mn-call:hover { color: #fff; text-decoration: none; }
    .mn-call-alt:hover { color: #008fe2; }
    .mn-mail { text-align: center; font-size: 13.5px; color: #6b7487; padding-top: 2px; }
}
@media (max-width: 380px) {
    .hd-brand small { display: none; }
    .hd-brand b { font-size: 14px; }
}

/* Không xuống dòng số điện thoại / email / nút */
.hd-contact-text a, .hd-contact-text > span, .hd-nav-btn, .hd-cta { white-space: nowrap; }
.hd-brand small i { color: #008fe2; margin-right: 3px; }
@media (max-width: 991px) {
    .hd-brand small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
}
/* Menu con 2 cột (Hướng dẫn) nằm gần mép phải → căn theo mép phải mục cha để không tràn ngang */
@media (min-width: 992px) { .mn-item .sub-wide { left: auto; right: 0; } }
@media (max-width: 991px) {
    /* Ngăn kéo là flex cột cuộn được: không cho phần tử con bị co (ô tìm kiếm từng bị ép còn 2px) */
    .mn > * { flex-shrink: 0; }
    /* Dòng trên: tên + địa chỉ co lại, cắt "..." để không đẩy nút tìm / menu ra ngoài màn hình */
    .hd-top-inner > .hd-logo { flex: 1 1 auto; min-width: 0; }
    .hd-brand { min-width: 0; }
    .hd-brand b, .hd-brand small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hd-mobile-actions { flex-shrink: 0; }
}
/* Thanh menu dính đầu trang cao ~50px → các cột "dính" khi cuộn (trang tin, chi tiết...) phải nằm dưới thanh menu */
@media (min-width: 992px) { .np-sticky { top: 70px !important; } }
