/* ========================================================================
   SEMICAPS Carousel Styles - Mobile-First Responsive Design
   ======================================================================== */

/* Base carousel structure */
.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-images {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}

.carousel-images .product-image,
.carousel-images .solution-image,
.carousel-images .accessory-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
}

.carousel-images .product-image.active,
.carousel-images .solution-image.active,
.carousel-images .accessory-image.active {
    opacity: 1;
    z-index: 2;
}

/* Navigation buttons */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--steel-700);
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 10;
    font-size: 1.2rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carousel-nav:hover {
    background-color: var(--pangu-blue);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: 15px;
}

.carousel-nav.next {
    right: 15px;
}

/* Container hierarchy - Mobile First */
.product-image-section,
.solution-image-section,
.accessory-image-section {
    display: block;
    width: 100%;
}

.product-image-container,
.solution-image-container,
.accessory-image-container {
    aspect-ratio: 4/3;
    min-height: 250px;
    max-height: 400px;
    width: 100%;
    display: block;
    position: relative;
    background: var(--steel-50);
    border-radius: 8px;
    overflow: hidden;
}

/* Image overlay */
.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: var(--spacing-md);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 5;
}

.carousel-container:hover .image-overlay {
    transform: translateY(0);
}

.overlay-text {
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    .product-image-container,
    .solution-image-container,
    .accessory-image-container {
        min-height: 300px;
        max-height: 450px;
    }
    
    .carousel-nav {
        width: 45px;
        height: 45px;
        font-size: 1.4rem;
    }
    
    .carousel-nav.prev {
        left: 20px;
    }
    
    .carousel-nav.next {
        right: 20px;
    }
    
    .overlay-text {
        font-size: 1.1rem;
    }
}

/* Desktop screens */
@media (min-width: 1024px) {
    .product-image-container,
    .solution-image-container,
    .accessory-image-container {
        min-height: 320px;
        max-height: 480px;
    }
}

/* Loading states */
.carousel-images img {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-images img.loading {
    background: linear-gradient(90deg, var(--steel-100) 25%, var(--steel-50) 50%, var(--steel-100) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Error state */
.carousel-images img[src=""],
.carousel-images img.error {
    background: var(--steel-100);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-images img[src=""]:after,
.carousel-images img.error:after {
    content: "Image not available";
    color: var(--steel-500);
    font-size: 0.9rem;
}