/* ============================================================
   HEADER — ChitPi Diamond
   Layout: Topbar (white, 3-col) + Navbar (logo-left + nav-right)
   ============================================================ */

/* ---- LOGO ---- */
.logo-container img {
    max-width: 200px;
    height: auto;
    display: block;
}

/* ---- HEADER WRAPPER ---- */
.header-section {
    position: relative;
    z-index: 10;
    background: #fff;
}

/* ============================================================
   TOP BAR  — white background, 3 items centred in one row
   ============================================================ */
.topbar {
    background: #fff;
    border-bottom: 1px solid #eee;
    color: #444;
    font-size: 13px;
}

.topbar-inner {
    display: flex;
    justify-content: end;
    align-items: center;
    gap: 40px;
    padding: 10px 15px;
}

/* Hide old trapezoid element */
.topbar-center-cutout {
    display: none;
}

.topbar-left,
.topbar-center,
.topbar-right {
    /* flex: 1; */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 13px;
}

.topbar-left {
    justify-content: flex-start;
}

.topbar-right {
    justify-content: flex-end;
}

.topbar-left span,
.topbar-center span,
.topbar-right span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topbar-left i,
.topbar-center i,
.topbar-right i {
    color: #555;
    font-size: 17px;
    flex-shrink: 0;
}

/* ============================================================
   NAVBAR  — logo left · nav items inline to the right
   ============================================================ */
.navbar-wrapper {
    background: #fff;
    position: relative;
    z-index: 5;
    border-bottom: 1px solid #eee;
    padding: 0;
}

.navbar-wrapper>.ctnr {
    display: flex;
    align-items: center;
    min-height: 72px;
}

/* Logo — fixed left, no negative margin */
.logo-container {
    flex-shrink: 0;
    margin-top: 0;
    margin-right: 24px;
    position: relative;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    padding: 8px 0;
}

.logo-container img {
    max-width: 160px;
}

/* Nav — fills remaining space */
.navbar {
    flex: 1;
    display: flex;
    align-items: center;
}

/* NAV MENU */
.nav-menu {
    display: flex;
    justify-content: end;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100%;
}

.nav-menu li {
    list-style: none;
}

.nav-menu>li>a {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 13.5px;
    font-weight: 600;
    text-transform: uppercase;
    color: #222;
    padding: 10px 0px;
    border-bottom: 2px solid transparent;
    letter-spacing: 0.03em;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
    text-decoration: none;
}

.nav-menu>li.active>a,
.nav-menu>li:hover>a {
    color: var(--color-3, #c62a2a);
    border-bottom-color: var(--color-3, #c62a2a);
}

/* Cart pushed to right end */
.menu-cart {
    /* margin-left: auto; */
    display: flex;
    align-items: center;
    padding: 0 0 0 8px;
}

.cart-btn {
    position: relative;
    display: flex !important;
    align-items: center;
    color: #333;
    transition: color 0.3s;
    padding: 20px 0;
    text-decoration: none;
}

.cart-btn i {
    font-size: 24px;
    line-height: 1;
}

.cart-btn:hover {
    color: var(--color-3, #c62a2a) !important;
}

.cart-count {
    position: absolute;
    top: 10px;
    right: -10px;
    background: var(--color-3, #c62a2a);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* NAV ARROW */
.nav-arrow {
    font-size: 16px;
    transition: transform 0.25s ease;
}

.nav-menu li.has-submenu:hover .nav-arrow {
    transform: rotate(180deg);
}

.nav-menu li.has-submenu {
    position: relative;
}

.nav-menu li.has-submenu>a {
    display: flex;
    align-items: center;
    gap: 3px;
}

.nav-menu li.has-submenu:hover>a {
    color: var(--color-3, #c62a2a);
}

/* ============================================================
   SUBMENU — Level 2
   ============================================================ */
.submenu.level-2 {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #eaeaea;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    min-width: 220px;
    padding: 8px 0;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1000;
    border-radius: 4px;
    list-style: none;
}

.nav-menu li.has-submenu:hover .submenu.level-2 {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li {
    position: relative;
    list-style: none;
}

.submenu li a {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    font-size: 14px;
    color: #333;
    font-weight: 400;
    text-transform: none;
    border-bottom: none !important;
    transition: background 0.2s ease, color 0.2s ease;
    text-align: left;
    white-space: nowrap;
    letter-spacing: 0;
}

.submenu li a:hover {
    background: #faf9f8;
    color: var(--color-3, #c62a2a) !important;
}

/* ============================================================
   SUBMENU — Level 3
   ============================================================ */
.submenu li.has-submenu-right {
    position: relative;
}

.submenu li.has-submenu-right>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-arrow-right {
    font-size: 16px;
    color: #888;
}

.submenu.level-3 {
    position: absolute;
    top: 0;
    left: 100%;
    background: #ffffff;
    border: 1px solid #eaeaea;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    min-width: 200px;
    padding: 8px 0;
    margin-left: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1001;
    border-radius: 4px;
    list-style: none;
}

.submenu li.has-submenu-right:hover .submenu.level-3 {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ============================================================
   STICKY NAV
   ============================================================ */
.navbar-wrapper.affixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
    background: #fff;
    border-bottom: 1px solid #eee;
    animation: navSlideDown 0.25s ease-out forwards;
}

@keyframes navSlideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* ============================================================
   MOBILE — hide desktop nav, show hamburger
   ============================================================ */
.mobile-menu-toggle,
.mobile-cart-btn,
.mobile-actions,
.mobile-drawer {
    display: none;
}

/* Badge position cho mobile-cart-btn */
.mobile-cart-btn {
    position: relative;
}

/* ============================================================
   RESPONSIVE <= 1150px  — hamburger drawer layout
   ============================================================ */
@media (max-width: 1150px) {

    .topbar {
        display: none;
    }

    /* Navbar: [LOGO]  ............  [🛒] [☰] */
    .navbar-wrapper {
        display: flex;
        align-items: center;
        padding: 0;
        border-bottom: 1px solid #eee;
    }

    .navbar-wrapper>.ctnr {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 64px;
        width: 100%;
    }

    .navbar {
        display: none !important;
    }

    /* Logo — bên TRÁI */
    .logo-container {
        flex-shrink: 0;
        margin: 0;
        padding: 8px 0;
    }

    /* Nhóm actions bên PHẢI: [🛒] [☰] */
    .mobile-actions {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }

    /* Giỏ hàng mobile */
    .mobile-cart-btn {
        display: flex;
        align-items: center;
        color: #333;
        padding: 8px;
        text-decoration: none;
        position: relative;
        transform: none;

    }

    .cart-count {
        top: 2px;
        right: 2px;
    }

    .mobile-cart-btn i {
        font-size: 26px;
    }

    /* Hamburger toggle */
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        color: #333;
        padding: 8px;
        position: static;
        transform: none;
    }

    .mobile-menu-toggle i {
        font-size: 30px;
        display: block;
    }

    .logo-container img {
        max-width: 130px !important;
        height: auto;
    }

    /* Sticky — keep logo visible */
    .navbar-wrapper.affixed .logo-container {
        display: inline-flex !important;
    }

    .navbar-wrapper.affixed {
        padding: 0;
    }

    /* ---- DRAWER ---- */
    .mobile-drawer {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10000;
        visibility: hidden;
        transition: visibility 0.3s ease;
    }

    .mobile-drawer.open {
        visibility: visible;
    }

    .drawer-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-drawer.open .drawer-overlay {
        opacity: 1;
    }

    .drawer-content {
        position: absolute;
        top: 0;
        left: -300px;
        width: 300px;
        height: 100%;
        background: #fff;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        display: flex;
        flex-direction: column;
        padding: 20px;
        z-index: 2;
    }

    .mobile-drawer.open .drawer-content {
        left: 0;
    }

    .drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24px;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 15px;
    }

    .drawer-logo img {
        max-width: 120px;
        height: auto;
    }

    .drawer-close {
        background: none;
        border: none;
        cursor: pointer;
        color: #333;
        padding: 4px;
    }

    .drawer-close i {
        font-size: 28px;
        display: block;
    }

    .drawer-menu {
        list-style: none;
        overflow-y: auto;
        flex: 1;
        padding: 0;
        margin: 0;
    }

    .drawer-item {
        margin-bottom: 12px;
        border-bottom: 1px solid #f5f5f5;
        padding-bottom: 10px;
    }

    .drawer-item>a {
        font-size: 14px;
        font-weight: 600;
        text-transform: uppercase;
        color: #222;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-decoration: none;
        padding: 4px 0;
    }

    .drawer-item>a .nav-arrow {
        font-size: 18px;
        transition: transform 0.2s ease;
    }

    .drawer-item>a.open .nav-arrow {
        transform: rotate(180deg);
    }

    .drawer-submenu {
        padding-left: 20px;
        margin-top: 8px;
        display: none;
        list-style-type: disc !important;
    }

    .drawer-submenu li {
        display: list-item !important;
        list-style-type: disc !important;
        margin-bottom: 8px;
        color: var(--color-3, #c62a2a);
    }

    .drawer-submenu li a {
        font-size: 13px;
        color: #555;
        text-decoration: none;
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        padding: 3px 0;
    }

    .drawer-submenu li a:hover {
        color: var(--color-3, #c62a2a);
    }

    .drawer-submenu li.drawer-has-submenu-right>a {
        display: inline-flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        color: #555;
    }

    .drawer-submenu li.drawer-has-submenu-right>a.open .nav-arrow-right {
        transform: rotate(90deg);
    }

    .drawer-submenu li.drawer-has-submenu-right .nav-arrow-right {
        font-size: 16px;
        transition: transform 0.2s ease;
    }
}

/* ============================================================
   Tablet refinement (<= 768px)
   ============================================================ */