/* Обёртка бегущей строки */
.custom-marquee {
    width: 100vw;
    max-width: 100%;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 20px 0;
    box-sizing: border-box;
    overflow: hidden;
}

.custom-marquee__viewport {
    overflow: hidden;
    width: 100%;
}

/* Дорожка слайдов */
.custom-marquee__track {
    display: flex;
    width: max-content;
    animation: custom-marquee-scroll var(--marquee-duration, 80s) linear infinite;
    will-change: transform;
}

/* Каждый слайд — 16:9 */
.custom-marquee__item {
    width: 40vw;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    margin-right: 20px;
    overflow: hidden;
    border-radius: 12px;
}

.custom-marquee__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Движение ровно на половину дорожки — вторая копия слайдов создаёт бесшовность */
@keyframes custom-marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Пауза */
.custom-marquee.is-paused .custom-marquee__track {
    animation-play-state: paused;
}

/* Блок с кнопкой — справа под слайдером */
.custom-marquee__controls {
    padding: 0 20px;
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}

/* Круглая кнопка */
.custom-marquee__pause {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #111;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.custom-marquee__pause:hover {
    background: #000;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.custom-marquee__pause:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.custom-marquee__pause:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: 3px;
}

/* Иконки */
.custom-marquee__pause .icon {
    position: absolute;
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

/* По умолчанию показываем "пауза", "плей" — скрыт */
.custom-marquee__pause .icon--play {
    opacity: 0;
    transform: scale(0.7);
}

/* Когда слайдер на паузе — показываем "плей" */
.custom-marquee__pause[aria-pressed="true"] .icon--pause {
    opacity: 0;
    transform: scale(0.7);
}

.custom-marquee__pause[aria-pressed="true"] .icon--play {
    opacity: 1;
    transform: scale(1);
}