/**
 * Copyright © Inn. All rights reserved.
 * Inn_ProductImageHover Styles
 */

/* Product image container */
.product-item .product-image-container,
.product-item .product-item-photo {
    position: relative;
    overflow: hidden;
}

/* Hover image base styles */
.product-image-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    pointer-events: none;
}

/* Fade effect (default) */
.product-image-hover.hover-effect-fade {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Slide effect */
.product-image-hover.hover-effect-slide {
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

/* Zoom effect */
.product-image-hover.hover-effect-zoom {
    opacity: 0;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* Flip effect */
.product-image-hover.hover-effect-flip {
    opacity: 0;
    transform: rotateY(90deg);
    transition: all 0.3s ease;
    transform-origin: left center;
}

/* Blur to focus effect */
.product-image-hover.hover-effect-blur {
    opacity: 0;
    filter: blur(10px);
    transition: all 0.3s ease;
}

/* Main image slight zoom on hover */
.product-item:hover .product-image-photo:not(.product-image-hover) {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Ensure smooth transitions */
.product-item .product-image-photo {
    transition: transform 0.3s ease;
}

/* Loading state */
.product-image-hover:not([src]) {
    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;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Disable on mobile for better performance */
    .product-image-hover {
        display: none !important;
    }
}

/* Grid view specific */
.products-grid .product-item .product-image-container {
    aspect-ratio: 3/4;
}

/* List view specific */
.products-list .product-item .product-image-container {
    aspect-ratio: 1/1;
}

/* Ensure images maintain aspect ratio */
.product-item .product-image-photo,
.product-item .product-image-hover {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Accessibility - reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .product-image-hover,
    .product-item .product-image-photo {
        transition: none !important;
        animation: none !important;
    }
}
