/* Búsqueda predictiva del storefront.
   Usa variables --st-* de cada theme para adaptarse al diseño activo. */

.st-predictive-anchor {
    position: relative;
}

.st-predictive {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 80;
    background: var(--st-bg, #ffffff);
    color: var(--st-fg, #111827);
    border: 1px solid var(--st-border, rgba(15, 23, 42, 0.12));
    border-radius: var(--st-radius, 12px);
    box-shadow: var(--st-shadow-strong, 0 18px 44px rgba(15, 23, 42, 0.18));
    overflow: hidden;
    text-align: left;
}

.st-predictive[hidden] {
    display: none;
}

.st-predictive-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    font-size: 0.9rem;
    color: var(--st-fg-muted, rgba(15, 23, 42, 0.65));
}

.st-predictive-spinner {
    flex: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--st-border, rgba(15, 23, 42, 0.15));
    border-top-color: var(--st-accent, currentColor);
    border-radius: 50%;
    animation: st-predictive-spin 0.7s linear infinite;
}

@keyframes st-predictive-spin {
    to {
        transform: rotate(360deg);
    }
}

.st-predictive-list {
    max-height: 340px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.st-predictive-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.12s ease;
}

.st-predictive-item:hover,
.st-predictive-item.is-active {
    background: var(--st-bg-soft, rgba(15, 23, 42, 0.05));
}

.st-predictive-thumb {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: var(--st-radius-sm, 8px);
    object-fit: cover;
    background: var(--st-bg-soft, rgba(15, 23, 42, 0.06));
}

.st-predictive-thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--st-fg-soft, rgba(15, 23, 42, 0.4));
}

.st-predictive-name {
    flex: 1;
    min-width: 0;
    font-size: 0.92rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.st-predictive-name mark {
    background: transparent;
    color: inherit;
    font-weight: 700;
    padding: 0;
}

.st-predictive-price {
    flex: none;
    font-size: 0.9rem;
    font-weight: 650;
    white-space: nowrap;
}

.st-predictive-price-old {
    font-weight: 400;
    opacity: 0.55;
    margin-right: 6px;
}

.st-predictive-price-from {
    font-weight: 400;
    color: var(--st-fg-muted, rgba(15, 23, 42, 0.65));
}

.st-predictive-empty {
    padding: 14px 16px;
    font-size: 0.9rem;
    color: var(--st-fg-muted, rgba(15, 23, 42, 0.65));
}

.st-predictive-footer a {
    display: block;
    padding: 11px 14px;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 650;
    text-decoration: none;
    color: var(--st-accent, inherit);
    border-top: 1px solid var(--st-border, rgba(15, 23, 42, 0.1));
    transition: background-color 0.12s ease;
}

.st-predictive-footer a:hover {
    background: var(--st-bg-soft, rgba(15, 23, 42, 0.05));
}

@media (max-width: 640px) {
    .st-predictive-list {
        max-height: 300px;
    }

    .st-predictive-thumb {
        width: 40px;
        height: 40px;
    }
}
