/* ============================================================
   Asistente Virtual — widget de chat flotante
   ============================================================ */

.cb-bubble{
  position:fixed;
  bottom:20px;
  right:20px;
  width:62px;
  height:62px;
  border-radius:50%;
  background:var(--accent,#25D366);
  border:none;
  cursor:pointer;
  box-shadow:0 10px 25px rgba(0,0,0,.25);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  transition:transform .2s;
}
.cb-bubble:hover{transform:scale(1.06);}
.cb-bubble svg{width:30px;height:30px;fill:#fff;}
.cb-bubble .cb-bubble-dot{
  position:absolute;
  top:2px;
  right:2px;
  width:14px;
  height:14px;
  background:#ff4d4f;
  border:2px solid #fff;
  border-radius:50%;
}

.cb-window{
  position:fixed;
  bottom:96px;
  right:20px;
  width:340px;
  max-width:calc(100vw - 24px);
  height:480px;
  max-height:calc(100vh - 140px);
  background:#fff;
  border-radius:16px;
  box-shadow:0 20px 50px rgba(0,0,0,.25);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  z-index:9999;
  font-family:Arial,Helvetica,sans-serif;
  opacity:0;
  transform:translateY(16px);
  pointer-events:none;
  transition:opacity .2s ease,transform .2s ease;
}
.cb-window.open{
  opacity:1;
  transform:translateY(0);
  pointer-events:auto;
}

.cb-header{
  background:var(--primary,#143b4f);
  color:#fff;
  padding:14px 16px;
  display:flex;
  align-items:center;
  gap:12px;
}
.cb-header-avatar{
  width:40px;
  height:40px;
  border-radius:50%;
  background:var(--accent,#25D366);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:bold;
  font-size:16px;
  flex-shrink:0;
}
.cb-header-info{flex:1;min-width:0;}
.cb-header-title{font-size:15px;font-weight:bold;}
.cb-header-status{
  font-size:12px;
  color:#cfe9d9;
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:2px;
}
.cb-status-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#25D366;
  box-shadow:0 0 0 2px rgba(37,211,102,.35);
}
.cb-close{
  background:none;
  border:none;
  color:#fff;
  font-size:20px;
  cursor:pointer;
  line-height:1;
  padding:4px 6px;
  opacity:.85;
}
.cb-close:hover{opacity:1;}

.cb-body{
  flex:1;
  overflow-y:auto;
  padding:16px;
  background:#f5f9fc;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.cb-msg{
  max-width:82%;
  padding:10px 14px;
  border-radius:14px;
  font-size:13.5px;
  line-height:1.5;
  white-space:pre-line;
}
.cb-msg-bot{
  align-self:flex-start;
  background:#fff;
  color:#333;
  border-bottom-left-radius:4px;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
}
.cb-msg-user{
  align-self:flex-end;
  background:var(--accent,#25D366);
  color:#fff;
  border-bottom-right-radius:4px;
}
.cb-msg-alert{
  align-self:flex-start;
  background:#fff7e0;
  border:1px solid #f1d98a;
  color:#6b5400;
}

.cb-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);
}
.cb-typing span{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#9fb3bf;
  animation:cb-blink 1.2s infinite ease-in-out;
}
.cb-typing span:nth-child(2){animation-delay:.2s;}
.cb-typing span:nth-child(3){animation-delay:.4s;}
@keyframes cb-blink{
  0%,80%,100%{opacity:.3;transform:translateY(0);}
  40%{opacity:1;transform:translateY(-3px);}
}

.cb-error{
  align-self:flex-start;
  color:#c0392b;
  font-size:12px;
  padding:0 4px;
}

.cb-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-self:flex-start;
  max-width:100%;
}
.cb-btn{
  border:none;
  border-radius:20px;
  padding:9px 16px;
  font-size:13px;
  font-weight:bold;
  cursor:pointer;
}
.cb-btn-primary{
  background:var(--accent,#25D366);
  color:#fff;
}
.cb-btn-secondary{
  background:#e7edf1;
  color:#333;
}
.cb-btn-whatsapp{
  background:#25D366;
  color:#fff;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:6px;
}

.cb-inputrow{
  display:flex;
  gap:8px;
  padding:12px;
  border-top:1px solid #e6eef4;
  background:#fff;
}
.cb-inputrow input{
  flex:1;
  border:1px solid #d7e2ea;
  border-radius:20px;
  padding:10px 14px;
  font-size:13.5px;
  outline:none;
  font-family:inherit;
}
.cb-inputrow input:focus{border-color:var(--accent,#25D366);}
.cb-send{
  background:var(--primary,#143b4f);
  color:#fff;
  border:none;
  width:38px;
  height:38px;
  border-radius:50%;
  cursor:pointer;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
}
.cb-send svg{width:16px;height:16px;fill:#fff;}

@media(max-width:480px){
  .cb-window{
    right:12px;
    left:12px;
    width:auto;
    bottom:88px;
  }
  .cb-bubble{right:16px;bottom:16px;}
}
