/**
 * Image Consistency Styles
 * Ensures product images look consistent against the cream background
 */

/* ===== PRODUCT IMAGE CONTAINER ===== */
.product-image {
    position: relative;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #EDE0CE 0%, #F5E6D3 50%, #EDE0CE 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    overflow: hidden;
}

/* Subtle vignette effect for depth */
.product-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.05) 100%);
    pointer-events: none;
    z-index: 1;
}

/* ===== PRODUCT IMAGES ===== */
.product-image img {
    max-height: 85%;
    max-width: 85%;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.15));
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
    filter: drop-shadow(0 15px 40px rgba(0,0,0,0.2));
}

/* ===== MAIN PRODUCT IMAGE (Single Page) ===== */
.main-image {
    position: relative;
    background: linear-gradient(135deg, #EDE0CE 0%, #F5E6D3 50%, #EDE0CE 100%);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.main-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.08) 100%);
    pointer-events: none;
    z-index: 1;
}

.main-image img {
    max-height: 90%;
    max-width: 90%;
    object-fit: contain;
    filter: drop-shadow(0 20px 50px rgba(0,0,0,0.2));
    position: relative;
    z-index: 2;
}

/* ===== GALLERY THUMBNAILS ===== */
.gallery-thumb {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #EDE0CE 0%, #F5E6D3 100%);
    padding: var(--spacing-xs);
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-thumb img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1));
}

.gallery-thumb.active,
.gallery-thumb:hover {
    border-color: var(--color-gold);
    background: linear-gradient(135deg, #F5E6D3 0%, #EDE0CE 100%);
}

/* ===== RETAILER LOGOS ===== */
.retailer-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: var(--color-white);
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs);
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1));
}

/* ===== EDITORIAL IMAGES ===== */
.editorial-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.editorial-card:hover .editorial-image {
    transform: scale(1.05);
}

/* ===== FALLBACK/PLACEHOLDER STYLES ===== */
.product-image .placeholder-icon,
.main-image .placeholder-icon {
    font-size: 5rem;
    opacity: 0.3;
    filter: grayscale(100%);
}

/* ===== SEARCH RESULT IMAGES ===== */
.search-result-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: linear-gradient(135deg, #EDE0CE 0%, #F5E6D3 100%);
    border-radius: var(--radius-sm);
    padding: 5px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1));
}

/* ===== SIMILAR PRODUCTS SLIDER ===== */
.similar-item .product-image {
    aspect-ratio: 1;
}

.similar-item .product-image img {
    max-height: 80%;
    max-width: 80%;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .product-image {
        padding: var(--spacing-sm);
    }
    
    .product-image img {
        max-height: 80%;
        max-width: 80%;
    }
    
    .main-image {
        padding: var(--spacing-md);
    }
    
    .main-image img {
        max-height: 85%;
        max-width: 85%;
    }
    
    .gallery-thumb {
        width: 60px;
        height: 60px;
    }
}

/* ===== IMAGE LOADING STATES ===== */
.product-image img,
.main-image img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.product-image img[data-loading="true"],
.main-image img[data-loading="true"] {
    opacity: 0;
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: high) {
    .product-image,
    .main-image {
        background: #fff;
        border: 2px solid #000;
    }
}
