/* Starnet Live Chat — burbuja compacta */

.sn-chat {
	--sn-chat-size: 3.5rem;
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 99999;
	font-family: Outfit, Inter, system-ui, sans-serif;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.55rem;
	pointer-events: none;
}

.sn-chat > * {
	pointer-events: auto;
}

.sn-chat[hidden] {
	display: none !important;
}

/* Tip flotante pequeño (no el launcher) */
.sn-chat__tip {
	position: relative;
	max-width: min(15.5rem, calc(100vw - 5.5rem));
	padding: 0.55rem 0.7rem;
	border-radius: 14px 14px 4px 14px;
	border: 1px solid rgba(56, 189, 248, 0.35);
	background: rgba(7, 22, 36, 0.96);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
	color: #e2e8f0;
	font-size: 0.8rem;
	line-height: 1.35;
	animation: snChatTipIn 0.35s ease both;
}

.sn-chat__tip[hidden],
.sn-chat.is-open .sn-chat__tip {
	display: none !important;
}

.sn-chat__tip-close {
	position: absolute;
	top: 0.15rem;
	right: 0.25rem;
	width: 1.25rem;
	height: 1.25rem;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #94a3b8;
	font-size: 0.95rem;
	line-height: 1;
	cursor: pointer;
}

@keyframes snChatTipIn {
	from { opacity: 0; transform: translateY(8px) scale(0.96); }
	to { opacity: 1; transform: none; }
}

/* Launcher circular chico */
.sn-chat__bubble {
	position: relative;
	width: var(--sn-chat-size);
	height: var(--sn-chat-size);
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	display: grid;
	place-items: center;
	overflow: hidden;
	cursor: pointer;
	background: linear-gradient(145deg, #1d6fe8, #0a3a6b);
	box-shadow:
		0 10px 28px rgba(0, 0, 0, 0.45),
		0 0 0 2px rgba(255, 255, 255, 0.12),
		0 0 24px rgba(56, 189, 248, 0.45);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sn-chat__bubble:hover,
.sn-chat__bubble:focus-visible {
	transform: translateY(-2px) scale(1.04);
	box-shadow:
		0 14px 32px rgba(0, 0, 0, 0.5),
		0 0 0 2px rgba(255, 255, 255, 0.18),
		0 0 30px rgba(56, 189, 248, 0.55);
}

.sn-chat.is-open .sn-chat__bubble {
	display: none;
}

.sn-chat__bubble-logo {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
}

.sn-chat__bubble-logo img {
	width: 58%;
	height: 58%;
	object-fit: contain;
	display: block;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.sn-chat__bubble-copy {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.sn-chat__dot {
	position: absolute;
	top: 0.15rem;
	right: 0.15rem;
	width: 0.55rem;
	height: 0.55rem;
	border-radius: 50%;
	background: #22d3ee;
	box-shadow: 0 0 0 2px #0a3a6b, 0 0 10px rgba(34, 211, 238, 0.8);
	animation: snChatPulse 1.8s ease-in-out infinite;
}

@keyframes snChatPulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(0.85); opacity: 0.7; }
}

.sn-chat__panel {
	width: min(340px, calc(100vw - 1.5rem));
	height: min(460px, calc(100dvh - 5.5rem));
	display: flex;
	flex-direction: column;
	border-radius: 18px;
	overflow: hidden;
	border: 1px solid rgba(56, 189, 248, 0.28);
	background: linear-gradient(180deg, #071624, #02080f);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.sn-chat__panel[hidden] {
	display: none !important;
}

.sn-chat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 0.9rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(29, 111, 232, 0.18);
}

.sn-chat__head strong {
	display: block;
	font-size: 0.9rem;
	color: #fff;
}

.sn-chat__head span {
	font-size: 0.7rem;
	color: #7dd3fc;
}

.sn-chat__close {
	width: 1.85rem;
	height: 1.85rem;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
}

.sn-chat__body {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.sn-chat__hi {
	margin: 0 0 0.85rem;
	color: #e2e8f0;
	font-size: 0.9rem;
	line-height: 1.4;
}

.sn-chat__home,
.sn-chat__form {
	padding: 1rem;
}

.sn-chat__areas {
	display: grid;
	gap: 0.5rem;
}

.sn-chat__areas button,
.sn-chat__send-start {
	border: 1px solid rgba(56, 189, 248, 0.35);
	border-radius: 12px;
	padding: 0.7rem 0.9rem;
	background: rgba(29, 111, 232, 0.22);
	color: #fff;
	font-weight: 650;
	font-size: 0.9rem;
	cursor: pointer;
	transition: background 0.2s;
}

.sn-chat__areas button:hover,
.sn-chat__send-start:hover {
	background: rgba(29, 111, 232, 0.4);
}

.sn-chat__form label {
	display: grid;
	gap: 0.25rem;
	margin-bottom: 0.6rem;
	font-size: 0.72rem;
	font-weight: 600;
	color: #94a3b8;
}

.sn-chat__form input,
.sn-chat__form textarea,
.sn-chat__composer input {
	width: 100%;
	border: 1px solid rgba(148, 163, 184, 0.28);
	border-radius: 10px;
	padding: 0.6rem 0.7rem;
	background: rgba(2, 8, 15, 0.75);
	color: #fff;
	font: inherit;
}

.sn-chat__form textarea {
	resize: vertical;
	min-height: 4rem;
}

.sn-chat__back {
	display: inline-block;
	margin-top: 0.55rem;
	border: 0;
	background: transparent;
	color: #7dd3fc;
	cursor: pointer;
	font-size: 0.82rem;
}

.sn-chat__send-start {
	width: 100%;
	margin-top: 0.2rem;
}

.sn-chat__thread {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.sn-chat__messages {
	flex: 1;
	overflow-y: auto;
	padding: 0.8rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.sn-chat__msg {
	max-width: 85%;
	padding: 0.5rem 0.65rem;
	border-radius: 12px;
	font-size: 0.84rem;
	line-height: 1.4;
	color: #e2e8f0;
}

.sn-chat__msg small {
	display: block;
	margin-bottom: 0.12rem;
	font-size: 0.66rem;
	opacity: 0.7;
}

.sn-chat__msg--visitor {
	align-self: flex-end;
	background: rgba(29, 111, 232, 0.45);
	border: 1px solid rgba(56, 189, 248, 0.35);
}

.sn-chat__msg--agent {
	align-self: flex-start;
	background: rgba(15, 35, 55, 0.9);
	border: 1px solid rgba(148, 163, 184, 0.2);
}

.sn-chat__msg--system {
	align-self: center;
	max-width: 95%;
	background: transparent;
	color: #94a3b8;
	font-size: 0.72rem;
	text-align: center;
	padding: 0.2rem 0.4rem;
}

.sn-chat__composer {
	display: flex;
	gap: 0.4rem;
	padding: 0.65rem;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sn-chat__composer button {
	flex: 0 0 auto;
	width: 2.35rem;
	border: 0;
	border-radius: 10px;
	background: linear-gradient(135deg, #1d6fe8, #38bdf8);
	color: #fff;
	font-size: 0.95rem;
	cursor: pointer;
}

@media (max-width: 640px) {
	.sn-chat {
		right: 0.75rem;
		bottom: 0.75rem;
	}

	.sn-chat__panel {
		width: min(100vw - 1.25rem, 340px);
		height: min(68dvh, 440px);
	}
}
