#peakit-ai-widget {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#peakit-ai-toggle {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(135deg, var(--peakit-ai-color, #2e7d32), color-mix(in srgb, var(--peakit-ai-color, #2e7d32) 70%, #000));
	color: #fff;
	font-size: 26px;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0,0,0,0.28), 0 0 0 0 rgba(46,125,50,0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	animation: peakit-ai-pulse 2.4s ease-in-out infinite;
}
#peakit-ai-toggle:hover {
	transform: scale(1.08);
}
@keyframes peakit-ai-pulse {
	0%, 100% { box-shadow: 0 6px 20px rgba(0,0,0,0.28), 0 0 0 0 rgba(46,125,50,0.35); }
	50% { box-shadow: 0 6px 20px rgba(0,0,0,0.28), 0 0 0 8px rgba(46,125,50,0); }
}
#peakit-ai-widget.peakit-ai-open #peakit-ai-toggle { animation: none; }
#peakit-ai-widget.peakit-ai-open #peakit-ai-toggle .peakit-ai-icon-chat { display: none; }
#peakit-ai-widget:not(.peakit-ai-open) #peakit-ai-toggle .peakit-ai-icon-close { display: none; }

#peakit-ai-panel {
	position: absolute;
	bottom: 78px;
	right: 0;
	width: 360px;
	max-width: 92vw;
	height: 490px;
	max-height: 72vh;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 16px 50px rgba(0,0,0,0.22);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transition: opacity 0.18s ease, transform 0.18s ease;
}
#peakit-ai-panel.peakit-ai-hidden {
	display: none;
	opacity: 0;
}
#peakit-ai-panel:not(.peakit-ai-hidden) {
	opacity: 1;
	transform: translateY(0) scale(1);
}

#peakit-ai-header {
	background: linear-gradient(135deg, var(--peakit-ai-color, #2e7d32), color-mix(in srgb, var(--peakit-ai-color, #2e7d32) 65%, #000));
	color: #fff;
	padding: 16px 18px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
#peakit-ai-header .peakit-ai-title-row {
	display: flex;
	align-items: center;
	gap: 10px;
}
#peakit-ai-header .peakit-ai-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255,255,255,0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
}
#peakit-ai-header .peakit-ai-title-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}
#peakit-ai-header .peakit-ai-title-text strong {
	font-size: 14.5px;
	font-weight: 700;
}
#peakit-ai-header .peakit-ai-title-text span {
	font-size: 11px;
	opacity: 0.85;
}
#peakit-ai-header button {
	background: none;
	border: none;
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	opacity: 0.85;
}
#peakit-ai-header button:hover {
	opacity: 1;
}

#peakit-ai-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f9f7;
}

.peakit-ai-msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	animation: peakit-ai-fade-in 0.18s ease;
}
@keyframes peakit-ai-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}
.peakit-ai-msg.bot {
	background: #fff;
	border: 1px solid #eaeaea;
	align-self: flex-start;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.peakit-ai-msg.bot a {
	color: var(--peakit-ai-color, #2e7d32);
	font-weight: 600;
}
.peakit-ai-msg.user {
	background: var(--peakit-ai-color, #2e7d32);
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}
.peakit-ai-msg.typing {
	font-style: normal;
	color: #999;
	display: flex;
	gap: 4px;
	align-items: center;
	padding: 12px 14px;
}
.peakit-ai-msg.typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #bbb;
	display: inline-block;
	animation: peakit-ai-bounce 1.2s infinite ease-in-out;
}
.peakit-ai-msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.peakit-ai-msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes peakit-ai-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

.peakit-ai-product-card {
	border: 1px solid #eaeaea;
	border-radius: 12px;
	padding: 10px;
	background: #fff;
	align-self: flex-start;
	max-width: 85%;
	font-size: 13px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
	animation: peakit-ai-fade-in 0.2s ease;
}
.peakit-ai-product-card img {
	width: 100%;
	max-width: 140px;
	border-radius: 8px;
	display: block;
	margin-bottom: 8px;
	object-fit: cover;
}
.peakit-ai-product-card .name {
	font-weight: 700;
	margin-bottom: 2px;
	color: #222;
}
.peakit-ai-product-card .price {
	color: #666;
	margin-bottom: 9px;
	font-weight: 600;
}
.peakit-ai-product-card .actions {
	display: flex;
	gap: 6px;
}
.peakit-ai-product-card button,
.peakit-ai-product-card a {
	font-size: 12px;
	padding: 7px 11px;
	border-radius: 8px;
	border: 1px solid var(--peakit-ai-color, #2e7d32);
	background: var(--peakit-ai-color, #2e7d32);
	color: #fff;
	text-decoration: none;
	cursor: pointer;
	font-weight: 600;
	transition: opacity 0.15s ease;
}
.peakit-ai-product-card button:hover,
.peakit-ai-product-card a:hover {
	opacity: 0.85;
}
.peakit-ai-product-card a.secondary {
	background: #fff;
	color: var(--peakit-ai-color, #2e7d32);
}

.peakit-ai-link-card {
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1px solid #eaeaea;
	border-radius: 12px;
	padding: 8px;
	background: #fff;
	align-self: flex-start;
	max-width: 85%;
	text-decoration: none;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
	transition: box-shadow 0.15s ease;
}
.peakit-ai-link-card:hover {
	box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.peakit-ai-link-card img {
	width: 44px;
	height: 44px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
}
.peakit-ai-link-card .name {
	font-weight: 700;
	font-size: 13.5px;
	color: var(--peakit-ai-color, #2e7d32);
}

#peakit-ai-input-row {
	display: flex;
	border-top: 1px solid #eee;
	padding: 10px;
	gap: 8px;
	background: #fff;
}
#peakit-ai-input {
	flex: 1;
	border: 1px solid #e0e0e0;
	border-radius: 22px;
	padding: 10px 15px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.15s ease;
}
#peakit-ai-input:focus {
	border-color: var(--peakit-ai-color, #2e7d32);
}
#peakit-ai-send {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: var(--peakit-ai-color, #2e7d32);
	color: #fff;
	cursor: pointer;
	font-size: 15px;
	flex-shrink: 0;
	transition: opacity 0.15s ease;
}
#peakit-ai-send:hover {
	opacity: 0.85;
}

.peakit-ai-whatsapp-link {
	display: inline-block;
	margin-top: 4px;
	font-size: 12px;
	color: #128C7E;
	text-decoration: underline;
	align-self: flex-start;
}

#peakit-ai-teaser {
	position: absolute;
	bottom: 8px;
	right: 74px;
	max-width: 220px;
	background: #fff;
	border-radius: 14px;
	padding: 12px 30px 12px 14px;
	box-shadow: 0 8px 26px rgba(0,0,0,0.18);
	font-size: 13.5px;
	line-height: 1.4;
	color: #222;
	cursor: pointer;
	animation: peakit-ai-teaser-in 0.35s ease;
}
#peakit-ai-teaser.peakit-ai-hidden {
	display: none;
}
#peakit-ai-teaser::after {
	content: "";
	position: absolute;
	right: -7px;
	bottom: 18px;
	width: 14px;
	height: 14px;
	background: #fff;
	transform: rotate(45deg);
	box-shadow: 3px -3px 6px rgba(0,0,0,0.03);
}
@keyframes peakit-ai-teaser-in {
	from { opacity: 0; transform: translateX(8px) scale(0.96); }
	to { opacity: 1; transform: translateX(0) scale(1); }
}
#peakit-ai-teaser-close {
	position: absolute;
	top: 6px;
	right: 8px;
	background: none;
	border: none;
	color: #aaa;
	font-size: 11px;
	cursor: pointer;
	padding: 4px;
}
#peakit-ai-teaser-close:hover {
	color: #666;
}

@media (max-width: 480px) {
	#peakit-ai-panel {
		width: 92vw;
		right: -4px;
	}
	#peakit-ai-teaser {
		max-width: 60vw;
		right: 70px;
	}
}
