/* AI Search - frontend styles */
.ai-search-module { margin: 0 0 20px; }

/* ---- "AI" badge inside the existing search bar ---- */
.ai-search-badge {
	position: fixed; z-index: 9998; pointer-events: none;
	background: #14b8a6; color: #fff; font-size: 11px; font-weight: 700;
	line-height: 1; padding: 4px 7px; border-radius: 10px; letter-spacing: .3px;
	box-shadow: 0 1px 3px rgba(0,0,0,.2); white-space: nowrap;
}

/* ---- Capability hint shown under the bar on focus ---- */
.ai-search-cap {
	z-index: 9997; background: #111827; color: #e5e7eb;
	font-size: 12px; line-height: 1.4; padding: 8px 12px; border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

/* ---- Dropdown panel attached under the search bar ---- */
.ai-search-attached {
	position: fixed; z-index: 9999; background: #fff;
	border: 1px solid #e5e5e5; border-radius: 10px; padding: 16px;
	max-height: 70vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,.28);
}

/* ---- Floating launcher ---- */
.ai-search-floating { margin: 0; }
.ai-search-fab {
	position: fixed; right: 20px; bottom: 20px; z-index: 9998;
	display: inline-flex; align-items: center; gap: 8px;
	padding: 12px 18px; border: 0; border-radius: 30px; cursor: pointer;
	background: #1f2937; color: #fff; font-size: 14px; font-weight: 600;
	box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.ai-search-fab:hover { background: #111827; }
.ai-fab-icon { font-size: 16px; }
.ai-search-panel {
	position: fixed; right: 20px; bottom: 78px; z-index: 9999;
	width: 380px; max-width: calc(100vw - 40px); max-height: 75vh; overflow-y: auto;
	background: #fff; border: 1px solid #e5e5e5; border-radius: 10px;
	box-shadow: 0 12px 40px rgba(0,0,0,.28); padding: 16px;
}
.ai-search-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ai-search-close { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: #888; }
.ai-search-close:hover { color: #333; }
@media (max-width: 480px) {
	.ai-fab-text { display: none; }
	.ai-search-panel { right: 10px; left: 10px; width: auto; bottom: 70px; }
}

.ai-search-heading { font-size: 18px; margin: 0 0 10px; }
.ai-search-input-group { display: flex; gap: 8px; }
.ai-search-input { flex: 1 1 auto; }
.ai-search-powered { font-size: 11px; color: #888; margin-top: 6px; }
.ai-search-label { font-weight: 600; color: #555; }

.ai-search-results { margin-top: 16px; }
.ai-search-thinking { color: #666; font-size: 14px; padding: 8px 0; }
.ai-spinner {
	display: inline-block; width: 14px; height: 14px; border: 2px solid #ccc;
	border-top-color: #555; border-radius: 50%; animation: ai-spin .8s linear infinite;
	vertical-align: middle; margin-right: 6px;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

.ai-answer-text {
	background: #f6f8fa; border-left: 3px solid #4a90d9; padding: 10px 14px;
	border-radius: 4px; margin-bottom: 14px; line-height: 1.5; color: #333;
}
.ai-search-error { color: #c0392b; padding: 8px 0; }

.ai-product-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 14px;
}
.ai-product-card {
	border: 1px solid #e5e5e5; border-radius: 6px; overflow: hidden;
	background: #fff; display: flex; flex-direction: column;
}
.ai-product-thumb { display: block; }
.ai-product-thumb img { width: 100%; height: auto; display: block; }
.ai-product-body { padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.ai-product-name { font-weight: 600; color: #222; text-decoration: none; font-size: 14px; }
.ai-product-name:hover { text-decoration: underline; }
.ai-product-price { color: #b12704; font-weight: 700; }
.ai-product-reason { font-size: 12px; color: #666; font-style: italic; }

.ai-search-usage {
	margin-top: 14px; padding-top: 10px; border-top: 1px dashed #ddd;
	font-size: 11px; color: #999; display: flex; flex-wrap: wrap; gap: 14px;
}
.ai-search-usage span::before { content: "• "; color: #ccc; }
