/* =====================================================
   VẠN LỢI - GLOBAL HEADER V1.0
   LUXURY AUTOMOTIVE DESIGN

   01. Biến thiết kế
   02. Vô hiệu hóa Header mặc định
   03. Container
   04. Top Bar
   05. Logo
   06. Thanh tìm kiếm
   07. Hotline
   08. Menu chính
   09. Dropdown / Mega Menu
   10. Nút Tra cứu vỏ xe
   11. Sticky Header
   12. Hiệu ứng
   13. Tablet
   14. Mobile
===================================================== */

/* =====================================================
   01. BIẾN THIẾT KẾ

   Sửa tại đây nếu muốn đổi màu hoặc kích thước.
===================================================== */

.vl-gh {
    --gh-red: #C8102E;
    --gh-red-hover: #E51A3D;
    --gh-dark: #141414;
    --gh-carbon: #1B1D23;
    --gh-white: #FFFFFF;
    --gh-muted: #667080;
    --gh-border: #E1E5EB;

    /* Chiều rộng nội dung */
    --gh-width: 1320px;

    /* Kích thước logo */
    --gh-logo-width: 220px;
    --gh-logo-height: 65px;

    /* Chiều cao Header */
    --gh-main-height: 92px;
    --gh-nav-height: 58px;

    --gh-title: Montserrat, Arial, sans-serif;
    --gh-body: "Noto Sans", Arial, sans-serif;

    position: relative;
    z-index: 100;

    width: 100%;
    background: var(--gh-white);

    font-family: var(--gh-body);
    font-size: 14px;
    line-height: 1.5;

    box-shadow: 0 4px 18px rgba(0,0,0,.06);
}

.vl-gh,
.vl-gh *,
.vl-gh *::before,
.vl-gh *::after {
    box-sizing: border-box;
}

.vl-gh a {
    text-decoration: none;
}

.vl-gh ul,
.vl-gh li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vl-gh button {
    margin: 0;
    font-family: inherit;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.vl-gh :focus-visible {
    outline: 2px solid var(--gh-red);
    outline-offset: 3px;
}

/* =====================================================
   02. ẨN HEADER FLATSOME MẶC ĐỊNH

   Chỉ áp dụng khi Header Vạn Lợi được kích hoạt.
===================================================== */

body.vl-custom-header-active #header {
    display: none !important;
}

/* =====================================================
   03. CONTAINER CHUNG
===================================================== */

.vl-gh-container {
    width: 100%;
    max-width: calc(var(--gh-width) + 40px);
    padding: 0 20px;
    margin: 0 auto;
}

/* =====================================================
   04. TOP BAR
===================================================== */

.vl-gh-topbar {
    background: var(--gh-dark);
    color: #D4D8E0;
}

.vl-gh-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 37px;
}

.vl-gh-topbar-left,
.vl-gh-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.vl-gh-topbar-right a {
    color: #FFFFFF;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.vl-gh-topbar-right a:hover {
    color: #FF7189;
}

.vl-gh-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--gh-red);
    box-shadow: 0 0 8px #C8102E80;
}

.vl-gh-separator {
    width: 1px;
    height: 12px;
    background: #FFFFFF30;
}

/* =====================================================
   05. LOGO VÀ MAIN HEADER
===================================================== */

.vl-gh-main {
    background: #FFFFFF;
}

.vl-gh-main-inner {
    display: grid;

    grid-template-columns:
        240px minmax(0,1fr) auto;

    align-items: center;
    gap: 34px;

    min-height: var(--gh-main-height);
}

.vl-gh .vl-global-logo {
    display: flex;
    align-items: center;

    width: 100%;
    max-width: var(--gh-logo-width);
}

.vl-gh .vl-global-logo img {
    display: block;
    width: 100%;
    height: var(--gh-logo-height);

    object-fit: contain;
    object-position: left center;
}

.vl-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.vl-logo-text strong {
    color: #141414;
    font-family: var(--gh-title);
    font-size: 31px;
    font-style: italic;
    font-weight: 900;
    letter-spacing: -.045em;
}

.vl-logo-text small {
    margin-top: 5px;
    color: var(--gh-red);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .22em;
}

/* =====================================================
   06. THANH TÌM KIẾM
===================================================== */

.vl-gh-search {
    position: relative;

    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;
    max-width: 660px;

    margin: 0;
    padding: 5px 5px 5px 16px;

    background: #F5F6F8;
    border: 1px solid var(--gh-border);
    border-radius: 9px;

    transition:
        border-color .25s ease,
        box-shadow .25s ease;
}

.vl-gh-search:focus-within {
    border-color: var(--gh-red);
    box-shadow: 0 0 0 3px #C8102E12;
}

.vl-gh-search > svg {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    color: #79818D;
}

.vl-gh .vl-gh-search input {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 43px;

    margin: 0;
    padding: 0;

    background: transparent;
    border: 0;

    color: #141414;
    font-family: var(--gh-body);
    font-size: 14px;

    outline: none;
    box-shadow: none;
}

.vl-gh-search input::placeholder {
    color: #858D99;
}

.vl-gh .vl-gh-search button {
    flex-shrink: 0;

    min-height: 43px;
    padding: 10px 24px;

    background: var(--gh-red);
    border: 0;
    border-radius: 6px;

    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;

    transition: background .25s ease;
}

.vl-gh .vl-gh-search button:hover {
    background: #A90B25;
}

/* =====================================================
   07. HOTLINE
===================================================== */

.vl-gh .vl-gh-hotline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vl-gh-phone-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;
    flex: 0 0 48px;

    background: #FFF0F3;
    border: 1px solid #F4D5DC;
    border-radius: 50%;

    color: var(--gh-red);

    transition:
        background .3s ease,
        color .3s ease;
}

.vl-gh-phone-icon svg {
    width: 23px;
    height: 23px;
}

.vl-gh-hotline-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.vl-gh-hotline-info small {
    color: var(--gh-muted);
    font-size: 11px;
}

.vl-gh-hotline-info strong {
    color: var(--gh-red);
    font-family: var(--gh-title);
    font-size: 19px;
    font-weight: 800;
    white-space: nowrap;
}

.vl-gh-hotline:hover .vl-gh-phone-icon {
    background: var(--gh-red);
    color: #FFFFFF;
}

/* =====================================================
   08. MENU ĐIỀU HƯỚNG
===================================================== */

.vl-gh-navigation {
    position: relative;

    background:
        linear-gradient(
            110deg,
            #141414,
            #23262D
        );

    border-top: 1px solid #FFFFFF0A;
}

.vl-gh-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    min-height: var(--gh-nav-height);
}

.vl-gh-nav-inner > nav {
    flex: 1;
    min-width: 0;
}

.vl-gh-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vl-gh-menu > li {
    position: relative;
}

.vl-gh-menu > li > a {
    position: relative;

    display: flex;
    align-items: center;
    gap: 8px;

    min-height: var(--gh-nav-height);
    padding: 0 15px;

    color: #E0E3E9;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;

    transition: color .25s ease;
}

/* Đường gạch đỏ chuyển động dưới Menu */

.vl-gh-menu > li > a::before {
    content: "";

    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;

    height: 3px;

    background: var(--gh-red);

    transform: scaleX(0);
    transform-origin: left center;

    transition: transform .28s ease;
}

.vl-gh-menu > li:hover > a,
.vl-gh-menu > li.current-menu-item > a,
.vl-gh-menu > li.current-menu-ancestor > a {
    color: #FFFFFF;
}

.vl-gh-menu > li:hover > a::before,
.vl-gh-menu > li.current-menu-item > a::before,
.vl-gh-menu > li.current-menu-ancestor > a::before {
    transform: scaleX(1);
}

.vl-gh-menu > li:first-child > a {
    padding-left: 0;
}

.vl-gh-menu > li:first-child > a::before {
    left: 0;
}

/* Mũi tên menu con */

.vl-gh-menu
.menu-item-has-children > a::after {

    content: "";

    width: 6px;
    height: 6px;

    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;

    transform: rotate(45deg);

    margin-top: -3px;
}

/* =====================================================
   09. DROPDOWN MENU
===================================================== */

.vl-gh-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;

    z-index: 110;

    min-width: 255px;
    padding: 9px;

    background: #FFFFFF;
    border: 1px solid var(--gh-border);
    border-top: 3px solid var(--gh-red);

    border-radius: 0 0 11px 11px;

    box-shadow:
        0 15px 40px rgba(15,20,30,.13);

    opacity: 0;
    visibility: hidden;

    transform: translateY(8px);

    transition:
        opacity .22s ease,
        transform .22s ease,
        visibility .22s ease;
}

.vl-gh-menu li:hover > .sub-menu,
.vl-gh-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vl-gh-menu .sub-menu li {
    position: relative;
}

.vl-gh-menu .sub-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 43px;
    padding: 10px 13px;

    color: #343A45;
    font-size: 14px;
    font-weight: 500;

    border-radius: 6px;

    transition:
        color .2s ease,
        background .2s ease;
}

.vl-gh-menu .sub-menu a:hover {
    color: var(--gh-red);
    background: #FFF1F3;
}

.vl-gh-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    border-radius: 9px;
}

.vl-gh-menu
.sub-menu
.menu-item-has-children > a::after {
    transform: rotate(-45deg);
}

/* Mega Menu 2 cột

   Thêm CSS Class "vl-mega-menu"
   vào menu cha trong Appearance > Menus.
*/

.vl-gh-menu > .vl-mega-menu > .sub-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));

    min-width: 470px;
    padding: 16px;
    gap: 5px;
}

/* =====================================================
   10. NÚT TRA CỨU VỎ XE
===================================================== */

.vl-gh .vl-gh-finder-button {
    position: relative;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
    gap: 12px;

    min-height: 42px;
    padding: 9px 17px;

    background:
        linear-gradient(
            120deg,
            #D91A3D,
            #C8102E
        );

    border: 1px solid #FFFFFF15;
    border-radius: 7px;

    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
}

.vl-gh-finder-button svg {
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
}

.vl-gh-arrow {
    font-size: 19px;

    transition: transform .25s ease;
}

.vl-gh-finder-button:hover .vl-gh-arrow {
    transform: translateX(4px);
}

/* Racing sweep */

.vl-gh-finder-button::before {
    content: "";

    position: absolute;
    top: 0;
    bottom: 0;
    left: -70%;
    width: 40%;

    background:
        linear-gradient(
            90deg,
            transparent,
            #FFFFFF25,
            transparent
        );

    transform: skewX(-25deg);

    transition: left .55s ease;
}

.vl-gh-finder-button:hover::before {
    left: 140%;
}

/* =====================================================
   11. STICKY HEADER - STABILITY FIX V1.1

   Giữ chiều cao Header cố định khi cuộn trang.
   Chỉ thay đổi bóng đổ, không thay đổi kích thước.
   Tránh hiện tượng rung và nhảy nội dung.
===================================================== */

.vl-gh {
    position: sticky;
    top: 0;
    z-index: 100;

    transition: box-shadow .3s ease;
}

body.admin-bar .vl-gh {
    top: 32px;
}

/* Giữ nguyên chiều cao Header */

.vl-gh .vl-gh-main-inner,
.vl-gh.is-scrolled .vl-gh-main-inner {
    min-height: var(--gh-main-height);
}

/* Giữ nguyên kích thước logo */

.vl-gh .vl-global-logo img,
.vl-gh.is-scrolled .vl-global-logo img {
    height: var(--gh-logo-height);
}

/* Chỉ thay đổi bóng đổ khi cuộn */

.vl-gh.is-scrolled {
    box-shadow:
        0 8px 25px rgba(15,20,30,.12);
}

/* =====================================================
   12. NÚT MENU MOBILE
===================================================== */

.vl-gh-mobile-toggle {
    display: none;
}

.vl-gh-menu .vl-gh-sub-toggle {
    display: none;
}

/* =====================================================
   13. TABLET VÀ LAPTOP
===================================================== */

@media (max-width:1250px) {

    .vl-gh-main-inner {
        grid-template-columns:
            190px minmax(0,1fr) auto;

        gap: 22px;
    }

    .vl-gh-menu > li > a {
        padding: 0 10px;
        font-size: 13px;
    }

    .vl-gh-hotline-info strong {
        font-size: 17px;
    }

    .vl-gh-finder-button {
        gap: 8px;
    }
}

/* =====================================================
   14. MOBILE
===================================================== */

@media (max-width:1024px) {

    .vl-gh-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .vl-gh-topbar-inner {
        justify-content: center;
    }

    .vl-gh-topbar-left {
        display: none;
    }

    .vl-gh-topbar-right {
        font-size: 11px;
    }

    .vl-gh-main-inner {
        grid-template-columns:
            42px minmax(0,1fr) 42px;

        gap: 12px;

        min-height: 75px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .vl-gh .vl-gh-mobile-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        gap: 5px;

        width: 42px;
        height: 42px;
        min-height: 0;
        padding: 8px;

        background: #F5F6F8;
        border: 1px solid var(--gh-border);
        border-radius: 7px;

        box-shadow: none;
    }

    .vl-gh-mobile-toggle span {
        display: block;

        width: 21px;
        height: 2px;

        background: var(--gh-dark);
        border-radius: 2px;

        transition:
            transform .25s ease,
            opacity .25s ease;
    }

    .vl-gh.is-menu-open
    .vl-gh-mobile-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .vl-gh.is-menu-open
    .vl-gh-mobile-toggle span:nth-child(2) {
        opacity: 0;
    }

    .vl-gh.is-menu-open
    .vl-gh-mobile-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .vl-gh .vl-global-logo {
        justify-content: center;
        max-width: 100%;
    }

    .vl-gh .vl-global-logo img {
        width: 175px;
        height: 48px;
        object-position: center;
    }

    .vl-gh .vl-gh-hotline-info {
        display: none;
    }

    .vl-gh-phone-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .vl-gh-search {
        grid-column: 1 / -1;
        grid-row: 2;

        max-width: none;
        gap: 8px;

        padding-left: 10px;
    }

    .vl-gh .vl-gh-search input {
        font-size: 16px;
        height: 38px;
    }

    .vl-gh .vl-gh-search button {
        min-height: 38px;
        padding: 8px 14px;
        font-size: 12px;
    }

    /* Nếu JS lỗi, menu vẫn hiển thị để sử dụng */

    .vl-gh-navigation {
        max-height: 65vh;
        overflow-y: auto;
    }

    .vl-gh.is-ready:not(.is-menu-open)
    .vl-gh-navigation {
        display: none;
    }

    .vl-gh-nav-inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 12px;

        padding-top: 12px;
        padding-bottom: 16px;
    }

    .vl-gh-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .vl-gh-menu > li {
        border-bottom: 1px solid #FFFFFF12;
    }

    .vl-gh-menu > li > a,
    .vl-gh-menu > li:first-child > a {
        min-height: 46px;
        padding: 12px 8px;
        font-size: 14px;
    }

    .vl-gh-menu > li > a::before {
        display: none;
    }

    .vl-gh-menu .menu-item-has-children > a {
        padding-right: 48px;
    }

    .vl-gh-menu .menu-item-has-children > a::after {
        display: none;
    }

    .vl-gh-menu .vl-gh-sub-toggle {
        position: absolute;
        top: 4px;
        right: 0;

        display: flex;
        align-items: center;
        justify-content: center;

        width: 38px;
        height: 38px;
        min-height: 0;
        padding: 0;

        background: #FFFFFF09;
        border: 1px solid #FFFFFF18;
        border-radius: 5px;

        color: #FFFFFF;
        font-size: 20px;
    }

    .vl-gh-menu .sub-menu,
    .vl-gh-menu .sub-menu .sub-menu,
    .vl-gh-menu > .vl-mega-menu > .sub-menu {
        position: static;

        display: block;

        width: 100%;
        min-width: 0;

        margin: 0;
        padding: 6px 0 8px 14px;

        background: transparent;
        border: 0;
        border-radius: 0;

        opacity: 1;
        visibility: visible;
        transform: none;

        box-shadow: none;
    }

    .vl-gh.is-ready
    .vl-gh-menu li:not(.is-expanded) > .sub-menu {
        display: none;
    }

    .vl-gh-menu .sub-menu a {
        color: #D9DDE5;
        font-size: 13px;
    }

    .vl-gh-menu .sub-menu a:hover {
        color: #FFFFFF;
        background: #FFFFFF08;
    }

    .vl-gh .vl-gh-finder-button {
        min-height: 46px;
        width: 100%;
    }

    /* Giữ Header mobile ổn định khi cuộn */

.vl-gh .vl-gh-main-inner,
.vl-gh.is-scrolled .vl-gh-main-inner {
    min-height: 75px;
}

.vl-gh .vl-global-logo img,
.vl-gh.is-scrolled .vl-global-logo img {
    height: 48px;
}
}

@media (max-width:782px) {

    body.admin-bar .vl-gh {
        top: 46px;
    }
}

@media (max-width:600px) {

    body.admin-bar .vl-gh {
        top: 0;
    }
}

@media (max-width:380px) {

    .vl-gh-topbar-right {
        gap: 6px;
        font-size: 10px;
    }

    .vl-gh-topbar-right > span:first-child {
        display: none;
    }

    .vl-gh .vl-gh-search button {
        padding: 8px 10px;
    }
}

/* =====================================================
   15. ACCESSIBILITY
===================================================== */

@media (prefers-reduced-motion:reduce) {

    .vl-gh *,
    .vl-gh *::before,
    .vl-gh *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Thanh điều hướng desktop khi cuộn */
.vl-gh-compact-logo,
.vl-gh-compact-search {
    display: none;
}

@media (min-width:1025px) {
    .vl-gh.vl-gh-compact-ready {
        top: calc(0px - var(--gh-scroll-offset, 0px));
    }

    body.admin-bar .vl-gh.vl-gh-compact-ready {
        top: calc(32px - var(--gh-scroll-offset, 0px));
    }

    .vl-gh.is-compact .vl-gh-nav-inner {
        gap: clamp(8px, 1.4vw, 18px);
    }

    .vl-gh.is-compact .vl-gh-compact-logo,
    .vl-gh.is-compact .vl-gh-compact-search {
        display: block;
        flex: none;
    }

    .vl-gh.is-compact .vl-gh-compact-logo .vl-global-logo {
        width: auto;
        max-width: 92px;
    }

    .vl-gh.is-compact .vl-gh-compact-logo img {
        width: auto;
        max-width: 92px;
        height: 26px;
    }

    .vl-gh.is-compact .vl-gh-compact-logo .vl-logo-text strong {
        color: #fff;
        font-size: 21px;
    }

    .vl-gh.is-compact .vl-gh-compact-logo .vl-logo-text small {
        color: #ff7189;
        font-size: 8px;
    }

    .vl-gh.is-compact .vl-gh-menu > li > a {
        padding-inline: clamp(5px, .8vw, 12px);
        font-size: 13px;
    }

    .vl-gh-compact-search {
        position: relative;
    }

    .vl-gh-compact-search > summary {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border: 1px solid #ffffff48;
        border-radius: 8px;
        color: #fff;
        font-size: 25px;
        line-height: 1;
        cursor: pointer;
        list-style: none;
    }

    .vl-gh-compact-search > summary::-webkit-details-marker { display: none; }

    .vl-gh-compact-search > .vl-gh-search {
        position: absolute;
        z-index: 2;
        right: 0;
        top: calc(100% + 10px);
        width: min(420px, 42vw);
        margin: 0;
        box-shadow: 0 8px 25px rgba(15,20,30,.18);
    }
}
