/* центрируем всё */
.carousel-wrapper {
    position: relative;
    width: 900px;
    height: 450px;
    margin: 0 auto;
    margin-bottom: 200px;
    margin-top: 70px;
}

/* 3D контейнер */
.carousel {
    width: 100%;
    height: 100%;
    position: relative;
    perspective: 1200px;
    overflow: visible;
}

/* базовые карточки */
.slide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    width: 300px;     /* фикс ширина */
    height: 450px;    /* фикс высота */
    transform: translate(-50%, -50%);
    transition: transform .7s cubic-bezier(.25,.8,.25,1), opacity .7s;
    opacity: .45;
    border-radius: 18px;
    cursor: pointer;
}

/* все изображения одинакового размера */
.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;      /* обрезает без искажений */
    object-position: center;
    border-radius: 18px;
    display: block;
}

/* ЦЕНТРАЛЬНЫЙ СЛАЙД */
.slide.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 5;
}

/* ЛЕВЫЙ */
.slide.left {
    transform: translate(calc(-50% - 300px), -50%) rotateY(30deg);
    z-index: 4;
}

/* ПРАВЫЙ */
.slide.right {
    transform: translate(calc(-50% + 300px), -50%) rotateY(-30deg);
    z-index: 4;
}

/* Остальные */
.slide.hidden {
    transform: translate(-50%, -50%) scale(.5);
    opacity: 0;
    z-index: 1;
}

/* Стрелки */
.nav {
    position: absolute;
    bottom: -130px;

    padding: 12px 18px;
    border: none;
    cursor: pointer;
    font-size: 32px;

}

.prev { left: 0; }
.next { right: 0; }

.slider_button{
    display: none!important;
    position: absolute;
    bottom: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 40px;
    border-radius: 100px;
    border: 1px solid var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.slider_button:hover{
    border: 1px solid #ffffff;
}
.slider_button:hover span{
    color: #ffffff;
}
.slider_button:hover svg path{
    fill: #ffffff;
}
.slider_button svg path{
    transition: all 0.3s ease;
}
.slider_button svg{
    width: 20px;
    height: 20px;
    object-fit: contain;
    transition: all 0.3s ease;
}
.slider_button span{
    font-size: 20px;
    font-weight: 400;
    color: var(--red);
    transition: all 0.3s ease;
}
@media (max-width: 1030px) {
    .carousel-wrapper{
        width: 700px;
        height: 400px;
    }
    .slide{
        width: 250px;
        height: 378px;
    }
    .slide.left {
        transform: translate(calc(-50% - 250px), -50%) rotateY(30deg);
    }
    .slide.right {
    transform: translate(calc(-50% + 250px), -50%) rotateY(-30deg);
    }
    .nav img{
        width: 100px;
        height: 15px;
        object-fit: cover;
    }
    .prev img{
        object-position: left;
    }
    .next img{
        object-position: right;
    }
}
@media (max-width: 805px) {
    .carousel-wrapper{
        width: 500px;
        height: 300px;
    }

    .slide{
        width: 200px;
        height: 300px;
    }
    .slide.left {
        transform: translate(calc(-50% - 200px), -50%) rotateY(30deg);
    }
    .slide.right {
    transform: translate(calc(-50% + 200px), -50%) rotateY(-30deg);
    }
}
@media (max-width: 640px) {

    .carousel-wrapper {
        width: 470px;
        margin-top: 30px;
        margin-bottom: 150px;
        height: 262px;
    }
    .slide{
        width: 170px;
        height: 250px;
    }
    .slide.left {
        transform: translate(calc(-50% - 170px), -50%) rotateY(30deg);
    }
    .slide.right {
    transform: translate(calc(-50% + 170px), -50%) rotateY(-30deg);
    }
}

@media (max-width: 580px) {
    .carousel-wrapper {
        width: 470px;
        margin-top: 61px;
        margin-bottom: 150px;
        height: 203px;
    }
}

@media (max-width: 520px) {
    .slide {
        width: 196px;
        height: 292px;
        border-radius: 5px;
    }
    .slide img{
        border-radius: 5px;
    }
    .slide::after{
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 5px;
        padding: 1px;
        background: linear-gradient(to right, #FF0000, #4D00FF);
        -webkit-mask: 
            linear-gradient(#fff 0 0) content-box, 
            linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask: 
            linear-gradient(#fff 0 0) content-box, 
            linear-gradient(#fff 0 0);
        mask-composite: exclude;
        opacity: 1;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }
    .slide.left {
        transform: translate(calc(-50% - 140px), -50%) rotateY(30deg);
    }
    .slide.right {
    transform: translate(calc(-50% + 140px), -50%) rotateY(-30deg);
    }
}

@media (max-width: 480px) {
    .slide {
        width: 170px;
        height: 250px;

    }
    .slide.left {
        height: 250px;
        transform: translate(calc(-50% - 110px), -50%) rotateY(30deg);
    }
    .slide.right {
        height: 250px;
        transform: translate(calc(-50% + 110px), -50%) rotateY(-30deg);
    }
    .carousel-wrapper{
        width: 400px;
    }
    .slide::after{
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 5px;
        padding: 1px;
        background: linear-gradient(to right, #FF0000, #4D00FF);
        -webkit-mask: 
            linear-gradient(#fff 0 0) content-box, 
            linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask: 
            linear-gradient(#fff 0 0) content-box, 
            linear-gradient(#fff 0 0);
        mask-composite: exclude;
        opacity: 1;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }
}
@media (max-width: 420px) {
    .slide {
        width: 151px;
        height: 228px;
    }
    .slide.left {
        transform: translate(calc(-50% - 90px), -50%) rotateY(30deg);
    }
    .slide.right {
    transform: translate(calc(-50% + 90px), -50%) rotateY(-30deg);
    }
    .carousel-wrapper{
        width: 350px;
        margin-top: 81px;
        margin-bottom: 125px;
        height: 142px;
    }
    .nav{
        padding: 2px 5px;
    }
}