/* =============================================
   ÁGUA BONITA CHATBOT — Estilos
   Grupo Água Bonita · Tarumã/SP
   ============================================= */

:root {
  --ab-blue:        #092E77;
  --ab-blue-light:  #EEF4FF;
  --ab-blue-mid:    #2F4389;
  --ab-blue-dark:   #1C2E4A;
  --ab-blue-deep:   #091740;
  --ab-white:       #ffffff;
}

/* ── Launcher (botão flutuante) ── */
#ab-chat-launcher {
  position: fixed;
  bottom: 26px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--ab-blue);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(9,46,119,0.40);
  z-index: 99990;
  transition: transform 0.2s, box-shadow 0.2s;
}
#ab-chat-launcher.ab-right { right: 26px; }
#ab-chat-launcher.ab-left  { left: 26px; }
#ab-chat-launcher:hover {
  transform: scale(1.09);
  box-shadow: 0 6px 22px rgba(9,46,119,0.55);
}
#ab-chat-launcher svg {
  width: 28px;
  height: 28px;
  fill: #fff;
  transition: transform 0.25s;
}

/* Bolinha de notificação */
#ab-notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: #E24B4A;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}
#ab-notif-badge.ab-visible { display: block; }

/* ── Janela do chat ── */
#ab-chat-window {
  position: fixed;
  bottom: 98px;
  width: 375px;
  max-height: 590px;
  background: #f7f7f5;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99989;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.96);
  transition: opacity 0.24s ease, transform 0.24s ease;
}
#ab-chat-window.ab-right { right: 26px; }
#ab-chat-window.ab-left  { left: 26px; }
#ab-chat-window.ab-open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* ── Header ── */
#ab-chat-header {
  background: var(--ab-blue);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.ab-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.ab-header-info { flex: 1; }
.ab-header-name {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.ab-header-status {
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.ab-dot-online {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7CFC00;
  display: inline-block;
}
#ab-btn-close {
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  color: rgba(255,255,255,0.8) !important;
  font-size: 24px !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  box-sizing: border-box !important;
  transition: color 0.15s;
}
#ab-btn-close:hover { color: #fff !important; }

/* ── Área de mensagens ── */
#ab-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f7f5;
  min-height: 180px;
  max-height: 360px;
  scroll-behavior: smooth;
}
#ab-chat-messages::-webkit-scrollbar { width: 4px; }
#ab-chat-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

/* Balões */
.ab-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  word-break: break-word;
}
.ab-msg.ab-bot {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: #222;
}
.ab-msg.ab-user {
  background: var(--ab-blue-mid);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Link dentro das mensagens do chat */
.ab-message-link {
  color: var(--ab-blue) !important;
  text-decoration: underline !important;
  font-weight: 600 !important;
  transition: color 0.15s;
}
.ab-message-link:hover {
  color: var(--ab-blue-mid) !important;
}

/* Typing indicator */
.ab-typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}
.ab-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aaa;
  animation: ab-bounce 1.2s infinite;
}
.ab-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ab-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ab-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%            { transform: translateY(-6px); }
}

/* Card de telefone */
.ab-call-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ab-blue-light);
  border: 1px solid var(--ab-blue-mid);
  border-radius: 10px;
  padding: 9px 12px;
  margin-top: 7px;
  font-size: 13px;
  color: var(--ab-blue-dark);
}
.ab-call-card a {
  color: var(--ab-blue);
  font-weight: 600;
  text-decoration: none;
}
.ab-call-card a:hover { text-decoration: underline; }

/* ── Botões de menu rápido ── */
#ab-quick-btns {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  padding: 6px 12px 8px !important;
  background: #f7f7f5 !important;
  flex-shrink: 0 !important;
  max-height: 95px !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}
.ab-qbtn {
  background: #fff !important;
  border: 1px solid var(--ab-blue-mid) !important;
  color: var(--ab-blue-dark) !important;
  border-radius: 20px !important;
  padding: 5px 10px !important;
  font-size: 11.5px !important;
  cursor: pointer !important;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  height: auto !important;
  line-height: 1.4 !important;
}
.ab-qbtn:hover {
  background: var(--ab-blue-light) !important;
  transform: scale(1.03) !important;
}

/* ── Input área ── */
#ab-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  align-items: flex-end;
  flex-shrink: 0;
}
#ab-chat-input {
  flex: 1;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 20px;
  padding: 9px 15px;
  font-size: 13.5px;
  outline: none;
  resize: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f7f7f5;
  color: #222;
  min-height: 38px;
  max-height: 80px;
  transition: border-color 0.2s;
  line-height: 1.4;
}
#ab-chat-input:focus {
  border-color: var(--ab-blue-mid);
  background: #fff;
}
#ab-btn-send {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: var(--ab-blue) !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  transition: transform 0.15s, background 0.15s;
}
#ab-btn-send:hover { background: var(--ab-blue-mid) !important; }
#ab-btn-send:active { transform: scale(0.92) !important; }
#ab-btn-send svg {
  width: 17px !important;
  height: 17px !important;
  fill: #fff !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── Rodapé ── */
#ab-chat-footer {
  font-size: 11px;
  color: #aaa;
  text-align: center;
  padding: 5px 14px 9px;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Responsivo Mobile ── */
@media (max-width: 420px) {
  #ab-chat-window {
    width: calc(100vw - 20px);
    right: 10px !important;
    left: 10px !important;
    bottom: 88px;
  }
  #ab-chat-launcher.ab-right { right: 14px; bottom: 18px; }
  #ab-chat-launcher.ab-left  { left: 14px;  bottom: 18px; }
}
