/* Asistente IA · Xports Xperiences — colores de la marca en variables para poder ajustarlos */
.xx-asis {
	--xxa-ink: #0B0B0C;
	--xxa-or: #F2552A;
	--xxa-bl: #0C71C3;
	--xxa-sand: #EFEBE6;
	--xxa-font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	position: fixed;
	bottom: 22px;
	z-index: 99990;
	font-family: var(--xxa-font);
	font-size: 15px;
	line-height: 1.5;
	color: var(--xxa-ink);
}
.xx-asis--left { left: 22px; }
.xx-asis--right { right: 22px; }
.xx-asis *, .xx-asis *::before, .xx-asis *::after { box-sizing: border-box; }
.xx-asis [hidden] { display: none !important; }

/* Botón */
.xx-asis-fab {
	display: inline-flex; align-items: center; gap: 10px;
	height: 56px; padding: 0 22px 0 8px; border: 0; border-radius: 999px;
	background: var(--xxa-ink); color: #fff; cursor: pointer;
	font: 800 13px/1 var(--xxa-font); letter-spacing: 1px; text-transform: uppercase;
	box-shadow: 0 10px 30px rgba(11, 11, 12, .28);
	transition: transform .25s, box-shadow .25s, background .25s;
}
.xx-asis-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(11, 11, 12, .34); }
.xx-asis-fab-ico {
	width: 40px; height: 40px; border-radius: 50%;
	display: grid; place-items: center; font-size: 20px;
	background: var(--xxa-or);
	box-shadow: 0 0 0 0 rgba(242, 85, 42, .55);
	animation: xxa-pulse 2.6s ease-out infinite;
}
.xx-asis.is-open .xx-asis-fab-ico { animation: none; }
.xx-asis.is-open .xx-asis-fab { background: var(--xxa-or); }
.xx-asis.is-open .xx-asis-fab-ico { background: var(--xxa-ink); }
@keyframes xxa-pulse {
	0% { box-shadow: 0 0 0 0 rgba(242, 85, 42, .55); }
	70% { box-shadow: 0 0 0 12px rgba(242, 85, 42, 0); }
	100% { box-shadow: 0 0 0 0 rgba(242, 85, 42, 0); }
}


/* Mensaje flotante */
.xx-asis-teaser {
	position: absolute; bottom: 72px; width: max-content; max-width: 260px;
	background: #fff; color: var(--xxa-ink); padding: 14px 34px 14px 16px;
	font-weight: 700; font-size: 14px; line-height: 1.4; cursor: pointer;
	border-left: 4px solid var(--xxa-or);
	box-shadow: 0 12px 34px rgba(11, 11, 12, .18);
	animation: xxa-in .35s ease-out;
}
.xx-asis--left .xx-asis-teaser { left: 0; }
.xx-asis--right .xx-asis-teaser { right: 0; }
.xx-asis-teaser-x {
	position: absolute; top: 4px; right: 6px; border: 0; background: none;
	font-size: 18px; line-height: 1; color: #888; cursor: pointer; padding: 4px;
}

/* Panel */
.xx-asis-panel {
	position: absolute; bottom: 72px;
	width: 380px; max-width: calc(100vw - 32px);
	height: 560px; max-height: calc(100vh - 120px);
	display: flex; flex-direction: column;
	background: #fff; overflow: hidden;
	border-top: 4px solid var(--xxa-or);
	box-shadow: 0 24px 60px rgba(11, 11, 12, .28);
	animation: xxa-in .25s ease-out;
}
.xx-asis--left .xx-asis-panel { left: 0; }
.xx-asis--right .xx-asis-panel { right: 0; }
@keyframes xxa-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.xx-asis-head {
	display: flex; align-items: center; gap: 12px;
	padding: 14px 12px 14px 16px; background: var(--xxa-ink); color: #fff;
}
.xx-asis-ava {
	flex: 0 0 38px; height: 38px; border-radius: 50%;
	display: grid; place-items: center; font-size: 19px; background: var(--xxa-or);
}
.xx-asis-tit { flex: 1; min-width: 0; }
.xx-asis-tit b { display: block; font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: .5px; }
.xx-asis-tit small { display: block; font-size: 12.5px; color: #bdbdbd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xx-asis-head button {
	border: 0; background: transparent; color: #fff; cursor: pointer;
	width: 34px; height: 34px; font-size: 20px; line-height: 1; opacity: .8;
}
.xx-asis-head button:hover { opacity: 1; color: var(--xxa-or); }

.xx-asis-body {
	flex: 1; overflow-y: auto; padding: 18px 16px 8px;
	background: var(--xxa-sand);
	display: flex; flex-direction: column; gap: 10px;
	overscroll-behavior: contain;
}
.xx-asis-msg { max-width: 88%; padding: 11px 14px; font-size: 14.5px; line-height: 1.55; word-wrap: break-word; }
.xx-asis-msg p { margin: 0 0 8px; padding: 0; }
.xx-asis-msg p:last-child { margin-bottom: 0; }
.xx-asis-msg ul { margin: 4px 0 8px; padding: 0 0 0 18px; }
.xx-asis-msg li { margin: 0 0 4px; padding: 0; list-style: disc; }
.xx-asis-msg--bot { align-self: flex-start; background: #fff; border-left: 3px solid var(--xxa-or); }
.xx-asis-msg--user { align-self: flex-end; background: var(--xxa-ink); color: #fff; white-space: pre-wrap; }
.xx-asis-msg a { color: var(--xxa-bl); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.xx-asis-msg strong { font-weight: 800; }

.xx-asis-typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.xx-asis-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--xxa-or); animation: xxa-dot 1.2s infinite ease-in-out; }
.xx-asis-typing i:nth-child(2) { animation-delay: .15s; }
.xx-asis-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes xxa-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.xx-asis-sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 4px; background: var(--xxa-sand); }
.xx-asis-sugg button {
	border: 1.5px solid var(--xxa-ink); background: #fff; color: var(--xxa-ink);
	padding: 7px 11px; font: 700 12.5px/1.3 var(--xxa-font); cursor: pointer; text-align: left;
	transition: background .2s, color .2s;
}
.xx-asis-sugg button:hover { background: var(--xxa-ink); color: #fff; }
.xx-asis-sugg--quick { padding-top: 8px; animation: xxa-in .25s ease-out; }
.xx-asis-sugg--quick button:first-child { background: var(--xxa-or); border-color: var(--xxa-or); color: #fff; }
.xx-asis-sugg--quick button:first-child:hover { background: var(--xxa-ink); border-color: var(--xxa-ink); }

.xx-asis-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; background: #fff; border-top: 1px solid #e6e1db; }
.xx-asis-form textarea {
	flex: 1; resize: none; min-height: 44px; max-height: 120px; margin: 0;
	padding: 11px 12px; border: 1.5px solid #d6d0c9; border-radius: 0;
	font: 400 14.5px/1.4 var(--xxa-font); color: var(--xxa-ink); background: #fff;
}
.xx-asis-form textarea:focus { outline: none; border-color: var(--xxa-or); }
.xx-asis-form button {
	flex: 0 0 44px; height: 44px; border: 0; cursor: pointer;
	background: var(--xxa-or); color: #fff; font-size: 17px;
}
.xx-asis-form button:disabled { opacity: .5; cursor: default; }
.xx-asis-priv { margin: 0; padding: 0 12px 10px; background: #fff; font-size: 11px; line-height: 1.4; color: #8a8a8a; }
.xx-asis-priv a { color: #8a8a8a; text-decoration: underline; }

/* WhatsApp dentro del chat */
.xx-asis-wa {
	display: flex; align-items: center; gap: 10px;
	margin: 0; padding: 10px 14px; background: #fff;
	border-top: 1px solid #e6e1db; color: var(--xxa-ink) !important;
	font-size: 13px; line-height: 1.35; text-decoration: none !important;
	transition: background .2s;
}
.xx-asis-wa:hover { background: #effaf2; }
.xx-asis-wa b { color: #128C4A; font-weight: 800; }
.xx-asis-wa-ico {
	flex: 0 0 32px; height: 32px; border-radius: 50%;
	display: grid; place-items: center; background: #25D366; color: #fff;
}

/* Móvil: botón compacto y panel a pantalla casi completa */
@media (max-width: 600px) {
	.xx-asis { bottom: 16px; }
	.xx-asis--left { left: 14px; }
	.xx-asis--right { right: 14px; }
	.xx-asis-fab { height: 54px; padding: 0 7px; }
	.xx-asis-fab-txt { display: none; }
	.xx-asis-teaser { bottom: 66px; max-width: 220px; }
	.xx-asis.is-open { left: 0; right: 0; bottom: 0; }
	.xx-asis.is-open .xx-asis-fab { display: none; }
	.xx-asis-panel { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; max-width: none; height: 88vh; height: 88dvh; max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
	.xx-asis-fab-ico, .xx-asis-panel, .xx-asis-teaser, .xx-asis-typing i { animation: none !important; }
}

/* ===== Botón más visible (v1.4) ===== */
.xx-asis-fab {
	position: relative; height: 62px; padding: 0 24px 0 9px; gap: 12px;
	background: var(--xxa-ink); color: #fff;
	box-shadow: 0 12px 32px rgba(11, 11, 12, .32);
	animation: xxa-nudge 7s ease-in-out 4s infinite;
}
.xx-asis-fab:hover { background: #1c1c1e; box-shadow: 0 16px 38px rgba(11, 11, 12, .4); }
.xx-asis-fab-ico {
	width: 46px; height: 46px; background: var(--xxa-or); color: #fff;
	animation: xxa-pulse 2.4s ease-out infinite;
}
.xx-asis-fab-ico svg { width: 24px; height: 24px; display: block; }
.xx-asis-fab-txt { display: flex; flex-direction: column; align-items: flex-start; font-size: 15px; letter-spacing: 1px; line-height: 1.05; }
.xx-asis-fab-txt small { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; opacity: .9; margin-bottom: 3px; }
.xx-asis-fab-dot {
	position: absolute; top: 8px; left: 44px; width: 13px; height: 13px; border-radius: 50%;
	background: #2ED46B; border: 2px solid var(--xxa-ink);
}
.xx-asis.is-open .xx-asis-fab { background: var(--xxa-or); animation: none; }
.xx-asis.is-open .xx-asis-fab-ico { background: var(--xxa-ink); color: #fff; animation: none; }
.xx-asis.is-open .xx-asis-fab-dot { display: none; }
.xx-asis-ava { color: #fff; }
.xx-asis-ava svg { width: 20px; height: 20px; display: block; }
@keyframes xxa-pulse-w {
	0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); }
	70% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
	100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
@keyframes xxa-nudge {
	0%, 88%, 100% { transform: translateY(0) rotate(0); }
	90% { transform: translateY(-6px) rotate(-3deg); }
	92% { transform: translateY(0) rotate(2deg); }
	94% { transform: translateY(-3px) rotate(-1deg); }
	96% { transform: translateY(0) rotate(0); }
}
@media (max-width: 600px) {
	.xx-asis-fab { height: 56px; padding: 0 18px 0 7px; gap: 10px; }
	.xx-asis-fab-ico { width: 42px; height: 42px; }
	.xx-asis-fab-txt { font-size: 14px; }
	.xx-asis-fab-dot { top: 6px; left: 38px; }
}
@media (prefers-reduced-motion: reduce) {
	.xx-asis-fab { animation: none !important; }
}

/* Subtítulo de la cabecera en dos líneas si no cabe */
.xx-asis-tit small { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }

/* Foto/ilustración del asistente en la cabecera */
.xx-asis-ava.has-img { flex: 0 0 44px; height: 44px; padding: 0; overflow: hidden; background: var(--xxa-or); box-shadow: 0 0 0 2px rgba(255,255,255,.9); position: relative; }
.xx-asis-ava.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.xx-asis-head { position: relative; }
.xx-asis-ava.has-img + .xx-asis-tit b::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: #2ED46B; vertical-align: middle; }
