/* Allow complete category names in the desktop category mega menu. */
.theme-dropdown-container .theme-mega-menu .theme-mega-menu-container > .theme-col-3,
.theme-dropdown-container .theme-mega-menu .theme-mega-menu-container > .theme-col-9,
.theme-dropdown-container .theme-mega-menu .theme-category-main-container > .theme-row > .theme-col-4 {
    min-width: 0;
}

.theme-dropdown-container .theme-mega-menu .theme-category-dropdown-sidebar li.theme-category-dropdown-parent {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 12px;
    align-items: center;
    column-gap: 8px;
    padding-right: 12px;
}

.theme-dropdown-container .theme-mega-menu .theme-category-dropdown-sidebar li.theme-category-dropdown-parent > a,
.theme-dropdown-container .theme-mega-menu .theme-category-main-container > .theme-row > .theme-col-4 > a {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    min-height: 36px;
    padding: 7px 8px;
    line-height: 22px;
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: normal;
    border-radius: 6px;
}

.theme-dropdown-container .theme-mega-menu .theme-category-dropdown-sidebar li.theme-category-dropdown-parent > svg {
    width: 12px;
    height: 16px;
    margin-right: 0;
    flex-shrink: 0;
}

.theme-dropdown-container .theme-mega-menu .theme-category-main-container > .theme-row.show {
    display: block;
    column-count: 3;
    column-gap: 24px;
    column-fill: balance;
}

.theme-dropdown-container .theme-mega-menu .theme-category-main-container > .theme-row > .theme-col-4 {
    display: block;
    width: 100%;
    break-inside: avoid-column;
    margin-bottom: 2px;
}

.theme-dropdown-container .theme-mega-menu .theme-category-main-container > .theme-row > .theme-col-4 > a {
    display: block;
    min-height: 32px;
    padding-top: 5px;
    padding-bottom: 5px;
}

@media (max-width: 1024px) {
    .theme-dropdown-container .theme-mega-menu .theme-category-main-container > .theme-row.show {
        column-count: 2;
        column-gap: 20px;
    }
}

.theme-dropdown-container .theme-mega-menu .theme-category-dropdown-sidebar li.theme-category-dropdown-parent > a:hover,
.theme-dropdown-container .theme-mega-menu .theme-category-dropdown-sidebar li.theme-category-dropdown-parent > a:focus-visible,
.theme-dropdown-container .theme-mega-menu .theme-category-main-container > .theme-row > .theme-col-4 > a:hover,
.theme-dropdown-container .theme-mega-menu .theme-category-main-container > .theme-row > .theme-col-4 > a:focus-visible {
    background: #eef4ff;
    color: #0053e2;
}

.theme-dropdown-container .theme-mega-menu .theme-category-dropdown-sidebar,
.theme-dropdown-container .theme-mega-menu .theme-category-main-container {
    overflow-x: hidden;
    max-height: min(400px, calc(100dvh - 210px));
}

/* Grouped menus (Cleaning, Office, Janitorial, etc.): each heading and
   its links stay together and flow down independently of neighboring groups. */
.theme-dropdown-container .theme-mega-menu .theme-menu-group-columns {
    display: block;
    column-count: 3;
    column-gap: 24px;
    column-fill: balance;
}

.theme-dropdown-container .theme-mega-menu .theme-menu-group-columns > .theme-col-4 {
    display: block;
    width: 100%;
    min-width: 0;
    break-inside: avoid-column;
}

.theme-dropdown-container .theme-mega-menu .theme-menu-group-columns .cleaning-cart {
    margin-bottom: 22px;
}

.theme-dropdown-container .theme-mega-menu .cleaning-cart .theme-mega-menu-link,
.theme-dropdown-container .theme-mega-menu .cleaning-cart a {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 32px;
    padding: 5px 8px;
    line-height: 21px;
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: normal;
    border-radius: 6px;
    text-align: left;
}

.theme-dropdown-container .theme-mega-menu .cleaning-cart .cleaning-cart-title .theme-mega-menu-link {
    font-weight: 700;
}

.theme-dropdown-container .theme-mega-menu .cleaning-cart .theme-mega-menu-link:hover,
.theme-dropdown-container .theme-mega-menu .cleaning-cart .theme-mega-menu-link:focus-visible,
.theme-dropdown-container .theme-mega-menu .cleaning-cart a:hover,
.theme-dropdown-container .theme-mega-menu .cleaning-cart a:focus-visible {
    background: #eef4ff;
    color: #0053e2;
}

@media (max-width: 1024px) {
    .theme-dropdown-container .theme-mega-menu .theme-menu-group-columns {
        column-count: 2;
        column-gap: 20px;
    }
}

/* Keep the promotion visible inside the grouped menu's scroll area. */
.theme-dropdown-container .theme-mega-menu .theme-mega-menu-container.theme-scrollable > .theme-col-3 > .cleaning-sale-image {
    position: sticky;
    top: 0;
}

.theme-dropdown-container .theme-mega-menu .theme-mega-menu-container.theme-scrollable > .theme-col-3 > .cleaning-sale-image img {
    width: auto;
    max-width: 92%;
    height: auto;
    max-height: 420px;
    max-height: min(420px, calc(100dvh - 230px));
    object-fit: contain;
}
