/**
 * Anthropic AI Search — Styles
 * Covers: suggestion dropdown, intent chips bar, loading indicator
 */

/* ── Wrapper ──────────────────────────────────────────────── */
.ai-search-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* ── Loading spinner inside input ─────────────────────────── */
.ai-input-loader {
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: ai-spin .65s linear infinite;
    pointer-events: none;
}
.ai-input-loader.visible {
    display: block;
}
@keyframes ai-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ── Suggestion dropdown ──────────────────────────────────── */
.ai-suggest-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .14);
    z-index: 9999;
    overflow: hidden;
    max-height: 480px;
    overflow-y: auto;
    animation: ai-fadeIn .15s ease;
}
.ai-suggest-dropdown.open {
    display: block;
}
@keyframes ai-fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Dropdown intent header */
.ai-suggest-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #eff6ff, #f5f0ff);
    border-bottom: 1px solid #e0e7ff;
    font-size: 12px;
    font-weight: 600;
    color: #4f46e5;
}
.ai-suggest-icon {
    font-size: 14px;
}

/* Product suggestion row */
.ai-suggest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background .12s;
    border-bottom: 1px solid #f1f5f9;
}
.ai-suggest-item:last-of-type {
    border-bottom: none;
}
.ai-suggest-item:hover,
.ai-suggest-item.active {
    background: #f8faff;
}

/* Product thumbnail */
.ai-suggest-thumb {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-suggest-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ai-suggest-img-placeholder {
    font-size: 22px;
}

/* Product info */
.ai-suggest-info {
    flex: 1;
    min-width: 0;
}
.ai-suggest-name {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-suggest-price {
    font-size: 12px;
    font-weight: 700;
    color: #0f9d58;
    margin-top: 2px;
}

/* No results */
.ai-suggest-empty {
    padding: 16px 14px;
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
}

/* View all link */
.ai-suggest-view-all {
    display: block;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: none;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid #e2e8f0;
    transition: background .12s;
}
.ai-suggest-view-all:hover {
    background: #eff6ff;
    text-decoration: underline;
}

/* ── Intent + price chips bar ─────────────────────────────── */
.ai-chips-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f0f9ff 0%, #f5f0ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    font-size: 12px;
    animation: ai-fadeIn .2s ease;
}
.ai-chips-label {
    font-weight: 700;
    color: #4f46e5;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ai-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.chip-intent  { background: #ede9fe; color: #4c1d95; }
.chip-keyword { background: #dbeafe; color: #1e40af; }
.chip-price   { background: #dcfce7; color: #14532d; }
.chip-color   { background: #fef9c3; color: #713f12; }
.chip-brand   { background: #fee2e2; color: #7f1d1d; }
.chip-size    { background: #fce7f3; color: #831843; }
.chip-sort    { background: #e0f2fe; color: #0c4a6e; }
.chip-stock   { background: #dcfce7; color: #14532d; }
