/* Fleet Highlight Carousel
 * Horizontal, swipeable strip of vehicle-group cards.
 * Used by the [w2r-fleet_highlight-plugin] shortcode via grid-layout (layout=carousel).
 * Card count per view is driven by the --w2r-carousel-cols custom property.
 */

.w2r-fleet-carousel {
    --w2r-carousel-cols: 3;
    --w2r-carousel-gap: 1rem;
    width: 100%;
}

.w2r-fleet-carousel .w2r-panel-header {
    margin-bottom: 1rem;
}

.w2r-fleet-carousel-viewport {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.w2r-fleet-carousel-track {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: var(--w2r-carousel-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding-bottom: 0.5rem;
}

/* Hide scrollbar (WebKit) — navigation is via buttons / swipe */
.w2r-fleet-carousel-track::-webkit-scrollbar {
    display: none;
}

.w2r-fleet-carousel-item {
    flex: 0 0 calc(
        (100% - (var(--w2r-carousel-cols) - 1) * var(--w2r-carousel-gap))
        / var(--w2r-carousel-cols)
    );
    scroll-snap-align: start;
    display: flex;
}

/* Let the card fill the slide so heights line up (fleet vehicle-group,
   used-vehicle sale card, or any other card component) */
.w2r-fleet-carousel-item > * {
    width: 100%;
    min-width: 0;
}

.w2r-fleet-carousel-nav {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--color-btn-bg);
    color: var(--color-btn-text);
    cursor: pointer;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.w2r-fleet-carousel-nav:hover:not(:disabled) {
    filter: brightness(0.92);
}

.w2r-fleet-carousel-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

/* On small screens show roughly one full card plus a peek of the next */
@media (max-width: 767.98px) {
    .w2r-fleet-carousel-item {
        flex-basis: 85%;
    }
}
