/**
 * Estilos para galería de productos y hover dinámico
 */

/* Contenedor de imágenes de productos */
.product-img {
    height: 250px !important;
    width: 100%;
    object-fit: cover;
    transition: opacity 0.15s ease-in-out;
    display: block;
}

/* Contenedor relativo para evitar saltos */
.product-card .position-relative {
    overflow: hidden;
}

/* Sombra sutil para profundidad */
.product-card .position-relative::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 70%, rgba(0,0,0,0.05));
    z-index: 1;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .product-img {
        height: 230px !important;
        max-width: fit-content;
        margin: auto;
    }
}

@media (max-width: 768px) {
    .product-img {
        height: 200px !important;
        max-width: fit-content;
        margin: auto;
    }
    
}

@media (max-width: 576px) {
    .product-img {
        height: 180px !important;
        max-width: fit-content;
        margin: auto;
    }
}

/* Mejora de transición para hover */
.product-card {
    transition: box-shadow 0.2s ease-in-out;
}

.product-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Estados de loading para imágenes */
.product-img.loading {
    opacity: 0.7;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Overlay para información de producto en hover */
.product-card .product-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 2;
}

.product-card:hover .product-info-overlay {
    transform: translateY(0);
}

/* Mejoras para accesibilidad */
.product-img:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Placeholder para imágenes que no cargan */
.product-img.error {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 14px;
}

.product-img.error::before {
    content: "📷";
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}