/* AI Chat Agent widget styles */
.aichat-root {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
/* Product pages have a sticky add-to-cart bar; lift the widget above it. */
.aichat-root.aichat-product {
	bottom: 88px;
}
.aichat-bubble {
	width: 66px;
	height: 66px;
	border-radius: 50%;
	background: #ff5100;
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}
.aichat-bubble:hover {
	transform: scale(1.06);
}
/* Teaser card: appears ~7s after load, visible 3s, then fades out. */
.aichat-teaser {
	position: absolute;
	right: 0;
	bottom: 82px;
	min-width: 190px;
	max-width: 250px;
	background: #fff;
	color: #1f2530;
	box-shadow: 0 10px 30px rgba(15, 30, 60, 0.18), 0 2px 6px rgba(15, 30, 60, 0.08);
	border-radius: 16px 16px 4px 16px;
	padding: 12px 16px;
	font-size: 14px;
	line-height: 1.45;
	cursor: pointer;
	animation: aichat-teaser-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.aichat-teaser-head {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 4px;
}
.aichat-teaser-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #2ecc71;
	box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
}
.aichat-teaser-name {
	font-size: 12px;
	font-weight: 600;
	color: #6b7280;
}
.aichat-teaser-text {
	font-weight: 500;
}
.aichat-teaser.aichat-teaser-out {
	opacity: 0;
	transform: translateY(10px) scale(0.97);
	transition: opacity 0.35s ease, transform 0.35s ease;
}
@keyframes aichat-teaser-in {
	from { opacity: 0; transform: translateY(14px) scale(0.95); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.aichat-panel {
	display: none;
	position: absolute;
	right: 0;
	bottom: 70px;
	width: 340px;
	max-width: calc(100vw - 30px);
	height: 460px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
	flex-direction: column;
	overflow: hidden;
}
.aichat-panel.aichat-open {
	display: flex;
}
.aichat-header {
	background: #ff5100;
	color: #fff;
	padding: 12px 16px;
	font-size: 15px;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.aichat-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
}
.aichat-body {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	background: #f7f7f7;
}
.aichat-msg {
	max-width: 85%;
	margin-bottom: 8px;
	padding: 9px 12px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.45;
	word-wrap: break-word;
}
.aichat-msg a {
	color: #ff5100;
	text-decoration: underline;
	word-break: break-all;
}
.aichat-msg img.aichat-img {
	display: block;
	max-width: 160px;
	width: 100%;
	height: auto;
	border-radius: 10px;
	margin: 6px 0;
	border: 1px solid #e5e5e5;
	/* Not interactive: no zoom, no click-through. */
	pointer-events: none;
	cursor: default;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
}
.aichat-msg-ai {
	background: #fff;
	color: #222;
	border: 1px solid #e5e5e5;
	border-bottom-left-radius: 4px;
}
.aichat-msg-user {
	background: #ff5100;
	color: #fff;
	margin-left: auto;
	border-bottom-right-radius: 4px;
}
.aichat-typing span {
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-right: 3px;
	border-radius: 50%;
	background: #bbb;
	animation: aichat-blink 1.2s infinite both;
}
.aichat-typing span:nth-child(2) {
	animation-delay: 0.2s;
}
.aichat-typing span:nth-child(3) {
	animation-delay: 0.4s;
}
@keyframes aichat-blink {
	0%, 80%, 100% { opacity: 0.3; }
	40% { opacity: 1; }
}
.aichat-footer {
	display: flex;
	border-top: 1px solid #e5e5e5;
	background: #fff;
	padding: 8px;
	gap: 8px;
}
.aichat-input {
	flex: 1;
	border: 1px solid #ddd !important;
	border-radius: 8px !important;
	padding: 10px 10px !important;
	/* 16px keeps iOS Safari from auto-zooming the page when the field is focused. */
	font-size: 16px !important;
	line-height: 1.2 !important;
	outline: none;
	background: #fff !important;
	color: #222 !important;
	min-height: 0 !important;
}
.aichat-input:focus {
	border-color: #ff5100 !important;
	box-shadow: none !important;
}
.aichat-send {
	background: #ff5100 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 8px !important;
	padding: 0 14px !important;
	font-size: 14px !important;
	cursor: pointer;
}
.aichat-send:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}
.aichat-input:disabled {
	background: #f0f0f0 !important;
	color: #999 !important;
	cursor: not-allowed;
}
/* Lock the page behind the full-screen mobile chat so it never peeks through. */
html.aichat-lock,
html.aichat-lock body {
	overflow: hidden !important;
	height: 100% !important;
	overscroll-behavior: none;
}

@media (max-width: 480px) {
	.aichat-root {
		right: 12px;
		bottom: 12px;
	}
	.aichat-root.aichat-product {
		bottom: 96px;
	}
	/* Full-screen chat on mobile for a proper app-like experience. */
	.aichat-panel.aichat-open {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		border-radius: 0;
	}
}
