/* ── Esconde o botão WhatsApp antigo do bundle principal ─────────── */
/* Nosso widget substitui ele com mais recursos */
.whatsapp-float {
  display: none !important;
}

/* ── Avante Chat Widget ──────────────────────────────────────────── */

.av-chat-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Launcher button */
.av-chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.2rem 0.85rem 0.85rem;
  background: #25d366;
  color: #fff;
  box-shadow: 0 16px 40px rgba(37, 211, 102, 0.38);
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.28s ease;
  white-space: nowrap;
}

.av-chat-launcher:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 22px 50px rgba(37, 211, 102, 0.46);
}

.av-chat-launcher-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.av-chat-launcher-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: #fff;
}

.av-chat-launcher-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.av-chat-launcher-copy strong {
  font-size: 0.94rem;
  font-weight: 800;
}

.av-chat-launcher-copy span {
  font-size: 0.7rem;
  opacity: 0.82;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Panel */
.av-chat-panel {
  position: absolute;
  bottom: calc(100% + 0.85rem);
  right: 0;
  width: min(360px, calc(100vw - 2rem));
  border-radius: 1.4rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 30px 70px rgba(18, 58, 32, 0.16);
  border: 1px solid rgba(18, 58, 32, 0.1);
  transform-origin: bottom right;
  animation: avChatPanelIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.av-chat-panel[hidden] {
  display: none;
}

@keyframes avChatPanelIn {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(18px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Header */
.av-chat-header {
  padding: 1rem 1rem 0.9rem;
  background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.av-chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.av-chat-avatar {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.av-chat-header-text h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
}

.av-chat-header-text p {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  opacity: 0.84;
}

.av-chat-online {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #4ade80;
  margin-right: 0.3rem;
  animation: avOnlinePulse 2s ease-in-out infinite;
}

@keyframes avOnlinePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.av-chat-close {
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.18s;
}

.av-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Body */
.av-chat-body {
  padding: 1rem;
}

/* States */
.av-chat-state {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.av-chat-state[hidden],
.av-chat-success[hidden] {
  display: none;
}

/* Intro bubble */
.av-chat-bubble {
  background: #f0f4ee;
  border-radius: 1rem;
  border-top-left-radius: 0.3rem;
  padding: 0.9rem 1rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #1c3a22;
}

/* Form */
.av-chat-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.av-chat-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #374151;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.av-chat-input,
.av-chat-textarea {
  border: 1.5px solid #d1d5db;
  border-radius: 0.85rem;
  padding: 0.72rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.18s;
  width: 100%;
  box-sizing: border-box;
}

.av-chat-input:focus,
.av-chat-textarea:focus {
  border-color: #25d366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.14);
}

.av-chat-textarea {
  resize: none;
  min-height: 80px;
  line-height: 1.6;
}

.av-chat-hint {
  font-size: 0.7rem;
  color: #9ca3af;
  line-height: 1.4;
}

/* Submit */
.av-chat-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  border-radius: 0.95rem;
  padding: 0.85rem 1rem;
  background: #25d366;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.22s, background 0.22s, box-shadow 0.22s;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.3);
}

.av-chat-submit:hover {
  background: #1dbc59;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.4);
}

.av-chat-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.av-chat-submit svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

/* Error */
.av-chat-error {
  font-size: 0.78rem;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.6rem;
  padding: 0.5rem 0.75rem;
}

.av-chat-error[hidden] {
  display: none;
}

/* Success */
.av-chat-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  padding: 0.5rem 0;
}

.av-chat-success-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  background: #dcfce7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.av-chat-success h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1c3a22;
}

.av-chat-success p {
  margin: 0;
  font-size: 0.84rem;
  color: #4b5563;
  line-height: 1.65;
}

.av-chat-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 0.85rem;
  padding: 0.78rem 1.2rem;
  background: #25d366;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.av-chat-wa-btn:hover {
  background: #1dbc59;
  transform: translateY(-2px);
}

.av-chat-wa-btn svg {
  width: 1rem;
  height: 1rem;
  fill: #fff;
}

/* ── Mobile ─────────────────────────────────────────── */
@media (max-width: 767px) {
  .av-chat-root {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .av-chat-panel {
    width: min(340px, calc(100vw - 1.5rem));
  }

  .av-chat-launcher-copy {
    display: none;
  }

  .av-chat-launcher {
    padding: 0.85rem;
    border-radius: 999px;
  }
}

/* ── Garante que o IA Avante (esquerda) não colida em telas médias ── */
@media (max-width: 900px) and (min-width: 768px) {
  .avante-ai-launcher-copy span {
    display: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .av-chat-launcher,
  .av-chat-panel,
  .av-chat-submit,
  .av-chat-wa-btn {
    animation: none !important;
    transition: none !important;
  }
}
