/* ----- ESTILOS DEL MODAL DE BÚSQUEDA ----- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.6); 
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    background-color: #f8f9fa;
    margin: 5% auto;
    padding: 30px;
    border: none;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #212529;
    margin-top: 0;
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
}

.cerrar {
    color: #6c757d;
    float: right;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.2s;
}

.cerrar:hover,
.cerrar:focus {
    color: #212529;
    text-decoration: none;
    cursor: pointer;
}

/* ----- ESTILOS PARA FILTROS (CHIPS) ----- */
.filters-wrapper {
    margin-bottom: 25px;
}

.filter-group {
    margin-bottom: 20px;
}
.filter-group:last-child { margin-bottom: 0; }

.filter-group h4 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
    
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip {
    padding: 8px 18px;
    border: 1px solid #ced4da;
    border-radius: 50px;
    background-color: #ffffff;
    color: #495057;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

.filter-chip:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.filter-chip.active {
    background-color: #0056b3; /* Azul corporativo */
    color: #ffffff;
    border-color: #0056b3;
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.3);
}

/* ----- ESTILOS PARA TARJETAS DE PRODUCTOS ----- */
#resultados {
    display: grid;
    grid-template-columns: 1fr; /* Móviles: 1 columna */
    gap: 25px;
}

/* Tabletas: 2 columnas */
@media (min-width: 600px) {
    #resultados {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Escritorio: 3 columnas */
@media (min-width: 992px) {
    #resultados {
        grid-template-columns: repeat(3, 1fr);
    }
}

.producto-resultado {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.producto-resultado:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.producto-resultado a {
    text-decoration: none;
    color: inherit;
}

.producto-resultado img {
    width: 100%;
    height: 265px;
    display: block;
    border-bottom: 1px solid #e9ecef;
}
    
.producto-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Permite que el contenido se estire */
}

.producto-info h4 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    flex-grow: 1; 
}

.producto-info span {
    font-size: 1.25rem;
    font-weight: 700;
    color: #BF092F;
    margin-top: auto; 
    align-self: center; 
}