/* =========================================================
   Слайдер мебельных фабрик
========================================================= */

.factories {
    padding: 60px 0 70px;
}

.factories-slider-wrap {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 18px;
    align-items: center;
    width: 100%;
    margin-top: 20px;
}

/* Внутренний запас нужен, чтобы тени крайних карточек
   не обрезались границами Swiper */
.factories-slider {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 30px 15px;
    box-sizing: border-box;
}

.factories-slider .swiper-wrapper {
    align-items: stretch;
}

.factories-slider .swiper-slide {
    height: auto;
    min-width: 0;
    box-sizing: border-box;
}

/* Один слайд = одна колонка с двумя брендами */
.brand-block {
    display: grid;
    grid-template-rows: repeat(2, 150px);
    row-gap: 75px;

    width: 100%;
    min-width: 0;
}

.brand-block--single {
    grid-template-rows: 150px;
}

/* Одна фабрика */
.brand-block__item {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-width: 0;
    min-height: 150px;
    padding: 15px;

    background: #ffffff;
    border-radius: 2px;
    box-sizing: border-box;

    /* Figma: X 0, Y 15, Blur 25, Spread 0, #000 5% */
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.05);

    text-decoration: none;
    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease,
            background-color 0.2s ease;
}

.brand-block__item:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 17px 28px rgba(0, 0, 0, 0.07);
}

.brand-block__image {
    display: block;
    width: auto;
    max-width: 88%;
    height: auto;
    max-height: 58px;
    object-fit: contain;
}

.brand-block__name {
    color: #242424;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
}

/* =========================================================
   Стрелки
========================================================= */

.factories-slider-arrow {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 54px;
    padding: 0;

    border: 0;
    background: transparent;
    color: #b9c0c3;
    cursor: pointer;

    transition:
            color 0.2s ease,
            opacity 0.2s ease,
            transform 0.2s ease;
}

.factories-slider-arrow::before {
    content: "";
    width: 14px;
    height: 14px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    box-sizing: border-box;
}

.factories-slider-arrow--prev::before {
    transform: rotate(-135deg);
}

.factories-slider-arrow--next::before {
    transform: rotate(45deg);
}

.factories-slider-arrow:hover {
    color: #222222;
    transform: scale(1.05);
}

.factories-slider-arrow.swiper-button-disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

/* Кнопка под слайдером */
.factories-btn.btn-standart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 45px;
    border: solid 2px #272727;
    background: #fff;
    color: #272727;
}
.factories-more {
    text-align: center;
}

/* =========================================================
   Планшет
========================================================= */

@media (max-width: 991px) {
    .factories {
        padding: 48px 0 56px;
    }

    .factories-slider-wrap {
        grid-template-columns: 30px minmax(0, 1fr) 30px;
        gap: 10px;
    }

    .factories-slider {
        padding: 24px 18px 32px;
    }

    .brand-block {
        grid-template-rows: repeat(2, 135px);
        row-gap: 55px;
    }

    .brand-block--single {
        grid-template-rows: 135px;
    }

    .brand-block__item {
        min-height: 135px;
    }

    .brand-block__image {
        max-height: 52px;
    }

    .factories-slider-arrow {
        width: 30px;
    }
}

/* =========================================================
   Телефоны
========================================================= */

@media (max-width: 575px) {
    .factories {
        padding: 36px 0 45px;
    }

    .factories-slider-wrap {
        grid-template-columns: 26px minmax(0, 1fr) 26px;
        gap: 6px;
    }

    .factories-slider {
        padding: 18px 14px 28px;
    }

    .brand-block {
        grid-template-rows: repeat(2, 120px);
        row-gap: 35px;
    }

    .brand-block--single {
        grid-template-rows: 120px;
    }

    .brand-block__item {
        min-height: 120px;
        padding: 12px;
    }

    .brand-block__image {
        max-width: 90%;
        max-height: 46px;
    }

    .brand-block__name {
        font-size: 14px;
    }

    .factories-slider-arrow {
        width: 26px;
        height: 44px;
    }

    .factories-slider-arrow::before {
        width: 10px;
        height: 10px;
        border-width: 1px;
    }

    .factories-btn {
        width: 100%;
        margin-top: 20px;
    }
}