/* ========================================
   ESTILOS RESPONSIVE PARA IMÁGENES
   ======================================== */

/* Imágenes de productos - Ajuste automático */
.product-image,
.main-image,
.product-card-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Imagen principal del producto */
.main-image {
    max-height: 500px;
    padding: 1rem;
}

/* Imágenes en tarjetas de productos */
.product-card-image {
    height: 250px;
    padding: 0.5rem;
}

/* Miniaturas de galería */
.gallery-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 3px;
}

.gallery-thumbnail:hover {
    border-color: #2c3e50;
    transform: scale(1.05);
}

.gallery-thumbnail.active {
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.2);
}

/* Preview de imágenes en formularios */
.image-preview {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 5px;
    background: #f8f9fa;
}

/* Contenedor de galería */
.gallery-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .main-image {
        max-height: 300px;
        padding: 0.5rem;
    }

    .product-card-image {
        height: 200px;
    }

    .gallery-thumbnail {
        width: 60px;
        height: 60px;
    }
}

/* Responsive para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-image {
        max-height: 400px;
    }

    .product-card-image {
        height: 220px;
    }
}

/* Placeholder para imágenes sin cargar */
.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    font-size: 2rem;
}

/* Zoom en hover para imágenes de productos */
.product-image-zoom {
    overflow: hidden;
    border-radius: 8px;
}

.product-image-zoom img {
    transition: transform 0.3s ease;
}

.product-image-zoom:hover img {
    transform: scale(1.1);
}

/* Lazy loading - efecto de carga */
.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;
    }
}

/* Badges de información de imagen */
.image-info-badge {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Contenedor de imagen con ratio fijo */
.image-ratio-container {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    /* Ratio 1:1 */
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 8px;
}

.image-ratio-container img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Ratio 4:3 */
.image-ratio-4-3 {
    padding-bottom: 75%;
}

/* Ratio 16:9 */
.image-ratio-16-9 {
    padding-bottom: 56.25%;
}