/* Chat do site com a Bia. Usa as variáveis de estilo.css. */

.chat-so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Botão que abre a conversa */
.chat-lancador { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: var(--petroleo); color: #fff; font-family: var(--corpo); font-size: 1rem; font-weight: 700; cursor: pointer; box-shadow: 0 14px 30px -14px rgba(10, 46, 53, 0.75); transition: background-color 0.15s; }
.chat-lancador:hover { background: var(--petroleo-fundo); }
.chat-lancador[hidden] { display: none; }
.chat-lancador-sinal { width: 26px; height: 22px; border-radius: 9px 9px 9px 3px; background: var(--conversa); flex: none; }
.chat-lancador-novo { background: var(--ouro); color: var(--petroleo); font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; }
.chat-lancador-novo[hidden] { display: none; }

/* Janela da conversa */
.chat-painel { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 392px; max-width: calc(100vw - 40px); height: min(620px, calc(100vh - 40px)); height: min(620px, calc(100dvh - 40px)); display: flex; flex-direction: column; background: var(--nevoa); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 70px -30px rgba(10, 46, 53, 0.8), 0 0 0 1px rgba(14, 59, 67, 0.12); }
.chat-painel[hidden] { display: none; }

.chat-topo { display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 16px; background: var(--petroleo); color: #fff; flex: none; }
.chat-foto { width: 44px; height: 44px; border-radius: 50%; background: var(--conversa-clara); color: var(--petroleo); display: grid; place-items: center; font-family: var(--titulo); font-weight: 800; font-size: 1.25rem; flex: none; }
.chat-quem { flex: 1; min-width: 0; line-height: 1.25; }
.chat-quem strong { display: block; font-family: var(--titulo); font-size: 1.2rem; font-weight: 800; }
.chat-quem span { display: block; font-size: 0.84rem; color: #cfe3df; }
.chat-ponto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #4fdc9c; margin-right: 6px; vertical-align: 1px; }
.chat-fechar { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; flex: none; position: relative; }
.chat-fechar:hover { background: rgba(255, 255, 255, 0.14); }
.chat-fechar span::before, .chat-fechar span::after { content: ''; position: absolute; left: 13px; top: 21px; width: 18px; height: 2px; border-radius: 2px; background: #fff; transform: rotate(45deg); }
.chat-fechar span::after { transform: rotate(-45deg); }
.chat-topo :focus-visible { outline-color: #fff; }

.chat-corpo { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 14px 8px; }
.chat-corpo:focus-visible { outline-offset: -3px; }
.chat-falas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chat-fala { display: flex; flex-direction: column; max-width: 86%; }
.chat-fala p { margin: 0; padding: 10px 14px; border-radius: 18px; font-size: 1rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-fala-atendente { align-self: flex-start; align-items: flex-start; }
.chat-fala-atendente p { background: #fff; color: var(--tinta); border-top-left-radius: 5px; box-shadow: 0 1px 0 rgba(14, 59, 67, 0.08); }
.chat-fala-voce { align-self: flex-end; align-items: flex-end; }
.chat-fala-voce p { background: var(--petroleo); color: #fff; border-top-right-radius: 5px; }
.chat-fala a { color: inherit; font-weight: 600; }
.chat-imagem { display: block; margin-top: 4px; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 1px 0 rgba(14, 59, 67, 0.08); }
.chat-imagem img { display: block; width: 100%; max-width: 280px; height: auto; min-height: 120px; }
.chat-autor { font-size: 0.78rem; color: var(--tinta-suave); margin: 3px 6px 0; }

.chat-digitando p { display: inline-flex; gap: 5px; padding: 14px 16px; }
.chat-digitando i { width: 7px; height: 7px; border-radius: 50%; background: var(--tinta-suave); animation: chat-pulso 1.2s infinite ease-in-out; }
.chat-digitando i:nth-of-type(2) { animation-delay: 0.15s; }
.chat-digitando i:nth-of-type(3) { animation-delay: 0.3s; }
@keyframes chat-pulso { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .chat-digitando i { animation: none; opacity: 0.6; } }

.chat-atalhos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chat-atalhos button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--petroleo); background: transparent; color: var(--petroleo); font-family: var(--corpo); font-size: 0.95rem; font-weight: 600; cursor: pointer; }
.chat-atalhos button:hover { background: var(--petroleo); color: #fff; }
.chat-erro { align-self: stretch; background: #fde8e2; color: #8a2a12; border-radius: 12px; padding: 10px 14px; font-size: 0.92rem; }

.chat-escrever { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 6px; background: #fff; border-top: 1px solid var(--linha); flex: none; }
.chat-escrever textarea { flex: 1; min-height: 46px; max-height: 120px; resize: none; border: 1.5px solid var(--linha); border-radius: 23px; padding: 10px 16px; font-family: var(--corpo); font-size: 1rem; line-height: 1.4; color: var(--tinta); background: #fff; }
.chat-escrever textarea:focus { outline: none; border-color: var(--petroleo); }
.chat-enviar { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--ouro); color: var(--petroleo); display: grid; place-items: center; cursor: pointer; flex: none; }
.chat-enviar:hover { background: var(--ouro-forte); }
.chat-enviar:disabled { opacity: 0.5; cursor: default; }
.chat-nota { margin: 0; padding: 0 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; font-size: 0.74rem; line-height: 1.35; color: var(--tinta-suave); flex: none; }
.chat-nota a { color: inherit; }

@media (max-width: 600px) {
  /* No celular a conversa ocupa a tela toda e a página atrás não rola. */
  .chat-painel { inset: 0; width: auto; max-width: none; height: auto; border-radius: 0; box-shadow: none; }
  .chat-topo { padding-top: calc(12px + env(safe-area-inset-top)); }
  html.chat-aberto, html.chat-aberto body { overflow: hidden; }
  html.chat-aberto .lp-fixo { display: none; }
  /* No celular o botão vira um círculo no canto para não cobrir os botões da página (03/12/2026); o texto continua para leitor de tela. */
  .chat-lancador { right: 14px; bottom: 14px; width: 56px; height: 56px; min-height: 0; padding: 0; justify-content: center; gap: 0; }
  .chat-lancador-texto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .chat-lancador-novo { position: absolute; top: -6px; right: -6px; }
  html.chat-acoes-visiveis .chat-lancador { opacity: 0; pointer-events: none; }
  .chat-lancador { transition: opacity 0.2s; }
  /* Na landing o botão fixo de teste ocupa o rodapé: o chat fica logo acima dele. */
  .lp .chat-lancador { bottom: 82px; }
  .chat-escrever textarea { font-size: 16px; } /* menor que isso o iPhone dá zoom ao focar */
}
