/**
 * Mobile-only Carousel Styles
 * These styles only apply on mobile devices and work alongside existing carousel CSS
 */

/* Mobile carousel specific styling */
@media (max-width: 768px) {
    /* Override existing carousel styles for mobile */
    .mobile-carousel {
        position: relative !important;
        overflow: hidden !important;
        width: 100% !important;
        height: 300px !important; /* Consistent mobile height */
        margin: 0 auto !important;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .mobile-carousel .carousel-container {
        display: flex !important;
        height: 100% !important;
        transition: transform 0.3s ease-in-out !important;
        /* transform will be controlled by JS - no CSS override */
    }

    .mobile-carousel .carousel-slide {
        flex-shrink: 0 !important;
        /* width will be set by JS based on slide count */
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
    }

    .mobile-carousel .carousel-slide img {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        display: block !important;
        opacity: 1 !important; /* Force visibility */
        transition: opacity 0.3s ease;
        /* object-fit and object-position controlled by data attributes via JavaScript */
    }

    /* Ensure images are visible when loaded */
    .mobile-carousel .carousel-slide img.lazy-loaded-img {
        opacity: 1 !important;
    }

    .mobile-carousel .carousel-slide img.lazy-loading-img {
        opacity: 0.5 !important;
    }

    /* Style the dots for mobile */
    .mobile-carousel .carousel-dots {
        position: absolute;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 8px;
        z-index: 10;
    }

    .mobile-carousel .carousel-dots .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.5);
        cursor: pointer;
        transition: all 0.3s ease;
        border: 2px solid rgba(255, 255, 255, 0.8);
    }

    .mobile-carousel .carousel-dots .dot.active {
        background: rgba(255, 255, 255, 1);
        transform: scale(1.2);
    }

    /* Hide desktop carousel navigation on mobile */
    .mobile-carousel .carousel-nav {
        display: none !important;
    }

    /* Add touch feedback */
    .mobile-carousel {
        cursor: grab;
    }

    .mobile-carousel:active {
        cursor: grabbing;
    }

    /* Loading state */
    .mobile-carousel .carousel-slide img[src*="data:image/svg"] {
        background: #f0f0f0;
        border-radius: 4px;
    }

    /* Add a subtle border to define the carousel area */
    .mobile-carousel::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        pointer-events: none;
    }
}

/* For very small mobile screens */
@media (max-width: 480px) {
    .mobile-carousel {
        height: 250px !important;
    }
}

/* Dark theme support for mobile carousel */
body.dark-theme .mobile-carousel::after {
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .mobile-carousel .carousel-slide img[src*="data:image/svg"] {
    background: #333;
}