/* === VERA WIDGET — burbuja de chat en vivo ===
   Reutiliza los tokens de norlia.css (--signal, --bone, --black, --f-*). */

.vw-launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--wa, #25D366); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45); transition: transform .25s var(--ease, ease), opacity .25s ease;
}
.vw-launcher:hover { transform: translateY(-3px) scale(1.04); }
.vw-launcher img { width: 30px; height: 30px; }
.vw-launcher__dot {
  position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--signal); border: 2px solid var(--black);
}
.vw-launcher[hidden] { display: none; }

.vw-panel {
  position: fixed; right: 24px; bottom: 24px; z-index: 61;
  width: min(380px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 48px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--black, #0A0A0A); color: var(--bone, #FAFAF6);
  border: 1px solid rgba(250, 250, 246, .14); border-radius: 20px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
  transition: opacity .28s ease, transform .28s cubic-bezier(.2, .8, .2, 1);
}
.vw-panel.vw-open { opacity: 1; transform: none; pointer-events: auto; }

.vw-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  border-bottom: 1px solid rgba(250, 250, 246, .12); }
.vw-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--signal);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-disp); font-weight: 900; font-size: 18px; color: var(--bone); }
.vw-name { font-family: var(--f-body); font-size: 14px; font-weight: 700; line-height: 1.25; }
.vw-status { font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; color: #25D366; }
.vw-close { margin-left: auto; background: none; border: none; color: rgba(250, 250, 246, .6);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 6px; }
.vw-close:hover { color: var(--bone); }

.vw-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.vw-msg { max-width: 82%; padding: 11px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word; }
.vw-msg--v { align-self: flex-start; background: rgba(255, 87, 34, .16); border: 1px solid rgba(255, 87, 34, .3); }
.vw-msg--c { align-self: flex-end; background: rgba(250, 250, 246, .08); }
.vw-msg--sys { align-self: center; max-width: 100%; text-align: center; background: none;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em; color: rgba(250, 250, 246, .5); }
.vw-typing { align-self: flex-start; display: flex; gap: 5px; padding: 13px 15px; }
.vw-typing span { width: 7px; height: 7px; border-radius: 50%; background: rgba(250, 250, 246, .45);
  animation: vw-bounce 1.3s infinite; }
.vw-typing span:nth-child(2) { animation-delay: .18s; }
.vw-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes vw-bounce { 0%, 60%, 100% { transform: none; opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

.vw-handoff { margin: 4px 0 2px; padding: 14px; border-radius: 14px;
  background: rgba(37, 211, 102, .12); border: 1px solid rgba(37, 211, 102, .32); }
.vw-handoff p { margin: 0 0 12px; font-size: 13px; line-height: 1.55; }
.vw-handoff a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: #25D366; color: #0A0A0A; font-family: var(--f-disp); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: .03em; padding: 10px 16px; border-radius: 999px; }
.vw-handoff img { width: 16px; height: 16px; }

.vw-form { display: flex; gap: 8px; padding: 14px; border-top: 1px solid rgba(250, 250, 246, .12); }
.vw-form input { flex: 1; background: rgba(250, 250, 246, .07); border: 1px solid rgba(250, 250, 246, .16);
  border-radius: 999px; padding: 11px 16px; color: var(--bone); font-family: var(--f-body); font-size: 14px; }
.vw-form input:focus { outline: none; border-color: var(--signal); }
.vw-form button { background: var(--signal); border: none; border-radius: 50%; width: 42px; height: 42px;
  color: var(--bone); font-size: 17px; cursor: pointer; flex-shrink: 0; }
.vw-form button:disabled { opacity: .4; cursor: default; }

.vw-foot { padding: 0 16px 12px; font-family: var(--f-mono); font-size: 10px; line-height: 1.5;
  color: rgba(250, 250, 246, .4); text-align: center; }
.vw-foot a { color: rgba(250, 250, 246, .6); }

@media (max-width: 520px) {
  .vw-panel { right: 8px; left: 8px; bottom: 8px; width: auto; max-height: calc(100vh - 16px); border-radius: 16px; }
  .vw-launcher { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .vw-panel, .vw-launcher { transition: none; }
  .vw-typing span { animation: none; }
}

/* Aviso que señala la burbuja cuando termina el chat de ejemplo del hero. */
.vw-hint {
  position: fixed; right: 96px; bottom: 36px; z-index: 60; cursor: pointer;
  background: var(--bone, #FAFAF6); color: var(--black, #0A0A0A);
  font-family: var(--f-disp); font-weight: 700; font-size: 13px; text-transform: uppercase;
  letter-spacing: .03em; padding: 11px 16px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateX(10px); transition: opacity .35s ease, transform .35s ease;
}
.vw-hint--on { opacity: 1; transform: none; animation: vw-nudge 1.8s ease-in-out 1.2s 3; }
.vw-hint::after {
  content: ''; position: absolute; right: -6px; top: 50%; margin-top: -6px;
  border: 6px solid transparent; border-left-color: var(--bone, #FAFAF6); border-right: 0;
}
@keyframes vw-nudge { 0%, 100% { transform: none; } 50% { transform: translateX(6px); } }
@media (max-width: 520px) {
  .vw-hint { right: 84px; bottom: 28px; font-size: 12px; padding: 9px 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .vw-hint { transition: none; }
  .vw-hint--on { animation: none; }
}

/* El banner de cookies ocupa el pie de la pantalla mientras no se acepta.
   Mientras está visible, la burbuja y su aviso se apartan por encima de él. */
body.vw-cookies .vw-launcher { bottom: calc(24px + var(--vw-cookie-h, 76px)); }
body.vw-cookies .vw-hint { bottom: calc(36px + var(--vw-cookie-h, 76px)); }
body.vw-cookies .vw-panel { max-height: calc(100vh - 48px - var(--vw-cookie-h, 76px)); }

/* Barra de demo: el visitante está hablando con un negocio ficticio y tiene que
   poder volver sin saberse la palabra SALIR. */
.vw-demo {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px; background: rgba(255, 87, 34, .14);
  border-bottom: 1px solid rgba(255, 87, 34, .3);
  font-size: 12px; line-height: 1.4;
}
.vw-demo[hidden] { display: none; }
.vw-demo__label { color: rgba(250, 250, 246, .7); }
.vw-demo__name { font-weight: 700; color: var(--bone, #FAFAF6); }
.vw-demo__exit {
  margin-left: auto; cursor: pointer; border: 1px solid rgba(250, 250, 246, .3);
  background: none; color: var(--bone, #FAFAF6); border-radius: 999px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; padding: 5px 11px;
}
.vw-demo__exit:hover { background: var(--signal, #FF5722); border-color: var(--signal, #FF5722); }
.vw-demo__exit:disabled { opacity: .45; cursor: default; }
