.aspor-chatbot {
	--aspor-chatbot-color: #2563eb;
	position: fixed;
	bottom: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.aspor-chatbot--right {
	right: 20px;
}

.aspor-chatbot--left {
	left: 20px;
}

.aspor-chatbot__toggle {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: var(--aspor-chatbot-color);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
	transition: transform 0.15s ease;
}

.aspor-chatbot__toggle:hover {
	transform: scale(1.05);
}

.aspor-chatbot__toggle-icon {
	width: 28px;
	height: 28px;
}

img.aspor-chatbot__toggle-icon {
	border-radius: 50%;
	object-fit: cover;
}

.aspor-chatbot__modal {
	position: fixed;
	bottom: 96px;
	width: 360px;
	max-width: calc(100vw - 40px);
	height: 520px;
	max-height: calc(100vh - 140px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.aspor-chatbot--right .aspor-chatbot__modal {
	right: 0;
}

.aspor-chatbot--left .aspor-chatbot__modal {
	left: 0;
}

.aspor-chatbot__modal[hidden] {
	display: none;
}

.aspor-chatbot__header {
	background: var(--aspor-chatbot-color);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.aspor-chatbot__title {
	font-weight: 600;
	font-size: 15px;
}

.aspor-chatbot__close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
}

.aspor-chatbot__messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f7f8;
}

.aspor-chatbot__bubble {
	max-width: 80%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.4;
	word-wrap: break-word;
	white-space: pre-wrap;
}

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

.aspor-chatbot__bubble--bot {
	align-self: flex-start;
	background: #fff;
	color: #1f2937;
	border: 1px solid #e5e7eb;
	border-bottom-left-radius: 4px;
}

.aspor-chatbot__bubble--error {
	align-self: flex-start;
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.aspor-chatbot__bubble a {
	color: inherit;
	text-decoration: underline;
	word-break: break-word;
	overflow-wrap: anywhere;
}

.aspor-chatbot__bubble--bot a {
	color: var(--aspor-chatbot-color);
}

.aspor-chatbot__bubble--bot code {
	background: #f3f4f6;
	padding: 1px 5px;
	border-radius: 4px;
	font-size: 0.9em;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.aspor-chatbot__bubble--bot strong {
	font-weight: 600;
}

.aspor-chatbot__typing {
	display: flex;
	gap: 4px;
	padding: 0 16px 8px;
	flex-shrink: 0;
}

.aspor-chatbot__typing[hidden] {
	display: none;
}

.aspor-chatbot__typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9ca3af;
	animation: aspor-chatbot-bounce 1.2s infinite ease-in-out;
}

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

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

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

.aspor-chatbot__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #e5e7eb;
	background: #fff;
	flex-shrink: 0;
}

.aspor-chatbot__input {
	flex: 1;
	resize: none;
	max-height: 100px;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	padding: 8px 12px;
	font-size: 14px;
	font-family: inherit;
	line-height: 1.4;
}

.aspor-chatbot__input:focus {
	outline: none;
	border-color: var(--aspor-chatbot-color);
}

.aspor-chatbot__send {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: none;
	background: var(--aspor-chatbot-color);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
}

.aspor-chatbot__send:disabled {
	opacity: 0.6;
	cursor: default;
}

@media (max-width: 480px) {
	.aspor-chatbot__modal {
		width: calc(100vw - 24px);
		height: calc(100vh - 110px);
		bottom: 86px;
	}

	.aspor-chatbot--right {
		right: 12px;
	}

	.aspor-chatbot--left {
		left: 12px;
	}
}

/* Negritas y cursivas: se fuerzan para que el tema del sitio no las anule. */
#aspor-chatbot-widget .aspor-chatbot__bubble b,
#aspor-chatbot-widget .aspor-chatbot__bubble strong {
	font-weight: 700 !important;
}

#aspor-chatbot-widget .aspor-chatbot__bubble em,
#aspor-chatbot-widget .aspor-chatbot__bubble i {
	font-style: italic !important;
}
