/**
 * Search AI Frontend Styles
 */

/* Search Form Enhancement */
.search-ai-enhanced {
	position: relative;
}

/* Results Container */
.search-ai-results {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #ffffff;
	border: 1px solid #e1e1e1;
	border-top: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 9999;
	max-height: 500px;
	overflow-y: auto;
	margin-top: -1px;
}

.search-ai-results.active {
	display: block;
}

/* Results Header */
.search-ai-results-header {
	padding: 12px 16px;
	border-bottom: 1px solid #e1e1e1;
	background-color: #f8f9fa;
}

.search-ai-results-count {
	margin: 0;
	font-size: 13px;
	color: #666;
	font-weight: 500;
}

/* Products List */
.search-ai-products-list {
	max-height: 400px;
	overflow-y: auto;
}

/* Product Item */
.search-ai-product-item {
	display: flex;
	align-items: flex-start;
	padding: 12px 16px;
	border-bottom: 1px solid #f0f0f0;
	text-decoration: none;
	color: #333;
	transition: background-color 0.2s ease;
}

.search-ai-product-item:hover {
	background-color: #f8f9fa;
	text-decoration: none;
	color: #333;
}

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

/* Product Image */
.search-ai-product-image {
	flex-shrink: 0;
	width: 60px;
	height: 60px;
	margin-right: 12px;
	border-radius: 4px;
	overflow: hidden;
	background-color: #f5f5f5;
}

.search-ai-product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Product Info */
.search-ai-product-info {
	flex: 1;
	min-width: 0;
}

.search-ai-product-title {
	margin: 0 0 4px 0;
	font-size: 14px;
	font-weight: 600;
	color: #333;
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.search-ai-product-price {
	margin: 4px 0;
	font-size: 14px;
	font-weight: 600;
	color: #0073aa;
}

.search-ai-product-price .woocommerce-Price-amount {
	color: #0073aa;
}

.search-ai-product-description {
	margin: 4px 0 0 0;
	font-size: 12px;
	color: #666;
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* Results Footer */
.search-ai-results-footer {
	padding: 12px 16px;
	border-top: 1px solid #e1e1e1;
	background-color: #f8f9fa;
}

.search-ai-view-all {
	display: flex;
	align-items: center;
	justify-content: space-between;
	text-decoration: none;
	color: #333;
	font-size: 14px;
	font-weight: 500;
	transition: color 0.2s ease;
}

.search-ai-view-all:hover {
	color: #0073aa;
	text-decoration: none;
}

.search-ai-view-all svg {
	margin-left: 8px;
	flex-shrink: 0;
}

/* Loading State */
.search-ai-loading {
	padding: 40px 20px;
	text-align: center;
	color: #666;
	font-size: 14px;
}

.search-ai-loading:before {
	content: '';
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid #e1e1e1;
	border-top-color: #0073aa;
	border-radius: 50%;
	animation: search-ai-spin 0.8s linear infinite;
	margin-right: 8px;
	vertical-align: middle;
}

@keyframes search-ai-spin {
	to {
		transform: rotate(360deg);
	}
}

/* No Results State */
.search-ai-no-results {
	padding: 40px 20px;
	text-align: center;
	color: #666;
	font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
	.search-ai-results {
		max-height: 400px;
	}

	.search-ai-product-item {
		padding: 10px 12px;
	}

	.search-ai-product-image {
		width: 50px;
		height: 50px;
		margin-right: 10px;
	}

	.search-ai-product-title {
		font-size: 13px;
	}

	.search-ai-product-price {
		font-size: 13px;
	}

	.search-ai-product-description {
		font-size: 11px;
	}
}

/* Integration with WooCommerce Default Search */
.woocommerce-product-search .search-ai-enhanced {
	position: relative;
}

.woocommerce-product-search .search-ai-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
}

/* Hide default WooCommerce search suggestions when AI search is active */
.search-ai-enhanced ~ .widget_product_search,
.search-ai-enhanced ~ .woocommerce-product-search {
	position: relative;
}

/* Ensure results appear above other content */
.search-ai-results {
	z-index: 99999;
}

/* Scrollbar styling for results */
.search-ai-products-list::-webkit-scrollbar {
	width: 6px;
}

.search-ai-products-list::-webkit-scrollbar-track {
	background: #f1f1f1;
}

.search-ai-products-list::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 3px;
}

.search-ai-products-list::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}

/* ============================================
   CHATBOT MODE STYLES
   ============================================ */

/* Chatbot Toggle Button */
.search-ai-chatbot-toggle {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	transition: background-color 0.2s ease, transform 0.2s ease;
	z-index: 10;
}

.search-ai-chatbot-toggle svg,
.search-ai-chatbot-toggle .chat-icon-svg {
	width: 28px !important;
	height: 28px !important;
	min-width: 28px !important;
	min-height: 28px !important;
	max-width: 28px !important;
	max-height: 28px !important;
	display: block;
}

.search-ai-chatbot-toggle svg path {
	fill: currentColor;
	stroke: currentColor;
}

.search-ai-chatbot-toggle:hover {
	background: #005a87;
	transform: translateY(-50%) scale(1.05);
}

.search-ai-chatbot-toggle:active {
	transform: translateY(-50%) scale(0.95);
}

/* Floating Chatbot Toggle Button (for chatbot-only mode) */
.search-ai-chatbot-float {
	position: fixed;
	bottom: 24px;
	right: 24px;
	top: auto;
	transform: none;
	width: 64px;
	height: 64px;
	font-size: 28px;
	box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4), 0 0 0 0 rgba(102, 126, 234, 0.5);
	z-index: 999998;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 50%;
	animation: search-ai-float-pulse 2s infinite;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s ease;
}

.search-ai-chatbot-float svg,
.search-ai-chatbot-float .chat-icon-svg {
	width: 32px !important;
	height: 32px !important;
	min-width: 32px !important;
	min-height: 32px !important;
	max-width: 32px !important;
	max-height: 32px !important;
	display: block;
	flex-shrink: 0;
}

.search-ai-chatbot-float svg path {
	fill: currentColor;
	stroke: currentColor;
}

@keyframes search-ai-float-pulse {
	0%, 100% {
		box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4), 0 0 0 0 rgba(102, 126, 234, 0.5);
	}
	50% {
		box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4), 0 0 0 8px rgba(102, 126, 234, 0);
	}
}

.search-ai-chatbot-float:hover {
	transform: scale(1.1);
	box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5), 0 0 0 0 rgba(102, 126, 234, 0.5);
	animation: none;
}

.search-ai-chatbot-float:active {
	transform: scale(0.95);
}

/* Chatbot Container */
.search-ai-results.search-ai-chatbot {
	position: fixed;
	top: auto;
	bottom: 100px;
	right: 20px;
	left: auto;
	width: 420px;
	max-width: calc(100vw - 40px);
	max-height: 650px;
	height: auto;
	border-radius: 24px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
	display: none;
	flex-direction: column;
	overflow: hidden;
	background: #ffffff;
	z-index: 999999;
	backdrop-filter: blur(10px);
	animation: search-ai-chatbot-slide-up 0.3s ease-out;
}

@keyframes search-ai-chatbot-slide-up {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.search-ai-results.search-ai-chatbot.active {
	display: flex;
}

/* Chatbot Header */
.search-ai-chatbot-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 24px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #ffffff;
	border-bottom: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-ai-chatbot-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #ffffff;
	letter-spacing: -0.3px;
}

.search-ai-chatbot-close {
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #ffffff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
	backdrop-filter: blur(10px);
	padding-bottom: 3px;
}

.search-ai-chatbot-close:hover {
	background: rgba(255, 255, 255, 0.25);
	transform: rotate(90deg);
}

/* Chatbot Welcome Section */
.search-ai-chatbot-welcome {
	padding: 20px 24px;
	background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
	color: #ffffff;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-ai-chatbot-welcome-heading {
	margin: 0 0 8px 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	color: #ffffff;
}

.search-ai-chatbot-welcome-subheading {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.9);
}

/* Chatbot Messages Container */
.search-ai-chatbot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	background: linear-gradient(to bottom, #fafbfc 0%, #f5f7fa 100%);
	min-height: 300px;
	max-height: 480px;
}

/* Chatbot Message */
.search-ai-chatbot-message {
	display: flex;
	margin-bottom: 20px;
	animation: search-ai-message-fade-in 0.3s ease;
}

.search-ai-chatbot-message:last-child {
	margin-bottom: 0;
}

.search-ai-chatbot-message.user {
	justify-content: flex-end;
}

.search-ai-chatbot-message.assistant {
	justify-content: flex-start;
	flex-direction: column;
	align-items: flex-start;
}

@keyframes search-ai-message-fade-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Chatbot Message Content */
.search-ai-chatbot-message-content {
	max-width: 75%;
	padding: 12px 16px;
	border-radius: 18px;
	font-size: 13px;
	line-height: 1.5;
	word-wrap: break-word;
	display: block;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Paragraph spacing in chatbot messages */
.search-ai-chatbot-message-content p {
	margin: 0 0 12px 0;
	padding: 0;
	line-height: 1.6;
}

.search-ai-chatbot-message-content p:last-child {
	margin-bottom: 0;
}

/* URL Button Styles */
.search-ai-url-button {
	display: inline-block !important;
	margin: 8px 8px 8px 0 !important;
	padding: 10px 16px !important;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
	color: #ffffff !important;
	text-decoration: none !important;
	border-radius: 6px !important;
	font-weight: 500 !important;
	font-size: 14px !important;
	transition: all 0.2s ease !important;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
	border: none !important;
	cursor: pointer !important;
	vertical-align: middle !important;
}

.search-ai-url-button:hover {
	background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%) !important;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
	transform: translateY(-1px) !important;
}

.search-ai-url-button:active {
	transform: translateY(0) !important;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.search-ai-url-button span {
	margin-right: 6px !important;
	display: inline-block !important;
}

.search-ai-typing-text {
	display: inline-block;
}

/* Ensure products appear below message text */
.search-ai-chatbot-message.assistant .search-ai-chatbot-products {
	display: grid !important;
	width: 100%;
	max-width: 100%;
	margin-top: 16px;
	margin-left: 0;
	margin-bottom: 0;
	clear: both;
}

/* Chatbot FAQs Wrapper */
.search-ai-chatbot-faqs-wrapper {
	margin-top: 20px;
	margin-bottom: 8px;
	width: 100%;
}

.search-ai-chatbot-faqs-label {
	margin: 0 0 12px 0;
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Chatbot FAQs Container - Natural Flow Layout */
.search-ai-chatbot-faqs {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	width: 100%;
	align-items: flex-start;
	align-content: flex-start;
	justify-content: flex-start;
}

/* Chatbot FAQ Button */
.search-ai-chatbot-faq-btn {
	background: #2d3748;
	color: #ffffff;
	border: none;
	border-radius: 40px;
	padding: 10px 18px;
	font-size: 13px;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	line-height: 1.5;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	position: relative;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	flex: 0 0 auto;
	width: auto;
	max-width: 100%;
	white-space: nowrap;
}

.search-ai-faq-icon {
	font-size: 16px;
	flex-shrink: 0;
	opacity: 0.9;
	transition: all 0.3s ease, filter 0.3s ease, -webkit-filter 0.3s ease;
	margin-top: 2px;
	will-change: filter;
}

.search-ai-faq-text {
	flex: 0 1 auto;
	transition: filter 0.3s ease, -webkit-filter 0.3s ease;
	will-change: filter;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}



.search-ai-chatbot-message.user .search-ai-chatbot-message-content {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #ffffff;
	border-bottom-right-radius: 4px;
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.search-ai-chatbot-message.assistant .search-ai-chatbot-message-content {
	background: #ffffff;
	color: #2d3748;
	border: none;
	border-bottom-left-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	padding: 12px 16px;
	max-width: 100%;
}

/* Simple chat message design for order details */
.search-ai-chatbot-message.assistant .search-ai-order-details {
	padding: 12px 16px;
	margin: 0;
	line-height: 1.6;
	font-size: 13px;
}

/* Order Details Styling - Simple Chat Message Design */
.search-ai-order-details {
	line-height: 1.6;
	font-size: 14px;
	color: #2d3748;
	padding: 0;
	margin: 0;
	word-wrap: break-word;
	display: block;
	white-space: normal;
}

.search-ai-order-details strong {
	font-weight: 600;
	color: #2d3748;
	display: inline;
}

.search-ai-order-details strong[style*="color: orange"],
.search-ai-order-details strong[style*="color:orange"] {
	color: #f97316 !important;
}

.search-ai-order-details a {
	color: #f97316 !important;
	text-decoration: underline;
	transition: color 0.2s ease;
	font-weight: 500;
	display: inline;
}

.search-ai-order-details a:hover {
	color: #ea580c !important;
	text-decoration: underline;
}

/* Simple, natural line break spacing */
.search-ai-order-details br {
	display: block;
	margin: 0;
	padding: 0;
	content: "";
	line-height: 0.5;
	height: 0.5em;
	font-size: 0;
}

/* Double line break for paragraph spacing */
.search-ai-order-details br + br {
	height: 0.8em;
}

/* Remove any triple+ line breaks */
.search-ai-order-details br + br + br,
.search-ai-order-details br + br + br + br {
	display: none;
}

/* Remove default margins and padding from all elements */
.search-ai-order-details * {
	margin: 0;
	padding: 0;
	line-height: inherit;
}

/* Ensure proper inline display */
.search-ai-order-details strong,
.search-ai-order-details a,
.search-ai-order-details span {
	display: inline;
	vertical-align: baseline;
}

/* Chatbot Products Container */
.search-ai-chatbot-products {
	margin-top: 16px;
	margin-bottom: 0;
	display: grid !important;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px !important;
	row-gap: 20px !important;
	column-gap: 20px !important;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	width: 100%;
	clear: both;
	padding: 0;
	box-sizing: border-box;
}

/* Chatbot Product Card */
.search-ai-chatbot-product-card {
	background: #ffffff;
	border: 1px solid #e1e1e1;
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease, opacity 0.3s ease;
	min-width: 200px;
	flex-shrink: 0;
	margin: 0;
	opacity: 0;
	transform: translateY(10px);
	animation: search-ai-product-fade-in 0.4s ease forwards;
}

@keyframes search-ai-product-fade-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Stagger animation for multiple products */
.search-ai-chatbot-product-card:nth-child(1) {
	animation-delay: 0.1s;
}

.search-ai-chatbot-product-card:nth-child(2) {
	animation-delay: 0.15s;
}

.search-ai-chatbot-product-card:nth-child(3) {
	animation-delay: 0.2s;
}

.search-ai-chatbot-product-card:nth-child(4) {
	animation-delay: 0.25s;
}

.search-ai-chatbot-product-card:nth-child(5) {
	animation-delay: 0.3s;
}

.search-ai-chatbot-product-card:nth-child(n+6) {
	animation-delay: 0.35s;
}

.search-ai-chatbot-product-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.search-ai-chatbot-product-link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	padding: 12px;
}

.search-ai-chatbot-product-image {
	flex-shrink: 0;
	width: 100%;
	height: 180px;
	margin-bottom: 12px;
	border-radius: 6px;
	overflow: hidden;
	background-color: #f5f5f5;
}

.search-ai-chatbot-product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.search-ai-chatbot-product-info {
	flex: 1;
	min-width: 0;
}

.search-ai-chatbot-product-title {
	margin: 0 0 6px 0;
	font-size: 14px;
	font-weight: 600;
	color: #333;
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.search-ai-chatbot-product-price {
	margin: 6px 0;
	font-size: 15px;
	font-weight: 600;
	color: #0073aa;
}

.search-ai-chatbot-product-description {
	margin: 6px 0 0 0;
	font-size: 12px;
	color: #666;
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* Chatbot Footer */
.search-ai-chatbot-footer {
	padding: 16px 20px;
	background: #ffffff;
	border-top: none;
	box-shadow: none;
}

/* Chatbot Input Wrapper (for chatbot-only mode) */
.search-ai-chatbot-input-wrapper {
	position: relative;
	background: transparent;
	border-radius: 0;
	padding: 0;
	margin-bottom: 0;
	display: block;
}

/* Override any theme or WooCommerce input styles */
.search-ai-chatbot-input-wrapper input.search-ai-chatbot-input,
.search-ai-chatbot-input-wrapper .search-ai-chatbot-input,
input.search-ai-chatbot-input,
.search-ai-chatbot-input[type="text"] {
	font-size: 13px !important;
	border-radius: 24px !important;
}

.search-ai-chatbot-input {
	width: 100% !important;
	padding: 10px 50px 10px 14px !important;
	border: none !important;
	border-radius: 24px !important;
	font-size: 13px !important;
	outline: none !important;
	transition: all 0.2s ease;
	background: #f1f3f5 !important;
	color: #2d3748 !important;
	line-height: 1.5 !important;
	resize: none !important;
	min-height: 44px !important;
	box-sizing: border-box !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
}

.search-ai-chatbot-input:focus {
	border: none !important;
	background: #e9ecef !important;
	box-shadow: none !important;
	outline: none !important;
	border-radius: 24px !important;
	font-size: 13px !important;
}

.search-ai-chatbot-input::placeholder {
	color: #868e96;
}

.search-ai-chatbot-send {
	background: transparent;
	color: #868e96;
	border: none;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	flex-shrink: 0;
	box-shadow: none;
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	overflow: hidden;
	padding: 0;
}

.search-ai-chatbot-send:hover {
	background: transparent;
	color: #495057;
	transform: translateY(-50%) scale(1.1);
}

.search-ai-chatbot-send:active {
	transform: translateY(-50%) scale(0.95);
}

.search-ai-chatbot-send svg {
	width: 20px;
	height: 20px;
	display: block;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
	transition: transform 0.2s ease;
}

.search-ai-chatbot-send:hover svg {
	transform: translateX(1px) translateY(-1px);
}

.search-ai-chatbot-send svg path {
	stroke: currentColor;
	stroke-width: 2;
	fill: none;
}

/* Chatbot Typing Indicator */
.search-ai-chatbot-typing {
	padding: 8px 12px;
	font-size: 13px;
	color: #666;
	font-style: italic;
	display: flex;
	align-items: center;
}

.search-ai-chatbot-typing:before {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #0073aa;
	margin-right: 8px;
	animation: search-ai-typing-dot 1.4s infinite;
}

.search-ai-chatbot-typing:after {
	content: '...';
	animation: search-ai-typing-dots 1.4s infinite;
}

@keyframes search-ai-typing-dot {
	0%, 60%, 100% {
		opacity: 0.3;
		transform: scale(0.8);
	}
	30% {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes search-ai-typing-dots {
	0%, 20% {
		content: '.';
	}
	40% {
		content: '..';
	}
	60%, 100% {
		content: '...';
	}
}

/* Loading Message in Chat */
.search-ai-loading-message {
	opacity: 0.8;
	animation: search-ai-message-fade-in 0.3s ease;
}

.search-ai-loading-content {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	background: #f1f3f5;
	color: #64748b;
}

.search-ai-loading-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid #e2e8f0;
	border-top-color: #0073aa;
	border-radius: 50%;
	animation: search-ai-spin 0.8s linear infinite;
	flex-shrink: 0;
}

.search-ai-loading-text {
	font-size: 13px;
	font-weight: 500;
	color: #64748b;
}

@keyframes search-ai-spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* Chatbot Scrollbar */
.search-ai-chatbot-messages::-webkit-scrollbar {
	width: 6px;
}

.search-ai-chatbot-messages::-webkit-scrollbar-track {
	background: #f1f1f1;
}

.search-ai-chatbot-messages::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 3px;
}

.search-ai-chatbot-messages::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}

/* Responsive Chatbot */
/* Responsive Styles for Chatbot */
@media (max-width: 768px) {
	.search-ai-results.search-ai-chatbot {
		right: 10px;
		left: 10px;
		width: auto;
		bottom: 90px;
		max-height: calc(100vh - 100px);
		border-radius: 20px;
	}

	.search-ai-chatbot-float {
		bottom: 80px;
		right: 15px;
		width: 56px;
		height: 56px;
		font-size: 24px;
	}

	.search-ai-chatbot-float svg,
	.search-ai-chatbot-float .chat-icon-svg {
		width: 28px !important;
		height: 28px !important;
		min-width: 28px !important;
		min-height: 28px !important;
		max-width: 28px !important;
		max-height: 28px !important;
	}

	.search-ai-chatbot-header {
		padding: 12px 16px;
	}

	.search-ai-chatbot-header h3 {
		font-size: 15px;
	}

	.search-ai-chatbot-close {
		width: 28px;
		height: 28px;
		font-size: 18px;
	}

	.search-ai-chatbot-welcome {
		padding: 16px 18px;
	}

	.search-ai-chatbot-welcome-heading {
		font-size: 15px;
	}

	.search-ai-chatbot-welcome-subheading {
		font-size: 11px;
	}

	.search-ai-chatbot-messages {
		max-height: 350px;
		padding: 16px;
	}

	.search-ai-chatbot-message {
		margin-bottom: 16px;
	}

	.search-ai-chatbot-message-content {
		max-width: 85%;
		padding: 10px 14px;
		font-size: 13px;
	}

	.search-ai-chatbot-faqs {
		gap: 10px;
		margin-top: 16px;
	}

	.search-ai-chatbot-faq-btn {
		padding: 10px 14px;
		font-size: 12px;
		min-height: auto;
		max-width: 100%;
		width: fit-content;
	}

	.search-ai-chatbot-footer {
		padding: 12px 16px;
	}

	.search-ai-chatbot-input {
		font-size: 14px !important;
		padding: 12px 48px 12px 14px !important;
		min-height: 48px !important;
	}

	.search-ai-chatbot-send {
		right: 8px;
		width: 36px;
		height: 36px;
	}

	.search-ai-chatbot-send svg {
		width: 18px;
		height: 18px;
	}

	.search-ai-chatbot-products {
		grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
		gap: 16px;
		row-gap: 16px;
	}

	.search-ai-chatbot-product-card {
		min-width: 150px;
	}

	.search-ai-chatbot-product-image {
		height: 150px;
	}

	.search-ai-chatbot-product-title {
		font-size: 13px;
	}

	.search-ai-chatbot-product-price {
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	.search-ai-results.search-ai-chatbot {
		right: 0;
		left: 0;
		bottom: 0;
		top: 100px;
		width: 100%;
		max-width: 100%;
		border-radius: 20px;
		max-height: calc(100vh - 60px);
		height: auto;
	}

	.search-ai-chatbot-float {
		bottom: 80px;
		right: 15px;
		width: 56px;
		height: 56px;
		font-size: 24px;
	}

	.search-ai-chatbot-float svg,
	.search-ai-chatbot-float .chat-icon-svg {
		width: 28px !important;
		height: 28px !important;
		min-width: 28px !important;
		min-height: 28px !important;
		max-width: 28px !important;
		max-height: 28px !important;
	}

	.search-ai-chatbot-header {
		padding: 12px 16px;
		border-radius: 0;
	}

	.search-ai-chatbot-header h3 {
		font-size: 14px;
	}

	.search-ai-chatbot-close {
		width: 26px;
		height: 26px;
		font-size: 16px;
	}

	.search-ai-chatbot-welcome {
		padding: 14px 16px;
		border-radius: 0;
	}

	.search-ai-chatbot-welcome-heading {
		font-size: 14px;
		margin-bottom: 6px;
	}

	.search-ai-chatbot-welcome-subheading {
		font-size: 11px;
	}

	.search-ai-chatbot-messages {
		max-height: calc(100vh - 200px);
		padding: 14px;
	}

	.search-ai-chatbot-message {
		margin-bottom: 14px;
	}

	.search-ai-chatbot-message-content {
		max-width: 90%;
		padding: 10px 12px;
		font-size: 13px;
		border-radius: 16px;
	}

	.search-ai-chatbot-message-content p {
		margin-bottom: 10px;
		font-size: 13px;
		line-height: 1.5;
	}

	.search-ai-url-button {
		margin: 6px 6px 6px 0 !important;
		padding: 8px 14px !important;
		font-size: 13px !important;
	}

	.search-ai-chatbot-faqs-wrapper {
		margin-top: 16px;
		margin-bottom: 6px;
	}

	.search-ai-chatbot-faqs-label {
		font-size: 11px;
		margin-bottom: 10px;
	}

	.search-ai-chatbot-faqs {
		gap: 8px;
		margin-top: 12px;
	}

	.search-ai-chatbot-faq-btn {
		padding: 10px 12px;
		font-size: 11px;
		min-height: 40px;
		border-radius: 36px;
		max-width: 100%;
		width: fit-content;
	}

	.search-ai-chatbot-footer {
		padding: 12px 14px;
		border-radius: 0;
	}

	.search-ai-chatbot-input-wrapper {
		padding: 0;
	}

	.search-ai-chatbot-input {
		font-size: 14px !important;
		padding: 12px 46px 12px 12px !important;
		min-height: 48px !important;
		border-radius: 24px !important;
	}

	.search-ai-chatbot-send {
		right: 6px;
		width: 36px;
		height: 36px;
	}

	.search-ai-chatbot-send svg {
		width: 18px;
		height: 18px;
	}

	.search-ai-chatbot-products {
		grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
		gap: 12px;
		row-gap: 12px;
		column-gap: 12px;
		margin-top: 12px;
	}

	.search-ai-chatbot-product-card {
		min-width: 140px;
	}

	.search-ai-chatbot-product-image {
		height: 140px;
	}

	.search-ai-chatbot-product-title {
		font-size: 12px;
		line-height: 1.4;
	}

	.search-ai-chatbot-product-price {
		font-size: 13px;
	}

	.search-ai-chatbot-product-description {
		font-size: 11px;
	}

	.search-ai-loading-message {
		margin-bottom: 8px;
	}

	.search-ai-loading-content {
		padding: 10px 14px;
		font-size: 12px;
	}
}

/* Extra small devices (phones in portrait, less than 360px) */
@media (max-width: 360px) {
	.search-ai-chatbot-header {
		padding: 10px 14px;
	}

	.search-ai-chatbot-header h3 {
		font-size: 13px;
	}

	.search-ai-chatbot-welcome {
		padding: 12px 14px;
	}

	.search-ai-chatbot-welcome-heading {
		font-size: 13px;
	}

	.search-ai-chatbot-welcome-subheading {
		font-size: 10px;
	}

	.search-ai-chatbot-messages {
		padding: 12px;
	}

	.search-ai-chatbot-message-content {
		max-width: 92%;
		padding: 8px 10px;
		font-size: 12px;
	}

	.search-ai-chatbot-faq-btn {
		padding: 8px 10px;
		font-size: 10px;
		min-height: 36px;
	}

	.search-ai-chatbot-products {
		grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
		gap: 10px;
		row-gap: 10px;
		column-gap: 10px;
	}

	.search-ai-chatbot-product-card {
		min-width: 120px;
	}

	.search-ai-chatbot-product-image {
		height: 120px;
	}

	.search-ai-chatbot-input {
		font-size: 13px !important;
		padding: 10px 42px 10px 12px !important;
		min-height: 44px !important;
	}

	.search-ai-chatbot-float {
		bottom: 80px;
		right: 15px;
		width: 56px;
		height: 56px;
		font-size: 24px;
	}

	.search-ai-chatbot-float svg,
	.search-ai-chatbot-float .chat-icon-svg {
		width: 28px !important;
		height: 28px !important;
		min-width: 28px !important;
		min-height: 28px !important;
		max-width: 28px !important;
		max-height: 28px !important;
	}
}
