/* Product Carousel Component Styles - DESKTOP ONLY */

/* Hide carousel on mobile - will be replaced with new mobile carousel */
@media (max-width: 767px) {
    .carousel-section {
        display: none !important;
    }
}

/* Desktop Carousel Styles */
@media (min-width: 768px) {
    .carousel-section {
        display: block !important;
        padding: 0 var(--spacing-md) var(--spacing-md);
        background: var(--white);
        overflow: visible; /* MINIMAL FIX: Allow shadows to spill out */
        margin: 0 0 40px 0;
    }

    .carousel-container {
        position: relative;
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        overflow: visible; /* MINIMAL FIX: Allow shadows to spill out */
        padding: 0;
    }

    /* MINIMAL SHADOW FIX: Only change what's necessary */
    .carousel-track {
        display: flex;
        gap: var(--spacing-xl);
        overflow-x: auto;
        overflow-y: visible; /* Allow shadows to spill out - no jittering */
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 60px 80px 80px 80px; /* Generous padding for shadow space */
        margin-bottom: 0;
        position: relative;
        height: auto;
        max-height: none;
    }

    .carousel-track::-webkit-scrollbar {
        display: none;
    }

    /* Product Card Styles - Clean 2:3 Aspect Ratio with Premium Effects */
    .product-card {
        position: relative;
        flex: 0 0 auto;
        background: transparent;
        border-radius: 0; /* Straight edges */
        overflow: visible; /* MINIMAL FIX: Allow shadows to show */
        cursor: pointer;
        z-index: 100;
        /* DESKTOP SHADOWS: Same bold, beautiful shadows as mobile */
        box-shadow: 20px 25px 50px rgba(0, 0, 0, 0.6) !important;
        margin: 0;
        left: 0;
        top: 0;
        aspect-ratio: 2/3;
        width: 240px !important;
    }

    /* Carousel Indicators */
    .carousel-indicators {
        display: flex;
        justify-content: center;
        gap: var(--spacing-sm);
        margin-top: var(--spacing-md);
    }

    .carousel-indicator {
        width: 8px;
        height: 8px;
        border-radius: 0; /* Straight edges - small squares */
        background: var(--gray-300);
        transition: all var(--transition-fast);
        cursor: pointer;
    }

    .carousel-indicator.active {
        background: var(--gray-900);
        transform: scale(1.2);
    }

    .carousel-indicator:hover {
        background: var(--gray-600);
    }

    /* Loading States */
    .product-card.loading {
        /* MOBILE FIX: Don't disable pointer events, just show loading state */
        opacity: 0.8;
    }

    .product-card.loading::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
        background-size: 200% 100%;
        animation: shimmer 1.5s infinite;
        z-index: 5;
    }

    /* Error States */
    .product-card.error {
        opacity: 0.7;
        /* MOBILE FIX: Allow clicks even on error state */
    }

    .product-card.error::after {
        content: 'Image not available';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: var(--gray-500);
        font-size: var(--font-size-sm);
        text-align: center;
        z-index: 20;
    }

    /* Desktop spacing adjustments */
    .carousel-section {
        padding: 0 var(--spacing-xl) var(--spacing-2xl);
    }

    /* Touch and Gesture Handling */
    .carousel-track {
        touch-action: pan-x pan-y;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }

    .carousel-track * {
        touch-action: pan-x pan-y;
    }

    .product-card:focus-visible {
        outline: 2px solid var(--gray-900);
        outline-offset: 2px;
    }

    .carousel-indicator:focus-visible {
        outline: 2px solid var(--gray-900);
        outline-offset: 2px;
    }

    /* DISABLED: slideInUp animations were causing carousel jittering */
    .carousel-section.animate-in .product-card {
        /* animation: slideInUp 0.6s ease-out forwards; */
        opacity: 1; /* Ensure cards are visible without animation */
    }

    .carousel-section.animate-in .product-card:nth-child(2),
    .carousel-section.animate-in .product-card:nth-child(3),
    .carousel-section.animate-in .product-card:nth-child(4),
    .carousel-section.animate-in .product-card:nth-child(5) {
        /* animation-delay disabled */
        opacity: 1;
    }

    .tilt-card .glint-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(
            115deg,
            transparent 20%,
            rgba(255, 255, 255, 0.08) 50%,
            transparent 80%
        );
        transform: translateX(-100%) translateY(-100%) skew(-15deg);
        animation: glint-sweep 6s infinite;
        pointer-events: none;
        filter: blur(12px);
        z-index: 10;
        mix-blend-mode: normal;
        opacity: 1;
    }

    .shadow-container { 
        display: contents; 
    }
    
    /* 🚨 SHADOW CUTOFF FIX - STABLE VERSION 🚨
     * Prevents shadow clipping while maintaining carousel stability
     * 
     * IMPLEMENTATION:
     * 1. overflow: visible on carousel containers
     * 2. Generous padding for shadow space
     * 3. No complex transforms or positioning
     */
    .carousel-section {
        overflow: visible !important; /* Allow shadows to spill out */
    }
    
    .carousel-container {
        overflow: visible !important; /* Allow shadows to spill out */
    }
    
    .carousel-track {
        overflow-x: auto !important; /* Horizontal scrolling */
        overflow-y: hidden !important; /* SIMPLE FIX: Prevent vertical scrolling - accept minor shadow clipping */
    }
    
    .carousel-track .product-card {
        overflow: visible !important; /* Allow shadows to spill out */
    }
}

/* Large desktop screens */
@media (min-width: 1024px) {
    .product-card {
        width: 280px !important;
    }
    
    .carousel-track {
        gap: var(--spacing-2xl);
    }
}

/* Shimmer animation for loading states - moved to main.css */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 