/* ==========================================================
   HV Header – Lớp 1 (thương hiệu) + Lớp 2 (menu)
   ========================================================== */
.hv-header {
    --hv-primary: var(--e-global-color-primary, #6F5E4B);
    --hv-accent: var(--e-global-color-secondary, #922B2A);
    --hv-accent-dark: color-mix(in srgb, var(--hv-accent) 80%, #000);
    --hv-text: #1d2733;
    --hv-muted: #6b7684;
    --hv-border: #e3e7ec;
    --hv-font: var(--e-global-typography-primary-font-family, "Roboto Flex"), sans-serif;
    --hv-logo-h: 56px;
    --hv-top: var(--wp-admin--admin-bar--height, 0px);
    position: relative;
    z-index: 1000;
    width: 100%;
    font-family: var(--hv-font);
    background: #fff;
}

.hv-header *,
.hv-drawer * {
    box-sizing: border-box;
}

.hv-header a {
    text-decoration: none;
}

.hv-header__container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Sticky (thu gọn khi cuộn) ---------- */
.hv-header.is-sticky {
    position: fixed;
    top: var(--hv-top);
    left: 0;
    right: 0;
    box-shadow: 0 6px 24px rgba(16, 24, 40, .12);
    animation: hv-header-in .3s ease;
}

@keyframes hv-header-in {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: none;
    }
}

/* ---------- Lớp 1 ---------- */
.hv-header__main {
    border-bottom: 1px solid var(--hv-border);
}

.hv-header__main .hv-header__container {
    display: flex;
    align-items: center;
    gap: 40px;
    min-height: calc(var(--hv-logo-h) + 32px);
    transition: min-height .3s ease;
}

.hv-header .hv-header__burger {
    display: none;
    padding: 6px;
    margin-left: -6px;
    border: 0;
    background: transparent;
    color: var(--hv-text);
    cursor: pointer;
    line-height: 0;
}

.hv-header__logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.hv-header__logo img {
    display: block;
    height: var(--hv-logo-h);
    width: auto;
    max-width: 240px;
    object-fit: contain;
    transition: height .3s ease;
}

.hv-header__site-name {
    font-size: 26px;
    font-weight: 800;
    color: var(--hv-primary);
    text-transform: uppercase;
}

/* Tìm kiếm: nút kính lúp → bảng tìm kiếm ở giữa header, có từ khoá gợi ý + gợi ý sản phẩm */
.hv-header {
    --hv-search-tone: #BEB8B8;
    --hv-ink: #1f1f1f;
}

.hv-header .hv-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin: 0 6px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--hv-ink);
    cursor: pointer;
    transition: background .2s ease;
}

.hv-header .hv-search-toggle:hover,
.hv-header .hv-search-toggle:focus-visible,
.hv-header .hv-search-toggle[aria-expanded="true"] {
    background: color-mix(in srgb, var(--hv-search-tone) 35%, transparent);
    color: var(--hv-ink);
}

.hv-searchbox {
    position: fixed;
    top: var(--wp-admin--admin-bar--height, 0px); /* = 0 với khách; chừa thanh quản trị khi admin đăng nhập */
    left: 0;
    right: 0;
    z-index: 60;
    max-height: 100vh;
    overflow-y: auto;
    padding: 26px 20px 30px;
    background: #fff;
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .25);
    animation: hv-searchbox-in .3s cubic-bezier(.2, .7, .2, 1);
}

.hv-searchbox[hidden],
.hv-searchbox-overlay[hidden] {
    display: none;
}

@keyframes hv-searchbox-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
}

.hv-searchbox__inner {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

.hv-searchbox__form {
    display: flex;
    align-items: center;
    height: 56px;
    margin: 0 56px 0 0;
    padding: 4px;
    border: 1.5px solid var(--hv-search-tone);
    border-radius: 999px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.hv-searchbox__form:focus-within {
    border-color: #8f8888;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--hv-search-tone) 35%, transparent);
}

.hv-header .hv-searchbox__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: var(--hv-ink);
    font-family: inherit;
    font-size: 16px;
    outline: none;
}

.hv-searchbox__input::placeholder {
    color: #9b9595;
}

.hv-searchbox__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.hv-header .hv-searchbox__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 76px;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--hv-ink);
    color: #fff;
    cursor: pointer;
    transition: background .2s ease;
}

.hv-header .hv-searchbox__submit:hover {
    background: #5c5757;
    color: #fff;
}

.hv-header .hv-searchbox__close {
    position: absolute;
    top: 6px;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f3f2f2;
    color: var(--hv-ink);
    cursor: pointer;
    transition: background .2s ease, transform .3s ease;
}

.hv-header .hv-searchbox__close:hover {
    background: var(--hv-search-tone);
    color: var(--hv-ink);
    transform: rotate(90deg);
}

.hv-searchbox__keywords {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 14px 56px 0 20px;
    font-size: 14px;
}

.hv-searchbox__keywords span {
    color: #8f8888;
}

.hv-header .hv-searchbox__keywords a {
    padding: 5px 12px;
    border-radius: 999px;
    background: #f3f2f2;
    color: #4a4545;
    transition: background .2s ease, color .2s ease;
}

.hv-header .hv-searchbox__keywords a:hover {
    background: var(--hv-ink);
    color: #fff;
}

/* Gợi ý sản phẩm */
.hv-searchbox__results:empty {
    display: none;
}

.hv-searchbox__results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 16px;
    margin: 18px 56px 0 0;
    padding-top: 16px;
    border-top: 1px solid #efeded;
}

.hv-header .hv-searchbox__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 12px;
    color: var(--hv-ink);
    transition: background .2s ease;
}

.hv-header .hv-searchbox__item:hover {
    background: #f6f5f5;
}

.hv-searchbox__item img {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: #f6f5f5;
    object-fit: contain;
}

.hv-searchbox__item span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hv-searchbox__item strong {
    overflow: hidden;
    font-size: 14.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hv-searchbox__item em {
    color: var(--hv-accent);
    font-size: 13.5px;
    font-style: normal;
    font-weight: 700;
}

.hv-searchbox__empty,
.hv-searchbox__all {
    grid-column: 1 / -1;
    margin: 4px 8px 0;
    color: #8f8888;
    font-size: 14px;
}

.hv-header .hv-searchbox__all {
    color: var(--hv-ink);
    font-weight: 600;
    text-decoration: underline;
}

.hv-searchbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(20, 20, 20, .35);
}

.hv-header__actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.hv-hotline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 12px;
    color: var(--hv-text);
}

.hv-hotline__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--hv-search-tone) 35%, transparent);
    color: var(--hv-ink);
    transition: background .2s ease, color .2s ease;
}

.hv-hotline:hover .hv-hotline__icon {
    background: var(--hv-ink);
    color: #fff;
}

.hv-hotline__text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.hv-hotline__text small {
    font-size: 12px;
    color: #4a4545;
}

.hv-hotline__text strong {
    font-size: 17px;
    font-weight: 800;
    color: var(--hv-ink);
    letter-spacing: .02em;
    white-space: nowrap;
}

.hv-action {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--hv-ink);
    transition: background .2s ease, color .2s ease;
}

.hv-action:hover {
    background: color-mix(in srgb, var(--hv-search-tone) 35%, transparent);
    color: var(--hv-ink);
}

.hv-cart-count {
    position: absolute;
    top: 3px;
    right: 1px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--hv-ink);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

/* Thu gọn lớp 1 khi sticky */
.hv-header.is-sticky .hv-header__main .hv-header__container {
    min-height: calc(var(--hv-logo-h) * .7 + 20px);
}

.hv-header.is-sticky .hv-header__logo img {
    height: calc(var(--hv-logo-h) * .7);
}

/* ---------- Lớp 2: Menu ---------- */
/* Thanh menu: xám sáng #DEDEDD, chữ đậm, mục đang chọn màu đỏ */
.hv-nav {
    --hv-nav-bg: #DEDEDD;
    --hv-nav-text: #2b2622;
    position: relative;
    background: var(--hv-nav-bg);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .06);
}

.hv-menu,
.hv-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hv-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(18px, 3vw, 44px);
}

.hv-menu > li {
    position: relative;
}

.hv-header .hv-menu > li > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 15px 4px;
    color: var(--hv-nav-text, #2b2622);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color .2s ease;
}

.hv-menu > li > a::before {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 8px;
    height: 2px;
    border-radius: 2px;
    background: var(--hv-ink);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
}

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

/* Mục đang chọn / rê chuột: chữ đen đậm */
.hv-header .hv-menu > li:hover > a,
.hv-header .hv-menu > li.current-menu-item > a,
.hv-header .hv-menu > li.current-menu-ancestor > a {
    color: #000;
    text-shadow: 0 0 .6px #000, 0 0 .6px #000; /* đậm hơn mà không làm chữ xê dịch */
}

/* Mũi tên dropdown */
.hv-menu li.menu-item-has-children > a::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-top: -3px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
    flex-shrink: 0;
}

.hv-menu > li.menu-item-has-children:hover > a::after {
    transform: rotate(225deg);
    margin-top: 3px;
}

/* Dropdown cấp 2, 3 */
.hv-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    min-width: 250px;
    padding: 8px 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(16, 24, 40, .16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.hv-menu > li > .sub-menu {
    border-top: 3px solid var(--hv-ink);
    border-radius: 0 0 10px 10px;
}

.hv-menu .sub-menu .sub-menu {
    top: -8px;
    left: 100%;
    margin-left: 4px;
    transform: translateX(10px);
}

.hv-menu li:hover > .sub-menu,
.hv-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.hv-menu .sub-menu li {
    position: relative;
}

.hv-header .hv-menu .sub-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    color: var(--hv-text);
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.4;
    transition: background .15s ease, color .15s ease, padding .15s ease;
}

.hv-header .hv-menu .sub-menu a:hover,
.hv-header .hv-menu .sub-menu .current-menu-item > a {
    background: #f4f3f3;
    color: #000;
    padding-left: 24px;
}

.hv-menu .sub-menu li.menu-item-has-children > a::after {
    transform: rotate(-45deg);
    margin-top: 0;
}

/* 2 mục cuối: mở dropdown sang trái để không tràn màn hình */
.hv-menu > li:nth-last-child(-n+2) > .sub-menu {
    left: auto;
    right: 0;
}

.hv-menu > li:nth-last-child(-n+2) .sub-menu .sub-menu {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 4px;
    transform: translateX(-10px);
}

.hv-menu > li:nth-last-child(-n+2) li:hover > .sub-menu {
    transform: none;
}

/* ---------- Drawer mobile ---------- */
.hv-drawer {
    position: fixed;
    inset: 0;
    z-index: 100000;
    visibility: hidden;
    pointer-events: none;
}

.hv-drawer.is-open {
    visibility: visible;
    pointer-events: auto;
}

.hv-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 35, .5);
    opacity: 0;
    transition: opacity .3s ease;
}

.hv-drawer.is-open .hv-drawer__overlay {
    opacity: 1;
}

.hv-drawer__panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(340px, 86vw);
    display: flex;
    flex-direction: column;
    background: #fff;
    font-family: var(--e-global-typography-primary-font-family, "Roboto Flex"), sans-serif;
    transform: translateX(-100%);
    transition: transform .32s cubic-bezier(.4, 0, .2, 1);
}

.hv-drawer.is-open .hv-drawer__panel {
    transform: none;
}

.hv-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 14px 20px;
    border-bottom: 1px solid #e3e7ec;
}

.hv-drawer__logo img {
    display: block;
    height: 40px;
    width: auto;
}

.hv-drawer .hv-drawer__close {
    padding: 6px;
    border: 0;
    background: transparent;
    color: #1d2733;
    line-height: 0;
    cursor: pointer;
}

.hv-drawer__nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.hv-mobile-menu,
.hv-mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hv-mobile-menu li {
    position: relative;
}

.hv-drawer .hv-mobile-menu a {
    display: block;
    padding: 13px 56px 13px 20px;
    color: #1d2733;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid #f0f2f5;
}

.hv-drawer .hv-mobile-menu > li > a {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14.5px;
}

.hv-drawer .hv-mobile-menu .current-menu-item > a {
    color: #000;
}

.hv-mobile-menu .sub-menu {
    display: none;
    background: #f7f9fb;
}

.hv-mobile-menu .sub-menu a {
    padding-left: 34px;
}

.hv-mobile-menu .sub-menu .sub-menu a {
    padding-left: 48px;
    font-size: 14px;
}

.hv-mobile-menu li.is-open > .sub-menu {
    display: block;
}

.hv-drawer .hv-submenu-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-left: 1px solid #f0f2f5;
    background: transparent;
    color: #1d2733;
    cursor: pointer;
}

.hv-submenu-toggle::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.hv-mobile-menu li.is-open > .hv-submenu-toggle::before {
    transform: rotate(225deg);
    margin-top: 4px;
}

.hv-drawer__hotline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 16px 20px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #1f1f1f;
    color: #fff;
    font-size: 15px;
    text-decoration: none;
}

body.hv-drawer-open {
    overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
    .hv-header__main .hv-header__container {
        gap: 24px;
    }

    .hv-hotline__text small {
        display: none;
    }

    .hv-header .hv-menu > li > a {
        font-size: 14px;
    }
}

@media (max-width: 991px) {
    .hv-header {
        --hv-logo-h: 42px;
    }

    .hv-nav {
        display: none;
    }

    .hv-header__main .hv-header__container {
        position: relative;
        flex-wrap: nowrap;
        gap: 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .hv-header .hv-header__burger {
        display: block;
    }

    .hv-header__logo {
        margin-right: auto;
    }

    /* Mobile: nút kính lúp nhỏ lại, bảng tìm kiếm rộng hết màn hình */
    .hv-header .hv-search-toggle {
        width: 40px;
        height: 40px;
        margin: 0;
    }

    .hv-searchbox {
        padding: 16px 14px 20px;
    }

    .hv-searchbox__form {
        height: 50px;
        margin-right: 50px;
    }

    .hv-header .hv-searchbox__submit {
        width: 56px;
    }

    .hv-header .hv-searchbox__close {
        top: 3px;
    }

    .hv-searchbox__keywords {
        margin: 12px 0 0 4px;
        font-size: 13.5px;
    }

    .hv-searchbox__results {
        grid-template-columns: minmax(0, 1fr);
        margin-right: 0;
    }

    .hv-hotline {
        margin-right: 0;
    }

    .hv-hotline__text {
        display: none;
    }

    .hv-hotline__icon {
        width: 40px;
        height: 40px;
    }

    .hv-action {
        width: 40px;
        height: 40px;
    }

    .hv-header.is-sticky .hv-header__main .hv-header__container {
        padding-top: 6px;
        padding-bottom: 6px;
    }
}

@media (max-width: 575px) {
    .hv-header__container {
        padding: 0 14px;
    }

    .hv-action--account {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hv-header,
    .hv-header *,
    .hv-drawer * {
        animation: none !important;
        transition: none !important;
    }
}

/* Chặn style nút mặc định của Hello Elementor (reset.css) */
.hv-header .hv-header__burger:hover,
.hv-header .hv-header__burger:focus,
.hv-drawer .hv-drawer__close:hover,
.hv-drawer .hv-drawer__close:focus,
.hv-drawer .hv-submenu-toggle:hover,
.hv-drawer .hv-submenu-toggle:focus {
    background: transparent;
    color: var(--hv-text, #1d2733);
}

.hv-header .hv-menu > li > a:not([href]) {
    cursor: default;
}

/* Chặn tràn ngang toàn site (VD mũi tên carousel Elementor nằm lệch ra ngoài) */
html,
body {
    overflow-x: clip;
}

@supports not (overflow: clip) {
    body {
        overflow-x: hidden;
    }
}

