/* ===== TOPBAR ===== */
.topbar {
    background: #1c38b5;
    color: #fff;
    font-size: 13px;
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    gap: 12px;
}

.topbar__left,
.topbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar__link {
    opacity: .95;
}

.topbar__link:hover {
    opacity: 1;
    text-decoration: underline;
}

.topbar__sep {
    opacity: .6;
}

/* ===== HEADER MAIN ===== */
.header-main {
    background: #1a237e;
    padding: 14px 0;
}

.header-main__inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 28px;
    letter-spacing: .5px;
    color: #fff;
    white-space: nowrap;
}

.brand__text {
    line-height: 1;
}

/* Search */
.header-search {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .22);
    border-radius: 999px;
    padding: 8px 10px;
    gap: 8px;
}

.header-search__input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    color: #fff;
    font-size: 14px;
}

.header-search__input::placeholder {
    color: rgba(255, 255, 255, .85);
}

.header-search__btn {
    border: 0;
    background: rgba(0, 0, 0, .12);
    color: #fff;
    width: 40px;
    height: 34px;
    border-radius: 999px;
    cursor: pointer;
}

/* Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.btn-hotline {
    background: #b01212;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
}

.btn-cart {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .18);
}

.btn-cart__count {
    min-width: 26px;
    height: 22px;
    border-radius: 999px;
    background: #ffcc00;
    color: #1d1d1d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
}

/* ===== NAV BAR ===== */
.header-nav {
    background: #4362a0;
}

.header-nav__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
}

/* Category button + panel */
.cat-menu {
    position: relative;
}

.cat-menu__btn {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 999px;
    background: #f2b63f;
    font-weight: 800;
    color: #fff;
}

.cat-menu__caret {
    opacity: .9;
}

.cat-menu.is-open .cat-menu__panel {
    display: block;
}

/* Mega */
.mega__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.mega__item {
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, .06);
    background: #fff;
    transition: transform .12s ease, box-shadow .12s ease;
}

.mega__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .10);
}

.mega__thumb {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 10px;
    overflow: hidden;
    background: #f4f5f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mega__ph {
    font-size: 26px;
    opacity: .65;
}

.mega__name {
    margin-top: 8px;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
}

.mega__all {
    display: block;
    margin-top: 12px;
    text-align: right;
    font-weight: 800;
    color: #3b1ac2;
}

/* Menu ngang */
.main-menu {
    flex: 1;
}

.main-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 18px;
    color: #fff;
    font-weight: 700;
}

.main-menu__list a {
    opacity: .95;
}

.main-menu__list a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 980px) {
    .header-main__inner {
        flex-wrap: wrap;
    }

    .header-search {
        order: 3;
        width: 100%;
    }

    .header-actions {
        margin-left: auto;
    }

    .mega__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .btn-hotline {
        display: none;
    }

    .mega__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ===== MEGA MENU DẠNG DỌC (DELAX STYLE) ===== */

.mega-vertical {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    min-height: 320px;
}

/* CỘT TRÁI */
.mega-left {
    border-right: 1px solid #eee;
}

.mega-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-cat-item a {
    display: block;
    padding: 12px 16px;
    font-weight: 600;
    color: #222;
    border-radius: 6px;
}

.mega-cat-item a:hover {
    background: #f3f7f6;
    color: #1f7a63;
}

.mega-cat-item.all a {
    font-weight: 700;
    color: #1f7a63;
}

/* CỘT PHẢI */
.mega-right {
    padding-left: 10px;
}

.mega-page-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-page-item a {
    display: block;
    padding: 10px 12px;
    font-weight: 600;
    color: #0f6b5c;
}

.mega-page-item a:hover {
    text-decoration: underline;
}

/* Panel phải nằm đúng và không trôi */
.cat-menu {
    position: relative;
}

.cat-menu__panel {
    position: absolute;
    top: 100%;
    left: 0;

    margin-top: 8px;
    /* 👈 tạo khoảng hở cho đẹp */

    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
    width: auto;
    min-width: 320px;
    max-width: 520px;
    display: none;
    z-index: 6;
}

/* 👉 CẦU NỐI HOVER (QUAN TRỌNG) */
.cat-menu__panel::before {
    content: "";
    position: absolute;
    top: -12px;
    /* phủ lên khoảng hở */
    left: 0;
    right: 0;
    height: 12px;

    background: transparent;
}

/* Hiện panel khi hover (giống DELAX) */
.cat-menu:hover .cat-menu__panel {
    display: block;
}

/* Nếu bạn muốn click mở thay vì hover: dùng JS class is-open (đã có) */
.cat-menu.is-open .cat-menu__panel {
    display: block;
}

/* ===== Mega v2 layout ===== */
.mega-v2 {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 18px;
    min-height: 360px;
}

/* Bỏ bullet (dấu chấm) */
.mega-v2__cats {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-v2__catlink {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 700;
    color: #222;
}

.mega-v2__catlink:hover {
    background: #f3f7f6;
    color: #1f7a63;
}

/* Right */
.mega-v2__rightHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.mega-v2__title {
    font-weight: 900;
    font-size: 16px;
    color: #0f6b5c;
}

.mega-v2__all {
    font-weight: 800;
    color: #1f7a63;
}

/* Grid sản phẩm trong panel */
.mega-v2__products ul.products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}

/* Fix Woo ul li style trong panel */
.mega-v2__products ul.products li.product {
    margin: 0 !important;
}

/* ===============================
   MEGA MENU – LIST ITEM STYLE
================================ */

/* UL */
.mega-v3__cats {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

/* LI */
.mega-v3__cats li {
    margin-bottom: 6px;
    /* khoảng cách giữa các dòng */
}

/* LINK */
.mega-v3__cats li a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #111;
    transition: all .2s ease;
}

/* HOVER + ACTIVE */
.mega-v3__cats li a:hover{
    background: #e6f4f1;
    /* màu xanh nhạt giống ảnh */
    color: #0f6b5c;
    /* xanh DELAX */
}

/* =====================
   MINI CART RIÊNG MEXI
===================== */

.mexi-cart-wrap {
    position: relative;
}

.mexi-cart-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,.18);
    color: #fff;
    font-weight: 700;
}

.mexi-cart-count {
    background: #ffcc00;
    color: #111;
    min-width: 24px;
    height: 22px;
    border-radius: 999px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* BOX */
.mexi-mini-cart {
    position: absolute;
    top: 53px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);

    background: #fff;
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(0,0,0,.3);
    padding: 16px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px);
    transition: .25s ease;
    z-index: 99999;
}

.mexi-mini-cart::before {
    content: "";
    position: absolute;
    top: -14px;
    /* độ cao cầu nối */
    right: 0;
    left: 0;
    height: 14px;
    background: transparent;
}

/* Hover mở */
.mexi-cart-wrap:hover .mexi-mini-cart {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* LIST */
.mexi-cart-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mexi-cart-item {
    display: grid;
    grid-template-columns: 56px 1fr 24px;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.mexi-cart-item img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
}

.mexi-cart-title {
    font-weight: 700;
    font-size: 14px;
    color: #0f6b5c;
    line-height: 1.3;
}

.mexi-cart-qty {
    font-size: 13px;
    color: #444;
    margin-top: 4px;
}

.mexi-cart-remove {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #eee;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.mexi-cart-remove:hover {
    background: #e74c3c;
    color: #fff;
}

/* TOTAL */
.mexi-cart-total {
    display: flex;
    justify-content: space-between;
    margin: 14px 0;
    font-size: 15px;
    font-weight: 700;
}

/* ACTIONS */
.mexi-cart-actions {
    display: grid;
    gap: 10px;
}

.mexi-btn-view {
    background: #0f6b5c;
    color: #fff;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-weight: 800;
}

.mexi-btn-checkout {
    background: #5bb85c;
    color: #fff;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-weight: 800;
}

/* EMPTY */
.mexi-cart-empty {
    text-align: center;
    padding: 24px 10px;
    font-weight: 600;
}

/* MOBILE */
@media (max-width: 768px) {
    .mexi-mini-cart {
        left: 12px;
        right: 12px;
        width: auto;
    }
}


.mexi-cart-qtybox {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    height: 32px;
    background: #fafafa;
}

.mexi-cart-qtybox input {
    width: 36px;
    height: 32px;
    border: 0;
    outline: none;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    background: transparent;
    appearance: textfield;
}

/* Ẩn mũi tên input number */
.mexi-cart-qtybox input::-webkit-outer-spin-button,
.mexi-cart-qtybox input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mexi-cart-qtybox .qty-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: #f0f0f0;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: .15s ease;
}

.mexi-cart-qtybox .qty-btn:hover {
    background: #0f6b5c;
    color: #fff;
}

.mexi-cart-qtybox {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.mexi-cart-qtybox input {
    width: 36px;
    text-align: center;
    border: none;
    outline: none;
    font-weight: 700;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f3f3f3;
    cursor: pointer;
    font-size: 16px;
    font-weight: 800;
}

.qty-btn:hover {
    background: #0f6b5c;
    color: #fff;
}