/* Header, navigation and mega menu styles. */

.header-top {
    padding-top: 8px;
}

.header .top-left .list-main li:first-child {
    padding-left: 0;
}

.header .list-main li {
    display: inline-block;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    border-right: 1px solid #f0f0f0;
    padding: 0px 10px;
}

.header .top-left .list-main li i {
    display: inline-block;
    margin-right: 4px;
    font-size: 15px;
    color: #ffffff;
    position: relative;
    top: 3px;
}

.header .right-content {
    float: right;
}

.header .right-content ul li a {
    color: #ffffff;
}

/* =======================================================
   2. THANH TÃŒM KIáº¾M (SEARCH FORM)
   ======================================================= */
.header .header-nav .header-search-form {
    text-align: center;
}

.header .header-nav .header-search-form .searchform-wrapper input {
    display: inline-block;
    background: #ffffff;
    position: relative;
    margin: 0;
    height: 40px;
    line-height: 40px;
    border-radius: 24px;
    border: 1px solid #ececec;
}

/* =======================================================
   3. MENU CHÃNH (HEADER BOTTOM)
   ======================================================= */
.header-bottom {
    min-height: 45px;
    background: #ffffff !important;
}

.header-bottom .nav li {
    margin-right: 0px;
    position: relative;
    float: none;
}

.header-bottom .nav li a {
    text-transform: capitalize;
    font-size: 16px;
    padding: 22px 8px;
    font-weight: 500;
    display: block;
    color: #158247; /* ÄÃ£ Ä‘á»“ng bá»™ mÃ u xanh chuáº©n */
    position: relative;
    transition: all 0.4s ease;
}

/* =======================================================
   GREEN NATURE HEADER REDESIGN
   ======================================================= */
:root {
    --gn-header-green: #167344;
    --gn-header-green-dark: #0f603a;
    --gn-header-green-light: #23844f;
}

#header #masthead.header-main {
    height: auto !important;
    min-height: 84px;
    background: var(--gn-header-green) !important;
}

#header #masthead .header-inner {
    min-height: 84px;
    align-items: center !important;
    gap: 20px;
}

#header #masthead #logo {
    flex: 0 0 176px;
    width: 176px !important;
    margin: 0 !important;
}

#header #masthead #logo > a {
    display: flex;
    width: 100%;
    height: 68px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4px 8px;
    border-radius: 12px;
    background: #fff;
}

#header #masthead #logo img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 60px !important;
    padding: 0 !important;
    object-fit: contain;
}

#header #masthead .header-inner > .flex-col.hide-for-medium.flex-left.flex-grow {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 18px;
}

#header #masthead .header-search-form,
#header #masthead .header-search-form-wrapper,
#header #masthead .searchform-wrapper,
#header #masthead .searchform {
    width: 100%;
    max-width: none;
}

#header #masthead .searchform-wrapper .flex-row {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 11px;
    background: #fff;
}

#header #masthead .searchform input.search-field {
    height: 44px;
    margin: 0;
    border: 0 !important;
    border-radius: 0;
    background: #fff;
    box-shadow: none !important;
    color: #26352c;
    font-size: 15px;
}

#header #masthead .searchform input.search-field::placeholder {
    color: #7b8980;
    opacity: 1;
}

#header #masthead .searchform .ux-search-submit {
    width: 52px;
    height: 44px;
    margin: 0;
    border: 0 !important;
    border-left: 1px solid #e3ece5 !important;
    border-radius: 0;
    background: #f7fbf8 !important;
    color: var(--gn-header-green) !important;
}

#header #masthead .searchform .ux-search-submit:hover {
    background: #eaf4ed !important;
}

#header #masthead .flex-col.hide-for-medium.flex-right .header-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

#header #masthead .header-nav-main > li.account-item,
#header #masthead .header-nav-main > li.cart-item {
    margin: 0;
}

#header #masthead .account-item > a,
#header #masthead .cart-item > a {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 9px;
    padding: 4px 6px;
    color: #fff !important;
    white-space: nowrap;
}

#header #masthead .account-item > a::after {
    content: "Tài khoản\A Đăng nhập";
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    white-space: pre-line;
}

#header #masthead .cart-item > a::after {
    content: "Giỏ hàng";
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

#header #masthead .account-item .icon-user,
#header #masthead .cart-item .icon-shopping-bag {
    color: #fff;
    font-size: 21px;
}

#header #masthead .header-divider {
    height: 38px;
    border-left: 1px solid rgba(255, 255, 255, .35);
}

#header #wide-nav.header-bottom {
    min-height: 56px;
    border-top: 1px solid rgba(255, 255, 255, .16);
    background: var(--gn-header-green-dark) !important;
}

#header #wide-nav .flex-row.container {
    min-height: 56px;
    align-items: center;
}

#header #wide-nav .flex-col.hide-for-medium.flex-center {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
    padding: 0;
}

#header #wide-nav .header-bottom-nav {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

#header #wide-nav .header-bottom-nav > li {
    position: relative;
    display: flex;
    align-items: center;
    float: none;
    margin: 0 !important;
}

#header #wide-nav .header-bottom-nav > li > a {
    display: flex;
    min-height: 36px;
    align-items: center;
    padding: 0 14px !important;
    border: 1px solid rgba(255, 255, 255, .48);
    border-radius: 999px;
    background: transparent !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    white-space: nowrap;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

#header #wide-nav .header-bottom-nav > li:not(.menu-item-object-product_cat).current-menu-item > a {
    border-color: #fff;
    background: #fff !important;
    color: var(--gn-header-green-dark) !important;
}

#header #wide-nav .header-bottom-nav > li:nth-child(5){
    margin-left: auto !important;
}

#header #wide-nav .header-bottom-nav > li.menu-item-object-product_cat > a {
    min-height: 36px;
    padding: 0 9px !important;
    border-color: transparent;
    border-radius: 8px;
    background: transparent !important;
    font-weight: 500;
}

#header #wide-nav .header-bottom-nav > li.menu-item-object-product_cat.current-menu-item > a {
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .12) !important;
    color: #fff !important;
}

#header #wide-nav .header-bottom-nav .nav-dropdown {
    top: calc(100% + 7px);
    min-width: 190px;
    padding: 8px;
    border: 1px solid #e3ece5;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(11, 52, 30, .16);
}

#header #wide-nav .header-bottom-nav .nav-dropdown li a {
    min-height: 36px;
    padding: 9px 12px !important;
    border-radius: 8px;
    color: #294334 !important;
    font-size: 13px;
}

@media (min-width: 850px) and (max-width: 1150px) {
    #header #masthead .header-inner {
        gap: 12px;
    }

    #header #masthead #logo {
        flex-basis: 150px;
        width: 150px !important;
    }

    #header #masthead .header-inner > .flex-col.hide-for-medium.flex-left.flex-grow {
        padding: 0 8px;
    }

    #header #wide-nav .header-bottom-nav {
        column-gap: 3px;
    }

    #header #wide-nav .header-bottom-nav > li > a {
        padding-right: 9px !important;
        padding-left: 9px !important;
        font-size: 12px;
    }
}

@media (max-width: 849px) {
    #header #masthead.header-main,
    #header #masthead .header-inner {
        min-height: 72px;
    }

    #header #masthead .header-inner {
        gap: 8px;
    }

    #header #masthead #logo {
        flex-basis: 142px;
        width: 142px !important;
    }

    #header #masthead #logo > a {
        height: 56px;
        padding: 3px 6px;
        border-radius: 10px;
    }

    #header #masthead #logo img {
        max-height: 50px !important;
    }

    #header #masthead .mobile-nav > li > a {
        color: #fff !important;
    }

    #header #masthead .mobile-nav .icon-menu,
    #header #masthead .mobile-nav .icon-shopping-bag {
        color: #fff;
    }
}

/* =======================================================
   STORE CATEGORY MEGA MENU + EDITABLE PROMO BANNER
   ======================================================= */
@media (min-width: 850px) {
    #header #wide-nav .flex-row.container {
        position: relative;
    }

    #header #wide-nav .header-bottom-nav {
        position: static;
    }

    #header #wide-nav .header-bottom-nav > li.gn-mega-menu-parent {
        position: static;
        z-index: 30;
    }

    #header #wide-nav .header-bottom-nav > li.gn-mega-menu-parent > a {
        border-color: #fff;
        background: #fff !important;
        color: var(--gn-header-green-dark) !important;
    }

    #header #wide-nav .header-bottom-nav > li.gn-mega-menu-parent > ul.nav-dropdown {
        position: absolute !important;
        top: calc(100% - 0px) !important;
        left: 50% !important;
        right: auto !important;
        display: grid !important;
        width: min(1380px, calc(100vw - 40px));
        min-width: 0;
        max-height: none !important;
        margin: 0 !important;
        padding: 20px 0 !important;
        border: 1px solid #e5eee7;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 18px 45px rgba(14, 64, 38, .18);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translate(-50%, 8px);
        transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
        overflow: hidden;
    }

    #header #wide-nav .header-bottom-nav > li.gn-mega-menu-parent:focus-within > ul.nav-dropdown {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translate(-50%, 0);
    }

    #header #wide-nav .gn-mega-menu-parent.gn-mega-columns-1 > ul.nav-dropdown { grid-template-columns: minmax(190px, 1fr) 285px; }
    #header #wide-nav .gn-mega-menu-parent.gn-mega-columns-2 > ul.nav-dropdown { grid-template-columns: repeat(2, minmax(160px, 1fr)) 285px; }
    #header #wide-nav .gn-mega-menu-parent.gn-mega-columns-3 > ul.nav-dropdown { grid-template-columns: repeat(3, minmax(145px, 1fr)) 285px; }
    #header #wide-nav .gn-mega-menu-parent.gn-mega-columns-4 > ul.nav-dropdown { grid-template-columns: repeat(4, minmax(135px, 1fr)) 285px; }
    #header #wide-nav .gn-mega-menu-parent.gn-mega-columns-5 > ul.nav-dropdown { grid-template-columns: repeat(5, minmax(125px, 1fr)) 285px; }
    #header #wide-nav .gn-mega-menu-parent.gn-mega-columns-6 > ul.nav-dropdown { grid-template-columns: repeat(6, minmax(115px, 1fr)) 285px; }
    #header #wide-nav .gn-mega-menu-parent.gn-mega-columns-7 > ul.nav-dropdown { grid-template-columns: repeat(7, minmax(105px, 1fr)) 285px; }
    #header #wide-nav .gn-mega-menu-parent.gn-mega-columns-8 > ul.nav-dropdown { grid-template-columns: repeat(8, minmax(95px, 1fr)) 285px; }
    #header #wide-nav .header-bottom-nav > li.gn-mega-menu-parent.gn-mega-columns-1 > ul.nav-dropdown { width: min(640px, calc(100vw - 40px)); }
    #header #wide-nav .header-bottom-nav > li.gn-mega-menu-parent.gn-mega-columns-2 > ul.nav-dropdown { width: min(800px, calc(100vw - 40px)); }
    #header #wide-nav .header-bottom-nav > li.gn-mega-menu-parent.gn-mega-columns-3 > ul.nav-dropdown { width: min(1000px, calc(100vw - 40px)); }
    #header #wide-nav .header-bottom-nav > li.gn-mega-menu-parent.gn-mega-columns-4 > ul.nav-dropdown { width: min(1200px, calc(100vw - 40px)); }

    #header #wide-nav .gn-mega-menu-parent > ul.nav-dropdown > li {
        position: relative;
        display: block;
        width: auto;
        min-width: 0;
        margin: 0;
        padding: 0 17px;
        border: 0;
        border-right: 1px solid #e7eee9;
        background: transparent;
    }

    #header #wide-nav .gn-mega-menu-parent > ul.nav-dropdown > li.gn-mega-column > a {
        display: flex;
        min-height: 38px;
        align-items: center;
        gap: 10px;
        padding: 0 0 10px !important;
        border: 0;
        border-radius: 0;
        background: transparent !important;
        color: var(--gn-header-green-dark) !important;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.25;
        text-transform: uppercase;
        white-space: normal;
    }

    #header #wide-nav .gn-mega-menu-parent > ul.nav-dropdown > li.gn-mega-column > a::before {
        display: inline-flex;
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #edf7ef;
        color: var(--gn-header-green);
        content: "✿";
        font-size: 17px;
        font-weight: 500;
    }

    #header #wide-nav .gn-mega-menu-parent > ul.nav-dropdown > li.gn-mega-column > ul.sub-menu {
        position: static !important;
        display: block !important;
        width: auto;
        min-width: 0;
        margin: 0 !important;
        padding: 0 !important;
        border: 0;
        background: transparent;
        box-shadow: none;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    #header #wide-nav .gn-mega-menu-parent > ul.nav-dropdown > li.gn-mega-column > ul.sub-menu > li {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
    }

    #header #wide-nav .gn-mega-menu-parent > ul.nav-dropdown > li.gn-mega-column > ul.sub-menu > li > a {
        display: block;
        min-height: 32px;
        padding: 7px 4px !important;
        border-radius: 6px;
        background: transparent !important;
        color: #34483b !important;
        font-size: 13px;
        font-weight: 400;
        line-height: 1.35;
        text-transform: none;
        white-space: normal;
    }

    #header #wide-nav .gn-mega-menu-parent > ul.nav-dropdown > li.gn-mega-column > ul.sub-menu > li.gn-mega-view-all > a {
        color: var(--gn-header-green-dark) !important;
        font-weight: 600;
    }

    #header #wide-nav .gn-mega-menu-parent > ul.nav-dropdown > li.gn-menu-promo-item {
        grid-column: -2;
        grid-row: 1;
        min-height: 330px;
        padding: 0 16px 0 0;
        border: 0;
    }

    #header #wide-nav .gn-mega-promo {
        position: relative;
        display: flex;
        width: 100%;
        height: 100%;
        min-height: 330px;
        align-items: flex-start;
        overflow: hidden;
        padding: 26px 19px;
        border-radius: 13px;
        background: #edf7ef;
        color: var(--gn-header-green-dark) !important;
        text-decoration: none;
        white-space: normal;
    }

.nav-dropdown-has-arrow li.has-dropdown:after, .nav-dropdown-has-arrow li.has-dropdown:before{display:none !important;}

    #header #wide-nav .gn-mega-promo-image,
    #header #wide-nav .gn-mega-promo-placeholder {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    #header #wide-nav .gn-mega-promo-placeholder {
        background: radial-gradient(circle at 85% 82%, #b9d9bb 0 18%, transparent 19%), linear-gradient(140deg, #f5fbf5, #dceede);
    }

    #header #wide-nav .gn-mega-promo-content {
        position: relative;
        z-index: 2;
        display: flex;
        width: 78%;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px;
        border: 1px solid rgba(255, 255, 255, .78);
        border-radius: 12px;
        background: rgba(255, 255, 255, .9);
        box-shadow: 0 8px 24px rgba(15, 96, 58, .14);
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px);
    }

    #header #wide-nav .gn-mega-promo-kicker {
        color: var(--gn-header-green);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    #header #wide-nav .gn-mega-promo-content > strong {
        color: var(--gn-header-green-dark);
        font-size: clamp(21px, 1.7vw, 30px);
        font-weight: 800;
        line-height: 1.08;
        text-transform: uppercase;
    }

    #header #wide-nav .gn-mega-promo-description {
        color: #405246;
        font-size: 13px;
        line-height: 1.45;
    }

    #header #wide-nav .gn-mega-promo-button {
        display: inline-flex;
        min-height: 36px;
        align-items: center;
        gap: 10px;
        margin-top: 3px;
        padding: 0 14px;
        border-radius: 999px;
        background: var(--gn-header-green);
        color: #fff;
        font-size: 12px;
        font-weight: 700;
        white-space: nowrap;
    }
}

@media (min-width: 850px) and (max-width: 1100px) {
    #header #wide-nav .gn-mega-menu-parent > ul.nav-dropdown {
        grid-template-columns: repeat(3, minmax(125px, 1fr)) 250px !important;
    }

    #header #wide-nav .gn-mega-menu-parent > ul.nav-dropdown > li.gn-menu-promo-item {
        grid-column: 4;
        grid-row: 1 / span 3;
    }
}

@media (max-width: 849px) {
    #header #wide-nav .gn-mega-menu-parent > ul.nav-dropdown {
        display: none !important;
    }
}
