/* Horizontal scrollable deliveries carousel */
.deliveries-horizontal-container {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.deliveries-scroll-wrapper {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(44, 106, 179, 0.5) rgba(105, 112, 123, 0.25);
    width: 100%;
    box-sizing: border-box;
    /* Prevent momentum scroll issues on mobile */
    scroll-snap-type: x proximity;
    /* Force GPU acceleration for smoother scrolling */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.carousel-arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(44, 106, 179, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-arrow:hover {
    background: rgba(44, 106, 179, 0.95);
}

.carousel-arrow:hover .material-symbols-outlined {
    color: white;
}

.carousel-arrow .material-symbols-outlined {
    font-size: 48px;
    color: rgba(44, 106, 179, 0.8);
    transition: color 0.3s ease;
    font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 0, 'opsz' 48;
}

.carousel-arrow-left {
    left: 0;
    border-radius: 4px 0 0 4px;
}

.carousel-arrow-right {
    right: 0;
    border-radius: 0 4px 4px 0;
}

/* Position arrows with offset on larger screens */
@media (min-width: 1231px) {
    .carousel-arrow-left {
        left: var(--left_right);
    }

    .carousel-arrow-right {
        right: var(--left_right);
    }
}

.deliveries-scroll-wrapper::-webkit-scrollbar {
    height: 8px;
}

.deliveries-scroll-wrapper::-webkit-scrollbar-track {
    background: rgba(105, 112, 123, 0.25);
    border-radius: 4px;
}

.deliveries-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(44, 106, 179, 0.5);
    border-radius: 4px;
}

.deliveries-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(44, 106, 179, 0.75);
}

.car-delivered-horizontal {
    flex: 0 0 auto;
    min-width: 300px;
    max-width: fit-content;
    border: 1px solid rgba(44, 106, 179, 0.5);
    border-radius: 4px;
    padding: 8px;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    scroll-snap-align: start;
    /* Prevent layout shifts */
    contain: layout;
}

.car-delivered-horizontal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.car-delivered-horizontal.current {
    color: rgba(255, 87, 34, 1);
    background-color: rgba(255, 255, 64, 0.75);
    border-color: rgba(255, 87, 34, 1);
}

.delivery-loading {
    flex: 0 0 auto;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

.cars-container {
    display: flex;
    flex-direction: row;
    gap: 4px;
    flex-wrap: nowrap;
}

.single-car-block {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}

.car-images-pair {
    display: flex;
    flex-direction: row;
    gap: 2px;
}

.car-images-pair .delivered-image {
    flex: 0 0 auto;
    display: block;
    max-width: 200px;
    height: 150px;
    object-fit: cover;
}

/* Responsive adjustments for horizontal scroll */
@media (max-width: 768px) {
    .carousel-arrow {
        width: 32px;
        opacity: 0.85;
    }

    .carousel-arrow .material-symbols-outlined {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .deliveries-scroll-wrapper {
        gap: 6px;
        padding: 0;
    }

    .car-images-pair .delivered-image {
        max-width: 150px;
        height: auto;
    }
}

@media (max-width: 476px) {
    .car-images-pair .delivered-image {
        max-width: 120px;
        height: auto;
    }
}
