/* ==========================================
   GENIENT PRODUCT MEGA MENU
========================================== */

.mega-menu-item {
    position: static !important;
}

.mega-menu-item>.nav-link {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.mega-menu-wrapper {
    --mega-purple: var(--secondary-color, #760980);
    --mega-orange: var(--primary-color, #EF410E);
    --mega-soft: var(--bg-color, #F5F1F5);
    --mega-text: var(--text-color, #444);
    --mega-ink: var(--black, #2c2b2b);
    animation: megaFade .22s ease;
    background: #fff;
    border: 0 !important;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 24px 54px rgba(44, 43, 43, .14);
    left: 50% !important;
    margin-top: 0 !important;
    max-height: calc(100vh - 118px);
    overflow: hidden;
    padding: 0 !important;
    top: 100% !important;
    transform: translateX(-50%);
    width: min(1360px, calc(100vw - 24px)) !important;
}

.mega-menu-wrapper::before {
    background: var(--gradient-left-to-right, linear-gradient(86deg, #76097F 22.66%, #EF410F 100%));
    content: "";
    display: block;
    height: 4px;
}

@keyframes megaFade {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.mega-menu-wrapper>.container {
    max-width: none;
    padding: 0 16px 12px;
}

.mega-top-strip {
    align-items: center;
    background: linear-gradient(86deg, #76097F 0%, #EF410F 100%);
    display: flex;
    gap: 20px;
    justify-content: space-between;
    padding: 12px 16px;
}

.mega-top-strip h4 {
    color: #fff;
    font-family: var(--font-weight-700);
    font-size: 17px;
    line-height: 1.2;
    margin: 0 0 4px;
}

.mega-top-strip p {
    color: rgba(255, 255, 255, .84) !important;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.mega-search {
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 4px;
    color: var(--mega-ink);
    font-family: var(--font-weight-400);
    font-size: 14px;
    min-width: 260px;
    outline: none;
    padding: 8px 12px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.mega-search:focus {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .26);
}

.mega-layout {
    display: grid;
    gap: 12px;
    grid-template-columns: 285px minmax(0, 1fr);
    max-height: calc(100vh - 216px);
    min-height: 0;
    padding-top: 12px;
}

.featured-products {
    background: var(--mega-soft);
    border: 1px solid rgba(118, 9, 128, .12);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 12px;
}

.featured-card {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(118, 9, 128, .12);
    border-radius: 8px;
    color: var(--mega-ink);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) 70px;
    min-height: 96px;
    padding: 14px;
    text-decoration: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.featured-card:first-child {
    background: var(--gradient-top-to-bottom, linear-gradient(180deg, #760980 0%, #E83E16 100%));
    border-color: transparent;
    color: #fff;
}

.featured-card:hover {
    border-color: rgba(239, 65, 14, .34);
    box-shadow: 0 12px 24px rgba(118, 9, 128, .12);
    transform: translateY(-2px);
}

.featured-card img {
    background: rgba(255, 255, 255, .85);
    border-radius: 6px;
    height: 62px;
    justify-self: end;
    object-fit: contain;
    padding: 6px;
    width: 70px;
}

.featured-card strong {
    color: inherit;
    display: block;
    font-family: var(--font-weight-700);
    font-size: 14px;
    line-height: 1.25;
}

.featured-card em {
    color: currentColor;
    display: block;
    font-size: 12px;
    font-style: normal;
    line-height: 1.35;
    margin-top: 4px;
    opacity: .76;
}

.featured-label {
    color: var(--mega-orange);
    display: block;
    font-family: var(--font-weight-600);
    font-size: 11px;
    line-height: 1.2;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.featured-card:first-child .featured-label {
    color: rgba(255, 255, 255, .82);
}

#megaMenuContainer {
    align-content: start;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mega-column {
    background: #fff;
    border: 1px solid #f0e6f2;
    border-radius: 8px;
    min-width: 0;
    padding: 15px;
}

.mega-column h6 {
    align-items: flex-start;
    color: var(--mega-purple);
    display: flex;
    font-family: var(--font-weight-700);
    font-size: 13px;
    gap: 8px;
    line-height: 1.35;
    margin: 0 0 12px;
}

.mega-title-icon {
    align-items: center;
    background: rgba(239, 65, 14, .1);
    border-radius: 6px;
    color: var(--mega-orange);
    display: inline-flex;
    flex: 0 0 27px;
    height: 27px;
    justify-content: center;
    margin-top: -4px;
    width: 27px;
}

.mega-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-column li {
    margin: 0;
}

.mega-column a {
    align-items: flex-start;
    color: var(--mega-text);
    display: flex;
    font-size: 12px;
    gap: 8px;
    line-height: 1.35;
    padding: 5px 0;
    text-decoration: none;
    transition: color .2s ease, transform .2s ease;
}

.mega-column a::before {
    background: var(--mega-orange);
    border-radius: 50%;
    content: "";
    flex: 0 0 5px;
    height: 5px;
    margin-top: 6px;
    opacity: .55;
    width: 5px;
}

.mega-column a:hover,
.mega-column a:focus {
    color: var(--mega-orange);
    transform: translateX(3px);
}

.mega-footer {
    border-top: 1px solid #f0e6f2;
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    padding: 10px 16px 0;
}

.mega-footer a {
    align-items: center;
    background: var(--mega-purple);
    border-radius: 4px;
    color: #fff;
    display: inline-flex;
    font-family: var(--font-weight-600);
    font-size: 14px;
    gap: 9px;
    line-height: 1;
    padding: 10px 14px;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease;
}

.mega-footer a:hover,
.mega-footer a:focus {
    background: var(--mega-orange);
    color: #fff;
    transform: translateY(-1px);
}

.mega-empty-state {
    align-items: center;
    border: 1px dashed rgba(118, 9, 128, .28);
    border-radius: 8px;
    color: var(--mega-text);
    display: none;
    font-size: 14px;
    grid-column: 1 / -1;
    justify-content: center;
    min-height: 96px;
    padding: 20px;
    text-align: center;
}

.mega-empty-state.is-visible {
    display: flex;
}

/* Desktop category switcher */
.mega-layout {
    grid-template-columns: 300px minmax(0, 1fr);
}

.featured-products {
    background: linear-gradient(180deg, rgba(245, 241, 245, .95), rgba(255, 255, 255, .95));
    border: 1px solid rgba(118, 9, 128, .14);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - 230px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    scrollbar-color: rgba(118, 9, 128, .35) rgba(245, 241, 245, .8);
    scrollbar-width: thin;
}

.featured-products::-webkit-scrollbar,
#megaMenuContainer .mega-column::-webkit-scrollbar {
    width: 8px;
}

.featured-products::-webkit-scrollbar-track,
#megaMenuContainer .mega-column::-webkit-scrollbar-track {
    background: rgba(245, 241, 245, .88);
    border-radius: 999px;
}

.featured-products::-webkit-scrollbar-thumb,
#megaMenuContainer .mega-column::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(118, 9, 128, .65), rgba(239, 65, 14, .72));
    border-radius: 999px;
}

.mega-category-button {
    align-items: center;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--mega-ink);
    cursor: pointer;
    display: grid;
    gap: 10px;
    grid-template-columns: 30px minmax(0, 1fr) 12px;
    min-height: 48px;
    padding: 7px 9px;
    text-align: left;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
    width: 100%;
}

.mega-category-button:hover,
.mega-category-button:focus,
.mega-category-button.is-active {
    background: #fff;
    border-color: rgba(239, 65, 14, .32);
    box-shadow: 0 12px 28px rgba(118, 9, 128, .12);
    outline: none;
    transform: translateX(4px);
}

.mega-category-button.is-active {
    background: linear-gradient(135deg, rgba(118, 9, 128, .96), rgba(239, 65, 14, .92));
    color: #fff;
}

.mega-category-icon {
    align-items: center;
    background: rgba(239, 65, 14, .1);
    border-radius: 8px;
    color: var(--mega-orange);
    display: inline-flex;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.mega-category-button.is-active .mega-category-icon {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.mega-category-copy {
    min-width: 0;
}

.mega-category-copy strong {
    display: block;
    font-family: var(--font-weight-700);
    font-size: 12px;
    line-height: 1.25;
}

.mega-category-copy em {
    display: block;
    font-size: 10px;
    font-style: normal;
    line-height: 1.2;
    margin-top: 5px;
    opacity: .72;
}

.mega-category-button>.fa-chevron-right {
    color: currentColor;
    font-size: 12px;
    opacity: .65;
}

#megaMenuContainer {
    display: block;
    min-height: 0;
    position: relative;
}

#megaMenuContainer .mega-column {
    animation: megaPanelIn .26s ease both;
    background: #fff;
    border: 1px solid #f0e6f2;
    border-radius: 8px;
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: calc(100vh - 230px);
    min-height: 315px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 14px 8px;
    scrollbar-color: rgba(118, 9, 128, .35) rgba(245, 241, 245, .8);
    scrollbar-width: thin;
}

#megaMenuContainer .mega-column.is-active {
    display: grid;
}

#megaMenuContainer .mega-column.is-single-group {
    align-content: start;
    grid-template-columns: 1fr;
}

#megaMenuContainer .mega-column.is-single-group .mega-menu-group {
    background: linear-gradient(180deg, rgba(245, 241, 245, .72), rgba(255, 255, 255, .94));
    border: 1px solid rgba(118, 9, 128, .1);
    border-radius: 8px;
    padding: 14px 16px;
}

.mega-menu-group {
    min-width: 0;
    padding: 0 8px 10px;
}

.mega-menu-group h6 {
    align-items: center;
    color: var(--mega-purple);
    display: flex;
    font-family: var(--font-weight-700);
    font-size: 12px;
    gap: 8px;
    line-height: 1.35;
    margin: 0 0 6px;
}

.mega-menu-group h6::before {
    background: var(--mega-orange);
    border-radius: 50%;
    content: "";
    flex: 0 0 7px;
    height: 7px;
    width: 7px;
}

.mega-menu-group ul {
    column-gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

#megaMenuContainer .mega-column.is-active .mega-menu-group:only-child ul {
    columns: 3 190px;
    column-gap: 30px;
}

#megaMenuContainer .mega-column.is-single-group .mega-menu-group:only-child ul {
    display: grid;
    gap: 4px 24px;
    grid-template-columns: repeat(3, minmax(170px, 1fr));
}

.mega-menu-group li {
    break-inside: avoid;
    margin: 0;
}

.mega-menu-group a {
    align-items: flex-start;
    color: var(--mega-text);
    display: flex;
    font-size: 11px;
    gap: 8px;
    line-height: 1.35;
    padding: 3px 0;
    text-decoration: none;
    transition: color .2s ease, transform .2s ease;
}

.mega-menu-group a::before {
    background: var(--mega-orange);
    border-radius: 50%;
    content: "";
    flex: 0 0 5px;
    height: 5px;
    margin-top: 6px;
    opacity: .55;
    width: 5px;
}

.mega-menu-group a:hover,
.mega-menu-group a:focus {
    color: var(--mega-orange);
    transform: translateX(3px);
}

@keyframes megaPanelIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-mobile-menu {
    max-height: 70vh;
    overflow-y: auto;
}

@media (min-width: 992px) {
    .mega-menu-item:hover .dropdown-menu.mega-menu-wrapper {
        display: block;
    }

    .product-mobile-menu {
        display: none !important;
    }
}

@media (min-width: 1280px) {
    #megaMenuContainer .mega-column {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1199.98px) {
    .mega-menu-wrapper {
        width: min(1100px, calc(100vw - 18px)) !important;
    }

    .mega-layout {
        grid-template-columns: 255px minmax(0, 1fr);
    }

    .mega-category-button {
        grid-template-columns: 28px minmax(0, 1fr) 10px;
        min-height: 44px;
        padding: 6px 8px;
    }

    .mega-category-icon {
        height: 28px;
        width: 28px;
    }

    #megaMenuContainer .mega-column {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mega-menu-group a {
        font-size: 10.5px;
    }
}

@media (max-width: 991.98px) {
    .mega-menu-item {
        position: relative !important;
    }

    .mega-menu-wrapper {
        display: none !important;
    }

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

    .product-mobile-menu.show {
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        display: block !important;
        float: none;
        margin: 8px 0 0 !important;
        max-height: calc(100vh - 178px);
        max-width: 100% !important;
        overflow-y: auto;
        padding: 0 !important;
        position: static !important;
        transform: none !important;
        width: 100%;
    }

    .product-mobile-menu li {
        width: 100%;
    }

    .mobile-product-group {
        background: #fff;
        border: 1px solid rgba(118, 9, 128, .14);
        border-radius: 8px;
        margin-bottom: 8px;
        overflow: hidden;
    }

    .mobile-category-toggle {
        align-items: center;
        background: #fff;
        border: 0;
        color: var(--mega-purple);
        display: flex;
        font-family: var(--font-weight-600);
        font-size: 14px;
        gap: 10px;
        justify-content: space-between;
        line-height: 1.3;
        padding: 12px 13px;
        text-align: left;
        width: 100%;
    }

    .mobile-category-toggle span {
        align-items: center;
        display: flex;
        gap: 9px;
        min-width: 0;
    }

    .mobile-category-toggle .fa-chevron-down {
        color: var(--mega-orange);
        flex: 0 0 auto;
        font-size: 12px;
        transition: transform .2s ease;
    }

    .mobile-category-toggle:hover,
    .mobile-category-toggle:focus {
        background: var(--mega-soft);
        outline: none;
    }

    .mobile-product-list {
        display: none;
        list-style: none;
        margin: 0;
        padding: 0 12px 10px 39px;
    }

    .mobile-product-group.is-open .mobile-product-list {
        display: block;
    }

    .mobile-product-group.is-open .fa-chevron-down {
        transform: rotate(180deg);
    }

    .mobile-product-list a.dropdown-item {
        color: var(--mega-text);
        font-size: 13px;
        line-height: 1.35;
        margin: 0;
        padding: 7px 0;
        white-space: normal;
    }

    .mobile-product-list a.dropdown-item:hover,
    .mobile-product-list a.dropdown-item:focus {
        background: transparent;
        color: var(--mega-orange);
    }
}

@media (max-width: 575.98px) {
    .product-mobile-menu.show {
        max-height: calc(100vh - 155px);
    }
}
