.slider {
    height: 250px;
    margin: auto;
    position: relative;
    width: 90%;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.slide-track {
    display: flex;
    width: calc(250px * 10);
    /* 250px slide width * number of slides (original 5 + duplicate 5) */
    animation: scroll 40s linear infinite;
}

.slide {
    height: 200px;
    width: 250px;
    display: flex;
    align-items: center;
    padding: 15px;
    perspective: 100px;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.slide img:hover {
    transform: scale(1.05);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-250px * 5));
        /* Scroll half the total width (the original set) */
    }
}

/* RTL Support - Flips the direction for Arabic/RTL pages if body has dir="rtl" */
[dir="rtl"] .slide-track {
    animation: scroll-rtl 40s linear infinite;
}

@keyframes scroll-rtl {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(250px * 5));
        /* Positive value moves in opposite direction */
    }
}