﻿
body, html {
    margin: 0;
    font-family: system-ui, sans-serif;
}

/* ─── Ẩn native scrollbar (dùng custom floating tv-scrollbar bên dưới) ─── */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ─── Custom floating scrollbar (xanh chủ đạo, bên phải, fixed) ─── */
/* Track mảnh, mờ; phình to khi hover / đang scroll / đang drag */
.tv-scrollbar {
    position: fixed;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 45vh;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    z-index: 9000;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18), 0 1px 3px rgba(0,0,0,0.1);
    transition: width 0.2s ease, right 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.tv-scrollbar:hover, .tv-scrollbar.dragging, .tv-scrollbar.scrolling {
    width: 12px;
    right: 1rem;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.12);
}
/* Thumb dùng màu xanh chủ đạo của TransViet (var(--BLUE)), đậm hơn khi hover/drag */
.tv-scrollbar-thumb {
    position: absolute;
    left: 0;
    right: 0;
    background: var(--BLUE, #005792);
    border-radius: 999px;
    min-height: 2rem;
    transition: background 0.2s;
}
.tv-scrollbar-thumb:hover, .tv-scrollbar.dragging .tv-scrollbar-thumb { background: #003d66; }

/* Icon máy bay bám theo thumb — JS set top = top thumb + nửa chiều cao thumb (đã trừ lùi qua translateY(-50%)) */
.tv-scrollbar-plane {
    position: absolute;
    right: calc(100% + 0.5rem);
    width: 2.25rem;
    height: 2.25rem;
    object-fit: contain;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
    transform: translateY(-50%);
    transition: right 0.25s ease, width 0.25s ease, height 0.25s ease;
}
.tv-scrollbar.dragging .tv-scrollbar-plane { cursor: grabbing; }
/* Chỉ phình icon khi hover/drag — KHÔNG phình khi .scrolling vì class đó được add/remove liên tục mỗi 600ms khi cuộn, gây nhấp nháy giật icon */
.tv-scrollbar:hover .tv-scrollbar-plane,
.tv-scrollbar.dragging .tv-scrollbar-plane {
    width: 3.5rem;
    height: 3.5rem;
    right: calc(100% + 0.75rem);
}
@media (max-width: 991.98px) {
    .tv-scrollbar-plane { display: none !important; }
}

/* ─── Floating scroll-to-top FAB — animate ẩn/hiện mượt mà ─── */
/* Mặc định: ẩn hoàn toàn (max-height + margin-top = 0) → không chiếm chỗ, cụm 3 nút trên sát bottom container. */
/* Khi có class .tv-fab-visible: phình ra + opacity 1 + dịch lên đúng chỗ → đồng thời margin-top tạo khoảng cách, đẩy cụm 3 nút lên một cách mượt. */
#tvScrollTopFab {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    transform: translateY(20px);
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.35s ease, opacity 0.35s ease, transform 0.35s ease, margin-top 0.35s ease;
}
#tvScrollTopFab.tv-fab-visible {
    opacity: 1;
    max-height: 4rem;
    margin-top: 1.25rem;
    transform: translateY(0);
    pointer-events: auto;
}

.header {
    background: var(--WHITE);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    height: 10rem;
}

.mini-header {
    position: fixed; /* 🔹 Dính cố định màn hình */
    top: 0; /* 🔹 Cố định ở mép trên */
    left: 0;
    width: 100%;
    z-index: 1000; /* 🔹 Luôn nằm trên nội dung khác */
    background-color: #fff; /* hoặc dùng var(--bgwhite) nếu bạn có biến màu */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    backdrop-filter: blur(8px); /* tùy chọn: mờ nền nhẹ */
}

    .mini-header.active {
        transform: translateY(0);
        opacity: 1;
    }


.header-container {
    max-width: 1400px;
}

.right-info {
/*    padding-left: 5vw;*/
}

.logo {
    width: 10rem;
}

.btn-yellow {
    background: #ffca28;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
}

.btn-blue {
    background: #2196f3;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
}

.main-nav {
    background: white;
    border-top: 1px solid #eee;
}

    .main-nav ul {
        display: flex;
        justify-content: center;
        list-style: none;
        margin: 0;
        padding: 0.5rem;
        flex-wrap: wrap;
    }

    .main-nav li {
        margin: 0 1rem;
    }

    .main-nav a {
        text-decoration: none;
        color: #000;
        font-weight: 500;
    }

/* Tablet (992px) */
@media (max-width: 992px) {
    .contact {
        display: none;
    }
}

/* ══════════ MOBILE SIDEBAR MENU ══════════ */
.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.mobile-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 85vw;
    max-width: 360px;
    height: 100vh;
    background: #fff;
    overflow-y: auto;
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.mobile-sidebar-header {
    border-bottom: 1px solid #eee;
}

/* Nút icon (✕ đóng / ☰ menu) trên header mobile: luôn vuông, icon canh giữa bằng flexbox */
.btn-icon-square {
    height: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.mobile-sidebar-logo {
    width: 8rem;
}

.mobile-sidebar-icon {
    width: 2.2rem;
    height: 2.2rem;
    object-fit: contain;
    aspect-ratio: 1 / 1;
}

.mobile-sidebar-menu {
    padding: 0.5rem 0;
}

.mobile-menu-item {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.mobile-menu-title:active {
    background: #f5f5f5;
}

.mobile-menu-arrow {
    font-size: 2rem;
    color: #999;
    transition: transform 0.2s;
    display: inline-block;
}

.mobile-menu-arrow.expanded {
    transform: rotate(180deg);
}

.mobile-submenu {
    padding-left: 1rem;
}

.mobile-submenu-group {
    border-top: 1px solid #f5f5f5;
}

.mobile-submenu-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--BLUE, #1976d2);
    cursor: pointer;
    user-select: none;
}

.mobile-submenu-title:active {
    background: #f9f9f9;
}

.mobile-submenu-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0.5rem 2rem;
}

.mobile-submenu-list li {
    padding: 0.5rem 1rem;
    color: #333;
    cursor: pointer;
}

.mobile-submenu-list li:active {
    color: var(--BLUE, #1976d2);
    background: #f5f5f5;
}

/* Mobile (768px) */
@media (max-width: 768px) {
    .actions {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        flex-direction: column;
        text-align: center;
    }

        .main-nav.active {
            display: flex;
        }

        .main-nav ul {
            flex-direction: column;
        }

        .main-nav li {
            margin: 0.5rem 0;
        }
}
