/**
 * Estilos para Popovers de Imágenes de Productos
 * Inventario - SGB
 * Fecha: 2025-11-11
 */

/* Popover principal - Tamaño fijo reducido */
.popover-imagen-producto {
    max-width: 296px !important;
    width: 296px !important;
    z-index: 1050 !important; /* Menor que modales pero mayor que contenido */
    pointer-events: auto !important;
}

.popover-imagen-producto .popover-body {
    padding: 0 !important;
    overflow: visible !important;
}

/* CRÍTICO: Asegurar que el popover no bloquee la página */
.popover-imagen-producto::before,
.popover-imagen-producto::after {
    pointer-events: none !important;
}

/* Contenedor de la imagen - Tamaño fijo reducido */
.popover-imagen-contenedor {
    width: 280px;
    height: 340px;
    display: flex;
    flex-direction: column;
    padding: 8px;
}

/* Área de la imagen */
.popover-imagen-contenedor > div:first-child {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

/* Botón de sugerir imagen */
.btn-sugerir-imagen {
    transition: all 0.2s ease;
}

.btn-sugerir-imagen:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Modal de sugerencia */
#modalSugerirImagen .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#modalSugerirImagen .alert-info {
    background-color: #e7f3ff;
    border-color: #b3d9ff;
    color: #004085;
}

/* Preview de imagen en modal */
#sugerenciaPreview img {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Ajustes para dispositivos móviles */
@media (max-width: 768px) {
    .popover-imagen-producto {
        max-width: 240px !important;
        width: 240px !important;
    }
    
    .popover-imagen-contenedor {
        width: 220px;
        height: 300px;
    }
}

/* Prevenir que el popover se cierre al hacer click dentro */
.popover-imagen-producto.popover {
    pointer-events: auto !important;
}

/* CRÍTICO: No bloquear el resto de la página */
body > *:not(.popover) {
    pointer-events: auto !important;
}

/* Mejorar legibilidad de badges */
.popover-imagen-contenedor .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    font-weight: 600;
}

/* Indicador visual de imagen con popover */
.product-with-image {
    position: relative;
}

.product-with-image::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-with-image:hover::after {
    opacity: 0.6;
}

