/* Image Optimization Styles */
/* Loading states and animations for optimized images */

/* Basic image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Loading state for lazy images */
.img-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    min-height: 200px;
    opacity: 0.7;
}

@keyframes loading-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Loaded state */
.img-loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Error state */
.img-error {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    opacity: 0.6;
}

/* Progressive loading styles */
.img-progressive-low {
    filter: blur(5px);
    transition: filter 0.3s ease;
}

.img-progressive-high {
    filter: none;
}

/* Responsive image container */
.img-responsive-container {
    position: relative;
    overflow: hidden;
}

.img-responsive-container::before {
    content: '';
    display: block;
    padding-bottom: 66.67%; /* 3:2 aspect ratio */
}

.img-responsive-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gallery specific optimizations */
.gallery-image {
    aspect-ratio: 3/4;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.05);
}

/* Hero image optimization */
.hero-image {
    aspect-ratio: 16/9;
    object-fit: cover;
    object-position: center;
}

/* Card image optimization */
.card-img-top {
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Model image optimization */
.model-image {
    aspect-ratio: 3/4;
    object-fit: cover;
}

/* Logo optimization */
.navbar-brand img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* Lookbook specific styles */
.lookbook-gallery .gallery-image {
    height: 300px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.lookbook-gallery .gallery-item:hover .gallery-image {
    transform: scale(1.02);
}

/* Shop page product images */
.product-image {
    aspect-ratio: 1/1;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-image:hover {
    transform: scale(1.1);
}

/* Fade in animation for loaded images */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.img-loaded {
    animation: fadeInScale 0.3s ease;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .gallery-image {
        height: 250px;
    }
    
    .hero-image {
        aspect-ratio: 4/3;
    }
    
    .product-image {
        height: 200px;
    }
}

/* Tablet optimization */
@media (min-width: 769px) and (max-width: 1024px) {
    .gallery-image {
        height: 280px;
    }
    
    .product-image {
        height: 250px;
    }
}

/* Desktop optimization */
@media (min-width: 1025px) {
    .gallery-image {
        height: 320px;
    }
    
    .product-image {
        height: 280px;
    }
}

/* High DPI display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .high-dpi-image {
        background-size: 50%;
    }
}

/* Preload critical images */
.critical-image {
    content-visibility: auto;
    contain-intrinsic-size: 400px 300px;
}

/* Intersection Observer fallback */
.no-intersection-observer img[data-src] {
    display: none;
}

/* Print optimization */
@media print {
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}
