/* ==========================================================================
   NellyBot — Widget de chat flotante
   Ajusta los colores de marca aquí en :root
   ========================================================================== */

#nellybot {
	/* --nellybot-primary lo inyecta PHP desde el setting "color principal".
	   Colores oficiales de Nelly: naranja #ED7302 + negro. */
	--nb-primary: var(--nellybot-primary, #ED7302);
	--nb-primary-dark: color-mix(in srgb, var(--nb-primary) 80%, black);
	--nb-accent: #ED7302;           /* Acento (botón enviar / detalles) */
	--nb-bg: #0e1424;               /* Fondo base (oscuro) */
	--nb-bot-bubble: rgba(255, 255, 255, 0.07); /* Burbuja del bot (glass) */
	--nb-user-bubble: var(--nb-primary);
	--nb-text: #eef1f6;             /* Texto principal (claro) */
	--nb-muted: rgba(255, 255, 255, 0.55); /* Texto secundario */
	--nb-radius: 18px;
	--nb-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);

	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Aislamiento del tema (reset dirigido)
   Neutralizamos SOLO las propiedades que un tema de WordPress suele inyectar
   en botones, inputs, enlaces, etc. (tipografía, fondos, bordes, sombras,
   transformaciones de texto…). No usamos `all` para no romper el layout.
   Todas nuestras reglas van prefijadas con #nellybot para ganar en
   especificidad tanto a este reset como a las reglas del tema.
   -------------------------------------------------------------------------- */
#nellybot *,
#nellybot *::before,
#nellybot *::after {
	box-sizing: border-box;
}

#nellybot div,
#nellybot span,
#nellybot p,
#nellybot a,
#nellybot strong,
#nellybot header,
#nellybot form,
#nellybot button,
#nellybot input,
#nellybot svg,
#nellybot path {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	outline: none;
	text-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	text-align: left;
	font-family: inherit;
	font-weight: 400;
	font-style: normal;
	line-height: 1.4;
	text-decoration: none;
	float: none;
	min-width: 0;
	min-height: 0;
	vertical-align: baseline;
}

#nellybot button {
	cursor: pointer;
	color: inherit;
	-webkit-appearance: none;
	appearance: none;
}

#nellybot input {
	color: inherit;
	-webkit-appearance: none;
	appearance: none;
}

/* --------------------------------------------------------------------------
   Botón flotante (launcher) — se expande en píldora para el mensaje proactivo
   -------------------------------------------------------------------------- */
#nellybot .nellybot__launcher {
	position: relative;
	width: 66px;
	height: 66px;
	border: none;
	border-radius: 999px;
	/* Color sólido de marca (sin degradado) */
	background: var(--nb-primary);
	color: #fff;
	cursor: pointer;
	box-shadow:
		0 10px 26px rgba(0, 0, 0, 0.30),
		0 6px 16px color-mix(in srgb, var(--nb-primary) 45%, transparent),
		inset 0 1px 0 rgba(255, 255, 255, 0.32),
		inset 0 -2px 6px rgba(0, 0, 0, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-left: auto;
	overflow: hidden;
	white-space: nowrap;
	transition: width 0.3s ease, padding 0.3s ease, transform 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.28), box-shadow 0.25s ease;
}

/* Reflejo de luz superior sutil (da volumen sin parche blanco) */
#nellybot .nellybot__launcher::before {
	content: "";
	position: absolute;
	left: 18%;
	right: 18%;
	top: 8%;
	height: 34%;
	border-radius: 50%;
	background: radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 70%);
	pointer-events: none;
	z-index: 0;
}

#nellybot .nellybot__launcher:hover {
	transform: translateY(-3px) scale(1.05);
	box-shadow:
		0 16px 34px rgba(0, 0, 0, 0.34),
		0 10px 24px color-mix(in srgb, var(--nb-primary) 55%, transparent),
		inset 0 1px 0 rgba(255, 255, 255, 0.4),
		inset 0 -2px 6px rgba(0, 0, 0, 0.18);
}

#nellybot .nellybot__launcher:active {
	transform: translateY(-1px) scale(0.99);
}

#nellybot .nellybot__launcher:focus-visible {
	outline: 3px solid var(--nb-accent);
	outline-offset: 3px;
}

/* Anillo pulsante: un halo que late para llamar la atención mientras el
   chat está cerrado (se pausa al abrir o al mostrar el mensaje proactivo). */
#nellybot:not(.is-open):not(.is-teasing) .nellybot__launcher {
	animation: nb-pulse 2.4s ease-out infinite;
}

@keyframes nb-pulse {
	0% {
		box-shadow:
			0 10px 26px rgba(0, 0, 0, 0.30),
			0 6px 16px color-mix(in srgb, var(--nb-primary) 45%, transparent),
			inset 0 1px 0 rgba(255, 255, 255, 0.32),
			inset 0 -2px 6px rgba(0, 0, 0, 0.18),
			0 0 0 0 color-mix(in srgb, var(--nb-primary) 50%, transparent);
	}
	70% {
		box-shadow:
			0 10px 26px rgba(0, 0, 0, 0.30),
			0 6px 16px color-mix(in srgb, var(--nb-primary) 45%, transparent),
			inset 0 1px 0 rgba(255, 255, 255, 0.32),
			inset 0 -2px 6px rgba(0, 0, 0, 0.18),
			0 0 0 16px transparent;
	}
	100% {
		box-shadow:
			0 10px 26px rgba(0, 0, 0, 0.30),
			0 6px 16px color-mix(in srgb, var(--nb-primary) 45%, transparent),
			inset 0 1px 0 rgba(255, 255, 255, 0.32),
			inset 0 -2px 6px rgba(0, 0, 0, 0.18),
			0 0 0 0 transparent;
	}
}

#nellybot .nellybot__launcher .nellybot__icon-open,
#nellybot .nellybot__launcher .nellybot__icon-close {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28));
}

#nellybot .nellybot__launcher .nellybot__icon-open {
	animation: nb-launch-bob 3.2s ease-in-out infinite;
}

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

#nellybot .nellybot__launcher .nellybot__icon-close {
	display: none;
}

/* Texto del mensaje proactivo, integrado en el propio botón */
#nellybot .nellybot__launcher-label {
	position: relative;
	z-index: 1;
	max-width: 0;
	opacity: 0;
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	transition: max-width 0.32s ease, opacity 0.25s ease, margin 0.32s ease;
}

#nellybot.is-teasing .nellybot__launcher {
	width: auto;
	padding: 0 20px;
}

#nellybot.is-teasing .nellybot__launcher-label {
	max-width: 220px;
	opacity: 1;
	margin-right: 12px;
}

/* --------------------------------------------------------------------------
   Asistente proactivo (globo de diálogo estilo "Clippy")
   -------------------------------------------------------------------------- */
#nellybot .nellybot__pop {
	position: absolute;
	right: 0;
	bottom: 84px;
	width: 270px;
	max-width: calc(100vw - 32px);
	background: linear-gradient(165deg, #18203a 0%, #121829 100%);
	color: var(--nb-text);
	border: 1px solid rgba(255, 255, 255, 0.10);
	border-radius: 16px;
	box-shadow: var(--nb-shadow);
	padding: 14px;
	display: flex;
	gap: 11px;
	align-items: flex-start;
	opacity: 0;
	transform: translateY(12px) scale(0.96);
	transform-origin: bottom right;
	transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.18, 0.89, 0.32, 1.28);
	pointer-events: none;
}

#nellybot .nellybot__pop.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	animation: nb-pop-wiggle 2.4s ease 0.5s 2;
}

#nellybot.is-open .nellybot__pop {
	display: none;
}

/* Pico apuntando al botón flotante */
#nellybot .nellybot__pop::after {
	content: "";
	position: absolute;
	right: 26px;
	bottom: -6px;
	width: 16px;
	height: 16px;
	background: #121829;
	border-right: 1px solid rgba(255, 255, 255, 0.10);
	border-bottom: 1px solid rgba(255, 255, 255, 0.10);
	transform: rotate(45deg);
}

#nellybot .nellybot__pop-avatar {
	position: relative;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	flex-shrink: 0;
	background: var(--nb-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 18px;
	animation: nb-pop-bob 2.6s ease-in-out infinite;
}

/* Punto "en línea" del avatar */
#nellybot .nellybot__pop-dot {
	position: absolute;
	right: -1px;
	bottom: -1px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #3ddc84;
	border: 2px solid #161d30;
	box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
	animation: nb-dot-pulse 1.8s ease-out infinite;
}

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

@keyframes nb-dot-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55); }
	70%  { box-shadow: 0 0 0 7px rgba(61, 220, 132, 0); }
	100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

#nellybot .nellybot__pop-body {
	flex: 1;
	min-width: 0;
}

#nellybot .nellybot__pop-text {
	font-size: 13.5px;
	line-height: 1.45;
	margin-bottom: 10px;
}

#nellybot .nellybot__pop-cta {
	border: none;
	background: var(--nb-primary);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	padding: 7px 16px;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.15s ease;
}

#nellybot .nellybot__pop-cta:hover {
	background: var(--nb-primary-dark);
	transform: translateY(-1px);
}

#nellybot .nellybot__pop-close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 20px;
	height: 20px;
	border: none;
	background: transparent;
	color: var(--nb-muted);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

#nellybot .nellybot__pop-close:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

@keyframes nb-pop-wiggle {
	0%, 100% { transform: translateY(0) rotate(0); }
	25% { transform: translateY(-3px) rotate(-2deg); }
	75% { transform: translateY(-3px) rotate(2deg); }
}

/* Estado abierto: el launcher muestra la X y se contrae a círculo */
#nellybot.is-open .nellybot__launcher .nellybot__icon-open {
	display: none;
}

#nellybot.is-open .nellybot__launcher .nellybot__icon-close {
	display: flex;
}

/* --------------------------------------------------------------------------
   Panel del chat
   -------------------------------------------------------------------------- */
#nellybot .nellybot__panel {
	position: absolute;
	right: 0;
	bottom: 78px;
	width: 370px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 120px);
	background:
		radial-gradient(120% 80% at 50% -10%, #1c2747 0%, rgba(28, 39, 71, 0) 55%),
		linear-gradient(165deg, #0b1020 0%, #131a2e 55%, #0e1424 100%);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--nb-radius);
	box-shadow: var(--nb-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;

	/* Oculto por defecto */
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

#nellybot.is-open .nellybot__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

/* --------------------------------------------------------------------------
   Encabezado
   -------------------------------------------------------------------------- */
#nellybot .nellybot__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: rgba(255, 255, 255, 0.04);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: #fff;
}

#nellybot .nellybot__avatar {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--nb-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 18px;
	flex-shrink: 0;
	box-shadow: 0 4px 12px color-mix(in srgb, var(--nb-primary) 45%, transparent);
}

#nellybot .nellybot__heading {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
	flex: 1; /* empuja botones de acción (WhatsApp, cerrar) a la derecha */
	min-width: 0;
}

#nellybot .nellybot__heading strong {
	font-size: 15px;
	font-weight: 700;
}

#nellybot .nellybot__status {
	font-size: 12px;
	opacity: 0.85;
	display: flex;
	align-items: center;
	gap: 6px;
}

#nellybot .nellybot__status::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #3ddc84;
	display: inline-block;
}

/* Botón WhatsApp en el header — siempre visible si hay número configurado */
#nellybot .nellybot__wa {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #25D366;
	color: #fff;
	text-decoration: none;
	transition: transform 0.15s ease, background 0.15s ease;
	flex-shrink: 0;
}

#nellybot .nellybot__wa:hover {
	background: #1ebe57;
	transform: scale(1.06);
	color: #fff;
}

#nellybot .nellybot__wa:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.6);
	outline-offset: 2px;
}

#nellybot .nellybot__close {
	background: transparent;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 4px;
	border-radius: 8px;
	display: flex;
	opacity: 0.85;
	transition: opacity 0.2s ease, background 0.2s ease;
	flex-shrink: 0;
}

#nellybot .nellybot__close:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.15);
}

/* --------------------------------------------------------------------------
   Mensajes
   -------------------------------------------------------------------------- */
#nellybot .nellybot__messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: transparent;
}

#nellybot .nellybot__msg {
	max-width: 80%;
	padding: 10px 14px;
	border-radius: 16px;
	word-wrap: break-word;
	white-space: pre-wrap;
	animation: nb-pop 0.18s ease;
	/* Las burbujas NUNCA se encogen: si el contenido desborda, el contenedor
	   hace scroll. Sin esto, al haber muchos mensajes los items flex se
	   comprimen por debajo de su contenido y se enciman. */
	flex: 0 0 auto;
}

#nellybot .nellybot__msg--bot {
	align-self: flex-start;
	background: var(--nb-bot-bubble);
	color: var(--nb-text);
	border: 1px solid rgba(255, 255, 255, 0.10);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	border-bottom-left-radius: 4px;
}

#nellybot .nellybot__msg--user {
	align-self: flex-end;
	background: linear-gradient(135deg, var(--nb-primary), var(--nb-primary-dark));
	color: #fff;
	border-bottom-right-radius: 4px;
	box-shadow: 0 4px 14px color-mix(in srgb, var(--nb-primary) 35%, transparent);
}

/* Texto del mensaje (envuelto en span para que el timestamp quede abajo) */
#nellybot .nellybot__msg-text {
	display: block;
	white-space: pre-wrap;
	word-wrap: break-word;
}

/* Links dentro de las burbujas (reseñas, WhatsApp, etc.) */
#nellybot .nellybot__link {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-all; /* URLs largas no rompen el layout */
	font-weight: 600;
	transition: opacity 0.15s ease;
}

#nellybot .nellybot__link:hover {
	opacity: 0.75;
}

/* En burbuja del bot el link va en el color principal de la marca */
#nellybot .nellybot__msg--bot .nellybot__link {
	color: var(--nb-primary);
}

/* En burbuja del usuario (fondo color), el link queda en blanco visible */
#nellybot .nellybot__msg--user .nellybot__link {
	color: #fff;
	text-decoration-color: rgba(255, 255, 255, 0.6);
}

/* Hora del mensaje (estilo discreto, alineado a la derecha) */
#nellybot .nellybot__time {
	display: block;
	font-size: 10.5px;
	margin-top: 4px;
	text-align: right;
	line-height: 1;
	letter-spacing: 0.02em;
}

#nellybot .nellybot__msg--bot .nellybot__time {
	color: var(--nb-muted);
	opacity: 0.85;
}

#nellybot .nellybot__msg--user .nellybot__time {
	color: rgba(255, 255, 255, 0.85);
}

/* Enlaces dentro de las burbujas (reseñas Google, etc.) */
#nellybot .nellybot__msg-text a {
	text-decoration: underline;
	font-weight: 600;
	word-break: break-word;
}

#nellybot .nellybot__msg--bot .nellybot__msg-text a {
	color: var(--nb-primary);
}

#nellybot .nellybot__msg--user .nellybot__msg-text a {
	color: #fff;
}

#nellybot .nellybot__msg-text a:hover {
	opacity: 0.85;
}

@keyframes nb-pop {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Indicador de escritura */
#nellybot .nellybot__typing {
	align-self: flex-start;
	background: var(--nb-bot-bubble);
	padding: 12px 16px;
	border-radius: 16px;
	border-bottom-left-radius: 4px;
	display: flex;
	gap: 4px;
	flex: 0 0 auto;
}

#nellybot .nellybot__typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--nb-muted);
	animation: nb-bounce 1.2s infinite ease-in-out;
}

#nellybot .nellybot__typing span:nth-child(2) { animation-delay: 0.15s; }
#nellybot .nellybot__typing span:nth-child(3) { animation-delay: 0.3s; }

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

/* --------------------------------------------------------------------------
   Respuestas rápidas (quick replies)
   -------------------------------------------------------------------------- */
#nellybot .nellybot__quick {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 16px 8px;
	background: transparent;
}

#nellybot .nellybot__quick:empty {
	display: none;
}

#nellybot .nellybot__chip {
	border: 1px solid color-mix(in srgb, var(--nb-primary) 45%, transparent);
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
	padding: 7px 14px;
	border-radius: 999px;
	font-size: 13px;
	cursor: pointer;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

#nellybot .nellybot__chip:hover {
	background: var(--nb-primary);
	border-color: var(--nb-primary);
	color: #fff;
	transform: translateY(-1px);
}

/* Botón de WhatsApp dentro del chat (handoff a humano) */
#nellybot .nellybot__wa-cta-wrap {
	display: flex;
	justify-content: flex-start;
	margin-top: 2px;
	padding: 18px  0px !important;
}
#nellybot-messages > div.nellybot__wa-cta-wrap > a {
	padding: 18px  30px !important;
}

#nellybot .nellybot__wa-cta {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	background: #25D366;
	color: #fff;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 18px;
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
	transition: background 0.2s ease, transform 0.15s ease;
}

#nellybot .nellybot__wa-cta:hover {
	background: #1ebe57;
	color: #fff;
	transform: translateY(-1px);
}

#nellybot .nellybot__wa-cta svg {
	flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Formulario de entrada
   -------------------------------------------------------------------------- */
#nellybot .nellybot__form {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.03);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

#nellybot .nellybot__input {
	flex: 1;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 999px;
	padding: 12px 16px;
	font-size: 14px;
	outline: none;
	/* !important para ganarle a temas de WordPress que fuerzan input blanco */
	background: #1a2236 !important;
	color: #ffffff !important;
	-webkit-text-fill-color: #ffffff;
	caret-color: var(--nb-primary);
	transition: border-color 0.2s ease, background 0.2s ease;
}

#nellybot .nellybot__input::placeholder {
	color: rgba(255, 255, 255, 0.45) !important;
	-webkit-text-fill-color: rgba(255, 255, 255, 0.45);
	opacity: 1;
}

#nellybot .nellybot__input:focus {
	border-color: color-mix(in srgb, var(--nb-primary) 70%, transparent);
	background: #20293f !important;
}

/* Autocompletado del navegador: evita que pinte el input de blanco/amarillo */
#nellybot .nellybot__input:-webkit-autofill,
#nellybot .nellybot__input:-webkit-autofill:hover,
#nellybot .nellybot__input:-webkit-autofill:focus {
	-webkit-text-fill-color: #ffffff;
	caret-color: #ffffff;
	-webkit-box-shadow: 0 0 0 1000px #1a2236 inset !important;
	box-shadow: 0 0 0 1000px #1a2236 inset !important;
}

#nellybot .nellybot__input:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

#nellybot .nellybot__send {
	width: 46px;
	height: 46px;
	flex-shrink: 0;
	border: none;
	border-radius: 50%;
	background: linear-gradient(135deg, color-mix(in srgb, var(--nb-primary) 88%, #fff) 0%, var(--nb-primary) 45%, var(--nb-primary-dark) 100%);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 16px color-mix(in srgb, var(--nb-primary) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.3);
	transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#nellybot .nellybot__send:hover {
	transform: translateY(-1px) scale(1.05);
	box-shadow: 0 10px 22px color-mix(in srgb, var(--nb-primary) 50%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#nellybot .nellybot__send:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* --------------------------------------------------------------------------
   Pantalla de bienvenida (hero futurista con glassmorphism)
   -------------------------------------------------------------------------- */
#nellybot .nellybot__welcome {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	flex-direction: column;
	gap: 11px;
	padding: 16px 14px;
	overflow-y: auto;
	overflow-x: hidden;
	background:
		radial-gradient(120% 80% at 50% -10%, #1c2747 0%, rgba(28, 39, 71, 0) 60%),
		linear-gradient(165deg, #0b1020 0%, #131a2e 55%, #0e1424 100%);
	color: #fff;
	/* Oculta por defecto: aparece solo en la primera apertura.
	   pointer-events:none es CLAVE: aunque por una transición o un CSS viejo
	   en caché quedara invisible (opacity:0), NUNCA debe capturar clics encima
	   del chat. Así no quedan "opciones invisibles" bloqueando el texto. */
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: scale(1.02);
	transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
}

#nellybot.is-welcome .nellybot__welcome {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: scale(1);
}

/* Los hijos NUNCA se encogen: si no caben, el contenedor hace scroll.
   Sin esto, los items flex se comprimen por debajo de su contenido y el
   texto se encima/clipa. */
#nellybot .nellybot__welcome > * {
	flex: 0 0 auto;
}

/* Halos de color de marca difuminados al fondo (toque futurista, animados) */
#nellybot .nb-wc-glow {
	position: absolute;
	top: -70px;
	right: -50px;
	width: 230px;
	height: 230px;
	border-radius: 50%;
	background: var(--nb-primary);
	opacity: 0.32;
	filter: blur(72px);
	pointer-events: none;
	animation: nb-wc-float 9s ease-in-out infinite;
}

#nellybot .nb-wc-glow--2 {
	top: auto;
	bottom: -90px;
	right: auto;
	left: -70px;
	width: 200px;
	height: 200px;
	opacity: 0.16;
	filter: blur(80px);
	animation-duration: 12s;
	animation-direction: reverse;
}

@keyframes nb-wc-float {
	0%, 100% { transform: translate(0, 0); }
	50% { transform: translate(-16px, 14px); }
}

#nellybot .nb-wc-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: relative;
	z-index: 1;
}

#nellybot .nb-wc-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

#nellybot .nb-wc-brand__logo {
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	border-radius: 11px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--nb-primary);
	background: color-mix(in srgb, var(--nb-primary) 18%, transparent);
	border: 1px solid color-mix(in srgb, var(--nb-primary) 32%, transparent);
}

#nellybot .nb-wc-brand__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

#nellybot .nb-wc-brand__name {
	font-weight: 800;
	font-size: 14.5px;
	letter-spacing: 0.2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#nellybot .nb-wc-online {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.6);
}

#nellybot .nb-wc-online i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #3ddc84;
	box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
	animation: nb-dot-pulse 1.8s ease-out infinite;
}

/* Subtítulo bajo el título hero */
#nellybot .nb-wc-sub {
	position: relative;
	z-index: 1;
	margin: -4px 2px 2px;
	font-size: 13px;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.6);
}

#nellybot .nb-wc-close {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.75);
	background: rgba(255, 255, 255, 0.08);
	transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

#nellybot .nb-wc-close:hover {
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	transform: rotate(90deg);
}

/* Título hero */
#nellybot .nb-wc-hero {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	font-size: 23px;
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: -0.4px;
	margin: 0 2px 2px;
}

#nellybot .nb-wc-hero__accent {
	display: inline-block;
	padding-bottom: 3px; /* evita que el degradado recorte las colas (y, p, ?) */
	background: linear-gradient(100deg, var(--nb-primary), color-mix(in srgb, var(--nb-primary) 55%, #ffb066));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: var(--nb-primary);
}

/* Tarjetas de acción (glassmorphism + 3D sutil) */
#nellybot .nb-wc-cards {
	display: flex;
	flex-direction: column;
	gap: 11px;
	position: relative;
	z-index: 1;
}

#nellybot .nb-wc-card {
	display: flex;
	align-items: center;
	gap: 13px;
	width: 100%;
	flex-shrink: 0;
	text-align: left;
	padding: 14px;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 255, 255, 0.12);
	-webkit-backdrop-filter: blur(10px) saturate(130%);
	backdrop-filter: blur(10px) saturate(130%);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
	color: #fff;
	position: relative;
	overflow: hidden;
	transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#nellybot .nb-wc-card::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	padding: 1px;
	background: linear-gradient(140deg, color-mix(in srgb, var(--nb-primary) 55%, transparent), transparent 45%);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
}

#nellybot .nb-wc-card:hover {
	transform: translateY(-3px);
	background: rgba(255, 255, 255, 0.11);
	border-color: color-mix(in srgb, var(--nb-primary) 60%, transparent);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45),
		0 0 0 1px color-mix(in srgb, var(--nb-primary) 30%, transparent),
		0 10px 34px color-mix(in srgb, var(--nb-primary) 28%, transparent);
}

#nellybot .nb-wc-card:hover::before { opacity: 1; }

#nellybot .nb-wc-card:focus-visible {
	outline: 2px solid var(--nb-primary);
	outline-offset: 2px;
}

#nellybot .nb-wc-card__icon {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--nb-primary);
	background: color-mix(in srgb, var(--nb-primary) 20%, transparent);
	border: 1px solid color-mix(in srgb, var(--nb-primary) 35%, transparent);
}

#nellybot .nb-wc-card__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	flex: 1;
}

#nellybot .nb-wc-card__title {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.28;
}

#nellybot .nb-wc-card__desc {
	font-size: 12.5px;
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.6);
}

#nellybot .nb-wc-card__chev {
	flex-shrink: 0;
	color: var(--nb-primary);
	display: flex;
	align-items: center;
	transition: transform 0.2s ease;
}

#nellybot .nb-wc-card:hover .nb-wc-card__chev {
	transform: translateX(3px);
}

/* Enlace "o escribe tu pregunta" */
#nellybot .nb-wc-type {
	align-self: center;
	background: transparent;
	color: rgba(255, 255, 255, 0.75);
	font-size: 12.5px;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 999px;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}

#nellybot .nb-wc-type:hover { color: #fff; }

/* Footer de soporte */
#nellybot .nb-wc-foot {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 11px 13px;
	border-radius: 13px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 11.5px;
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.7);
	position: relative;
	z-index: 1;
}

#nellybot .nb-wc-foot svg {
	flex-shrink: 0;
	color: var(--nb-primary);
}

#nellybot .nb-wc-foot strong { color: #fff; font-weight: 700; }

/* Aparición escalonada de las tarjetas */
#nellybot.is-welcome .nb-wc-card {
	animation: nb-wc-in 0.4s ease both;
}
#nellybot.is-welcome .nb-wc-card:nth-child(1) { animation-delay: 0.05s; }
#nellybot.is-welcome .nb-wc-card:nth-child(2) { animation-delay: 0.13s; }
#nellybot.is-welcome .nb-wc-card:nth-child(3) { animation-delay: 0.21s; }

@keyframes nb-wc-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Responsive (móvil)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
	#nellybot {
		right: 16px;
		bottom: 16px;
	}

	#nellybot .nellybot__panel {
		width: calc(100vw - 24px);
		height: calc(100vh - 100px);
		right: -4px;
	}

	#nellybot.is-teasing .nellybot__launcher-label {
		max-width: 150px;
		font-size: 13px;
	}

	#nellybot .nb-wc-hero { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
	#nellybot .nellybot__panel,
	#nellybot .nellybot__launcher,
	#nellybot .nellybot__launcher .nellybot__icon-open,
	#nellybot .nellybot__launcher-label,
	#nellybot .nellybot__pop,
	#nellybot .nellybot__pop.is-visible,
	#nellybot .nellybot__pop-avatar,
	#nellybot .nellybot__pop-dot,
	#nellybot .nellybot__msg,
	#nellybot .nellybot__send,
	#nellybot .nellybot__welcome,
	#nellybot.is-welcome .nb-wc-card,
	#nellybot .nb-wc-close,
	#nellybot .nb-wc-card__chev,
	#nellybot .nb-wc-glow,
	#nellybot .nb-wc-online i {
		transition: none;
		animation: none;
	}
}
