/* Изолированная раскладка слайдера маршрутов. Подключается после style.css. */
.routes > .container {
    max-width: 1680px;
    padding-right: 32px;
    padding-left: 32px;
}

.routes-slider {
    position: relative;
    width: 100%;
    min-width: 0;
}

.routes-slider-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: -28px 0 14px;
}

.routes-slider-arrow {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbdac7;
    border-radius: 50%;
    background: #fff;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 20px;
    transition: background-color 0.2s ease, border-color 0.2s ease,
                color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.routes-slider-arrow:hover:not(:disabled),
.routes-slider-arrow:focus-visible {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
    outline: none;
    transform: translateY(-2px);
}

.routes-slider-arrow:disabled {
    cursor: default;
    opacity: 0.35;
}

.routes-slider > .cards-grid {
    display: flex;
    grid-template-columns: none;
    width: 100%;
    min-width: 0;
    gap: 20px;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 3px 20px;
    scroll-behavior: smooth;
    scroll-padding-inline: 3px;
    scroll-snap-type: x mandatory;
    scrollbar-color: #8da589 #e5ece3;
    scrollbar-width: thin;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.routes-slider > .cards-grid::-webkit-scrollbar {
    height: 7px;
}

.routes-slider > .cards-grid::-webkit-scrollbar-track {
    border-radius: 999px;
    background: #e5ece3;
}

.routes-slider > .cards-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #8da589;
}

.routes-slider > .cards-grid > .card {
    width: auto;
    min-width: 0;
    flex: 0 0 calc((100% - 80px) / 5);
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.routes-slider .card-content {
    padding: 22px 15px;
}

.routes-slider .card-content h3 {
    font-size: 18px;
    line-height: 1.3;
}

.routes-slider .card-content .short-desc {
    font-size: 13px;
}

.routes-slider .price {
    font-size: 19px;
    line-height: 1.3;
}

.routes-slider .card-content .btn {
    padding: 10px 12px;
    font-size: 12px;
}

@media (max-width: 1100px) {
    .routes-slider > .cards-grid > .card {
        flex-basis: calc((100% - 60px) / 4);
    }
}

@media (max-width: 900px) {
    .routes-slider > .cards-grid > .card {
        flex-basis: calc((100% - 40px) / 3);
    }
}

@media (max-width: 700px) {
    .routes > .container {
        padding-right: 20px;
        padding-left: 20px;
    }

    .routes-slider-controls {
        margin-top: -34px;
    }

    .routes-slider > .cards-grid > .card {
        flex-basis: calc((100% - 20px) / 2);
    }
}

@media (max-width: 520px) {
    .routes-slider-controls {
        margin-top: -32px;
        margin-bottom: 12px;
    }

    .routes-slider-arrow {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .routes-slider > .cards-grid {
        gap: 14px;
        padding-bottom: 16px;
    }

    .routes-slider > .cards-grid > .card {
        flex-basis: 88%;
    }
}
