/* ── ASISTENTE VIRTUAL INTERNO — HEAVENSY ── */
/* ── BITÁCORA ──
   [v2026.06.29-1] asistente.css
   2026-06-29 | Estilos para arrastrar/ocultar la burbuja: .hva-wrap (contenedor móvil),
                .hva-hide-btn (× al hover), .hva-reopen (pestaña para reabrir). */

.hva-bubble {
  position: fixed; bottom: 24px; right: 24px; z-index: 9990;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg,#9961FF,#5b8dee);
  border: none; cursor: pointer;
  box-shadow: 0 4px 18px rgba(153,97,255,0.45), 0 2px 6px rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
  overflow: hidden;
}
.hva-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(153,97,255,0.55), 0 2px 8px rgba(0,0,0,0.18);
}
.hva-bubble svg { transition: opacity .2s, transform .2s; position: absolute; }
.hva-bubble .hva-ico-close { opacity: 0; transform: rotate(-90deg) scale(.7); }
.hva-bubble.open .hva-ico-chat  { opacity: 0; transform: rotate(90deg) scale(.7); }
.hva-bubble.open .hva-ico-close { opacity: 1; transform: rotate(0) scale(1); }

.hva-notif {
  position: absolute; top: 4px; right: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #f43f5e; border: 2px solid #fff;
  animation: hva-pulse 2s infinite;
}
.hva-bubble.open .hva-notif { display: none; }
@keyframes hva-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(244,63,94,.5); }
  50%      { box-shadow: 0 0 0 5px rgba(244,63,94,0); }
}

.hva-panel {
  position: fixed; bottom: 88px; right: 24px; z-index: 9989;
  width: 340px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.08);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(.97);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  max-height: 520px;
}
.hva-panel.open {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: all;
}

.hva-header {
  background: linear-gradient(135deg,#9961FF,#5b8dee);
  padding: 14px 16px; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.hva-header-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.35);
}
.hva-header-info { flex: 1; }
.hva-header-name   { font-size: 14px; font-weight: 600; color: #fff; font-family: 'Poppins',sans-serif; }
.hva-header-status { font-size: 11px; color: rgba(255,255,255,.8); display: flex; align-items: center; gap: 5px; font-family: 'Poppins',sans-serif; }
.hva-status-dot    { width: 7px; height: 7px; background: #4ade80; border-radius: 50%; flex-shrink: 0; }
.hva-header-close  {
  background: rgba(255,255,255,.15); border: none; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; transition: background .15s;
}
.hva-header-close:hover { background: rgba(255,255,255,.3); }

.hva-messages {
  flex: 1; overflow-y: auto; padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 10px;
  background: #F8F8FA;
}
.hva-messages::-webkit-scrollbar { width: 4px; }
.hva-messages::-webkit-scrollbar-thumb { background: #d0d4e8; border-radius: 4px; }

.hva-msg { display: flex; align-items: flex-end; gap: 7px; animation: hva-msg-in .22s ease; }
@keyframes hva-msg-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.hva-msg.bot  { align-self: flex-start; }
.hva-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.hva-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg,#9961FF,#5b8dee);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.hva-msg-bubble {
  max-width: 220px; padding: 9px 12px; border-radius: 14px;
  font-size: 12.5px; line-height: 1.5; font-family: 'Poppins',sans-serif;
}
.hva-msg.bot  .hva-msg-bubble { background: #fff; color: #383838; border-radius: 4px 14px 14px 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); }
.hva-msg.user .hva-msg-bubble { background: linear-gradient(135deg,#9961FF,#5b8dee); color: #fff; border-radius: 14px 4px 14px 14px; }
.hva-msg-time { font-size: 10px; color: rgba(56,56,56,0.38); margin-top: 3px; font-family: 'Poppins',sans-serif; }
.hva-msg.bot  .hva-msg-time { text-align: left; }
.hva-msg.user .hva-msg-time { text-align: right; }

.hva-typing { display: flex; align-items: flex-end; gap: 7px; animation: hva-msg-in .22s ease; }
.hva-typing-dots { display: flex; gap: 4px; align-items: center; background: #fff; padding: 10px 14px; border-radius: 4px 14px 14px 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); }
.hva-typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: #9961FF; opacity: .5; animation: hva-bounce .9s infinite; }
.hva-typing-dots span:nth-child(2) { animation-delay: .15s; }
.hva-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes hva-bounce { 0%,80%,100% { transform:translateY(0); } 40% { transform:translateY(-5px); opacity:1; } }

.hva-quick { padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px; background: #F8F8FA; flex-shrink: 0; }
.hva-qr-btn {
  background: #fff; border: 1.5px solid rgba(153,97,255,0.3);
  border-radius: 20px; padding: 5px 12px; font-size: 11px; font-weight: 500;
  color: #9961FF; cursor: pointer; font-family: 'Poppins',sans-serif;
  transition: all .15s; white-space: nowrap;
}
.hva-qr-btn:hover { background: #9961FF; color: #fff; border-color: #9961FF; }
.hva-qr-btn:disabled { opacity: .4; cursor: default; }

.hva-input-area {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-top: 1px solid rgba(0,0,0,0.07);
  background: #fff; flex-shrink: 0;
}
.hva-input {
  flex: 1; border: 1.5px solid rgba(0,0,0,0.1); border-radius: 20px;
  padding: 8px 14px; font-size: 12px; font-family: 'Poppins',sans-serif;
  color: #383838; outline: none; transition: border-color .15s;
  background: #F8F8FA;
}
.hva-input:focus { border-color: #9961FF; background: #fff; }
.hva-input::placeholder { color: #a0a8c0; }
.hva-send {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg,#9961FF,#5b8dee);
  border: none; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(153,97,255,0.35); transition: transform .15s, opacity .15s;
}
.hva-send:hover { transform: scale(1.08); }
.hva-send:disabled { opacity: .38; cursor: default; transform: none; box-shadow: none; }
.hva-send svg { width: 15px; height: 15px; fill: #fff; }

/* ── Arrastre + ocultar/reabrir (burbuja) [v2026.06.29-1] ── */
.hva-wrap {
  position: fixed; bottom: 24px; right: 24px; z-index: 9990;
  width: 52px; height: 52px;
  user-select: none; touch-action: none;
}
.hva-wrap .hva-bubble {
  position: relative; bottom: auto; right: auto;
  width: 100%; height: 100%; cursor: grab;
}
.hva-wrap .hva-bubble:active { cursor: grabbing; }
.hva-wrap.hva-hidden { display: none; }

.hva-hide-btn {
  position: absolute; top: -7px; left: -7px; z-index: 2;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; color: #6b7280; border: 1px solid #e5e7eb;
  font-size: 14px; line-height: 1; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  opacity: 0; transform: scale(.8); pointer-events: none;
  transition: opacity .15s, transform .15s, background .15s, color .15s;
}
.hva-wrap:hover .hva-hide-btn { opacity: 1; transform: scale(1); pointer-events: all; }
.hva-hide-btn:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

.hva-reopen {
  position: fixed; right: 0; bottom: 24px; z-index: 9990;
  width: 30px; height: 46px; border: none; cursor: pointer; padding: 0;
  border-radius: 23px 0 0 23px;
  background: linear-gradient(135deg,#9961FF,#5b8dee);
  box-shadow: -2px 2px 10px rgba(153,97,255,0.4);
  display: none; align-items: center; justify-content: center;
  transform: translateX(9px); transition: transform .15s, width .15s;
}
.hva-reopen.show { display: flex; }
.hva-reopen:hover { transform: translateX(0); width: 38px; }

@media (max-width: 480px) {
  .hva-panel  { width: calc(100vw - 32px); right: 16px; bottom: 82px; }
  .hva-wrap   { right: 16px; bottom: 16px; }
}