/* Responsive Image Optimization Styles */
/* Comprehensive styles for maximum responsiveness and performance */

/* Base responsive image styles */
.responsive-image {
    max-width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Lazy loading states */
.lazy-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    min-height: 200px;
}

.lazy-image.loading {
    opacity: 0.7;
    animation: shimmer 1.5s infinite;
}

.lazy-image.loaded {
    animation: none;
    background: none;
    opacity: 1;
}

.lazy-image.error {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    opacity: 0.6;
}

/* Shimmer animation for loading */
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Progressive loading styles */
.progressive-low {
    filter: blur(4px);
    transform: scale(1.02);
}

.progressive-high {
    filter: none;
    transform: scale(1);
}

/* Responsive containers */
.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.image-container::before {
    content: '';
    display: block;
    padding-bottom: 75%; /* 4:3 aspect ratio default */
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Specific aspect ratios */
.aspect-square::before { padding-bottom: 100%; }
.aspect-video::before { padding-bottom: 56.25%; }
.aspect-portrait::before { padding-bottom: 133.33%; }
.aspect-landscape::before { padding-bottom: 66.67%; }

/* Hero images */
.hero-image {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    object-fit: cover;
    object-position: center;
}

@media (min-width: 768px) {
    .hero-image {
        height: 70vh;
        min-height: 500px;
    }
}

@media (min-width: 1200px) {
    .hero-image {
        height: 80vh;
        min-height: 600px;
    }
}

/* Product images */
.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.product-image:hover {
    transform: scale(1.05);
}

/* Gallery images */
.gallery-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    transition: all 0.3s ease;
}

@media (min-width: 576px) {
    .gallery-image { height: 280px; }
}

@media (min-width: 768px) {
    .gallery-image { height: 320px; }
}

@media (min-width: 992px) {
    .gallery-image { height: 350px; }
}

@media (min-width: 1200px) {
    .gallery-image { height: 380px; }
}

.gallery-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Model images */
.model-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 8px;
}

/* Logo optimization */
.logo-image {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

/* Lookbook specific styles */
.lookbook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

@media (min-width: 576px) {
    .lookbook-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

@media (min-width: 768px) {
    .lookbook-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 2rem;
    }
}

.lookbook-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fa;
}

.lookbook-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.lookbook-item:hover img {
    transform: scale(1.1);
}

/* Shop grid responsive */
.shop-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

@media (min-width: 576px) {
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (min-width: 768px) {
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (min-width: 992px) {
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* Performance optimizations */
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Modern CSS features */
@supports (aspect-ratio: 1) {
    .modern-aspect-square {
        aspect-ratio: 1;
        height: auto;
    }
    
    .modern-aspect-video {
        aspect-ratio: 16/9;
        height: auto;
    }
    
    .modern-aspect-portrait {
        aspect-ratio: 3/4;
        height: auto;
    }
}

/* Content visibility for performance */
@supports (content-visibility: auto) {
    .lazy-image {
        content-visibility: auto;
        contain-intrinsic-size: 300px 200px;
    }
}

/* Intersection observer fallback */
.no-js .lazy-image[data-src] {
    opacity: 0.5;
}

/* Loading placeholder improvements */
.image-placeholder {
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.2) 20%, 
        rgba(255,255,255,0.5) 60%, 
        rgba(255,255,255,0)
    );
    background-color: #f0f0f2;
    animation: loading-wave 2s infinite ease-in-out;
}

@keyframes loading-wave {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .responsive-image {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .lazy-image {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    }
    
    .lazy-image.error {
        background: #1a1a1a;
        border-color: #404040;
    }
    
    .image-placeholder {
        background-color: #2a2a2a;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .responsive-image,
    .product-image,
    .gallery-image,
    .model-image {
        transition: none;
    }
    
    .lazy-image {
        animation: none;
    }
    
    .product-image:hover,
    .gallery-image:hover,
    .lookbook-item:hover img {
        transform: none;
    }
}

/* Print styles */
@media print {
    .responsive-image,
    .product-image,
    .gallery-image,
    .model-image {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .lazy-image {
        animation: none;
        background: none;
    }
}

/* Focus states for accessibility */
.responsive-image:focus,
.product-image:focus,
.gallery-image:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Error state improvements */
.image-error {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    color: #6c757d;
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
    min-height: 200px;
}

.image-error::before {
    content: '⚠️ Image not available';
}

/* Loading spinner */
.image-loading {
    position: relative;
}

.image-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
