/* ========================================== */
/* CAROUSEL STYLES (Image, Dealership, Recently Added) */
/* ========================================== */

/* Image carousel */
.image-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Performance optimizations for mobile */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Lazy loading images - show placeholder while loading */
img.lazy-load {
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    min-height: 200px;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 2;
    opacity: 0;
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
    background: rgba(217, 56, 41, 0.6);
    transition: all 0.1s ease;
}

/* Carousel hover effects only for hover-capable devices */
@media (hover: hover) {
    .car-card:hover .carousel-nav {
        opacity: 1;
    }

    .carousel-nav:hover {
        background: rgba(217, 56, 41, 0.8);
        transform: translateY(-50%) scale(1.1);
    }
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (hover: hover) {
    .car-card:hover .carousel-indicators {
        opacity: 1;
    }
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: #D93829;
    transform: scale(1.2);
}

.carousel-dot:active {
    transform: scale(0.9);
    background: rgba(217, 56, 41, 0.6);
    transition: all 0.1s ease;
}

@media (hover: hover) {
    .carousel-dot:hover {
        background: rgba(217, 56, 41, 0.8);
    }
}

/* Dealership Gallery Section - Desktop Only */
@media (min-width: 769px) {
    .dealership-gallery {
        display: block !important;
        width: 100%;
        background: #0D0D0D; /* Same color as header */
        position: relative;
        overflow: hidden;
        margin: 0;
        padding: 0;
        height: 480px; /* Further increased height for better visibility */
        margin-top: 100px; /* Exactly at the end of fixed header (header height + padding) */
        z-index: 1; /* Below header but above other content */
    }
}

.dealership-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.dealership-track {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    height: 100%;
    transition: transform 0.5s ease;
    padding: 40px 0;
    position: relative;
    left: 50%;
}

.dealership-slide {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.5s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

/* Standard slide size */
.dealership-slide {
    width: 420px;
    height: 236px; /* 16:9 ratio for 420px width */
}

/* Center slide - larger */
.dealership-slide.center {
    width: 560px;
    height: 315px; /* 16:9 ratio for 560px width */
    transform: scale(1.1);
    z-index: 2;
    box-shadow: 0 12px 32px rgba(217, 56, 41, 0.3);
}

.dealership-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.dealership-slide:hover img {
    transform: scale(1.05);
}

/* Navigation arrows - reusing existing style */
.dealership-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(217, 56, 41, 0.2);
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    color: #D93829;
    cursor: pointer;
    z-index: 15;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dealership-arrow:hover {
    background: rgba(217, 56, 41, 0.1);
    border-color: rgba(217, 56, 41, 0.5);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(217, 56, 41, 0.3);
}

.dealership-arrow-left {
    left: 20px;
}

.dealership-arrow-right {
    right: 20px;
}

/* Indicators */
.dealership-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dealership-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dealership-dot.active {
    background: #D93829;
    border-color: #D93829;
    box-shadow: 0 0 10px rgba(217, 56, 41, 0.5);
}

.dealership-dot:hover {
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}
