/**
 * Product Image Display Fix for Hyva Theme
 * Fixes the issue where product images are not showing due to missing container dimensions
 */

/* Main Product Image Container Fix */
.product.photo.product-item-photo,
a.product.photo.product-item-photo {
    display: block !important;
    width: 100% !important;
    max-width: 300px !important;
    height: 300px !important;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* Image styling within containers */
.product.photo.product-item-photo img,
a.product.photo.product-item-photo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    transition: transform 0.3s ease;
}

/* Hover effects */
.product.photo.product-item-photo:hover img,
a.product.photo.product-item-photo:hover img {
    transform: scale(1.05);
}

/* Grid view specific adjustments */
.product-items .product-item .product.photo.product-item-photo {
    width: 100% !important;
    height: 250px !important;
}

/* List view specific adjustments */
.products.list .product.photo.product-item-photo {
    width: 200px !important;
    height: 200px !important;
    flex-shrink: 0;
}

/* Product slider adjustments */
.product-slider .product.photo.product-item-photo {
    width: 100% !important;
    height: 220px !important;
}

/* Category page adjustments */
.category-products .product.photo.product-item-photo {
    width: 100% !important;
    height: 280px !important;
}

/* Search results adjustments */
.search-results .product.photo.product-item-photo {
    width: 100% !important;
    height: 250px !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .product.photo.product-item-photo,
    a.product.photo.product-item-photo {
        height: 200px !important;
        max-width: 200px !important;
    }
    
    .products.list .product.photo.product-item-photo {
        width: 150px !important;
        height: 150px !important;
    }
}

@media (max-width: 480px) {
    .product.photo.product-item-photo,
    a.product.photo.product-item-photo {
        height: 180px !important;
        max-width: 180px !important;
    }
}

/* RTL specific adjustments */
[dir="rtl"] .product.photo.product-item-photo {
    margin-left: auto;
    margin-right: auto;
}

/* Loading state */
.product.photo.product-item-photo.loading {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="20" fill="none" stroke="%23ddd" stroke-width="2"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 40px 40px;
}

/* Fallback for missing images */
.product.photo.product-item-photo img[src=""],
.product.photo.product-item-photo img:not([src]) {
    display: none;
}

.product.photo.product-item-photo img[src=""]:after,
.product.photo.product-item-photo img:not([src]):after {
    content: "📷";
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #ccc;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
} 