/* ==========================================================================
   Search overlay — results, recent searches, recently viewed.
   Everything below .search-overlay-form (search-overlay.php). Uses the
   same tokens as the rest of the theme (variables.css) so light/dark
   mode, spacing and radius stay identical to every other surface —
   nothing here redefines a color or a spacing value of its own.
   ========================================================================== */

/* ---------- live results / recently viewed rows ---------- */
.search-results,
.search-viewed-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.search-product {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-2);
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: background var(--transition-fast);
}

.search-product:hover,
.search-product:focus-visible {
    background: var(--vl-cream);
    outline: none;
}

.search-product-media {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--vl-line);
}

.search-product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-product-brand {
    font-size: var(--text-xs);
    color: var(--vl-gold);
    font-weight: 700;
}

.search-product-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--vl-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-product-bottom {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-xs);
    color: var(--vl-muted);
}

.search-product-price {
    font-weight: 600;
    color: var(--vl-text);
}

.search-product-price ins {
    text-decoration: none;
    color: var(--vl-text);
}

.search-product-price del {
    color: var(--vl-muted);
    margin-inline-end: var(--space-1);
    opacity: .7;
}

.search-product-stock {
    color: var(--vl-muted);
}

.search-product-stock.is-out {
    color: #b3453a;
}

/* ---------- view-all link ---------- */
.search-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--vl-line);
    border-radius: 16px;
    color: var(--vl-text);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.search-view-all:hover {
    border-color: var(--vl-gold);
    color: var(--vl-gold);
}

/* ---------- recent searches / recently viewed panels ---------- */
.search-panel + .search-panel {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--vl-line);
}

.search-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.search-panel-head h3 {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--vl-muted);
}

.search-panel-clear {
    border: none;
    background: none;
    padding: 0;
    color: var(--vl-gold);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.search-panel-clear:hover {
    opacity: .75;
}

.search-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.search-chip {
    border: 1px solid var(--vl-line);
    background: transparent;
    color: var(--vl-text);
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
    border-radius: 999px;
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.search-chip:hover {
    border-color: var(--vl-gold);
    color: var(--vl-gold);
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
    .search-product-media {
        width: 48px;
        height: 48px;
    }
}
