.cl-chat-root {
	position: fixed;
	right: 20px;
	bottom: 90px;
	z-index: 2147483000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
}

.cl-chat-root.cl-chat-pos-left {
	right: auto;
	left: 20px;
}

.cl-chat-toggle {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	transition: transform 0.18s ease;
}

.cl-chat-toggle:hover {
	transform: translateY(-3px);
}

/* Badge circular con el icono */
.cl-chat-badge {
	position: relative;
	width: 62px;
	height: 62px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: linear-gradient(145deg, #14b8a6 0%, #0d9488 55%, #0f766e 100%);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 28px rgba(13, 148, 136, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.4);
	animation: clChatPulse 2.4s infinite;
}

.cl-chat-toggle:hover .cl-chat-badge {
	animation-play-state: paused;
}

.cl-chat-badge-icon {
	position: relative;
	z-index: 2;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
	animation: clChatBob 2.6s ease-in-out infinite;
}

/* Anillo de pulso alrededor del badge */
.cl-chat-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid rgba(20, 184, 166, 0.7);
	animation: clChatRing 2.4s ease-out infinite;
}

/* Punto de "en linea" */
.cl-chat-dot {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: #22c55e;
	border: 2px solid #fff;
	z-index: 3;
	box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
	animation: clChatDot 2s infinite;
}

/* Texto sobre fondo transparente, con etiqueta blanca legible */
.cl-chat-label {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
	text-align: left;
	white-space: nowrap;
	background: rgba(255, 255, 255, 0.92);
	color: #0f172a;
	padding: 7px 14px;
	border-radius: 14px;
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
	border-left: 4px solid #0d9488;
	backdrop-filter: blur(6px);
}

.cl-chat-label-top {
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.3px;
	color: #0d9488;
	text-transform: uppercase;
}

.cl-chat-label-bottom {
	font-size: 12.5px;
	font-weight: 600;
	color: #334155;
}

.cl-chat-toggle.cl-chat-hidden {
	display: none;
}

@keyframes clChatPulse {
	0% {
		box-shadow: 0 10px 28px rgba(13, 148, 136, 0.5), 0 0 0 0 rgba(13, 148, 136, 0.55);
	}
	70% {
		box-shadow: 0 10px 28px rgba(13, 148, 136, 0.5), 0 0 0 16px rgba(13, 148, 136, 0);
	}
	100% {
		box-shadow: 0 10px 28px rgba(13, 148, 136, 0.5), 0 0 0 0 rgba(13, 148, 136, 0);
	}
}

@keyframes clChatRing {
	0% {
		transform: scale(1);
		opacity: 0.9;
	}
	100% {
		transform: scale(1.35);
		opacity: 0;
	}
}

@keyframes clChatBob {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-2px);
	}
}

@keyframes clChatDot {
	0% {
		box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
	}
	70% {
		box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
	}
}

.cl-chat-panel {
	position: absolute;
	right: 0;
	bottom: 74px;
	width: 350px;
	max-width: calc(100vw - 32px);
	height: 480px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	opacity: 0;
	visibility: hidden;
	transform: translateY(14px) scale(0.97);
	transform-origin: bottom right;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.cl-chat-root.cl-chat-pos-left .cl-chat-panel {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}

.cl-chat-panel.cl-chat-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.cl-chat-header {
	background: #0d9488;
	color: #fff;
	padding: 14px 14px;
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
}

.cl-chat-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.5px;
	flex: 0 0 auto;
}

.cl-chat-title {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

.cl-chat-title strong {
	font-size: 15px;
	font-weight: 600;
}

.cl-chat-title small {
	font-size: 12px;
	opacity: 0.85;
}

.cl-chat-close {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	opacity: 0.85;
}

.cl-chat-close:hover {
	opacity: 1;
}

.cl-chat-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px 14px;
	background: #f4f7f7;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cl-chat-row {
	display: flex;
}

.cl-chat-row.cl-chat-user {
	justify-content: flex-end;
}

.cl-chat-row.cl-chat-bot {
	justify-content: flex-start;
}

.cl-chat-bubble {
	max-width: 82%;
	padding: 10px 13px;
	border-radius: 16px;
	font-size: 14.5px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}

.cl-chat-bot .cl-chat-bubble {
	background: #fff;
	color: #1f2937;
	border-bottom-left-radius: 5px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.cl-chat-user .cl-chat-bubble {
	background: #0d9488;
	color: #fff;
	border-bottom-right-radius: 5px;
}

.cl-chat-cta {
	padding: 4px 0 0;
	background: transparent;
	box-shadow: none;
	max-width: 100%;
}

.cl-chat-wa {
	display: block;
	width: 100%;
	text-align: center;
	background: #25d366;
	color: #06281a;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
	padding: 12px 14px;
	border-radius: 14px;
	box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
	transition: transform 0.15s ease, filter 0.15s ease;
}

.cl-chat-wa:hover {
	transform: translateY(-2px);
	filter: brightness(1.05);
}

.cl-chat-typing {
	display: flex;
	gap: 5px;
	padding: 12px 16px;
	background: #f4f7f7;
	align-items: center;
}

.cl-chat-typing[hidden] {
	display: none;
}

.cl-chat-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #94a3b8;
	animation: clChatBounce 1.3s infinite ease-in-out;
}

.cl-chat-typing span:nth-child(2) {
	animation-delay: 0.18s;
}

.cl-chat-typing span:nth-child(3) {
	animation-delay: 0.36s;
}

@keyframes clChatBounce {
	0%, 60%, 100% {
		transform: translateY(0);
		opacity: 0.5;
	}
	30% {
		transform: translateY(-5px);
		opacity: 1;
	}
}

.cl-chat-form {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px;
	background: #fff;
	border-top: 1px solid #e5e9ec;
}

.cl-chat-input {
	flex: 1 1 auto;
	min-width: 0;
	border: 1px solid #d6dde2;
	border-radius: 22px;
	padding: 11px 15px;
	font-size: 15px;
	font-family: inherit;
	outline: none;
	transition: border-color 0.15s ease;
}

.cl-chat-input:focus {
	border-color: #0d9488;
}

.cl-chat-send {
	width: 42px;
	height: 42px;
	flex: 0 0 auto;
	border: 0;
	border-radius: 50%;
	background: #0d9488;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, transform 0.15s ease;
}

.cl-chat-send:hover {
	background: #0f766e;
	transform: scale(1.06);
}

@media (max-width: 480px) {
	.cl-chat-root {
		right: 12px;
		bottom: 80px;
	}

	.cl-chat-root.cl-chat-pos-left {
		right: auto;
		left: 12px;
	}

	.cl-chat-toggle {
		gap: 8px;
	}

	.cl-chat-badge {
		width: 52px;
		height: 52px;
	}

	.cl-chat-badge-icon {
		width: 26px;
		height: 26px;
	}

	.cl-chat-label {
		padding: 5px 10px;
	}

	.cl-chat-label-top {
		font-size: 12.5px;
	}

	.cl-chat-label-bottom {
		font-size: 11px;
	}

	.cl-chat-panel {
		position: fixed;
		right: 10px;
		left: 10px;
		bottom: 84px;
		width: auto;
		max-width: none;
		height: 70vh;
		max-height: none;
		transform-origin: bottom center;
	}

	.cl-chat-root.cl-chat-pos-left .cl-chat-panel {
		left: 10px;
		right: 10px;
	}
}
