/**
 * Desplegable de resultados del buscador (header)
 * Ver: application/views/productos/recomendados.php
 */

.h-search {
    position: relative;
}

.recommendationsContainer {
    position: absolute;
    z-index: 1050;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
}

.search-results {
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px 0;
}

.search-section + .search-section {
    border-top: 1px solid var(--bs-border-color, #eee);
    margin-top: 6px;
    padding-top: 6px;
}

.search-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color, #6c757d);
    padding: 4px 16px;
}

/* ---- Categorías ---- */
.search-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 4px;
}

.search-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: var(--bs-tertiary-bg, #f1f1f1);
    color: var(--bs-body-color, #212529);
    font-size: 0.82rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.search-cat-chip:hover {
    background: var(--bs-primary, #0d6efd);
    color: #fff;
}

/* ---- Productos ---- */
.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    text-decoration: none;
    color: inherit;
}

.search-item:hover {
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.search-item-img {
    width: 48px;
    height: 48px;
    min-width: 48px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bs-tertiary-bg, #f1f1f1);
}

.search-item-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.search-item-title {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-brand {
    font-size: 0.76rem;
    color: var(--bs-secondary-color, #6c757d);
}

.search-item-price {
    flex-shrink: 0;
    text-align: right;
    font-size: 0.85rem;
    white-space: nowrap;
}

.search-item-price del {
    display: block;
    font-size: 0.72rem;
    color: var(--bs-secondary-color, #6c757d);
}

/* ---- Ver todos ---- */
.search-viewall {
    display: block;
    text-align: center;
    padding: 10px 16px 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border-top: 1px solid var(--bs-border-color, #eee);
    margin-top: 6px;
}

@media (max-width: 991.98px) {
    .recommendationsContainer {
        position: static;
        box-shadow: none;
        margin-top: 8px;
    }
}
