/* =============================================================
   g4c-overrides.css
   Final header and configured mega menu overrides.
   Loaded after tailwind.css, so these rules are the last word.
   ============================================================= */

/* Header sizing */
.main-header {
    top: 0 !important;
    padding-top: 0 !important;
}

.main-header:not(.fixed-header) .header-lower,
.sticky-header .outer-box {
    width: min(1680px, calc(100% - 8px));
    margin-top: 0 !important;
    background-color: var(--g4c-header-bg, #fff);
    border: 1px solid var(--g4c-header-border);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 10px 30px rgba(12, 38, 76, .10);
    backdrop-filter: blur(10px);
}

.main-header .outer-box,
.sticky-header .outer-box {
    padding: 8px 30px;
}

.main-header .logo-box figure.logo img,
.sticky-header .logo-box figure.logo img {
    height: 68px;
}

.main-header .main-menu .navigation > li > a,
.sticky-header .main-menu .navigation > li > a {
    font-size: 17px;
    padding-top: 18px;
    padding-bottom: 18px;
}

.main-header .main-menu .navigation > li.dropdown > a:before,
.sticky-header .main-menu .navigation > li.dropdown > a:before {
    top: 19px;
}

.main-header .main-menu .navigation > li > a:after,
.sticky-header .main-menu .navigation > li > a:after {
    bottom: 10px;
}

.main-header .menu-right-content .theme-btn,
.sticky-header .menu-right-content .theme-btn {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 12px;
}

/* Home header: no top gap before the static header */
body.page-home .main-header {
    position: absolute !important;
    top: 0 !important;
    margin-top: 0 !important;
}

body.page-home .main-header:not(.fixed-header) .header-lower {
    margin-top: 0 !important;
    transform: translateY(0) !important;
}

body.page-home .banner-section {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.page-home .boxed_wrapper {
    padding-top: 0 !important;
}

/* Desktop configured mega menu */
@media (min-width: 1201px) {
    .main-menu .navigation > li.dropdown > .menu-megamenu {
        position: fixed;
        top: calc(var(--mm-top, 80px) - 2px);
        left: 50%;
        width: min(1440px, calc(100vw - 8px));
        margin: 0 0 0 calc(min(1440px, 100vw - 8px) / -2);
        padding: 0;
        display: grid;
        grid-template-columns: 280px minmax(0, 1fr);
        overflow: hidden;
        border: 1px solid rgba(12, 38, 76, .10);
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 24px 64px rgba(12, 38, 76, .18);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: none;
        transition: opacity 140ms ease, visibility 140ms ease;
        z-index: 9999;
    }

    .main-menu .navigation > li.dropdown > .menu-megamenu--no-image {
        grid-template-columns: 1fr;
    }

    .main-menu .navigation > li.dropdown:hover > .menu-megamenu,
    .main-menu .navigation > li.dropdown:focus-within > .menu-megamenu {
        top: calc(var(--mm-top, 80px) - 2px);
        margin-top: 0;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }
}

.menu-megamenu__image {
    position: relative;
    min-height: 340px;
    overflow: hidden;
    background: #1a2e4a;
}

.menu-megamenu__image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    opacity: .88;
    transition: opacity 300ms ease;
}

.menu-megamenu__image:hover img {
    opacity: 1;
}

.menu-megamenu__columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    align-content: start;
    padding: 28px 24px 24px;
    background: #fff;
}

.menu-megamenu__column {
    min-width: 0;
    padding: 0 20px;
    border-right: 1px solid #f0ece6;
}

.menu-megamenu__column:last-child {
    border-right: 0;
}

.menu-megamenu__heading {
    display: block;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--theme-color);
    color: #0c264c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 200ms ease;
}

.menu-megamenu__heading:hover {
    color: var(--theme-color);
}

.main-menu .navigation > li > .menu-megamenu ul {
    position: static;
    width: auto;
    margin: 0;
    border: 0;
    background: transparent;
    display: block;
    opacity: 1;
    visibility: visible;
}

.main-menu .navigation > li > .menu-megamenu ul > li {
    position: static;
    width: auto;
    margin: 0;
    border: 0;
    background: transparent;
}

.main-menu .navigation > li > .menu-megamenu ul > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 7px 0;
    border-bottom: 1px solid #f5f0ea;
    color: #3d4350;
    font-family: var(--title-font);
    font-size: 13px;
    line-height: 1.3;
    font-weight: 500;
    text-transform: none;
    transition: color 200ms ease, padding-left 200ms ease;
}

.main-menu .navigation > li > .menu-megamenu ul > li:last-child > a {
    border-bottom: 0;
}

.main-menu .navigation > li > .menu-megamenu ul > li > a:hover {
    padding-left: 6px;
    color: var(--theme-color);
}

.main-menu .navigation > li > .menu-megamenu ul > li.current > a {
    color: var(--theme-color);
}

.mm-badge {
    display: inline-block;
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    line-height: 16px;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.mm-badge--best-seller,
.mm-badge--bestseller {
    background: #dc2626;
    color: #fff;
}

.mm-badge--recommended {
    background: #16a34a;
    color: #fff;
}

.mm-badge--trending {
    background: #b45309;
    color: #fff;
}

.mm-badge--new {
    background: #2563eb;
    color: #fff;
}

.mm-badge--popular {
    background: #7c3aed;
    color: #fff;
}

/* Mobile clone */
@media (max-width: 1200px) {
    .mobile-menu .menu-megamenu {
        position: static;
        width: auto;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .mobile-menu .menu-megamenu__image {
        display: none;
    }

    .mobile-menu .menu-megamenu__columns {
        display: block;
        padding: 0;
        background: transparent;
    }

    .mobile-menu .menu-megamenu__column {
        padding: 0;
        border-right: 0;
    }

    .mobile-menu .menu-megamenu__heading {
        margin: 0;
        padding: 10px 25px 10px 45px;
        border-top: 1px solid #efe6dc;
        border-bottom: 0;
        color: #0c264c;
    }

    .mobile-menu .menu-megamenu ul > li > a {
        margin-left: 20px;
    }
}
