/* =====================================================================
   CHATBOT.CSS — Widget flotante "Asistente Virtual"
   Reemplaza el botón flotante de WhatsApp. Vanilla CSS, sin dependencias.
   ===================================================================== */

.va-chatbot{
  position:fixed;
  bottom:24px;
  right:24px;
  z-index:9999;
  font-family:'Inter', sans-serif;
}

/* BURBUJA */
.va-chatbot-bubble{
  width:64px;
  height:64px;
  border-radius:50%;
  border:none;
  background:linear-gradient(135deg,#2f66d0,#3f7ae0);
  box-shadow:0 8px 20px rgba(0,0,0,.2);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  transition:transform .2s ease, box-shadow .2s ease;
}

.va-chatbot-bubble:hover{
  transform:scale(1.06);
  box-shadow:0 10px 26px rgba(0,0,0,.28);
}

.va-chatbot-bubble svg{
  width:30px;
  height:30px;
  fill:#ffffff;
}

.va-chatbot-badge{
  position:absolute;
  top:-4px;
  right:-4px;
  background:#d7e11f;
  color:#1c2a5a;
  font-size:11px;
  font-weight:800;
  width:20px;
  height:20px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  border:2px solid #fff;
}

.va-chatbot-badge[hidden]{
  display:none;
}

/* PANEL */
.va-chatbot-panel{
  position:fixed;
  bottom:100px;
  right:24px;
  width:360px;
  max-width:calc(100vw - 32px);
  height:520px;
  max-height:calc(100vh - 140px);
  background:#fff;
  border-radius:18px;
  box-shadow:0 20px 50px rgba(0,0,0,.25);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  animation:vaFadeUp .25s ease;
}

.va-chatbot-panel[hidden]{
  display:none;
}

@keyframes vaFadeUp{
  from{opacity:0; transform:translateY(16px);}
  to{opacity:1; transform:translateY(0);}
}

/* HEADER */
.va-chatbot-header{
  background:linear-gradient(90deg,#2f66d0,#3f7ae0);
  color:#fff;
  padding:16px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-shrink:0;
}

.va-chatbot-header-info{
  display:flex;
  align-items:center;
  gap:12px;
}

.va-chatbot-avatar{
  width:40px;
  height:40px;
  border-radius:50%;
  background:rgba(255,255,255,.2);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  flex-shrink:0;
}

.va-chatbot-name{
  font-weight:700;
  font-size:15px;
  line-height:1.3;
}

.va-chatbot-status{
  font-size:12px;
  opacity:.9;
  display:flex;
  align-items:center;
  gap:6px;
}

.va-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#4ade80;
  display:inline-block;
  box-shadow:0 0 0 2px rgba(255,255,255,.3);
}

.va-chatbot-close{
  background:transparent;
  border:none;
  color:#fff;
  font-size:18px;
  cursor:pointer;
  width:30px;
  height:30px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .2s ease;
}

.va-chatbot-close:hover{
  background:rgba(255,255,255,.18);
}

/* BODY / MENSAJES */
.va-chatbot-body{
  flex:1;
  overflow-y:auto;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  background:#f6f8fc;
}

.va-msg{
  max-width:82%;
  padding:10px 14px;
  border-radius:14px;
  font-size:14px;
  line-height:1.45;
  white-space:pre-line;
}

.va-msg-bot{
  align-self:flex-start;
  background:#fff;
  color:#1a1a1a;
  border-bottom-left-radius:4px;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
}

.va-msg-user{
  align-self:flex-end;
  background:#2f66d0;
  color:#fff;
  border-bottom-right-radius:4px;
}

.va-msg-alert{
  align-self:flex-start;
  background:#fff7e6;
  border:1px solid #ffd98e;
  color:#7a4a00;
  border-radius:14px;
  font-weight:600;
}

/* TYPING */
.va-typing{
  align-self:flex-start;
  background:#fff;
  border-radius:14px;
  border-bottom-left-radius:4px;
  padding:12px 16px;
  display:flex;
  gap:4px;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
}

.va-typing span{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#9aa5b1;
  display:inline-block;
  animation:vaTyping 1s infinite ease-in-out;
}

.va-typing span:nth-child(2){ animation-delay:.15s; }
.va-typing span:nth-child(3){ animation-delay:.3s; }

@keyframes vaTyping{
  0%, 60%, 100%{ transform:translateY(0); opacity:.5; }
  30%{ transform:translateY(-4px); opacity:1; }
}

/* BOTONES DE DECISIÓN / WHATSAPP */
.va-msg-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:4px;
}

.va-btn{
  border:none;
  border-radius:24px;
  padding:10px 16px;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease;
}

.va-btn:hover{
  transform:translateY(-1px);
}

.va-btn-primary{
  background:#25D366;
  color:#fff;
}

.va-btn-secondary{
  background:#e5e7eb;
  color:#374151;
}

.va-btn-whatsapp{
  background:#25D366;
  color:#fff;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:6px;
}

/* INPUT */
.va-chatbot-input-area{
  display:flex;
  align-items:center;
  gap:8px;
  padding:12px;
  border-top:1px solid #eef0f3;
  background:#fff;
  flex-shrink:0;
}

.va-chatbot-input{
  flex:1;
  border:1px solid #dfe3ea;
  border-radius:24px;
  padding:11px 16px;
  font-size:14px;
  font-family:inherit;
  outline:none;
}

.va-chatbot-input:focus{
  border-color:#2f66d0;
}

.va-chatbot-send{
  width:40px;
  height:40px;
  border-radius:50%;
  border:none;
  background:#2f66d0;
  color:#fff;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

.va-chatbot-send:hover{
  background:#25549f;
}

.va-chatbot-hint{
  font-size:11px;
  color:#9aa5b1;
  padding:0 16px 10px;
  background:#fff;
}

/* RESPONSIVE */
@media(max-width:480px){
  .va-chatbot{
    bottom:16px;
    right:16px;
  }

  .va-chatbot-panel{
    right:16px;
    bottom:88px;
    width:calc(100vw - 32px);
    height:calc(100vh - 120px);
  }
}
