.catalog-page--sections {
    padding-block: 32px;
}

.catalog-page--sections > .container {
    width: min(1576px, calc(100% - 48px));
}

.catalog-page--sections .sv-breadcrumbs {
    margin-bottom: 32px;
}

.sv-category-sections {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sv-category-section {
    display: grid;
    grid-template-columns: 296px minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

.sv-category-section__heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;

    min-width: 0;
}

.sv-category-section__title {
    margin: 0;

    color: #202020;

    font-family: "Inter", Arial, sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 36px;

    overflow-wrap: anywhere;
}

.sv-category-section__link,
.sv-category-section__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;

    min-height: 40px;
    max-width: 100%;
    padding: 8px 16px;

    border-radius: 20px;

    font-family: "Inter", Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;

    text-decoration: none;
}

.sv-category-section__link {
    color: #0093ee;
    background-color: #e8f6ff;
}

.sv-category-section__button {
    flex: 0 0 auto;

    color: #ffffff;
    background-color: #0093ee;
}

.sv-category-section__arrow {
    display: block;
    flex: 0 0 16px;

    width: 16px;
    height: 16px;

    background-color: currentColor;

    -webkit-mask-image:
            url("/images/icons/category-arrow-circle-right-108e708090425cc357a8bbe11386d3d1.svg");

    mask-image:
            url("/images/icons/category-arrow-circle-right-108e708090425cc357a8bbe11386d3d1.svg");

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    -webkit-mask-position: center;
    mask-position: center;

    -webkit-mask-size: 16px 16px;
    mask-size: 16px 16px;
}

.sv-category-section__content {
    display: flex;
    flex-direction: column;
    gap: 24px;

    min-width: 0;
}

.sv-category-section__products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.sv-category-section__products > li {
    min-width: 0;
}

.sv-category-section__footer {
    box-sizing: border-box;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 16px 24px;

    min-width: 0;
    min-height: 88px;
    padding: 24px;

    border-radius: 16px;
    background-color: #e8f6ff;
}

/*
 * Назви та посилання підкатегорій надходять із бази.
 * Список заповнюється по колонках зверху вниз.
 */

.sv-category-section__subcategories {
    flex: 1 1 360px;

    min-width: 0;
    margin: 0;
    padding: 0;

    columns: 2;
    column-gap: 24px;

    list-style: none;
}

.sv-category-section__subcategories > li {
    margin: 0;
    padding: 0;

    break-inside: avoid;
}

.sv-category-section__subcategory {
    display: inline-block;
    max-width: 100%;

    color: #0093ee;

    font-family: "Inter", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;

    text-decoration: none;
    overflow-wrap: anywhere;
}

.sv-category-section__link:focus-visible,
.sv-category-section__button:focus-visible,
.sv-category-section__subcategory:focus-visible {
    outline: 2px solid #0093ee;
    outline-offset: 4px;
}

.sv-category-page-title {
    position: absolute;

    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;

    overflow: hidden;
    clip-path: inset(50%);

    white-space: nowrap;
    border: 0;
}

@media (max-width: 1279px) {
    .sv-category-section {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .sv-category-section__products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .sv-category-section {
        grid-template-columns: minmax(0, 1fr);
    }

    .sv-category-section__products {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: min(296px, 100%);

        overflow-x: auto;
        padding-bottom: 8px;

        scroll-snap-type: x proximity;

        /*
         * Як у «Топ продажів» та «Схожих товарах».
         */
        scrollbar-width: thin;
        scrollbar-color: #0093ee #e8f6ff;
    }

    .sv-category-section__products::-webkit-scrollbar {
        height: 4px;
    }

    .sv-category-section__products::-webkit-scrollbar-track {
        border-radius: 4px;
        background: #e8f6ff;
    }

    .sv-category-section__products::-webkit-scrollbar-thumb {
        border-radius: 4px;
        background: #0093ee;
    }

    .sv-category-section__products > li {
        scroll-snap-align: start;
    }

    .sv-category-section__footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .sv-category-section__subcategories {
        flex: none;
        width: 100%;

        columns: 1;
    }
}