.carousel-related {
    margin: 0 0 1.5em;
}

.main-frame {
    position: relative;
    margin-bottom: 1em;
    padding-top: 56.25%; /* Соотношение 16:9 */
}

.carousel-related iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.carousel-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.carousel-inner a {
    flex: 0 0 auto; /* Предотвращает изменение размера элементов */
    width: calc(100% / 3 - 10px); /* 3 элемента */
    aspect-ratio: 16 / 9; /* Соотношение сторон 16:9 */
    overflow: hidden;
    position: relative; /* Позволяет контролировать позиционирование изображений */
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-inner {
    display: flex;
    transition: transform 0.3s ease;
    will-change: transform;
    gap: 5px;
}

.carousel-inner a img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Обрезка изображения для заполнения элемента */
    object-position: center; /* Центрирование изображения */
}

.carousel-prev,
.carousel-next {
    cursor: pointer;
    user-select: none;
    font-size: 2em;
    line-height: 1;
    padding: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #fff;
    background-color: rgba(0, 0, 0, 0.5);
    transition: all .3s;
    color: #fff; /* Белый цвет для стрелок */
    text-align: center;
}

.carousel-prev {
    left: 0;
}

.carousel-next {
    right: 0;
}

.carousel-prev::before {
    content: "<"; /* Стрелка влево */
    font-size: 0.8em; /* Размер стрелки */
}

.carousel-next::before {
    content: ">"; /* Стрелка вправо */
    font-size: 0.8em; /* Размер стрелки */
}

@media (min-width: 768px) {
    .carousel-inner a {
        width: calc(100% / 3 - 10px); /* 3 элемента */
    }
}

@media (max-width: 767px) {
    .carousel-inner a {
        width: calc(100% / 2 - 10px); /* 2 элемента */
    }
}

.carousel-related img {
    max-width: 100%;
    vertical-align: middle;
}
