.section-slider {
    margin: 100px 0 40px 0;
    background-color: rgb(221, 224, 224);
}

.text-slider {
    position: relative;
    width: 100%;
    height: 50px;
    overflow: hidden;
    background-color: rgb(221, 224, 224);
    overflow-x: clip;
    contain: paint;
}

.text-item {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    transform: translateX(100%);
    opacity: 0;
    animation: slide 12s infinite;
    transform: translate3d(100%, 0, 0);
}

/* Каждому задаём сдвиг старта, чтобы шли по очереди */
.text-item:nth-child(1) {
    animation-delay: 0s;
}

.text-item:nth-child(2) {
    animation-delay: 4s;
}

.text-item:nth-child(3) {
    animation-delay: 8s;
}

@keyframes slide {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }

    10% {
        transform: translateX(0);
        opacity: 1;
    }

    33.33% {
        transform: translateX(0);
        opacity: 1;
    }

    43.33% {
        transform: translateX(-100%);
        opacity: 0;
    }

    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@media (max-width: 430px) {
    .section-slider {
        margin: 72px 0 24px 0;
        /* поменьше отступов */
    }

    .text-slider {
        height: 42px;
        /* компактнее по высоте */
    }

    .text-item {
        font-size: clamp(12px, 4.2vw, 16px);
        /* гибкий размер шрифта */
        padding: 0 10px;
        /* меньше боковые отступы */
    }
}

@media (prefers-reduced-motion: reduce) {
    .text-item {
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
        position: static;
        /* чтобы всё просто отобразилось без абсолютов */
    }

    .text-slider {
        height: auto;
    }
}