﻿
body, html {
    margin: 0;
    font-family: system-ui, sans-serif;
}

/* ─── Reusable dropdown style (global cả web) ─── */
/* Container: position:relative để menu absolute-position relative theo trigger. */
.tv-dd { position: relative; }

/* Trigger (giả input): border xám nhạt, bo 0.5rem, padding pill, caret chevron-down phải. */
.tv-dd-trigger {
    width: 100%; padding: 0.75rem 1.1rem; border: 1px solid #d0d0d0; border-radius: 0.5rem; background: #fff;
    cursor: pointer; font-size: 1.1rem; color: #000;
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; user-select: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tv-dd-trigger:hover { border-color: #b0b0b0; }
.tv-dd.open .tv-dd-trigger { border-color: var(--ORANGE, #ff981f); box-shadow: 0 0 0 3px rgba(255,152,31,0.12); }

.tv-dd-caret { flex-shrink: 0; transition: transform 0.2s; opacity: 0.6; }
.tv-dd.open .tv-dd-caret { transform: rotate(180deg); opacity: 1; color: var(--ORANGE, #ff981f); }

/* Menu xổ XUỐNG dưới trigger (drop-down). Trang nào cần xổ lên (cv-search-dd) thì override `top/bottom`. */
.tv-dd-menu {
    position: absolute; top: calc(100% + 0.5rem); left: 0; right: 0;
    background: #fff; border-radius: 0.5rem; box-shadow: 0 12px 28px rgba(0,0,0,0.15);
    padding: 0.4rem; z-index: 50;
    opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.tv-dd.open .tv-dd-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }

.tv-dd-item {
    padding: 0.7rem 1rem; font-size: 1.1rem; color: #000; cursor: pointer;
    border-radius: 0.35rem; white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.tv-dd-item:hover { background: rgba(255,152,31,0.12); color: var(--ORANGE, #ff981f); }
.tv-dd-item.active { background: var(--ORANGE, #ff981f); color: #fff; font-weight: 600; }
.tv-dd-item.active:hover { background: var(--ORANGE, #ff981f); color: #fff; }

/* ─── Hide native scrollbar (dùng custom floating tv-scrollbar) ─── */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ─── Custom floating scrollbar (cam, bên phải, fixed) ─── */
.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);
}
.tv-scrollbar-thumb {
    position: absolute;
    left: 0;
    right: 0;
    background: var(--ORANGE, #ff981f);
    border-radius: 999px;
    min-height: 2rem;
    transition: background 0.2s;
}
.tv-scrollbar-thumb:hover, .tv-scrollbar.dragging .tv-scrollbar-thumb { background: #cc6a0f; }
.tv-scrollbar-car {
    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-car { cursor: grabbing; }
/* Chỉ phình icon khi hover/drag — KHÔNG phình khi .scrolling vì class đó add/remove mỗi 600ms khi cuộn, gây nhấp nháy giật icon */
.tv-scrollbar:hover .tv-scrollbar-car,
.tv-scrollbar.dragging .tv-scrollbar-car {
    width: 3.5rem;
    height: 3.5rem;
    right: calc(100% + 0.75rem);
}
@media (max-width: 991.98px) {
    .tv-scrollbar-car { display: none !important; }
}

.header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: none;
    height: 10rem;
}

@media (max-width: 767.98px) {
    .mini-header.h5rem { height: 7rem; justify-content: center; display: flex;}
}

.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; /* mini-header: full trắng đặc */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

    .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;
}

    .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(--ORANGE, #ff981f);
    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(--ORANGE, #ff981f);
    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;
        }
}
