/**
 * Estilos personalizados para la aplicación de búsqueda de productos
 *
 * Este archivo contiene todos los estilos CSS personalizados para la aplicación
 * que complementan a los estilos de Bootstrap.
 *
 * @author Claude
 * @version 1.0
 */

/* Estilos generales */
body {
    background-color: #f8f9fa;
    color: #333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card {
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Estilos para el contenedor de palabras clave */
.keywords-container {
    min-height: 100px;
    padding: 0.5rem 0;
}

/* Estilo para las etiquetas de palabras clave */
.keyword-badge {
    display: inline-flex;
    align-items: center;
    background-color: #007bff;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 2rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

/* Estilo para el botón de eliminar palabra clave */
.keyword-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-left: 0.5rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.keyword-remove:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
}

/* Estilos para los resultados de búsqueda */
.search-results {
    max-height: 75vh;
    overflow-y: auto;
}

/* Estilo para cada elemento de producto */
.product-item {
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

.product-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

/* Estilo para la imagen del producto */
.product-image-container {
    width: 120px;
    height: 120px;
    margin-right: 15px;
    position: relative;
    border-radius: 0.25rem;
    overflow: hidden;
    background-color: #f8f9fa;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.product-image:hover {
    transform: scale(1.05);
}

/* Aplicar un estilo diferente a las imágenes predeterminadas */
.product-image.default-image {
    max-width: 85%;
    max-height: 85%;
    opacity: 0.85;
    cursor: default;
}

.product-image.default-image:hover {
    transform: none;
}

.product-no-image {
    color: #aaa;
    font-size: 0.8rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #f8f9fa;
}

/* Estilo para los detalles del producto */
.product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Estilo para la información principal del producto */
.product-info {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px dashed #ddd;
    width: 100%;
}

/* Estilo para el código del producto */
.product-code {
    font-weight: bold;
    color: #007bff;
    width: 15%;
}

/* Estilo para la descripción del producto */
.product-description {
    width: 65%;
    font-weight: 600;
}

/* Estilo para el precio del producto */
.product-price {
    width: 20%;
    text-align: right;
    font-weight: bold;
    color: #28a745;
}

/* Estilo para las series del producto */
.product-series {
    font-size: 0.85rem;
    color: #6c757d;
    padding-top: 0.3rem;
}

/* Estilo para las acciones del producto */
.product-actions {
    display: flex;
    gap: 8px;
}

/* Modal para imagen ampliada */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    display: block;
    position: relative;
    margin: 5% auto;
    max-width: 80%;
    max-height: 80vh;
    animation: zoom 0.3s ease;
}

.modal-content img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    background-color: transparent;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 1060;
    cursor: pointer;
}

.modal-close:hover {
    color: #bbb;
    text-decoration: none;
}

.modal-product-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 15px;
    font-size: 1rem;
}

/* Botones de navegación para el modal */
.modal-navigation {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.modal-nav-btn {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
    pointer-events: auto;
    margin: 0 20px;
}

.modal-nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.prev-btn {
    padding-right: 3px;
}

.next-btn {
    padding-left: 3px;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoom {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.alert, .product-item {
    animation: fadeIn 0.5s ease;
}

/* Estilos para la página de detalle */
.product-images-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.product-image-detail {
    width: calc(50% - 8px);
    height: 200px;
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-image-detail:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.product-image-detail img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-image-detail:hover img:not(.default-image) {
    transform: scale(1.05);
}

.product-image-detail .image-number {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .product-item {
        flex-direction: column;
    }
    
    .product-image-container {
        width: 100%;
        height: 180px;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .product-info {
        flex-direction: column;
    }
    
    .product-code, .product-description, .product-price {
        width: 100%;
        margin-bottom: 0.2rem;
    }
    
    .product-price {
        text-align: left;
    }
    
    .modal-content {
        max-width: 95%;
    }
    
    .product-image-detail {
        width: 100%;
        height: 180px;
    }
    
    .modal-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        margin: 0 10px;
    }
}

@media (min-width: 768px) and (max-width: 992px) {
    .product-item {
        flex-direction: row;
    }
    
    .product-image-container {
        width: 100px;
        height: 100px;
    }
    
    .product-image-detail {
        width: calc(50% - 8px);
    }
}

@media (min-width: 992px) {
    .product-image-detail {
        width: calc(25% - 12px);
        height: 180px;
    }
}