@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

#aclc-chat {
	--aclc-color: #2563eb;
	--aclc-radio: 16px;
	--aclc-offset: 20px;
	--aclc-sombra: 0 10px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
	position: fixed;
	top: auto;
	right: auto;
	bottom: auto;
	left: auto;
	z-index: 2147483000;
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

#aclc-chat * {
	box-sizing: border-box;
}

/* ---------- Posición (esquina) ---------- */

#aclc-chat.aclc-pos-abajo-derecha {
	right: var(--aclc-offset);
	bottom: var(--aclc-offset);
}

#aclc-chat.aclc-pos-abajo-izquierda {
	left: var(--aclc-offset);
	bottom: var(--aclc-offset);
}

#aclc-chat.aclc-pos-arriba-derecha {
	right: var(--aclc-offset);
	top: var(--aclc-offset);
}

#aclc-chat.aclc-pos-arriba-izquierda {
	left: var(--aclc-offset);
	top: var(--aclc-offset);
}

/* ---------- Botón flotante (FAB) ---------- */

.aclc-fab {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--aclc-color);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 14px 20px;
	cursor: pointer;
	box-shadow: var(--aclc-sombra);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	max-width: 260px;
}

.aclc-fab:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 46px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.1);
}

.aclc-fab:active {
	transform: translateY(0);
}

.aclc-fab img,
.aclc-fab svg {
	width: 24px;
	height: 24px;
	flex: none;
	border-radius: 50%;
	object-fit: cover;
}

/* ---------- Forma del botón: círculo (solo icono) ---------- */

.aclc-forma-circulo .aclc-fab {
	width: 60px;
	height: 60px;
	padding: 0;
	justify-content: center;
	border-radius: 50%;
}

.aclc-forma-circulo .aclc-fab img,
.aclc-forma-circulo .aclc-fab svg {
	width: 28px;
	height: 28px;
}

.aclc-fab-texto {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
}

#aclc-chat.is-open .aclc-fab {
	transform: scale(0.001);
	width: 0;
	height: 0;
	padding: 0;
	opacity: 0;
	pointer-events: none;
	position: absolute;
}

/* ---------- Burbuja de bienvenida ---------- */

.aclc-popup {
	position: absolute;
	right: 0;
	bottom: calc(100% + 14px);
	width: 280px;
	background: #fff;
	border-radius: var(--aclc-radio);
	box-shadow: var(--aclc-sombra);
	padding: 14px;
	display: flex;
	gap: 10px;
	align-items: flex-start;
	animation: aclc-popup-in 0.28s ease;
}

.aclc-pos-abajo-izquierda .aclc-popup,
.aclc-pos-arriba-izquierda .aclc-popup {
	right: auto;
	left: 0;
}

.aclc-pos-arriba-derecha .aclc-popup,
.aclc-pos-arriba-izquierda .aclc-popup {
	bottom: auto;
	top: calc(100% + 14px);
}

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

.aclc-popup img {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	flex: none;
}

.aclc-popup-texto {
	flex: 1;
	color: #1f2430;
}

.aclc-popup-cerrar {
	position: absolute;
	top: 6px;
	right: 8px;
	border: none;
	background: transparent;
	color: #9aa1ae;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
}

.aclc-popup-cerrar:hover {
	color: #4b5261;
}

/* ---------- Ventana de chat ---------- */

.aclc-ventana {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 380px;
	height: 600px;
	max-height: calc(100vh - 40px);
	background: #fff;
	border-radius: var(--aclc-radio);
	box-shadow: var(--aclc-sombra);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px) scale(0.98);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

#aclc-chat.is-open .aclc-ventana {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.aclc-pos-abajo-izquierda .aclc-ventana,
.aclc-pos-arriba-izquierda .aclc-ventana {
	right: auto;
	left: 0;
}

.aclc-pos-arriba-derecha .aclc-ventana,
.aclc-pos-arriba-izquierda .aclc-ventana {
	bottom: auto;
	top: 0;
}

/* ---------- Tamaño de la ventana ---------- */

.aclc-size-compacta .aclc-ventana {
	width: 320px;
	height: 480px;
}

.aclc-size-normal .aclc-ventana {
	width: 380px;
	height: 600px;
}

.aclc-size-grande .aclc-ventana {
	width: 440px;
	height: 680px;
}

.aclc-header {
	background: var(--aclc-color);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
	flex: none;
}

.aclc-header img {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	object-fit: cover;
	flex: none;
	background: rgba(255, 255, 255, 0.2);
}

.aclc-header-titulo {
	flex: 1;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.aclc-header-cerrar {
	border: none;
	background: transparent;
	color: #fff;
	opacity: 0.85;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 6px;
	border-radius: 6px;
}

.aclc-header-cerrar:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.14);
}

/* ---------- Mensajes ---------- */

.aclc-mensajes {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f8fa;
}

.aclc-msg {
	max-width: 82%;
	padding: 10px 14px;
	border-radius: 16px;
	white-space: pre-wrap;
	word-wrap: break-word;
	animation: aclc-msg-in 0.18s ease;
}

@keyframes aclc-msg-in {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.aclc-msg--user {
	align-self: flex-end;
	background: var(--aclc-color);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.aclc-msg--bot {
	align-self: flex-start;
	background: #fff;
	color: #1f2430;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.aclc-msg--bot a {
	color: var(--aclc-color);
	word-break: break-word;
}

/* ---------- Acciones dentro de una respuesta del bot (carrito) ---------- */

.aclc-acciones {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 8px 0 2px;
}

.aclc-btn-carrito {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: none;
	background: var(--aclc-color);
	color: #fff;
	border-radius: 999px;
	padding: 8px 14px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.aclc-icono-carrito,
.aclc-icono-check {
	width: 15px;
	height: 15px;
	flex: none;
}

.aclc-btn-carrito:disabled {
	cursor: default;
}

.aclc-btn-carrito.is-cargando {
	opacity: 0.65;
}

.aclc-btn-carrito.is-hecho {
	background: #16a34a;
	opacity: 1;
}

.aclc-btn-producto,
.aclc-ver-carrito {
	font-size: 13px;
	font-weight: 600;
	color: var(--aclc-color);
	text-decoration: none;
	padding: 8px 4px;
}

.aclc-btn-producto:hover,
.aclc-ver-carrito:hover {
	text-decoration: underline;
}

.aclc-msg--error {
	align-self: center;
	background: #fef2f2;
	color: #991b1b;
	text-align: center;
	font-size: 13px;
}

.aclc-reintentar {
	display: inline-block;
	margin-top: 6px;
	border: none;
	background: #991b1b;
	color: #fff;
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 12px;
	cursor: pointer;
}

/* ---------- Indicador "escribiendo..." ---------- */

.aclc-typing {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	padding: 12px 14px;
	background: #fff;
	border-radius: 16px;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.aclc-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #b7bdc9;
	animation: aclc-typing-bounce 1.1s infinite ease-in-out;
}

.aclc-typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.aclc-typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes aclc-typing-bounce {
	0%, 60%, 100% {
		transform: translateY(0);
		opacity: 0.5;
	}
	30% {
		transform: translateY(-4px);
		opacity: 1;
	}
}

/* ---------- Entrada ---------- */

.aclc-input-row {
	flex: none;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid #eceef1;
	background: #fff;
}

.aclc-input {
	flex: 1;
	resize: none;
	border: 1px solid #dde1e7;
	border-radius: 14px;
	padding: 10px 14px;
	font: inherit;
	max-height: 100px;
	outline: none;
	transition: border-color 0.15s ease;
}

.aclc-input:focus {
	border-color: var(--aclc-color);
}

.aclc-enviar {
	flex: none;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: var(--aclc-color);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.15s ease;
}

.aclc-enviar:disabled {
	opacity: 0.5;
	cursor: default;
}

.aclc-enviar svg {
	width: 18px;
	height: 18px;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
	/* En móvil se fuerza siempre "abajo, ancho completo", sea cual sea la
	   esquina configurada — evita que el chat quede inusable o tapado por
	   otros elementos en pantallas pequeñas. */
	#aclc-chat,
	#aclc-chat.aclc-pos-abajo-derecha,
	#aclc-chat.aclc-pos-abajo-izquierda,
	#aclc-chat.aclc-pos-arriba-derecha,
	#aclc-chat.aclc-pos-arriba-izquierda {
		top: auto;
		right: 12px;
		bottom: 12px;
		left: 12px;
	}

	.aclc-ventana,
	.aclc-pos-abajo-izquierda .aclc-ventana,
	.aclc-pos-arriba-derecha .aclc-ventana,
	.aclc-pos-arriba-izquierda .aclc-ventana {
		width: 100%;
		height: calc(100vh - 90px);
		right: 0;
		left: auto;
		bottom: 0;
		top: auto;
	}

	.aclc-popup,
	.aclc-pos-abajo-izquierda .aclc-popup,
	.aclc-pos-arriba-derecha .aclc-popup,
	.aclc-pos-arriba-izquierda .aclc-popup {
		width: 100%;
		right: 0;
		left: auto;
		bottom: calc(100% + 14px);
		top: auto;
	}
}
