/* =============================================
   HEADER - LikeStyling Style
   Split nav layout: Left menu | Center logo | Right menu
   3-level dropdown support + Responsive
   ============================================= */

/* ---- Top accent line ---- */
#site-header::before {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: var(--color-3);
}

/* ---- Wrapper ---- */
#site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .07);
}

#site-header.scrolled .hdr-inner {
    padding: 5px 15px;
}

/* ---- Inner container ---- */
.hdr-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 30px 15px;
}

/* =============================================
   LOGO (center)
   ============================================= */
.hdr-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.hdr-logo img {
    height: 50px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* fallback text logo */
.hdr-logo-text {
    font-size: 24px;
    letter-spacing: .04em;
    color: #222;
    text-decoration: none;
}

.hdr-logo-text strong {
    font-weight: 800;
}

.hdr-logo-text span {
    font-weight: 300;
}

/* =============================================
   NAV SHARED STYLES
   ============================================= */
.hdr-nav {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
}

.hdr-nav--left {
    justify-content: flex-end;
}

.hdr-nav--right {
    justify-content: flex-start;
}

/* Nav item */
.hdr-nav>li {
    position: relative;
}

/* Nav link (level 1) */
.hdr-nav>li>a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 28px 14px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color .22s cubic-bezier(.4, 0, .2, 1);
    position: relative;
}

/* Underline slide-in on hover */
/* .hdr-nav>li>a::after {
    content: '';
    position: absolute;
    bottom: 14px;
    left: 14px;
    right: 14px;
    height: 1px;
    background: var(--color-3);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
} */

/* .hdr-nav>li:hover>a::after,
.hdr-nav>li.active>a::after {
    transform: scaleX(1);
} */


/* Accent nav item (e.g. JOURNAL) */
.hdr-nav>li.accent>a {
    color: var(--color-3);
}

/* Dropdown arrow */
.hdr-nav .arrow {
    display: inline-block;
    font-size: 9px;
    margin-left: 2px;
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}

.hdr-nav>li:hover>a .arrow {
    transform: rotate(180deg);
}

/* =============================================
   DROPDOWN - Level 2
   ============================================= */
.hdr-nav .dropdown {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    min-width: 220px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .10);
    border-top: 2px solid var(--color-3);
    list-style: none;
    margin: 0;
    padding: 20px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .22s cubic-bezier(.4, 0, .2, 1),
        visibility .22s cubic-bezier(.4, 0, .2, 1),
        transform .22s cubic-bezier(.4, 0, .2, 1);
    z-index: 200;
}

.hdr-nav>li:hover>.dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Level 2 items */
.hdr-nav .dropdown li {
    position: relative;
    padding: 0 20px;
}

.hdr-nav .dropdown li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 200;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #171717;
    text-decoration: none;
    white-space: nowrap;
    transition: color .22s cubic-bezier(.4, 0, .2, 1), background .22s cubic-bezier(.4, 0, .2, 1), padding-left .22s cubic-bezier(.4, 0, .2, 1);
}

.hdr-nav .dropdown li a:hover,
.hdr-nav .dropdown li.active>a {
    background: rgba(0, 0, 0, .03);
    /* background: #faf7f2; */
    /* padding-left: 26px; */
}

/* Level 2 arrow indicator */
.hdr-nav .dropdown li>a .sub-arrow {
    font-size: 10px;
    opacity: .6;
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}

.hdr-nav .dropdown li:hover>a .sub-arrow {
    transform: translateX(3px);
    opacity: 1;
}

/* Separator line */
.hdr-nav .dropdown .sep {
    height: 1px;
    background: #f0ebe2;
    margin: 6px 14px;
}

/* =============================================
   DROPDOWN - Level 3
   ============================================= */
.hdr-nav .dropdown .dropdown-sub {
    position: absolute;
    top: -8px;
    left: 100%;
    min-width: 200px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .10);
    border-top: 2px solid var(--color-3);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    transition: opacity .22s cubic-bezier(.4, 0, .2, 1),
        visibility .22s cubic-bezier(.4, 0, .2, 1),
        transform .22s cubic-bezier(.4, 0, .2, 1);
    z-index: 300;
}

.hdr-nav .dropdown li:hover>.dropdown-sub {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.hdr-nav .dropdown .dropdown-sub li a {
    padding: 10px 20px;
    font-size: 10.5px;
}

/* Flip sub-dropdown if near right edge */
.hdr-nav--right .dropdown .dropdown-sub {
    left: auto;
    right: 100%;
    transform: translateX(-8px);
}

.hdr-nav--right .dropdown li:hover>.dropdown-sub {
    transform: translateX(0);
}

/* =============================================
   CART ICON
   ============================================= */
.hdr-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* width: 40px;
    height: 40px; */
    color: #4a4a4a;
    text-decoration: none;
    flex-shrink: 0;
    transition: color .22s cubic-bezier(.4, 0, .2, 1),
        transform .22s cubic-bezier(.4, 0, .2, 1);
}

.hdr-cart:hover {
    color: var(--color-3);
    transform: scale(1.1);
}

.hdr-cart__icon {
    display: block;
    flex-shrink: 0;
}

/* Badge số lượng */
.hdr-cart__badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: var(--color-3, #c9a87c);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    border-radius: 999px;
    text-align: center;
    pointer-events: none;
    transform: scale(1);
    transition: transform .2s cubic-bezier(.34, 1.56, .64, 1),
        opacity .2s ease;
}

/* Ẩn badge khi số = 0 */
.hdr-cart__badge--hidden {
    opacity: 0;
    transform: scale(0);
}

/* Animation khi badge thay đổi */
.hdr-cart__badge--pop {
    animation: cartBadgePop .3s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes cartBadgePop {
    0% {
        transform: scale(0.6);
    }

    60% {
        transform: scale(1.25);
    }

    100% {
        transform: scale(1);
    }
}

/* =============================================
   HAMBURGER BUTTON (mobile)
   ============================================= */
.hdr-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    /* width: 40px;
    height: 40px; */
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    z-index: 1100;
}

.hdr-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #4a4a4a;
    border-radius: 2px;
    transition: transform .3s ease, opacity .3s ease, width .3s ease;
    transform-origin: center;
}

/* X state */
.hdr-hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hdr-hamburger.is-open span:nth-child(2) {
    opacity: 0;
    width: 0;
}

.hdr-hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =============================================
   MOBILE DRAWER
   ============================================= */
.hdr-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1050;
    opacity: 0;
    transition: opacity .3s ease;
}

.hdr-mobile-overlay.is-open {
    display: block;
    opacity: 1;
}

.hdr-mobile-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    background: #fff;
    z-index: 1100;
    overflow-y: auto;
    padding: 0;
    box-shadow: 4px 0 32px rgba(0, 0, 0, .15);
    transition: left .35s cubic-bezier(.4, 0, .2, 1);
    display: flex;
    flex-direction: column;
}

.hdr-mobile-drawer.is-open {
    left: 0;
}

/* Drawer header */
.hdr-mob-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 64px;
    border-bottom: 2px solid var(--color-3);
    flex-shrink: 0;
}

.hdr-mob-head img {
    height: 36px;
    width: auto;
}

.hdr-mob-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #4a4a4a;
    padding: 4px 8px;
}

/* Mobile nav list */
.hdr-mob-nav {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    flex: 1;
}

.hdr-mob-nav li a,
.hdr-mob-nav li button.hdr-mob-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: color .2s, background .2s;
}

.hdr-mob-nav li a:hover,
.hdr-mob-nav li button.hdr-mob-toggle:hover,
.hdr-mob-nav li.accent>a {
    color: var(--color-3);
    background: #faf7f2;
}

.hdr-mob-nav .hdr-mob-chevron {
    display: inline-block;
    font-size: 12px;
    transition: transform .25s;
}

.hdr-mob-nav li.is-open>button .hdr-mob-chevron,
.hdr-mob-nav li.is-open>a .hdr-mob-chevron {
    transform: rotate(180deg);
}

/* Mobile sub-list */
.hdr-mob-sub {
    display: none;
    list-style: disc;
    margin: 0;
    padding: 0 0 0 40px;
    background: #faf7f2;
}

.hdr-mob-sub li {
    display: list-item;
}

.hdr-mob-sub.is-open {
    display: block;
}

.hdr-mob-sub li a,
.hdr-mob-sub li button.hdr-mob-toggle {
    padding: 11px 20px 11px 0px;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 1px;
}

/* level 3 sub */
.hdr-mob-sub .hdr-mob-sub li a,
.hdr-mob-sub .hdr-mob-sub li button.hdr-mob-toggle {
    padding-left: 16px;
    font-size: 10px;
    font-weight: 500;
    color: #666;
}

/* Divider in mobile */
.hdr-mob-sep {
    height: 1px;
    background: #eee;
    margin: 4px 16px;
}

.hdr-cart-wrapper {
    display: flex;
    gap: 15px;
}

@media (max-width: 1200px) {
    .hdr-logo img {
        height: 34px;
    }

    .hdr-inner {
        padding: 30px 10px;
    }
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Tablet — collapse nav to hamburger below 1024px */
@media (max-width: 1023px) {
    .hdr-inner nav {
        display: none;
    }

    .hdr-nav {
        display: none;
    }

    .hdr-hamburger {
        display: flex;
    }

    .hdr-inner {
        padding: 10px 10px;
        justify-content: space-between;
    }

    .hdr-logo img {
        height: 40px;
    }
}

/* Large tablet / small desktop — reduce padding */
@media (max-width: 1199px) and (min-width: 1024px) {
    .hdr-nav>li>a {
        padding: 0 10px;
        letter-spacing: .09em;
    }
}

/* Mobile */
@media (max-width: 767px) {

    .hdr-nav>li>a {
        height: 64px;
    }

    .hdr-logo img {
        height: 34px;
    }

    #site-header.scrolled .hdr-inner {
        padding: 10px;
    }
}

/* Very small */
@media (max-width: 359px) {
    .hdr-inner {
        padding: 5px 12px;
    }
}