/* ══════════════════════════════════════════════════════════════
   ROTAS DOS PEREGRINOS — assistente virtual (canto inferior direito)
   Usa as variáveis de cor/fonte de style.css
   ══════════════════════════════════════════════════════════════ */

.chat-lancador {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 70;
  width: 62px; height: 62px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: var(--yellow);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  transition: transform .18s ease;
}
.chat-lancador:hover { transform: scale(1.06); }
.chat-lancador:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.chat-lancador .ico-fechar { display: none; }
.chat-aberto .chat-lancador .ico-abrir { display: none; }
.chat-aberto .chat-lancador .ico-fechar { display: block; }

/* pulso chamando atenção enquanto o chat não foi aberto */
.chat-lancador.chamando::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--yellow);
  animation: chat-pulso 2s ease-out infinite;
}
@keyframes chat-pulso {
  from { transform: scale(1); opacity: .8; }
  to   { transform: scale(1.5); opacity: 0; }
}

.chat-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #d93025;
  color: #fff;
  font: 700 .75rem/22px var(--f-corpo);
  text-align: center;
  display: none;
}
.chat-badge.visivel { display: block; }

/* — balão de convite — */
.chat-convite {
  position: fixed;
  right: 1.1rem;
  bottom: 5.6rem;
  z-index: 70;
  width: min(300px, calc(100vw - 2rem));
  padding: 1rem 2.2rem 1rem 1rem;
  background: var(--branco);
  color: var(--ink);
  border-radius: var(--raio) var(--raio) 4px var(--raio);
  box-shadow: var(--sombra), 0 2px 6px rgba(0, 0, 0, .08);
  font-size: .95rem;
  line-height: 1.45;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px) scale(.97);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.chat-convite.visivel { opacity: 1; transform: none; pointer-events: auto; }
.chat-convite strong { color: var(--navy); }
.chat-convite-fechar {
  position: absolute;
  top: .35rem; right: .35rem;
  width: 28px; height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #7a8492;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.chat-convite-fechar:hover { background: #eef0f3; }

/* — janela — */
.chat-janela {
  position: fixed;
  right: 1.1rem;
  bottom: 5.6rem;
  z-index: 70;
  width: min(380px, calc(100vw - 2rem));
  height: min(560px, calc(100dvh - 7.5rem));
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border-radius: var(--raio);
  box-shadow: 0 18px 50px rgba(11, 26, 46, .35);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}
.chat-aberto .chat-janela {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
  transition: opacity .25s ease, transform .25s ease;
}

.chat-topo {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  background: var(--navy);
  color: var(--branco);
}
.chat-avatar {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--navy);
  display: grid;
  place-items: center;
  font: 700 1.3rem/1 var(--f-display);
}
.chat-topo-texto { flex: 1; min-width: 0; line-height: 1.25; }
.chat-topo-texto strong {
  display: block;
  font-family: var(--f-display);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 1.1rem;
}
.chat-topo-texto span { font-size: .8rem; color: rgba(255, 255, 255, .75); }
.chat-topo-texto span::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: .35rem;
  border-radius: 50%;
  background: #34c759;
  vertical-align: 1px;
}
.chat-minimizar {
  width: 34px; height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: var(--branco);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.chat-minimizar:hover { background: rgba(255, 255, 255, .2); }

.chat-mensagens {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  overscroll-behavior: contain;
}
.chat-msg {
  max-width: 85%;
  padding: .65rem .85rem;
  border-radius: 14px;
  font-size: .94rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  animation: chat-entra .25s ease;
}
.chat-msg p + p, .chat-msg p + ul, .chat-msg ul + p { margin-top: .45rem; }
.chat-msg ul { padding-left: 1.1rem; }
.chat-msg li + li { margin-top: .15rem; }
.chat-msg strong { color: var(--navy); }
.chat-msg-bot {
  align-self: flex-start;
  background: var(--branco);
  color: var(--ink);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(11, 26, 46, .08);
}
.chat-msg-user {
  align-self: flex-end;
  background: var(--navy);
  color: var(--branco);
  border-bottom-right-radius: 4px;
}
.chat-msg-erro { background: #fdecea; color: #8a1c13; }
@keyframes chat-entra { from { opacity: 0; transform: translateY(6px); } }

.chat-digitando { display: inline-flex; gap: 4px; padding: .3rem 0; }
.chat-digitando i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #9aa3ae;
  animation: chat-ponto 1.2s infinite ease-in-out;
}
.chat-digitando i:nth-child(2) { animation-delay: .15s; }
.chat-digitando i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-ponto { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.chat-sugestoes {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: 0 1rem .6rem;
}
.chat-sugestoes:empty { display: none; }
.chat-sugestoes button {
  border: 1.5px solid var(--navy);
  background: transparent;
  color: var(--navy);
  border-radius: 999px;
  padding: .35rem .8rem;
  font: 600 .85rem var(--f-corpo);
  cursor: pointer;
}
.chat-sugestoes button:hover { background: var(--navy); color: var(--branco); }

.chat-form {
  display: flex;
  gap: .5rem;
  padding: .7rem;
  background: var(--branco);
  border-top: 1px solid #e6e1d4;
}
.chat-form textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid #d9d3c3;
  border-radius: 12px;
  padding: .6rem .75rem;
  font: 1rem/1.4 var(--f-corpo);   /* 16px evita zoom no iPhone */
  color: var(--ink);
  max-height: 110px;
  background: var(--cream);
}
.chat-form textarea:focus { outline: none; border-color: var(--navy); background: var(--branco); }
.chat-enviar {
  flex: none;
  width: 44px; height: 44px;
  align-self: flex-end;
  border: 0;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--navy);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.chat-enviar:disabled { opacity: .5; cursor: default; }
.chat-rodape-nota {
  padding: 0 .9rem .55rem;
  background: var(--branco);
  font-size: .72rem;
  color: #7a8492;
  text-align: center;
}
.chat-rodape-nota a { color: var(--navy); }

/* WhatsApp flutuante sobe para dar lugar ao chat */
.zap-flutuante { bottom: 5.6rem; width: 50px; height: 50px; right: 1.5rem; }
.chat-aberto .zap-flutuante, .chat-convite-ativo .zap-flutuante { opacity: 0; pointer-events: none; }

@media (max-width: 480px) {
  .chat-janela {
    right: 0; bottom: 0;
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
  .chat-aberto .chat-lancador { display: none; }
  .chat-aberto { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-lancador.chamando::before, .chat-msg, .chat-digitando i { animation: none; }
  .chat-janela, .chat-convite, .chat-lancador { transition: none; }
}
