/* ALIZONES Asistente IA — widget */

/* ---------- boton flotante ---------- */
/* bottom:76px deja libre el boton de "revisitar cookies" de CookieYes */
#nd-bot-btn{position:fixed;bottom:76px;z-index:2147482000;width:56px;height:56px;border-radius:50%;
  background:#E31E24;border:none;cursor:pointer;box-shadow:0 6px 22px rgba(0,0,0,.28);
  display:flex;align-items:center;justify-content:center;
  transition:transform .22s ease,opacity .22s ease,box-shadow .18s ease}
#nd-bot-btn:hover{box-shadow:0 10px 28px rgba(0,0,0,.34)}
#nd-bot-btn svg{width:26px !important;height:26px !important;fill:#fff;display:block}
#nd-bot-btn .nd-bot-dot{position:absolute;top:-3px;right:-3px;width:14px;height:14px;border-radius:50%;
  background:#22c55e;border:2px solid #fff}
#nd-bot-btn.nd-bot-away{opacity:0;transform:translateY(14px) scale(.85);pointer-events:none}
body.nd-bot-left #nd-bot-btn{left:24px}
body.nd-bot-right #nd-bot-btn{right:24px}
/* En escritorio el boton va centrado abajo: en la esquina pasaba desapercibido.
   Se centra con margin, no con transform, para no romper la animacion de ocultar. */
@media (min-width:1000px){
  body.nd-bot-left #nd-bot-btn,
  body.nd-bot-right #nd-bot-btn{left:50%;right:auto;margin-left:-28px}
}

/* ---------- fondo oscuro (solo escritorio) ---------- */
#nd-bot-back{position:fixed;inset:0;z-index:2147482900;background:rgba(15,17,20,.45);
  display:none;opacity:0;transition:opacity .18s ease}
#nd-bot-back.nd-open{display:block;opacity:1}

/* ---------- panel ----------
   En escritorio va centrado en la pantalla: escribir en una esquina
   resulta incomodo cuando la conversacion es larga. */
#nd-bot-panel{position:fixed;z-index:2147483000;
  top:50%;left:50%;transform:translate(-50%,-50%);
  width:560px;max-width:calc(100vw - 48px);
  height:min(680px,calc(100vh - 80px));background:#fff;border-radius:16px;overflow:hidden;
  box-shadow:0 24px 80px rgba(0,0,0,.35);display:none;flex-direction:column;
  font-family:inherit;color:#1c1e21}
body.nd-bot-left #nd-bot-panel,
body.nd-bot-right #nd-bot-panel{left:50%;right:auto}
#nd-bot-panel.nd-open{display:flex}
#nd-bot-panel .nd-bot-msg{max-width:76%}

/* ---------- cabecera ---------- */
.nd-bot-head{background:#141518;color:#fff;padding:14px 16px;display:flex;align-items:center;gap:10px;flex:0 0 auto}
.nd-bot-head .nd-bot-av{width:36px;height:36px;border-radius:50%;background:#E31E24;display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.nd-bot-head .nd-bot-av svg{width:18px;height:18px;fill:#fff}
.nd-bot-head b{display:block;font-size:15px;line-height:1.3}
.nd-bot-head span{display:block;font-size:12.5px;opacity:.72;line-height:1.3}
.nd-bot-title{flex:1 1 auto;min-width:0}
.nd-bot-reset{margin-left:auto;background:none;border:none;color:#fff;cursor:pointer;opacity:.72;
  padding:5px 7px;border-radius:8px;display:flex;align-items:center}
.nd-bot-reset svg{width:18px !important;height:18px !important;fill:none;stroke:#fff;stroke-width:2.2;stroke-linecap:round}
.nd-bot-reset:hover{opacity:1;background:rgba(255,255,255,.1)}
.nd-bot-close{background:none;border:none;color:#fff;font-size:26px;line-height:1;cursor:pointer;
  opacity:.8;padding:2px 8px;border-radius:8px}
.nd-bot-close:hover{opacity:1;background:rgba(255,255,255,.1)}

/* ---------- conversacion ----------
   min-height:0 es lo que impide que el panel "crezca" y se descoloque */
.nd-bot-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;padding:16px;background:#f7f8f9;display:flex;flex-direction:column;gap:10px}
.nd-bot-msg{max-width:86%;padding:10px 13px;border-radius:14px;font-size:14.5px;line-height:1.55;
  white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere}
.nd-bot-msg.bot{background:#fff;border:1px solid #e6e8eb;align-self:flex-start;border-bottom-left-radius:5px}
.nd-bot-msg.me{background:#E31E24;color:#fff;align-self:flex-end;border-bottom-right-radius:5px}
.nd-bot-msg a{color:inherit;text-decoration:underline}
.nd-bot-msg.bot a{color:#c8161d}
.nd-bot-typing{display:flex;gap:4px;padding:12px 14px;background:#fff;border:1px solid #e6e8eb;
  border-radius:14px;align-self:flex-start;width:fit-content;flex:0 0 auto}
.nd-bot-typing i{width:7px;height:7px;border-radius:50%;background:#b9bec4;animation:ndb 1s infinite}
.nd-bot-typing i:nth-child(2){animation-delay:.15s}
.nd-bot-typing i:nth-child(3){animation-delay:.3s}
@keyframes ndb{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

/* ---------- sugerencias ---------- */
.nd-bot-chips{display:flex;flex-wrap:wrap;gap:7px;padding:0 16px 12px;background:#f7f8f9;flex:0 0 auto}
.nd-bot-chip{border:1px solid #d9dce0;background:#fff;border-radius:16px;padding:7px 12px;font-size:13px;
  cursor:pointer;color:#33373d;line-height:1.3;font-family:inherit}
.nd-bot-chip:hover{border-color:#E31E24;color:#E31E24}

/* ---------- pie con el campo ---------- */
.nd-bot-foot{flex:0 0 auto;border-top:1px solid #e6e8eb;background:#fff;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom, 0px))}
.nd-bot-form{display:flex;gap:8px;align-items:flex-end}
.nd-bot-form textarea{flex:1 1 auto;resize:none;border:1.5px solid #d9dce0;border-radius:10px;padding:11px 12px;
  font-size:16px;line-height:1.4;font-family:inherit;height:46px;max-height:110px;color:#1c1e21;background:#fff;
  transition:border-color .15s ease}
.nd-bot-form textarea::placeholder{color:#8f949b;opacity:1}
.nd-bot-form textarea:focus{outline:none;border-color:#E31E24;box-shadow:0 0 0 3px rgba(227,30,36,.10)}
.nd-bot-send{flex:0 0 auto;width:46px;height:46px;border-radius:10px;border:none;background:#E31E24;cursor:pointer;
  display:flex;align-items:center;justify-content:center}
.nd-bot-send:disabled{opacity:.45;cursor:default}
.nd-bot-send svg{width:19px !important;height:19px !important;fill:#fff;display:block;flex:0 0 auto}
.nd-bot-note{display:block;margin-top:8px;font-size:11.5px;color:#8a8f96;line-height:1.45}
.nd-bot-note a{color:#8a8f96;text-decoration:underline}
.nd-bot-hp{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}

/* ---------- movil ---------- */
@media (max-width:999px){
  /* A la derecha: en el lado izquierdo tapaba las lineas del menu desplegable. */
  #nd-bot-btn{bottom:84px;width:52px;height:52px}
  body.nd-bot-left #nd-bot-btn,
  body.nd-bot-right #nd-bot-btn{left:auto;right:16px;margin-left:0}

  /* Con el menu lateral abierto el boton estorba: se aparta. */
  body.nd-cd-open #nd-bot-btn,
  body.ct-panel-active #nd-bot-btn{display:none !important}

  /* Pantalla completa y anclado arriba: la altura la fija el JS con visualViewport,
     asi el teclado no descoloca nada. */
  #nd-bot-panel{top:0;left:0 !important;right:0 !important;bottom:auto;transform:none;
    width:100%;max-width:100%;height:100dvh;border-radius:0}
  body.nd-bot-left #nd-bot-panel,
  body.nd-bot-right #nd-bot-panel{left:0 !important;right:0 !important}
  #nd-bot-panel .nd-bot-msg{max-width:86%}
  #nd-bot-back{display:none !important}
  .nd-bot-head{padding:12px 14px}
  .nd-bot-body{padding:14px}
  .nd-bot-chips{padding:0 14px 10px}
  .nd-bot-foot{padding:10px 12px calc(10px + env(safe-area-inset-bottom, 0px))}

  /* Con el chat abierto los demas botones flotantes taparian el campo */
  body.nd-bot-open #ht-ctc-chat,
  body.nd-bot-open .ht-ctc,
  body.nd-bot-open .cky-btn-revisit-wrapper{display:none !important}

  /* Bloqueo del fondo: evita que la pagina se mueva detras del chat */
  body.nd-bot-lock{position:fixed;left:0;right:0;width:100%;overflow:hidden}
}

/* Con el chat abierto no deben aparecer popups encima */
body.nd-bot-open .ct-popup,
body.nd-bot-open [class*="ct-popup"],
body.nd-bot-open .pum-overlay{display:none !important}

@media (prefers-reduced-motion:reduce){
  #nd-bot-btn,.nd-bot-typing i{transition:none;animation:none}
}

/* El icono flotante de configuracion de cookies estorbaba en movil y en
   escritorio; el enlace sigue disponible en el pie de pagina.
   CookieYes inyecta su estilo despues del nuestro, asi que hace falta
   mas especificidad (ademas el JS lo retira del documento). */
html body .cky-btn-revisit-wrapper,
html body .cky-revisit-bottom-left,
html body .cky-revisit-bottom-right,
html body [class*="cky-revisit"]{display:none !important;visibility:hidden !important;
  opacity:0 !important;pointer-events:none !important}

/* Boton apartado con un deslizamiento: se esconde tras el borde y asoma una pestana */
.nd-bot-tab{position:fixed;bottom:88px;z-index:2147482001;width:26px;height:44px;border:none;border-radius:8px 0 0 8px;
  background:#E31E24;color:#fff;cursor:pointer;display:none;align-items:center;justify-content:center;
  box-shadow:0 4px 14px rgba(0,0,0,.25);padding:0}
.nd-bot-tab svg{width:16px !important;height:16px !important;fill:none;stroke:#fff;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
body.nd-bot-left .nd-bot-tab{left:0;border-radius:0 8px 8px 0;transform:scaleX(-1)}
body.nd-bot-right .nd-bot-tab{right:0}
@media (max-width:999px){ .nd-bot-tab{right:0 !important;left:auto !important;border-radius:8px 0 0 8px !important;transform:none !important;bottom:96px} }
body.nd-bot-docked #nd-bot-btn{display:none !important}
body.nd-bot-docked .nd-bot-tab{display:flex}
body.nd-bot-open .nd-bot-tab{display:none !important}

/* ===== ALIZONES Corporate UI v1.4 ===== */
:root{--alz-navy:#0b2a3d;--alz-navy2:#123c55;--alz-red:#e5252a;--alz-red2:#ff3438;--alz-bg:#f5f7f9;--alz-line:#e3e8ec;--alz-text:#18222b}
#nd-bot-btn{width:60px;height:60px;background:linear-gradient(145deg,var(--alz-red2),var(--alz-red));border:3px solid #fff;box-shadow:0 10px 30px rgba(11,42,61,.28)}
#nd-bot-btn:before{content:'A';font:700 29px/1 Arial,sans-serif;color:#fff;position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
#nd-bot-btn>svg{display:none!important}
#nd-bot-btn .nd-bot-dot{width:12px;height:12px;top:1px;right:1px;background:#4bd37b}
#nd-bot-panel{width:520px;border-radius:20px;border:1px solid rgba(11,42,61,.08);box-shadow:0 28px 90px rgba(11,42,61,.28);color:var(--alz-text)}
.nd-bot-head{background:linear-gradient(135deg,var(--alz-navy),var(--alz-navy2));padding:16px 18px;gap:12px}
.nd-bot-head .nd-bot-av{width:42px;height:42px;background:#fff;border:1px solid rgba(255,255,255,.35);color:var(--alz-navy);font:800 24px/1 Arial,sans-serif;box-shadow:0 4px 14px rgba(0,0,0,.14)}
.nd-bot-title .nd-bot-brand{font-size:15px;letter-spacing:4px;font-weight:700}
.nd-bot-head span{font-size:12px;color:#d8f7e2;opacity:1;margin-top:3px}
.nd-bot-head span::first-letter{color:#4bd37b}
.nd-bot-body{background:linear-gradient(#f8fafb,#f4f6f8);padding:18px;gap:12px}
.nd-bot-msg{font-size:14.5px;line-height:1.55;box-shadow:0 2px 8px rgba(11,42,61,.04)}
.nd-bot-msg.bot{background:#fff;border:1px solid var(--alz-line);border-radius:16px 16px 16px 5px}
.nd-bot-msg.me{background:linear-gradient(135deg,var(--alz-red2),var(--alz-red));border-radius:16px 16px 5px 16px;box-shadow:0 5px 14px rgba(229,37,42,.18)}
.nd-bot-msg.bot a{display:inline-block;margin-top:5px;color:var(--alz-red);font-weight:700;text-decoration:none;border-bottom:1px solid rgba(229,37,42,.3)}
.nd-bot-chips{background:#f4f6f8;padding:0 18px 13px;gap:8px}
.nd-bot-chip{border:1px solid #d9e0e5;border-radius:18px;color:var(--alz-navy);padding:8px 12px;background:#fff;box-shadow:0 2px 7px rgba(11,42,61,.03)}
.nd-bot-chip:hover{border-color:var(--alz-red);color:var(--alz-red);transform:translateY(-1px)}
.nd-bot-foot{border-top:1px solid var(--alz-line);padding:12px 14px 9px}
.nd-bot-form textarea{border-radius:14px;border:1px solid #d8e0e5;background:#fbfcfd;padding:12px 14px}
.nd-bot-form textarea:focus{border-color:var(--alz-red);box-shadow:0 0 0 3px rgba(229,37,42,.09);background:#fff}
.nd-bot-send{border-radius:14px;background:linear-gradient(145deg,var(--alz-red2),var(--alz-red));box-shadow:0 5px 14px rgba(229,37,42,.22)}
.nd-bot-brand-foot{text-align:center;padding:9px 0 1px;color:#7c8992;font-size:10.5px;letter-spacing:.2px}
.nd-bot-brand-foot span{letter-spacing:2.2px;font-weight:700;color:var(--alz-navy)}
.nd-bot-brand-foot em{font-style:normal}
.nd-bot-note{border-top:1px solid #edf0f2;margin-top:9px;padding-top:7px}
.nd-bot-tab{background:var(--alz-red)}
@media (max-width:999px){
 #nd-bot-panel{border-radius:0;border:none}
 .nd-bot-head{padding:13px 15px}
 .nd-bot-head .nd-bot-av{width:38px;height:38px;font-size:21px}
 .nd-bot-title .nd-bot-brand{font-size:14px;letter-spacing:3px}
 .nd-bot-brand-foot{padding-bottom:max(1px,env(safe-area-inset-bottom))}
}

/* ===== Universal UI v2.0 ===== */
:root{--nd-primary:#0B2A3D;--nd-accent:#E5252A}
#nd-bot-btn{background:var(--nd-accent)!important;border:2px solid #fff!important}
#nd-bot-btn:before{content:none!important}
#nd-bot-btn>svg{display:block!important;fill:#fff!important}
.nd-bot-head{background:var(--nd-primary)!important}
.nd-bot-head .nd-bot-av{background:rgba(255,255,255,.13)!important;color:#fff!important}
.nd-bot-head .nd-bot-av svg{display:block;fill:#fff;width:22px;height:22px}
.nd-bot-title .nd-bot-brand{letter-spacing:.5px!important;text-transform:none}
.nd-bot-msg.me,.nd-bot-send{background:var(--nd-accent)!important}
.nd-bot-msg.bot a,.nd-bot-chip:hover{color:var(--nd-accent)!important}
.nd-bot-chip:hover{border-color:var(--nd-accent)!important}
.nd-bot-form textarea:focus{border-color:var(--nd-accent)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--nd-accent) 10%,transparent)!important}
.nd-bot-brand-foot span{color:var(--nd-primary)!important;letter-spacing:.5px!important}
.nd-bot-tab{background:var(--nd-accent)!important}
#nd-bot-btn.nd-bot-initial-hidden{opacity:0!important;pointer-events:none!important;transform:scale(.82)}
.nd-bot-invite{position:fixed;z-index:2147481999;bottom:146px;max-width:310px;background:#fff;color:#17212b;border:1px solid #e5e9ed;border-radius:16px;box-shadow:0 12px 38px rgba(0,0,0,.18);display:none;align-items:flex-start;overflow:hidden;font-family:inherit}
.nd-bot-invite.nd-show{display:flex;animation:ndInvite .25s ease-out}
.nd-bot-invite-text{border:0;background:transparent;padding:14px 10px 14px 15px;text-align:left;font:600 14px/1.45 inherit;color:inherit;cursor:pointer}
.nd-bot-invite-close{border:0;background:transparent;padding:9px 11px;color:#7b858d;font-size:20px;line-height:1;cursor:pointer}
body.nd-bot-left .nd-bot-invite{left:24px} body.nd-bot-right .nd-bot-invite{right:24px}
@keyframes ndInvite{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}
@media(min-width:1000px){body.nd-bot-left .nd-bot-invite,body.nd-bot-right .nd-bot-invite{left:50%;right:auto;transform:translateX(-50%);margin-left:0}.nd-bot-invite.nd-show{animation:ndInviteDesktop .25s ease-out}@keyframes ndInviteDesktop{from{opacity:0;transform:translate(-50%,8px) scale(.98)}to{opacity:1;transform:translate(-50%,0) scale(1)}}}
@media(max-width:999px){.nd-bot-invite{right:16px!important;left:auto!important;bottom:148px;max-width:min(310px,calc(100vw - 32px))}}


/* ===== Universal UI v2.1: persistent AI rail ===== */
/* Launcher and dock use the same neutral AI identity on every shop. */
#nd-bot-btn{background:var(--nd-primary)!important;border:2px solid #fff!important;box-shadow:0 10px 30px rgba(11,42,61,.24)!important}
#nd-bot-btn>svg,.nd-bot-head .nd-bot-av svg,.nd-bot-tab svg{display:block!important;fill:none!important;stroke:#fff!important;stroke-width:1.8!important;stroke-linecap:round!important;stroke-linejoin:round!important}
#nd-bot-btn>svg{width:30px!important;height:30px!important}
#nd-bot-btn .nd-bot-dot{background:#49c979!important}
.nd-bot-head .nd-bot-av{background:rgba(255,255,255,.12)!important}

/* Dock is anchored to the viewport, never to the footer/document flow. */
.nd-bot-tab{
  position:fixed!important;top:50%!important;bottom:auto!important;transform:translateY(-50%)!important;
  width:44px!important;height:76px!important;background:var(--nd-primary)!important;color:#fff!important;
  display:none;flex-direction:column;gap:4px;align-items:center;justify-content:center;
  border:1px solid rgba(255,255,255,.22)!important;box-shadow:0 8px 26px rgba(0,0,0,.22)!important;
  z-index:2147483640!important;padding:0!important
}
body.nd-bot-left .nd-bot-tab{left:0!important;right:auto!important;border-radius:0 14px 14px 0!important}
body.nd-bot-right .nd-bot-tab{right:0!important;left:auto!important;border-radius:14px 0 0 14px!important}
.nd-bot-tab svg{width:22px!important;height:22px!important;transform:none!important}
.nd-bot-tab-label{display:block;font:700 10px/1 Arial,sans-serif;letter-spacing:.7px;color:#fff}
body.nd-bot-docked .nd-bot-tab{display:flex!important}
body.nd-bot-open .nd-bot-tab{display:none!important}

@media(max-width:999px){
 .nd-bot-tab{top:56%!important;right:0!important;left:auto!important;bottom:auto!important;transform:translateY(-50%)!important;width:40px!important;height:68px!important;border-radius:12px 0 0 12px!important}
 .nd-bot-tab svg{width:20px!important;height:20px!important}
}

/* ===== Universal UI v2.2: clear header controls + hard viewport dock ===== */
.nd-bot-reset,.nd-bot-close{
  width:40px!important;height:40px!important;min-width:40px!important;border-radius:10px!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  opacity:1!important;padding:0!important;box-sizing:border-box!important
}
.nd-bot-reset{background:rgba(255,255,255,.12)!important;border:1px solid rgba(255,255,255,.24)!important}
.nd-bot-reset svg{width:23px!important;height:23px!important;stroke:#fff!important;stroke-width:2.35!important}
.nd-bot-reset:hover{background:rgba(255,255,255,.22)!important}
.nd-bot-close{background:rgba(255,255,255,.92)!important;color:#162733!important;border:1px solid rgba(255,255,255,.65)!important;font-size:29px!important;font-weight:400!important;line-height:1!important}
.nd-bot-close:hover{background:#fff!important;color:#000!important}

/* Keep the recovery rail on the viewport even if the theme has footer/layout rules. */
html body .nd-bot-tab{
  position:fixed!important;top:50vh!important;bottom:auto!important;margin:0!important;
  z-index:2147483647!important;visibility:visible!important;opacity:1!important
}
html body.nd-bot-left .nd-bot-tab{left:0!important;right:auto!important;transform:translateY(-50%)!important}
html body.nd-bot-right .nd-bot-tab{right:0!important;left:auto!important;transform:translateY(-50%)!important}
@media(max-width:999px){
 html body .nd-bot-tab{top:52vh!important;right:0!important;left:auto!important;transform:translateY(-50%)!important}
}
