/* =========================================================
   PRODUCTS MEGA MENU
   Bootstrap 5.3
========================================================= */

.products-mega-item {
    position: static;
}


/* =========================================================
   DROPDOWN
========================================================= */

.mega-menu {
    --bs-dropdown-border-width: 0;
    --bs-dropdown-border-radius: 0;

    position: absolute !important;

    top: 100% !important;
    left: 50% !important;
    right: auto !important;

    transform: translateX(-50%) !important;

    width: min(1200px, calc(100vw - 40px));

    margin: 0 !important;
    padding: 0;

    background: #ffffff;

    border: 0;
    border-top: 1px solid #eeeeee;
    border-radius: 0 0 14px 14px;

    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);

    overflow: hidden;

    z-index: 1050;
}


.mega-menu[data-bs-popper] {
    top: 100% !important;
    left: 50% !important;

    margin-top: 0 !important;

    transform: translateX(-50%) !important;
}


/* =========================================================
   INNER
========================================================= */

.mega-menu-inner {
    padding: 0;
}


/* =========================================================
   HEADER
========================================================= */

.mega-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    padding: 20px 24px;

    border-bottom: 1px solid #eeeeee;
}


.mega-menu-eyebrow {
    display: block;

    margin-bottom: 3px;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 1.5px;

    color: #999999;
}


.mega-menu-header h3 {
    margin: 0;

    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;

    color: #202020;
}


.mega-view-all {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    color: #333333;

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;

    transition:
        gap .2s ease,
        color .2s ease;
}


.mega-view-all:hover {
    gap: 12px;

    color: #000000;
}


/* =========================================================
   3 COLUMNS
========================================================= */

.mega-columns {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    min-height: 390px;
    max-height: 520px;
}


/* =========================================================
   COLUMN
========================================================= */

.mega-column {
    min-width: 0;

    background: #ffffff;

    border-right: 1px solid #eeeeee;

    overflow: hidden;
}


.mega-column:last-child {
    border-right: 0;
}


.mega-column-level-1 {
    background: #fafafa;
}


.mega-column-heading {
    display: flex;
    align-items: center;

    height: 46px;

    padding: 0 20px;

    border-bottom: 1px solid #eeeeee;

    color: #999999;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 1px;

    text-transform: uppercase;
}


/* Mobile-only navigation bars are hidden on desktop/tablet. */

.mega-mobile-nav {
    display: none;
}


/* =========================================================
   COLUMN CONTENT
========================================================= */

.mega-column-list,
.mega-column-content {
    height: calc(100% - 46px);

    max-height: 474px;

    padding: 10px;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;
}


/* =========================================================
   NAV ITEMS
========================================================= */

.mega-nav-item {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    width: 100%;

    min-height: 44px;

    padding: 9px 12px;
    margin: 0;

    border: 0;
    border-radius: 7px;

    background: transparent;

    color: #333333;

    font-family: inherit;
    font-size: 14px;
    font-weight: 500;

    line-height: 1.35;

    text-align: left;
    text-decoration: none;

    cursor: pointer;

    transition:
        background-color .15s ease,
        color .15s ease,
        padding-left .15s ease;
}


.mega-nav-text {
    flex: 1 1 auto;

    min-width: 0;

    white-space: normal;

    overflow-wrap: anywhere;
}


.mega-nav-item i {
    flex: 0 0 auto;

    font-size: 10px;

    color: #aaaaaa;

    transition:
        color .15s ease,
        transform .15s ease;
}


.mega-nav-item:hover {
    background: #f4f4f4;

    color: #111111;
}


.mega-nav-item:hover i {
    color: #444444;

    transform: translateX(2px);
}


.mega-nav-item.active {
    background: #eeeeee;

    color: #111111;

    font-weight: 600;
}


.mega-column-level-1 .mega-nav-item.active {
    background: #ffffff;

    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}


.mega-nav-item.active i {
    color: #222222;
}


/* =========================================================
   LEVEL GROUPS
========================================================= */

.mega-level-2-group,
.mega-level-3-group {
    display: none;
}


.mega-level-2-group.active,
.mega-level-3-group.active {
    display: block;
}


/* =========================================================
   LEVEL 2 DIRECT LINK
========================================================= */

.mega-level-2-link {
    color: #444444;
}


.mega-level-2-link i {
    opacity: .45;
}


.mega-level-2-link:hover {
    background: #f5f5f5;

    color: #111111;
}


.mega-level-2-link:hover i {
    opacity: 1;
}


/* =========================================================
   LEVEL 3
========================================================= */

.mega-level-3-item {
    color: #555555;
}


.mega-level-3-item:hover {
    background: #f7f7f7;

    color: #000000;

    padding-left: 16px;
}


.mega-direct-item {
    margin-bottom: 8px;

    background: #fafafa;

    border: 1px solid #eeeeee;

    font-weight: 600;
}


.mega-product-count {
    flex: 0 0 auto;

    min-width: 26px;

    padding: 2px 7px;

    border-radius: 20px;

    background: #eeeeee;

    color: #666666;

    font-size: 11px;
    font-weight: 700;

    line-height: 1.4;

    text-align: center;
}


/* =========================================================
   EMPTY
========================================================= */

.mega-empty {
    padding: 16px 12px;

    color: #aaaaaa;

    font-size: 13px;

    font-style: italic;
}


/* =========================================================
   SCROLLBAR
========================================================= */

.mega-column-list::-webkit-scrollbar,
.mega-column-content::-webkit-scrollbar {
    width: 5px;
}


.mega-column-list::-webkit-scrollbar-track,
.mega-column-content::-webkit-scrollbar-track {
    background: transparent;
}


.mega-column-list::-webkit-scrollbar-thumb,
.mega-column-content::-webkit-scrollbar-thumb {
    background: #dddddd;

    border-radius: 10px;
}


/* =========================================================
   NAVBAR
========================================================= */

.navbar {
    position: relative;

    z-index: 1040;
}


.navbar .nav-link {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 64px;

    padding-left: 15px !important;
    padding-right: 15px !important;

    color: #333333;

    font-size: 14px;
    font-weight: 600;

    letter-spacing: .15px;
}


.navbar .nav-link::before {
    content: "";

    position: absolute;

    left: 15px;
    right: 15px;
    bottom: 0;

    height: 2px;

    background: #222222;

    transform: scaleX(0);

    transform-origin: center;

    transition: transform .2s ease;
}


.navbar .nav-link:hover::before,
.navbar .nav-link.show::before,
.navbar .nav-link.active::before {
    transform: scaleX(1);
}


/* =========================================================
   TABLET / COLLAPSED NAVBAR
========================================================= */

@media (max-width: 991.98px) {

    .products-mega-item {
        position: relative;
    }


    .mega-menu,
    .mega-menu[data-bs-popper] {
        position: static !important;

        top: auto !important;
        left: auto !important;
        right: auto !important;

        transform: none !important;

        width: 100%;

        max-height: none;

        margin: 0 !important;

        border-radius: 0;

        border-top: 1px solid #eeeeee;

        box-shadow: none;

        overflow: hidden;
    }


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

        min-height: 350px;
        max-height: 60vh;
    }


    .mega-column-list,
    .mega-column-content {
        max-height: calc(60vh - 46px);
    }


    .mega-menu-header {
        padding: 16px;
    }


    .mega-nav-item {
        font-size: 13px;

        padding-left: 9px;
        padding-right: 9px;
    }


    .navbar .nav-link {
        min-height: 48px;

        padding-left: 12px !important;
        padding-right: 12px !important;
    }


    .navbar .nav-link::before {
        display: none;
    }
}


/* =========================================================
   PHONE - SINGLE PANEL DRILL-DOWN
========================================================= */

@media (max-width: 575.98px) {

    /*
     * Mega menu occupies one vertical panel.
     */

    .mega-menu,
    .mega-menu[data-bs-popper] {
        width: 100%;

        max-height: 72vh;

        overflow: hidden;
    }


    .mega-menu-header {
        padding: 13px 12px;
    }


    .mega-menu-header h3 {
        font-size: 18px;
    }


    .mega-menu-eyebrow {
        font-size: 9px;
    }


    .mega-view-all {
        gap: 5px;

        font-size: 11px;
    }


    /*
     * Important:
     * Mobile no longer uses a 3-column horizontal grid.
     * All columns occupy the same single panel.
     */

    .mega-columns {
        position: relative;

        display: block;

        min-height: 0;
        max-height: none;

        overflow: hidden;
    }


    .mega-column {
        display: none;

        width: 100%;

        min-width: 0;

        border-right: 0;

        background: #ffffff;
    }


    /*
     * Initial state = Level 1
     */

    .mega-column-level-1 {
        display: block;

        background: #ffffff;
    }


    /*
     * After selecting Level 1 = Level 2
     */

    .mega-columns.mobile-show-level-2 .mega-column-level-1 {
        display: none;
    }


    .mega-columns.mobile-show-level-2 .mega-column-level-2 {
        display: block;
    }


    /*
     * After selecting Level 2 = Level 3
     */

    .mega-columns.mobile-show-level-3 .mega-column-level-1,
    .mega-columns.mobile-show-level-3 .mega-column-level-2 {
        display: none;
    }


    .mega-columns.mobile-show-level-3 .mega-column-level-3 {
        display: block;
    }


    /*
     * Desktop/tablet column heading is unnecessary on phone,
     * because the mobile bar shows context.
     */

    .mega-column-level-2 > .mega-column-heading,
    .mega-column-level-3 > .mega-column-heading {
        display: none;
    }


    .mega-column-level-1 > .mega-column-heading {
        height: 43px;

        padding: 0 14px;
    }


    /*
     * Mobile back/context bar
     */

    .mega-mobile-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;

        gap: 12px;

        min-height: 49px;

        padding: 7px 10px;

        border-bottom: 1px solid #eeeeee;

        background: #fafafa;
    }


    .mega-mobile-back {
        display: inline-flex;
        align-items: center;

        gap: 7px;

        min-width: 0;

        padding: 7px 8px;

        border: 0;
        border-radius: 7px;

        background: transparent;

        color: #444444;

        font-family: inherit;
        font-size: 12px;
        font-weight: 600;

        text-align: left;

        cursor: pointer;
    }


    .mega-mobile-back:hover {
        background: #eeeeee;

        color: #111111;
    }


    .mega-mobile-back i {
        flex: 0 0 auto;

        font-size: 10px;
    }


    .mega-mobile-back span {
        min-width: 0;

        overflow: hidden;

        text-overflow: ellipsis;
        white-space: nowrap;
    }


    .mega-mobile-current {
        min-width: 0;

        overflow: hidden;

        color: #222222;

        font-size: 13px;
        font-weight: 700;

        text-align: right;

        text-overflow: ellipsis;
        white-space: nowrap;
    }


    /*
     * List height / scrolling
     */

    .mega-column-list,
    .mega-column-content {
        height: auto;

        max-height: calc(72vh - 125px);

        padding: 8px;

        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }


    .mega-column-level-1 .mega-column-list {
        max-height: calc(72vh - 118px);
    }


    /*
     * Larger touch targets.
     */

    .mega-nav-item {
        min-height: 48px;

        padding: 10px 11px;

        border-radius: 8px;

        font-size: 14px;

        touch-action: manipulation;
    }


    .mega-nav-item + .mega-nav-item {
        margin-top: 2px;
    }


    .mega-nav-item i {
        font-size: 11px;
    }


    .mega-level-3-item:hover {
        padding-left: 11px;
    }


    .mega-direct-item {
        margin-bottom: 7px;
    }


    .mega-product-count {
        min-width: 25px;

        padding: 2px 6px;

        font-size: 10px;
    }
}
