/* Widget com suporte a Bootstrap 4 + tema e botões */
.cb-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483647;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

.cb-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 30px;
  color:#fff;
}

.cb-header {
  padding: 20px 18px;
text-transform: uppercase;
font-weight: bold !important;
background: #4f46e5;
color: white;
  border-bottom: 1px solid rgba(0,0,0,.06);
  display:flow;
  align-items:center;
  gap:8px;
}

.cb-messages {
  padding: 12px;
  overflow-y: auto;
  height: 420px;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

.cb-inputbar {
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(0,0,0,.06);
  padding: 10px;
}

.cb-inputbar input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.cb-inputbar button {
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.cb-bubble {
  
    padding: 10px 12px;
    border-radius: 5px;
    margin: 6px 6px 6px 0px;
    max-width: 100%;
    
}

.cb-bubble.user {
  background: #fffed9;
  align-self: flex-end;
  margin-left: auto;
  box-shadow: 0px 0px 20px 0px #e5e5e5;
  margin-top: 20px;
  text-align: right;
  font-weight: bold!important;  
  font-size: 14px!important;
}

.cb-bubble.bot {
  box-shadow: 0px 0px 20px 0px #e5e5e5;
  background: #ffffff !important;
  text-align: left;
  font-size: 14px!important;
}

.cb-bubble span, .cb-bubble b, .cb-bubble strong, .cb-bubble li {
  font-size: 14px!important;
}
.cb-suggestion {
      display: block;
    margin: 6px 6px 0 0;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    background: #e9e9e9 !important;
    font-weight: 600;
}

.cb-suggestion:hover{
    background: #fcfcfc !important;
}

.cb-theme-dark .cb-panel{ background:#151515; color:#f2f2f2!important; border-color:#333; }
.cb-theme-dark .cb-bubble.bot{ background:#222; color:#f2f2f2!important; }
.cb-theme-dark .cb-bubble.user{ background:#203a5e;  color:#f2f2f2!important;}
.cb-theme-dark label{font-weight: bold;color:#ffffff!important;}
.cb-theme-dark .cb-suggestion{ background:#dfff6b;  color:#000000!important;}

.cb-prechat { padding: 12px; }
.cb-prechat .cb-field{ margin-bottom:10px; }
.cb-prechat input[type="text"], .cb-prechat input[type="email"]{
  width:100%; padding:10px; border:1px solid #ddd; border-radius:8px;
}
.cb-prechat .cb-privacy{ font-size:12px; opacity:.8; }
.cb-btn { display:inline-block; margin-top:8px; padding:8px 12px; border-radius:8px; border:1px solid rgba(0,0,0,.12); text-decoration:none; }

/* 🔹 Responsividade Mobile */
@media (max-width: 480px) {
  .cb-panel {
    width: 100% !important;
    height: 100% !important; /* vira tela cheia */
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 0; /* estilo app */
    max-height: none;
  }

  .cb-messages {
    height: calc(100% - 160px); /* ajusta altura dinamicamente */
  }
}
/* Estilo do indicador "digitando..." */
.cb-typing {
  display: flex;
  gap: 2px;
  margin: 8px 0;
  padding: 10px 15px;
  background: #f1f1f1;
  border-radius: 12px;
  max-width: fit-content;
}

.cb-typing span {
  width: 8px;
  height: 8px;
  background: #555;
  border-radius: 50%;
  animation: blink 1.2s infinite;
}

.cb-typing span:nth-child(2) { animation-delay: .3s }
.cb-typing span:nth-child(3) { animation-delay: .6s }

@keyframes blink {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}
.cb-prechat .cb-field {
    margin-bottom: 10px;
    font-weight: bold !important;
}
.cb-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #4f46e5;
    text-decoration: none;
    background: #4f46e5;
    color: white;
}

.cb-bubble.bot {
  white-space: normal; /* preserva quebras de linha */
}
/* botão fixo acima da barra de input */
.cb-copy {
  display: flow-root!important; 
  justify-content: flex-end;
  align-items: center;
  padding: 6px 10px;
  border-top: 0px solid rgba(0,0,0,0.06);
  background: transparent;
  box-sizing: border-box;
  width: 100%;
}


/* botão simples e discreto */
.cb-copy-btn {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  text-align: center;
}
.cb-copy-btn:hover { background: rgba(0,0,0,0.04); }
.cb-btn-link {
    border: 1px solid !important;
    padding: 5px 10px !important;
    border-radius: 10px !important;
    text-decoration: none !important;
}
.cb-btn-link:hover {
    background: #3b82f6 !important;
    color: white !important;
}
.cb-messages img {
    max-width: 100%;
    border-radius: 8px;
}

.cb-panel {
  position: fixed;
  right: 20px;
  bottom: 15px;
  width: 350px;
  max-width: 100%;
  height: 70vh;               /* usa a altura da tela */
  min-height: 400px;          /* altura mínima */
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.24);
  display: none;
  border: 1px solid rgba(0,0,0,.08);
  z-index: 999999999 !important;
  flex-direction: column;     /* organiza header, mensagens e input */
}

.cb-messages {
  flex: 1;                    /* ocupa espaço entre header e input */
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

.cb-inputbar {
  flex-shrink: 0;             /* mantém visível */
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(0,0,0,.06);
  padding: 10px;
  background: #fff;           /* garante contraste */
}

/* Mobile: ocupar tela cheia */
@media (max-width: 420px) {
  .cb-panel {
    width: 100% !important;
    height: 100% !important;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 0;
    max-height: none;
  }
}
