/* Mobile Image Optimization Styles */

/* General image improvements */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Product card images */
.product-image,
.product-card-image {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    transition: transform 0.3s ease;
}

.product-image img,
.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image,
.product-card:hover .product-card-image {
    transform: scale(1.02);
}

.product-card:hover .product-image img,
.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

/* Main product image in detail pages */
.main-image {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fa;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-image:hover img {
    transform: scale(1.02);
}

/* Image thumbnails */
.thumbnail {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.thumbnail:hover img {
    transform: scale(1.1);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    /* Product cards */
    .product-image,
    .product-card-image {
        border-radius: 8px 8px 0 0;
    }
    
    .product-card {
        border-radius: 12px;
        overflow: hidden;
    }
    
    /* Main product images */
    .main-image {
        border-radius: 8px;
    }
    
    /* Thumbnails */
    .thumbnail {
        border-radius: 6px;
    }
    
    /* Image galleries */
    .image-gallery {
        gap: 6px;
    }
    
    .gallery-image {
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    /* Smaller screens */
    .product-image,
    .product-card-image {
        border-radius: 6px 6px 0 0;
    }
    
    .product-card {
        border-radius: 8px;
    }
    
    .main-image {
        border-radius: 6px;
    }
    
    .thumbnail {
        border-radius: 4px;
    }
    
    .gallery-image {
        border-radius: 4px;
    }
}

/* Loading states for images */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Image error fallback */
.image-error {
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 24px;
}

/* Zoom functionality for product images */
.image-zoom-container {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}

.image-zoom-container.zoomed {
    cursor: zoom-out;
}

.image-zoom-container.zoomed img {
    transform: scale(1.5);
}

/* Touch-friendly image interactions */
@media (hover: none) and (pointer: coarse) {
    .product-image:hover,
    .product-card-image:hover,
    .main-image:hover,
    .thumbnail:hover {
        transform: none;
    }
    
    .product-image:hover img,
    .product-card-image:hover img,
    .main-image:hover img,
    .thumbnail:hover img {
        transform: none;
    }
    
    /* Add active states for touch devices */
    .product-image:active,
    .product-card-image:active,
    .main-image:active,
    .thumbnail:active {
        transform: scale(0.98);
    }
} 