.home-brands {
    --brands-visible-columns: 4;
    --brands-rows: 1;
    --brands-duration: 500ms;

    display: grid;
    grid-template-columns: 296px minmax(0, 1fr);
    align-items: start;
    gap: 24px;

    margin-top: 64px;
}

.home-brands__heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;

    min-width: 0;
}

.home-brands__title {
    margin: 0;

    color: #000000;

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

.home-brands__all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;

    min-height: 40px;
    padding: 8px 16px;

    border: 0;
    border-radius: 20px;

    color: #0093ee;
    background-color: #e8f6ff;

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

    white-space: nowrap;
    text-decoration: none;
}

.home-brands__all:disabled {
    opacity: 1;
    cursor: default;
}

.home-brands__carousel {
    position: relative;
    min-width: 0;
}

/* Цю обгортку створює JavaScript.
   Стрілки залишаються за її межами й не обрізаються. */
.home-brands__viewport {
    width: 100%;
    overflow: hidden;
}

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

    margin: 0;
    padding: 0;

    list-style: none;
}

/* Після запуску JavaScript список стає рухомою стрічкою. */
.home-brands__list.is-animated {
    display: flex;
    align-items: stretch;
    gap: 24px;
}

.home-brands__column {
    flex: 0 0 calc(
            (100% - (var(--brands-visible-columns) - 1) * 24px)
            / var(--brands-visible-columns)
    );

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

    list-style: none;
}

.home-brands__column-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 24px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.home-brands__card {
    position: relative;

    min-width: 0;
    aspect-ratio: 296 / 144;

    overflow: hidden;
    border-radius: 16px;

    background-color: #ffffff;
}

.home-brands__card::after {
    content: "";

    position: absolute;
    inset: 0;

    border: 3px solid #f5f5f5;
    border-radius: inherit;

    pointer-events: none;
}

.home-brands__card img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}

.home-brands__control {
    position: absolute;
    z-index: 1;
    top: 50%;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    padding: 8px;

    transform: translateY(-50%);

    border: 0;
    border-radius: 50%;

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

    cursor: pointer;
}

.home-brands__control--previous {
    left: -20px;
}

.home-brands__control--next {
    right: -20px;
}

.home-brands__control:disabled {
    opacity: 0.45;
    cursor: default;
}

.home-brands__icon {
    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: contain;
    mask-size: contain;
}

.home-brands__control .home-brands__icon {
    flex-basis: 24px;

    width: 24px;
    height: 24px;
}

.home-brands__control--previous .home-brands__icon {
    transform: rotate(180deg);
}

.home-brands__control:focus-visible,
.home-brands__all:focus-visible {
    outline: 2px solid #0093ee;
    outline-offset: 4px;
}

.home-brands__status {
    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) {
    .home-brands {
        grid-template-columns: 240px minmax(0, 1fr);
    }
}

@media (max-width: 767px) {
    .home-brands {
        --brands-visible-columns: 2;
        --brands-rows: 2;

        grid-template-columns: minmax(0, 1fr);
        gap: 24px;

        margin-top: 42px;
    }

    .home-brands__heading {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    .home-brands__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}