/* ===== Nexa (Zenix Agent) — diseño Zenix (oscuro, violeta y cyan) =====
   Misma estructura y clases que /assets/chatbot.css; solo cambia la piel. */
.zenix-chat {
  --zc-bg: rgba(16, 14, 27, .9); --zc-line: rgba(255, 255, 255, .1); --zc-ink: #f3f1fa; --zc-ink2: rgba(243, 241, 250, .72); --zc-muted: rgba(243, 241, 250, .48);
  --zc-vio: #8b5cf6; --zc-vio2: #6d3df5; --zc-cy: #22d3ee;
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 60;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--zc-ink);
  transition: transform .35s cubic-bezier(.16,1,.3,1), opacity .3s;
}

/* botón flotante */
.zenix-chat-launcher { position: relative; height: 50px; padding: 0 18px 0 8px; display: flex; align-items: center; gap: 10px; border-radius: 99px;
  border: 1px solid rgba(139, 92, 246, .38); background: rgba(16, 14, 27, .82); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  color: var(--zc-ink); font-weight: 650; font-size: 14px; line-height: 1; font-family: inherit; cursor: pointer;
  box-shadow: 0 14px 34px -14px rgba(109, 61, 245, .7), 0 2px 10px rgba(0, 0, 0, .35); transition: transform .18s, border-color .2s, background .2s; }
.zenix-chat-launcher:hover { transform: translateY(-2px); border-color: rgba(34, 211, 238, .5); }
.zenix-chat-launcher-ic { position: relative; width: 36px; height: 36px; display: grid; place-items: center; flex: none; color: #fff; border-radius: 50%;
  background: linear-gradient(135deg, var(--zc-vio2), var(--zc-vio) 58%, var(--zc-cy)); box-shadow: 0 6px 18px -8px rgba(109,61,245,.95); }
.zenix-chat-launcher-ic > svg { position: absolute; width: 19px; height: 19px; transition: opacity .2s, transform .25s; }
.zenix-chat-launcher .ic-chat { opacity: 1; transform: none; }
.zenix-chat-launcher .ic-close { opacity: 0; transform: rotate(-45deg) scale(.8); }
.zenix-chat.is-open .ic-chat { opacity: 0; transform: rotate(45deg) scale(.8); }
.zenix-chat.is-open .ic-close { opacity: 1; transform: none; }
.zenix-chat-launcher-dot { display: none; }
.zenix-chat.is-shy:not(.is-open) { transform: translateY(16px); opacity: 0; pointer-events: none; }

/* ---------- Nexa: esfera de partículas "Voz" ----------
   Se dibuja en un canvas desde chatbot.js (90 partículas en 3D). Acá solo se fija el tamaño. */
.nexa-orb { --o: 36px; position: relative; display: block; width: var(--o); height: var(--o); flex: none; }
.nexa-cv { display: block; width: 100%; height: 100%; }

/* panel */
.zenix-chat-panel { position: absolute; right: 0; bottom: 62px; width: min(392px, calc(100vw - 32px)); height: min(600px, calc(100dvh - 110px));
  display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; border: 1px solid var(--zc-line);
  background: radial-gradient(120% 60% at 100% 0%, rgba(109, 61, 245, .2), transparent 55%), radial-gradient(80% 40% at 0% 100%, rgba(34, 211, 238, .07), transparent 60%), var(--zc-bg);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .85), 0 0 0 1px rgba(139, 92, 246, .08);
  opacity: 0; visibility: hidden; transform: translateY(10px) scale(.985); transform-origin: bottom right;
  transition: opacity .2s ease, transform .24s cubic-bezier(.16,1,.3,1), visibility .2s; }
.zenix-chat.is-open .zenix-chat-panel { opacity: 1; visibility: visible; transform: none; }

.zenix-chat-head { padding: 14px 12px 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--zc-line); }
.zenix-chat-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.zenix-chat-brand { gap: 13px; }
.zenix-chat-brand .nexa-orb { --o: 38px; margin-left: 2px; }
.zenix-chat-brand strong { display: block; font-size: 15px; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; }
.zenix-chat-brand .nexa-status { margin-top: 3px; display: flex; align-items: center; gap: 6px; color: var(--zc-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nexa-status em { font-style: normal; overflow: hidden; text-overflow: ellipsis; }
.nexa-st-active { display: none; color: #bff3fb; }
.zenix-chat.nexa-active .nexa-st-idle { display: none; }
.zenix-chat.nexa-active .nexa-st-active { display: inline; }
.zenix-chat-brand .nexa-status i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--zc-cy); box-shadow: 0 0 8px rgba(34, 211, 238, .8); }
.zenix-chat-head-actions { display: flex; gap: 6px; flex: none; }
.zenix-chat-close, .zenix-chat-wa { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--zc-line); background: rgba(255, 255, 255, .04); color: var(--zc-ink2); cursor: pointer; transition: color .18s, border-color .18s, background .18s; }
.zenix-chat-close svg, .zenix-chat-wa svg { width: 18px; height: 18px; }
.zenix-chat-close:hover, .zenix-chat-wa:hover { color: #fff; border-color: rgba(139, 92, 246, .45); background: rgba(139, 92, 246, .14); }

.zenix-chat-messages { flex: 1; min-height: 0; padding: 18px 14px 8px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(139, 92, 246, .4) transparent; }
.zenix-chat-message { display: flex; margin: 0 0 10px; }
.zenix-chat-message.is-user { justify-content: flex-end; }
.zenix-chat-bubble { max-width: 86%; padding: 10px 13px; border-radius: 16px 16px 16px 6px; border: 1px solid var(--zc-line); background: rgba(255, 255, 255, .05);
  color: var(--zc-ink); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.zenix-chat-message.is-user .zenix-chat-bubble { border-color: transparent; border-radius: 16px 16px 6px 16px; background: linear-gradient(135deg, var(--zc-vio2), var(--zc-vio)); color: #fff; }
.zenix-chat-typing { display: flex; align-items: center; gap: 5px; width: max-content; padding: 13px 14px; }
.zenix-chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--zc-cy); animation: zenixTyping 1s infinite ease-in-out; }
.zenix-chat-typing span:nth-child(2) { animation-delay: .13s; } .zenix-chat-typing span:nth-child(3) { animation-delay: .26s; }
@keyframes zenixTyping { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* tarjeta interna del agente: oculta, igual que en la web actual */
.zenix-agent-card { display: none !important; }

/* opciones rápidas y derivación */
.zenix-chat-quick { padding: 4px 12px 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.zenix-chat-quick button, .zenix-chat-opt { flex: 1 1 auto; min-width: 0; padding: 8px 12px; border-radius: 99px; border: 1px solid rgba(139, 92, 246, .32); background: rgba(139, 92, 246, .1);
  color: #d8ccff; font-weight: 650; font-size: 12.5px; line-height: 1.1; font-family: inherit; text-align: center; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background .18s, border-color .18s, color .18s; }
.zenix-chat-quick button:hover, .zenix-chat-opt:hover { background: rgba(139, 92, 246, .2); border-color: rgba(34, 211, 238, .45); color: #fff; }
.zenix-chat-opt.is-wa { border-color: rgba(34, 211, 238, .4); background: rgba(34, 211, 238, .1); color: #bff3fb; }

.zenix-chat-form { margin: 0 12px 10px; padding: 6px 6px 6px 14px; display: flex; align-items: center; gap: 8px; border-radius: 16px; border: 1px solid var(--zc-line); background: rgba(255, 255, 255, .045); transition: border-color .2s; }
.zenix-chat-form:focus-within { border-color: rgba(139, 92, 246, .5); }
.zenix-chat-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--zc-ink); font-weight: 500; font-size: 16px; line-height: 1.35; font-family: inherit; }
.zenix-chat-input::placeholder { color: var(--zc-muted); }
.zenix-chat-input:disabled { opacity: .55; }
.zenix-chat-send { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--zc-vio2), var(--zc-vio)); color: #fff; cursor: pointer; transition: transform .18s, opacity .18s; }
.zenix-chat-send:hover { transform: translateY(-1px); }
.zenix-chat-send:disabled { cursor: default; opacity: .4; transform: none; }
.zenix-chat-send svg { width: 19px; height: 19px; }
.zenix-chat-foot { padding: 0 16px 12px; color: var(--zc-muted); font-size: 11px; text-align: center; }

/* celular: botón redondo y compacto; el panel ocupa el ancho con márgenes */
@media (max-width: 760px) {
  .zenix-chat { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); }
  .zenix-chat-launcher { width: 50px; height: 50px; padding: 0; justify-content: center; }
  .zenix-chat-launcher-ic { width: 38px; height: 38px; }
  .zenix-chat-launcher-txt { display: none; }
  .zenix-chat-launcher-dot { top: 5px; left: auto; right: 5px; }
  .zenix-chat-panel { position: fixed; left: 10px; right: 10px; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 60px); width: auto; height: min(580px, calc(100dvh - max(14px, env(safe-area-inset-bottom)) - 84px)); border-radius: 22px; transform-origin: bottom center; }
  .zenix-chat-bubble { max-width: 88%; }
}
@media (prefers-reduced-motion: reduce) {
  .zenix-chat, .zenix-chat-panel, .zenix-chat-launcher, .zenix-chat-launcher-ic svg, .zenix-chat-send { transition: none; }
  .zenix-chat-typing span { animation: none; }
  /* sin movimiento: la esfera queda quieta (lo maneja chatbot.js) */
}
