.cbc-chatbot {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 9999;
}

.cbc-chatbot__boton {
	display: flex;
	align-items: center;
	justify-content: center;

	width: 60px;
	height: 60px;
	padding: 0;

	border: 1px solid rgba(255, 255, 255, 0.42);
	border-radius: 50%;

	background:
		linear-gradient(
			135deg,
			rgba(159, 96, 57, 0.96),
			rgba(126, 75, 45, 0.98)
		);

	-webkit-backdrop-filter: blur(14px) saturate(120%);
	backdrop-filter: blur(14px) saturate(120%);

	color: #ffffff;
	font-size: 28px;
	line-height: 1;

	box-shadow:
		0 4px 12px rgba(80, 49, 29, 0.14),
		0 14px 34px rgba(80, 49, 29, 0.18);

	cursor: pointer;

	transition:
		transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
		border-color 240ms cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 240ms cubic-bezier(0.22, 1, 0.36, 1),
		filter 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cbc-chatbot__boton:hover,
.cbc-chatbot__boton:focus-visible {
	transform: translateY(-2px) scale(1.03);

	border-color: rgba(255, 255, 255, 0.62);

	filter: brightness(1.05);

	box-shadow:
		0 6px 16px rgba(80, 49, 29, 0.16),
		0 18px 42px rgba(80, 49, 29, 0.22);
}

.cbc-chatbot__boton:active {
	transform: translateY(0) scale(0.97);

	box-shadow:
		0 3px 8px rgba(80, 49, 29, 0.14),
		0 8px 22px rgba(80, 49, 29, 0.16);
}

.cbc-chatbot__boton:focus-visible {
	outline: 3px solid rgba(139, 91, 59, 0.18);
	outline-offset: 4px;
}

.cbc-chatbot__icono-abrir {
	display: block;
	flex-shrink: 0;
}

.cbc-chatbot__ventana {
	position: absolute;
	right: 0;
	bottom: 84px;

	display: flex;
	flex-direction: column;

	width: 360px;
	max-width: calc(100vw - 32px);
	max-height: min(620px, calc(100dvh - 180px));

	overflow: hidden;

	border: 1px solid rgba(255, 255, 255, 0.72);
	border-radius: 22px;

	background: rgba(255, 253, 249, 0.9);

	-webkit-backdrop-filter: blur(24px) saturate(125%);
	backdrop-filter: blur(24px) saturate(125%);

	color: var(--cbc-color-text);

	box-shadow:
		0 2px 8px rgba(73, 48, 31, 0.04),
		0 16px 42px rgba(73, 48, 31, 0.1),
		0 30px 70px rgba(73, 48, 31, 0.08);

	transform-origin: right bottom;
}

.cbc-chatbot__ventana--abierta {
	animation:
		cbc-aparecer-ventana 280ms
		cubic-bezier(0.22, 1, 0.36, 1)
		both;
}

.cbc-chatbot__ventana--cerrando {
	pointer-events: none;

	animation:
		cbc-cerrar-ventana 220ms
		cubic-bezier(0.4, 0, 1, 1)
		both;
}

.cbc-chatbot__cabecera {
	position: relative;

	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;

	width: 100%;
	min-height: 88px;
	padding: 20px 58px;

	border-bottom: 1px solid rgba(255, 255, 255, 0.2);

	background:
		linear-gradient(
			135deg,
			rgba(151, 91, 54, 0.96),
			rgba(120, 70, 42, 0.98)
		);

	-webkit-backdrop-filter: blur(16px) saturate(120%);
	backdrop-filter: blur(16px) saturate(120%);

	color: #ffffff;
	text-align: center;
}

.cbc-chatbot__marca {
	display: flex;
	align-items: center;
	justify-content: center;

	width: 100%;
	min-width: 0;
}

.cbc-chatbot__titulo {
	margin: 0;
	color: inherit;
}

.cbc-chatbot__titulo.cbc-chatbot__logotipo {
	color: #ffffff;

	font-family:
		Arial,
		Helvetica,
		sans-serif;

	font-size: 25px;
	font-weight: 800;
	letter-spacing: -0.055em;
	line-height: 1;
	text-align: center;
	text-transform: lowercase;
}

.cbc-chatbot__logotipo sup {
	position: relative;
	top: -0.48em;

	display: inline-block;

	margin-left: 2px;

	font-size: 7px;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1;
	vertical-align: baseline;
}

.cbc-chatbot__cerrar {
	position: absolute;
	top: 12px;
	right: 12px;

	display: flex;
	align-items: center;
	justify-content: center;

	width: 36px;
	height: 36px;
	padding: 0;

	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 50%;

	background: rgba(255, 255, 255, 0.08);
	color: #ffffff;

	font-size: 20px;
	line-height: 1;

	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.12),
		0 4px 12px rgba(73, 48, 31, 0.08);

	cursor: pointer;

	transition:
		transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
		background-color 200ms ease,
		border-color 200ms ease,
		box-shadow 200ms ease;
}

.cbc-chatbot__cerrar svg {
	display: block;
	flex-shrink: 0;
}

.cbc-chatbot__cerrar:hover,
.cbc-chatbot__cerrar:focus-visible {
	transform: scale(1.05);

	border-color: rgba(255, 255, 255, 0.34);
	background: rgba(255, 255, 255, 0.16);

	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.18),
		0 6px 16px rgba(73, 48, 31, 0.12);
}

.cbc-chatbot__cerrar:active {
	transform: scale(0.94);
}

.cbc-chatbot__cerrar:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.22);
	outline-offset: 2px;
}

.cbc-chatbot__contenido {
	flex: 1;
	min-height: 0;

	padding: 22px;

	overflow-y: auto;
	overscroll-behavior: contain;

	background:
		linear-gradient(
			180deg,
			rgba(255, 255, 255, 0.42),
			rgba(255, 252, 247, 0.3)
		);

	text-align: center;

	scrollbar-width: thin;
	scrollbar-color:
		rgba(139, 91, 59, 0.35)
		transparent;
}

.cbc-chatbot__contenido p {
	margin: 0 0 12px;

	color: var(--cbc-color-text);

	line-height: 1.6;
	text-align: center;
}

.cbc-chatbot__contenido p:last-child {
	margin-bottom: 0;
}

.cbc-chatbot__contenido::-webkit-scrollbar {
	width: 7px;
}

.cbc-chatbot__contenido::-webkit-scrollbar-track {
	background: transparent;
}

.cbc-chatbot__contenido::-webkit-scrollbar-thumb {
	border: 2px solid transparent;
	border-radius: 999px;

	background: rgba(139, 91, 59, 0.32);
	background-clip: padding-box;
}

.cbc-chatbot__contenido::-webkit-scrollbar-thumb:hover {
	background: rgba(139, 91, 59, 0.48);
	background-clip: padding-box;
}

.cbc-chatbot__pantalla:not([hidden]) {
	animation:
		cbc-aparecer-pantalla 260ms
		cubic-bezier(0.22, 1, 0.36, 1)
		both;
}

@keyframes cbc-aparecer-ventana {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.97);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes cbc-cerrar-ventana {
	from {
		opacity: 1;
		transform: translateY(0) scale(1);
	}

	to {
		opacity: 0;
		transform: translateY(10px) scale(0.98);
	}
}

@keyframes cbc-aparecer-pantalla {
	from {
		opacity: 0;
		transform: translateY(7px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cbc-chatbot__boton,
	.cbc-chatbot__cerrar {
		transition: none;
	}

	.cbc-chatbot__ventana--abierta,
	.cbc-chatbot__ventana--cerrando,
	.cbc-chatbot__pantalla:not([hidden]) {
		animation: none;
	}

	.cbc-chatbot__boton:hover,
	.cbc-chatbot__boton:focus-visible,
	.cbc-chatbot__boton:active,
	.cbc-chatbot__cerrar:hover,
	.cbc-chatbot__cerrar:focus-visible,
	.cbc-chatbot__cerrar:active {
		transform: none;
	}
}