/* // === start patch ai chat === */
.ai-chat-widget {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 10000;
	font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}
/* // === end patch ai chat === */

.ai-chat-toggle {
	background: #1e2a36;
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 10px 16px;
	font-size: 14px;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.ai-chat-panel {
	position: absolute;
	right: 0;
	bottom: 52px;
	width: 420px;
	max-width: calc(100vw - 32px);
	height: 580px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.ai-chat-panel[hidden] {
	display: none;
}

.ai-chat-header {
	background: #1e2a36;
	color: #fff;
	padding: 10px 12px;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ai-chat-title {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ai-chat-status {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #9aa4af;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.ai-chat-status.is-online {
	background: #33d17a;
	box-shadow: 0 0 0 2px rgba(51, 209, 122, 0.3);
}

.ai-chat-status.is-offline {
	background: #f04438;
	box-shadow: 0 0 0 2px rgba(240, 68, 56, 0.3);
}

.ai-chat-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

.ai-chat-close {
	background: transparent;
	color: #fff;
	border: 0;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}

.ai-chat-clear {
	background: transparent;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.6);
	cursor: pointer;
	font-size: 12px;
	line-height: 1;
	padding: 3px 8px;
	border-radius: 4px;
}

.ai-chat-messages {
	flex: 1;
	padding: 12px;
	overflow-y: auto;
	background: #f6f7f9;
	font-size: 13px;
}

.ai-chat-message {
	margin: 0 0 25px 0;
	padding: 8px 20px;
	border-radius: 10px;
	max-width: 85%;
	word-wrap: break-word;
	opacity: 0;
	transform: translateY(6px);
	animation: ai-chat-fade-in 220ms ease-out forwards;
}

.ai-chat-details {
	overflow: hidden;
	transition: height 320ms ease, opacity 220ms ease, transform 220ms ease;
}

.ai-chat-details.is-collapsed {
	height: 0;
	opacity: 0;
	transform: translateY(6px);
}

.ai-chat-message.bot.ai-chat-details-actions {
	background: transparent;
	border: 0;
	padding: 0;
	margin-top: -10px;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.ai-chat-message.user {
	background: #dfe7ff;
	margin-left: auto;
}

.ai-chat-message.bot {
	background: #ffffff;
	border: 1px solid #e3e5e8;
	margin-right: auto;
}

.ai-chat-form {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e3e5e8;
	background: #fff;
}

.ai-chat-input {
	flex: 1;
	border: 1px solid #d4d7dc;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13px;
}

.ai-chat-send {
	background: #1e2a36;
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 13px;
	cursor: pointer;
}

.ai-chat-loading {
	opacity: 0.7;
	font-style: italic;
	position: relative;
	padding-right: 26px;
}

.ai-chat-loading::after {
	content: '';
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 8px 0 0 currentColor, 16px 0 0 currentColor;
	animation: ai-chat-dots 1s infinite ease-in-out;
}

.ai-chat-products {
	background: transparent;
	border: 0;
	padding: 0;
	max-width: 100%;
}

.ai-chat-product-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ai-chat-message.bot.ai-chat-products,
.ai-chat-message.bot.ai-chat-actions {
	background: transparent;
	border: 0;
	padding: 0;
}

.ai-chat-product-card {
	display: flex;
	gap: 10px;
	background: #ffffff;
	border: 1px solid #e3e5e8;
	border-radius: 10px;
	padding: 6px 8px;
	text-decoration: none;
	color: inherit;
	opacity: 0;
	transform: translateY(6px);
	animation: ai-chat-fade-in 220ms ease-out forwards;
}

.ai-chat-product-media {
	width: 56px;
	flex: 0 0 56px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ai-chat-product-image {
	width: 56px;
	height: 56px;
	border-radius: 6px;
	overflow: hidden;
	background: #f0f2f5;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ai-chat-product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.ai-chat-product-btn {
	border: 0;
	border-radius: 999px;
	background: #eef2f7;
	color: #111827;
	font-size: 10px;
	line-height: 1;
	padding: 2px 6px;
	cursor: pointer;
	white-space: nowrap;
}

.ai-chat-product-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.ai-chat-message-discussion {
	background: #fff7ed;
	border: 1px solid #fed7aa;
	position: relative;
}

.ai-chat-message-discussion::before {
	content: attr(data-discussion-title);
	position: absolute;
	top: -8px;
	left: 10px;
	background: #fed7aa;
	color: #7c2d12;
	font-size: 9px;
	line-height: 1;
	padding: 2px 6px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
	max-width: 70%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ai-chat-message.ai-chat-stream {
	white-space: pre-line;
	position: relative;
}


.ai-chat-product-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.ai-chat-product-title {
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
}

.ai-chat-product-price-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.ai-chat-product-price {
	font-size: 12px;
	font-weight: 700;
	color: #111827;
	white-space: nowrap;
}

.ai-chat-product-price-old {
	text-decoration: line-through;
	color: #9ca3af;
	font-weight: 500;
	margin-left: 6px;
	font-size: 11px;
}

.ai-chat-product-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	font-size: 11px;
	color: #6b7280;
}

.ai-chat-product-rating {
	color: #f59e0b;
	letter-spacing: 1px;
	width: 30%;
}

.ai-chat-product-qty {
	color: #16a34a;
	width: 60%;
}

.ai-chat-product-cart {
	/*background: #1e2a36;*/
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 4px 8px;
	font-size: 11px;
	cursor: pointer;
	white-space: nowrap;
}

.ai-chat-product-cart:disabled {
	opacity: 0.6;
	cursor: default;
}

.ai-chat-details-title {
	font-weight: 600;
	margin-bottom: 6px;
}

.ai-chat-details-section {
	font-weight: 600;
	margin: 8px 0 4px;
}

.ai-chat-details-text {
	margin-bottom: 6px;
}

.ai-chat-details-specs {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ai-chat-spec-more {
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-height 260ms ease, opacity 200ms ease;
}

.ai-chat-spec-more.is-open {
	max-height: 1200px;
	opacity: 1;
}

.ai-chat-spec-row {
	font-size: 12px;
	line-height: 1.3;
}

.ai-chat-spec-toggle {
	margin-top: 6px;
	border: 0;
	background: #e5e7eb;
	color: #111827;
	border-radius: 6px;
	padding: 4px 8px;
	font-size: 11px;
	cursor: pointer;
}

.ai-chat-review {
	font-weight: 600;
	margin-top: 6px;
}

.ai-chat-review-text {
	margin-top: 2px;
}

.ai-chat-actions {
	background: transparent;
	border: 0;
	padding: 0;
	max-width: 100%;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ai-chat-action-btn {
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	color: #0f172a;
	border-radius: 999px;
	padding: 6px 10px;
	font-size: 12px;
	cursor: pointer;
	opacity: 0;
	transform: translateY(6px);
	animation: ai-chat-fade-in 220ms ease-out forwards;
}

.ai-chat-action-btn:hover {
	background: #e2e8f0;
}

@media (max-width: 480px) {
	.ai-chat-panel {
		width: 100%;
		right: -16px;
	}
}

@keyframes ai-chat-fade-in {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes ai-chat-dots {
	0% {
		opacity: 0.3;
	}
	50% {
		opacity: 1;
	}
	100% {
		opacity: 0.3;
	}
}


.ai-chat-reviews {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ai-chat-review-item {
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 6px 8px;
}

.ai-chat-review-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	color: #6b7280;
}

.ai-chat-review-stars {
	color: #f59e0b;
	letter-spacing: 1px;
	font-size: 11px;
}

.ai-chat-review-author {
	font-weight: 600;
	color: #111827;
}

.ai-chat-review-date {
	color: #9ca3af;
}

.ai-chat-review-text {
	margin-top: 4px;
	font-size: 12px;
	line-height: 1.3;
	color: #111827;
}

.ai-chat-product-btn {
	border: 0;
	border-radius: 999px;
	background: #eef2f7;
	color: #111827;
	font-size: 14px;
	line-height: 1;
	padding: 2px 6px;
	cursor: pointer;
	white-space: nowrap;
}

.ai-chat-product-discussion {
	background: #e0f2fe;
	color: #0f172a;
}
.ai-chat-product-configurator {
	background: #1060C1;
	color: #fff;
}

.ai-chat-discussion {
	background: #fff7ed;
	border-bottom: 1px solid #fed7aa;
}

.ai-chat-discussion-card {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
}

.ai-chat-discussion-link {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
	min-width: 0;
	text-decoration: none;
	color: inherit;
}

.ai-chat-discussion-link[aria-disabled="true"] {
	pointer-events: none;
	opacity: 0.7;
}

.ai-chat-discussion-image {
	width: 40px;
	height: 40px;
	flex: 0 0 40px;
	border-radius: 6px;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	display: flex;
	align-items: center;
	justify-content: center;
}

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

.ai-chat-discussion-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ai-chat-discussion-label {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #9a3412;
}

.ai-chat-discussion-title {
	font-size: 12px;
	font-weight: 600;
	color: #111827;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ai-chat-discussion-exit {
	border: 0;
	background: #fed7aa;
	color: #7c2d12;
	border-radius: 999px;
	padding: 4px 8px;
	font-size: 10px;
	cursor: pointer;
	white-space: nowrap;
}

.ai-chat-product-btn:disabled {
	opacity: 0.6;
	cursor: default;
}


.ai-chat-stream-word {
	opacity: 0;
	transform: translateY(2px);
	animation: ai-chat-word-fade 220ms ease-out forwards;
}

@keyframes ai-chat-word-fade {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}


.ai-chat-quick-questions {
	margin-top: 15px;
	margin-bottom: 20px;
	background: transparent;
	border: 0;
	padding: 0;
	max-width: 100%;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ai-chat-quick-question-btn {
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	color: #0f172a;
	border-radius: 999px;
	padding: 6px 10px;
	font-size: 12px;
	cursor: pointer;
}

.ai-chat-quick-question-btn:hover {
	background: #e2e8f0;
}

.ai-chat-quick-questions {
	opacity: 1;
	transform: translateY(0);
	transition: opacity 220ms ease, transform 220ms ease;
}

.ai-chat-quick-questions-hidden {
	opacity: 0;
	transform: translateY(6px);
}

.ai-chat-panel {
	transform-origin: bottom right;
}

.ai-chat-panel.is-opening {
	animation: ai-chat-panel-in 220ms ease-out;
}

@keyframes ai-chat-panel-in {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.ai-chat-panel.is-closing {
	animation: ai-chat-panel-out 200ms ease-in forwards;
}

@keyframes ai-chat-panel-out {
	from {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
	to {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
}
