/* General Styles */
body {
    background-color: #f5f5f5;
    font-family: 'Arial', sans-serif;
    color: #333;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container {
    margin-top: 10px;
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 1600px;
}

h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 20px;
}

.form-inline {
    margin-bottom: 20px;
    width: 100%;
}

.search-container {
    width: 100%;
    display: flex;
    justify-content: flex-start; /* Alinea los elementos a la izquierda */
    align-items: center;
    position: relative; /* Necesario para la posición del dropdown de categorías */
}

.search-input {
    flex-grow: 1;
    max-width: 300px; /* Ajustado para hacer la anchura del input de búsqueda más pequeño */
    padding: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-right: 10px; /* Espaciado entre los inputs */
}

.category-input {
    flex-grow: 1;
    max-width: 250px; /* Ajustado para la anchura del input de categoría */
    padding: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-right: 10px; /* Espaciado entre los inputs */
}

.list-group {
    position: absolute;
    top: 60px; /* Ajustado para estar debajo del input */
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    max-height: 150px; /* Para permitir desplazamiento si hay muchas categorías */
    overflow-y: auto; /* Para agregar barra de desplazamiento si es necesario */
    display: none; /* Oculta inicialmente */
    z-index: 1000; /* Para asegurar que esté sobre otros elementos */
}

.list-group-item {
    cursor: pointer;
}

.form-check {
    margin-left: 0px; /* Ajuste para pegar más la casilla de verificación a la categoría */
    font-size: 1rem;
}

.result-count {
    text-align: left;
    font-size: 0.9rem;
}

.product-details {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin-top: 20px;
}

.product-list-container {
    flex: 3;
    max-width: 600px; /* Ajustado para hacer la lista más compacta */
}

.product-list {
    max-height: 450px; /* Ajustado para eliminar la barra de desplazamiento y mostrar 5 productos */
    overflow-y: hidden; /* Oculta la barra de desplazamiento vertical */
    border-right: 1px solid #ddd;
    padding-right: 20px;
}

.product-list img.product-thumbnail {
    max-width: 60px; /* Ajustado para hacer las imágenes más pequeñas */
    height: 60px; /* Ajustado para hacer las imágenes más pequeñas */
    margin-right: 10px;
    border-radius: 4px;
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.product-list .product-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 10px;
    border: 1px solid transparent;
    transition: background-color 0.3s ease, border 0.3s ease;
    height: 80px; /* Ajustado para hacer los productos menos altos */
    white-space: normal;
}

.product-list .product-item:hover, .product-list .product-item.selected {
    border: 1px solid #ddd;
    background-color: #f8f8f8;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.product-info img.product-large {
    max-width: 350px; /* Ajustado para hacer la imagen más grande */
    margin-bottom: 20px;
    border-radius: 8px;
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.product-info .price {
    font-size: 2rem;
    color: #333;
    margin-bottom: 10px;
}

.product-info .stock {
    font-size: 1.5rem;
    color: green;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.pagination-container button {
    min-width: 80px;
}

.modal .modal-dialog-centered {
    max-width: 90%;
}

.modal .modal-body img {
    max-width: 100%;
}

.product-thumbnail[src='/static/placeholder.png'] {
    background-color: white;
    border: 1px solid #ddd;
}

/* Odoo70: rows grow with product names; preserve all five search results. */
#odoo70_product-list {
    max-height: none;
    overflow: visible;
}
#odoo70_product-list .product-item {
    box-sizing: border-box;
    height: auto;
    min-height: 80px;
    align-items: flex-start;
    gap: 12px;
}
#odoo70_product-list .product-item > .product-thumbnail {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    margin-right: 0;
    object-fit: contain;
    overflow: hidden;
}
#odoo70_product-list .product-item > span {
    flex: 1 1 0%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}
.product-details > .product-list-container {
    min-width: 0;
}
#odoo70_product-info {
    box-sizing: border-box;
    min-width: 0;
    overflow-wrap: anywhere;
}
#odoo70_product-info .product-large {
    width: 100%;
    max-width: 350px;
    height: auto;
    object-fit: contain;
}
@media screen and (max-width: 1023px) {
    .product-details {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
    .product-details > .product-list-container {
        width: 100%;
        max-width: none;
    }
    #odoo70_product-list {
        border-right: 0;
        padding-right: 0;
    }
    #odoo70_product-info {
        width: 100%;
        margin-left: 0;
        padding: 14px;
    }
    #odoo70_product-info:empty { display: none; }
    .search-container { flex-wrap: wrap; gap: 10px; }
    #odoo70_search, #odoo70_category {
        flex: 0 0 100%;
        width: 100%;
        max-width: none;
        margin: 0 !important;
    }
    .search-container .form-check { margin: 0 !important; min-height: 44px; padding-top: 10px; }
    #category-list {
        position: static;
        transform: none;
        order: 4;
        width: 100%;
        max-height: 220px;
        flex: 0 0 100%;
    }
    .pagination-container { flex-wrap: wrap; gap: 10px; }
    .pagination-container button { min-height: 44px; }
}
