/* ==========================================================================
   NEXO · Robot guía del sitio de Lucas León
   ========================================================================== */
.nx { --nx-size: 68px; position: fixed; left: 22px; bottom: 22px; z-index: 120; width: var(--nx-size); height: var(--nx-size);
  transition: left .9s cubic-bezier(.22,1,.36,1), top .9s cubic-bezier(.22,1,.36,1), bottom .9s cubic-bezier(.22,1,.36,1), transform .4s; touch-action: none; }
.nx.is-free { bottom: auto; }
.nx.is-dragging { transition: none; cursor: grabbing; }
.nx__btn { position: relative; width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle at 50% 35%, #1c2230, #0d1016 70%); border: 1px solid rgba(236,232,225,.16);
  box-shadow: 0 16px 36px -12px rgba(0,0,0,.8), 0 0 0 0 rgba(77,124,255,.5); animation: nxRing 3.2s ease-out infinite; }
.nx__btn:focus-visible { outline: 2px solid #4d7cff; outline-offset: 4px; }
@keyframes nxRing { 0% { box-shadow: 0 16px 36px -12px rgba(0,0,0,.8), 0 0 0 0 rgba(77,124,255,.45); } 70%, 100% { box-shadow: 0 16px 36px -12px rgba(0,0,0,.8), 0 0 0 14px rgba(77,124,255,0); } }
.nx__svg { width: 78%; height: 78%; overflow: visible; animation: nxFloat 3.6s ease-in-out infinite; }
@keyframes nxFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-2deg); } }
.nx.is-flying .nx__svg { animation: nxFly .5s ease-in-out infinite alternate; }
@keyframes nxFly { from { transform: translateY(-2px) rotate(-8deg); } to { transform: translateY(2px) rotate(6deg); } }
.nx__eye { transition: transform .12s linear; }
.nx__lids { transform-origin: 50% 50%; animation: nxBlink 5s infinite; }
@keyframes nxBlink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.nx__ant { transform-origin: 64px 84px; animation: nxAnt 2.4s ease-in-out infinite; }
@keyframes nxAnt { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(8deg); } }
.nx__bulb { animation: nxBulb 2s ease-in-out infinite; }
@keyframes nxBulb { 50% { opacity: .35; } }
.nx.is-thinking .nx__bulb { animation-duration: .45s; fill: #c49a6c; }
.nx__mouth { transition: d .2s; }
.nx.is-talking .nx__mouth { animation: nxTalk .28s ease-in-out infinite alternate; transform-origin: 50px 56.5px; }
@keyframes nxTalk { from { transform: scaleY(.4); } to { transform: scaleY(1.4); } }
.nx__badge { position: absolute; top: -2px; right: -2px; width: 18px; height: 18px; border-radius: 50%; background: #3ecf8e; border: 2px solid #0a0c0f;
  font: 700 10px/14px "Manrope", system-ui, sans-serif; color: #0a0c0f; text-align: center; }
.nx.has-opened .nx__badge { display: none; }

/* Burbuja de tips */
.nx__tip { position: absolute; left: calc(100% + 14px); bottom: 8px; width: max-content; max-width: min(300px, calc(100vw - 120px));
  background: #ece8e1; color: #14161a; border-radius: 16px 16px 16px 4px; padding: 12px 14px; font: 600 14px/1.45 "Manrope", system-ui, sans-serif;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.75); opacity: 0; transform: translateX(-6px) scale(.96); transform-origin: left bottom; pointer-events: none;
  transition: opacity .3s, transform .4s cubic-bezier(.22,1,.36,1); }
.nx__tip.is-on { opacity: 1; transform: none; pointer-events: auto; }
.nx__tip button { display: inline-flex; margin-top: 8px; margin-right: 6px; font: 700 12.5px/1 "Manrope", system-ui, sans-serif; padding: 8px 11px; border-radius: 999px; background: #14161a; color: #ece8e1; border: 0; cursor: pointer; }
.nx__tip button.ghost { background: transparent; color: #14161a; border: 1px solid rgba(20,22,26,.2); }
.nx__tip-x { position: absolute; top: 4px; right: 6px; background: none !important; color: #5d5f63 !important; padding: 4px !important; margin: 0 !important; font-size: 16px !important; }
.nx.is-right .nx__tip { left: auto; right: calc(100% + 14px); border-radius: 16px 16px 4px 16px; transform-origin: right bottom; }

/* Señalador de elementos */
.nx-spot { position: relative; z-index: 1; outline: 2px solid #4d7cff !important; outline-offset: 8px; border-radius: 12px; animation: nxSpot 1.2s ease-in-out 3; }
@keyframes nxSpot { 50% { outline-color: rgba(77,124,255,.25); outline-offset: 14px; } }

/* Panel de chat */
.nx-panel { position: fixed; left: 22px; bottom: 104px; z-index: 121; width: min(400px, calc(100vw - 44px)); height: min(620px, calc(100vh - 140px));
  display: flex; flex-direction: column; background: #0f1217; color: #ece8e1; border: 1px solid rgba(236,232,225,.14); border-radius: 22px; overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.9); font-family: "Manrope", system-ui, sans-serif;
  opacity: 0; transform: translateY(16px) scale(.98); transform-origin: left bottom; visibility: hidden;
  transition: opacity .3s, transform .45s cubic-bezier(.22,1,.36,1), visibility 0s linear .45s; }
.nx-panel.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity .3s, transform .45s cubic-bezier(.22,1,.36,1); }
.nx-panel__head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 18px; border-bottom: 1px solid rgba(236,232,225,.09); background: linear-gradient(180deg, rgba(77,124,255,.10), transparent); }
.nx-panel__avatar { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #1c2230, #0d1016 70%); border: 1px solid rgba(236,232,225,.16); display: grid; place-items: center; flex: none; }
.nx-panel__avatar svg { width: 30px; height: 30px; }
.nx-panel__who { flex: 1; min-width: 0; line-height: 1.25; }
.nx-panel__who strong { display: block; font-size: 15.5px; font-weight: 800; }
.nx-panel__who span { font-size: 12.5px; color: #8a8c91; display: inline-flex; align-items: center; gap: 6px; }
.nx-panel__who span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3ecf8e; }
.nx-panel__who span.ai::after { content: "IA"; font: 700 9.5px/1 "Play", sans-serif; letter-spacing: .12em; color: #4d7cff; border: 1px solid rgba(77,124,255,.5); border-radius: 6px; padding: 3px 5px; }
.nx-icon-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #b7b4ae; background: transparent; border: 1px solid transparent; cursor: pointer; flex: none; }
.nx-icon-btn:hover { color: #ece8e1; border-color: rgba(236,232,225,.14); }
.nx-icon-btn svg { width: 18px; height: 18px; }
.nx-panel__body { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; overscroll-behavior: contain; }
.nx-msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; word-wrap: break-word; animation: nxIn .35s cubic-bezier(.22,1,.36,1); }
@keyframes nxIn { from { opacity: 0; transform: translateY(6px); } }
.nx-msg--bot { background: #181c24; border: 1px solid rgba(236,232,225,.07); border-bottom-left-radius: 5px; align-self: flex-start; }
.nx-msg--user { background: #4d7cff; color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; }
.nx-msg p { margin: 0 0 8px; } .nx-msg p:last-child { margin: 0; }
.nx-msg strong { color: #fff; }
.nx-msg ul { margin: 6px 0 8px; padding-left: 18px; list-style: disc; } .nx-msg li { margin: 3px 0; }
.nx-msg a { color: #8fb0ff; text-decoration: underline; }
.nx-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nx-act { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font: 700 13px/1.1 "Manrope", system-ui, sans-serif; cursor: pointer;
  background: rgba(77,124,255,.14); color: #cfdcff; border: 1px solid rgba(77,124,255,.35); text-decoration: none !important; transition: background-color .2s; }
.nx-act:hover { background: rgba(77,124,255,.26); }
.nx-act--wa { background: rgba(37,211,102,.14); border-color: rgba(37,211,102,.4); color: #b5f2cd; }
.nx-act--pdf { background: rgba(196,154,108,.14); border-color: rgba(196,154,108,.4); color: #f0d9bd; }
.nx-act svg { width: 14px; height: 14px; }
.nx-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.nx-typing i { width: 7px; height: 7px; border-radius: 50%; background: #8a8c91; animation: nxDot 1s infinite; }
.nx-typing i:nth-child(2) { animation-delay: .15s; } .nx-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes nxDot { 30% { transform: translateY(-4px); background: #ece8e1; } }
.nx-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px 10px; scrollbar-width: none; flex: none; }
.nx-chips::-webkit-scrollbar { display: none; }
.nx-chip { flex: none; padding: 8px 12px; border-radius: 999px; border: 1px solid rgba(236,232,225,.16); background: transparent; color: #b7b4ae; font: 650 13px/1 "Manrope", system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.nx-chip:hover { color: #ece8e1; border-color: #b7b4ae; }
.nx-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid rgba(236,232,225,.09); flex: none; }
.nx-form input { flex: 1; min-width: 0; min-height: 46px; border-radius: 14px; border: 1px solid rgba(236,232,225,.14); background: #0a0c0f; color: #ece8e1; padding: 0 14px; font: 500 15.5px/1 "Manrope", system-ui, sans-serif; }
.nx-form input:focus { outline: none; border-color: #4d7cff; box-shadow: 0 0 0 3px rgba(77,124,255,.2); }
.nx-form button { width: 46px; height: 46px; border-radius: 14px; background: #4d7cff; color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; }
.nx-form button svg { width: 18px; height: 18px; }
.nx-foot { font-size: 11px; color: #6c6f75; text-align: center; padding: 0 12px 10px; flex: none; }

@media (max-width: 1023px) {
  .nx { --nx-size: 58px; left: 14px; bottom: 90px; }
  .nx__tip { max-width: calc(100vw - 110px); font-size: 13.5px; }
}
@media (max-width: 640px) {
  .nx-panel { left: 0; right: 0; bottom: 0; width: 100%; height: min(86vh, 100%); height: min(86dvh, 100%); border-radius: 22px 22px 0 0; border-bottom: 0; transform-origin: center bottom; }
  .nx-panel.is-open ~ .nx, body.nx-open .nx { opacity: 0; pointer-events: none; }
  body.nx-open .wa-float, body.nx-open .mobile-cta { opacity: 0; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) { .nx__btn { animation: none; } }
@media print { .nx, .nx-panel { display: none !important; } }
.nx.is-guiding .nx__tip { left: 0; right: auto; bottom: calc(100% + 12px); border-radius: 16px 16px 16px 4px; transform-origin: left bottom; }

.nx__tip-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nx__tip-acts button { margin: 0 !important; }
.nx.is-guiding.tip-below .nx__tip { bottom: auto; top: calc(100% + 12px); border-radius: 4px 16px 16px 16px; transform-origin: left top; }

/* Sugerencias: todas visibles en una sola vista (sin desplazamiento lateral) */
.nx-chips { flex-wrap: wrap; overflow: visible; gap: 6px; padding: 10px 14px 12px; }
.nx-chip { white-space: normal; text-align: left; line-height: 1.25; padding: 7px 11px; font-size: 12.5px; }
.nx-chip:hover { background: rgba(236,232,225,.05); }
