/**
 * SRE Carousel - Lightweight Image Carousel for Search Results
 * Version: 1.0.1 | Date: 2026-02-04
 * Minimal CSS for carousel with lazy loading
 * 
 * ROLLBACK INSTRUCTIONS:
 * To disable this feature:
 * 1. In functions.php, comment out: require_once(get_stylesheet_directory() . '/inc/sre-carousel-functions.php');
 * 2. In item-v1_cstm.php, replace carousel code with: get_template_part('template-parts/listing/partials/item-image');
 * 3. This file will no longer be loaded automatically
 */

/* Carousel Container */
.sre-carousel-wrap {
    position: relative;
    width: 100%;
    height: 100%;
}

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

.sre-carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Slides */
.sre-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sre-carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.sre-carousel-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.sre-carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lazy loading placeholder */
.sre-carousel-img.lazy {
    background: #f5f5f5;
}

.sre-carousel-img.lazy.loaded {
    background: none;
}

/* Navigation Arrows */
.sre-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s ease;
    color: #333;
}

.sre-carousel-wrap:hover .sre-carousel-arrow {
    opacity: 1;
}

.sre-carousel-arrow:hover {
    background: rgba(255, 255, 255, 1);
}

.sre-carousel-prev {
    left: 12px;
}

.sre-carousel-next {
    right: 12px;
}

.sre-carousel-arrow svg {
    width: 20px;
    height: 20px;
}

/* Hide arrows on single image */
.sre-carousel-wrap:not(.has-carousel) .sre-carousel-arrow {
    display: none;
}

/* Dots Indicator */
.sre-carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sre-carousel-wrap:hover .sre-carousel-dots {
    opacity: 1;
}

.sre-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease, transform 0.2s ease;
}

.sre-carousel-dot:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.2);
}

.sre-carousel-dot.active {
    background: rgba(255, 255, 255, 1);
}

/* Hide dots on single image */
.sre-carousel-wrap:not(.has-carousel) .sre-carousel-dots {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .sre-carousel-arrow {
        width: 32px;
        height: 32px;
        opacity: 0.7; /* Always slightly visible on mobile */
    }
    
    .sre-carousel-prev {
        left: 8px;
    }
    
    .sre-carousel-next {
        right: 8px;
    }
    
    .sre-carousel-dots {
        opacity: 0.9; /* Always visible on mobile */
        bottom: 8px;
    }
    
    .sre-carousel-dot {
        width: 6px;
        height: 6px;
    }
}

/* Touch feedback */
.sre-carousel-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.sre-carousel-dot:active {
    transform: scale(0.9);
}
