/* D3 AI — Search Widget */

.d3-ai-search-wrap {
    position: relative;
    width: 100%;
}

.d3-ai-search-inner {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: visible;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.d3-ai-search-inner:focus-within {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.d3-ai-search-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 10px 14px;
    font-size: 14px;
    background: transparent;
    font-family: inherit;
    min-width: 0;
}

.d3-ai-search-btn {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: none;
    background: none;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    transition: color 0.15s;
}

.d3-ai-search-btn:hover {
    color: #2271b1;
}

/* Results dropdown */
.d3-ai-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 9999;
    overflow: hidden;
    max-height: 380px;
    overflow-y: auto;
}

.d3-ai-search-results:empty {
    display: none;
}

.d3-ai-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.12s;
}

.d3-ai-search-item:last-child {
    border-bottom: none;
}

.d3-ai-search-item:hover {
    background: #f5f8fc;
}

.d3-ai-search-item img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid #eee;
}

.d3-ai-search-item-info {
    flex: 1;
    min-width: 0;
}

.d3-ai-search-item-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1a1a1a;
}

.d3-ai-search-item-price {
    font-size: 12px;
    color: #555;
    margin-top: 2px;
}

.d3-ai-search-item-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.d3-ai-search-item-badge.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.d3-ai-search-item-badge.out-of-stock {
    background: #fce4ec;
    color: #c62828;
}

.d3-ai-search-status {
    padding: 12px 16px;
    font-size: 13px;
    color: #888;
    text-align: center;
}
