.custom-modal {
    display: none;
    position: fixed;
    z-index: 8;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    box-sizing: border-box;

}

.custom-modal-content {
    background-color: #fefefe;
    margin: 1% auto; /* Уменьшен отступ сверху */
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-sizing: border-box;
    text-align: center;
}

.custom-modal-image {
    width: 100%;
    height: auto;
    margin: 0 auto 20px;
    display: block;
}

.swiper-container {
    display: none;
}

.swiper-slide {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: auto;
    box-sizing: border-box;
    padding: 20px;
    text-align: center;
}

.swiper-slide img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto 30px; /* Увеличен отступ снизу */
    will-change: transform;
    transition: transform 0.3s ease-in-out;
    border-radius: 7px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: block;
}

.swiper-slide p {
    margin: 0 auto;
    max-width: 90%;
    text-align: center;
}

.swiper-button-next, .swiper-button-prev {
    color: #333;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
}

.swiper-pagination {
    margin-top: 10px;
}

#sboriSlider, #eventsSlider, #samboSlider, #karateSlider, #techvandoSlider {
    overflow-x: hidden;
    scrollbar-width: none;
}

#sboriSlider::-webkit-scrollbar,
#eventsSlider::-webkit-scrollbar,
#samboSlider::-webkit-scrollbar,
#karateSlider::-webkit-scrollbar,
#techvandoSlider::-webkit-scrollbar {
    display: none;
}

@media (max-width: 767px) {
    .custom-modal-content {
        margin: 1% auto;
        padding: 10px;
        border: none;
        border-radius: 8px;
        height: auto; /* Изменено на auto */
        max-height: none; /* Убрано ограничение высоты */
    }

    .swiper-slide img {
        max-height: none; /* Убрано ограничение высоты */
        margin-bottom: 10px;
    }

    .swiper-slide {
        padding: 10px;
    }

    .swiper-slide p {
        padding: 0 10px;
    }
}

@media (min-width: 4000px) {
    .custom-modal {
        padding: 20px;
    }

    .custom-modal-content {
        padding: 40px;
        border: 2px solid #888;
        max-width: 1200px;
        max-height: 85vh;
    }

    .swiper-slide {
        padding: 40px;
    }

    .swiper-slide img {
        max-height: 65vh;
        margin-bottom: 40px;
        border-radius: 14px;
    }

    .swiper-slide p {
        max-width: 80%;
        font-size: 1.1em;
    }

    .swiper-button-next, .swiper-button-prev {
        font-size: 48px;
    }

    .swiper-pagination {
        margin-top: 20px;
    }
}
