/**
 * Búsqueda predictiva de la cabecera (inc/live-search.php, js/live-search.js).
 * Se carga después de style.css (inc/assets.php).
 */

.allimport-live-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.16), 0 4px 10px -2px rgba(15, 23, 42, 0.06) !important;
    z-index: 99999 !important;
    overflow: hidden !important;
    animation: allimportSearchFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 16px;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.live-search-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: allimportSpin 0.7s linear infinite;
}

.live-header {
    padding: 9px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.live-count-tag {
    background: #e2e8f0;
    color: #334155;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
}

.live-items-list {
    max-height: 380px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.live-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 16px !important;
    border-bottom: 1px solid #f8fafc !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
    text-decoration: none !important;
    color: inherit !important;
}

.live-item:hover,
.live-item.is-selected {
    background: #eff6ff !important;
}

.live-item:last-child {
    border-bottom: none !important;
}

.live-thumb-wrap {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-thumb-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.live-thumb-placeholder {
    font-size: 20px;
}

.live-info {
    flex: 1;
    min-width: 0;
}

.live-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.live-mark {
    background: #fef08a !important;
    color: #854d0e !important;
    padding: 0 2px !important;
    border-radius: 2px !important;
    font-weight: 800 !important;
}

.live-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.live-cat {
    color: #64748b;
    font-weight: 500;
}

.live-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
}

.live-stock-badge.stock-in {
    background: #dcfce7;
    color: #15803d;
}

.live-stock-badge.stock-out {
    background: #f1f5f9;
    color: #94a3b8;
}

.live-price-wrap {
    text-align: right;
    flex-shrink: 0;
}

.live-price {
    font-size: 14px;
    font-weight: 800;
    color: #2563eb;
    display: block;
}

.live-regular-price {
    font-size: 11px;
    text-decoration: line-through;
    color: #94a3b8;
    display: block;
}

.live-footer {
    padding: 9px 16px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.live-footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.live-footer-btn:hover {
    color: #1d4ed8;
    text-decoration: underline !important;
}

.live-empty-state {
    padding: 22px 16px;
    text-align: center;
}

.live-empty-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.live-empty-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.live-empty-desc {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}

.live-empty-wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #25d366;
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 999px;
    text-decoration: none !important;
    transition: background 0.2s ease;
}

.live-empty-wa-btn:hover {
    background: #1ebc57;
}

@media (max-width: 768px) {
.allimport-live-dropdown {
        left: 0;
        right: 0;
        width: 100%;
        max-height: 360px;
    }
.live-title {
        font-size: 13px;
    }
}
