/* Navigation for branded catalog listings. */
@media (min-width: 769px) {
    body.catalog-category-modal-open {
        overflow: hidden;
    }
    .catalog-category-modal--brand {
        position: fixed;
        z-index: 1200;
        inset: 0;
        display: block;
        overflow: hidden;
        pointer-events: none;
    }
    .catalog-category-modal--brand.is-open {
        pointer-events: auto;
    }
    .catalog-category-modal--brand .catalog-category-modal__overlay {
        position: absolute;
        z-index: 1;
        inset: 0;
        background: rgba(0, 0, 0, .5);
        opacity: 0;
        transition: opacity .18s ease;
    }
    .catalog-category-modal--brand.is-open .catalog-category-modal__overlay {
        opacity: 1;
    }
    .catalog-category-modal--brand .catalog-category-modal__close {
        position: absolute;
        z-index: 3;
        display: flex;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #fff;
        color: #202732;
        box-shadow: 0 4px 14px rgba(32, 39, 50, .08);
        cursor: pointer;
        top: calc(12dvh + 8px);
        right: max(36px, calc((100% - 1080px) / 2 + 8px));
    }
    .catalog-category-modal--brand .catalog-category-modal__close span,
    .catalog-category-modal--brand .catalog-category-modal__close span::after {
        display: block;
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        content: '';
    }
    .catalog-category-modal--brand .catalog-category-modal__close span {
        position: relative;
        transform: rotate(45deg);
    }
    .catalog-category-modal--brand .catalog-category-modal__close span::after {
        position: absolute;
        inset: 0;
        transform: rotate(90deg);
    }
    .catalog-category-modal--brand .catalog-category-modal__panel {
        position: relative;
        z-index: 2;
        overflow-y: auto;
        background: #fff;
        transform: translateY(18px);
        transition: transform .2s ease;
        overscroll-behavior: contain;
        width: min(1080px, calc(100% - 64px));
        height: auto;
        max-height: 75dvh;
        margin: 12dvh auto 0;
        padding: 24px;
        border-radius: 16px;
    }
    .catalog-category-modal--brand.is-open .catalog-category-modal__panel {
        transform: translateY(0);
    }
    .catalog-category-modal--brand .catalog-category-modal__grid {
        display: flex;
        width: 100%;
        align-content: stretch;
        align-items: flex-start;
        flex-wrap: wrap;
        height: auto;
        min-height: 0;
        gap: 16px;
        overflow: visible;
    }
    .catalog-category-modal--brand .catalog-category-modal__item {
        display: flex;
        height: 120px;
        align-items: flex-start;
        justify-content: flex-end;
        flex-direction: column;
        color: #202732;
        font-size: 12px;
        line-height: 15px;
        width: calc(25% - 12px);
        flex-basis: calc(25% - 12px);
        margin: 0;
    }
    .catalog-category-modal--brand .catalog-category-modal__image {
        position: relative;
        display: flex;
        width: 100%;
        height: 80px;
        align-items: flex-end;
        justify-content: center;
    }
    .catalog-category-modal--brand .catalog-category-modal__image::before {
        position: absolute;
        z-index: 0;
        right: 0;
        bottom: 0;
        left: 0;
        height: 50px;
        border-radius: 100px;
        background: #EA4C2F;
        content: '';
    }
    .catalog-category-modal--brand .catalog-category-modal__image img {
        position: relative;
        z-index: 1;
        display: block;
        width: 80px;
        height: 80px;
        object-fit: contain;
    }
    .catalog-category-modal--brand .catalog-category-modal__caption {
        display: block;
        margin-top: 8px;
        text-align: left;
    }
}

.page-catalog-list .catalog-categories--brand {
    max-width: 100%;
    min-width: 0;
    margin-inline: 0;
}

.page-catalog-list .catalog-categories--brand a:nth-child(10) {
    margin-left: 0;
}

.page-catalog-list .catalog-categories--brand a.catalog-categories__brand-text {
    display: flex;
    height: auto;
    min-height: 44px;
    align-self: center;
    justify-content: center;
    margin-block: 0;
    padding: 8px;
    border: 1px solid #efeeec;
    border-radius: 12px;
    text-align: center;
}

.page-catalog-list .catalog-categories--brand .catalog-categories__all {
    display: flex !important;
    width: auto;
    height: 50px;
    align-self: center;
    align-items: center;
    justify-content: center;
    margin: 0;
    border-radius: 100px;
    background: #EA4C2F;
    color: #fff;
    scroll-snap-align: start;
    min-width: 120px;
    flex: 0 0 auto;
    padding-inline: 12px;
}

@media (max-width: 768px) {
    .catalog-category-modal--brand .catalog-category-modal__grid {
        display: grid;
        height: auto;
        min-height: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .catalog-category-modal--brand .catalog-category-modal__item {
        width: 100%;
        height: auto;
        min-height: 44px;
        justify-content: center;
        margin: 0;
    }
}

@media (max-width: 760px) {
    .page-catalog-list .catalog-categories--brand {
        width: 100%;
        height: auto;
        min-height: 0;
        margin: 0;
        padding: 8px 0 14px;
    }

    .page-catalog-list .catalog-categories--brand a:not(.catalog-categories__all) {
        margin-top: 0;
    }

    .page-catalog-list .catalog-categories--brand .catalog-categories__all {
        align-self: center;
        margin-top: 0;
    }
}

