/* Chat de atendimento e conversa dentro do pedido. Cores da marca TBA. */
.tba-chat { position: fixed; right: 18px; bottom: 18px; z-index: 9999; font-size: 15px; display: flex; flex-direction: column; align-items: flex-end; }
.tba-chat[hidden] { display: none; }
/* O botão único "Fale com a TBA" (atendimento unificado, 07/10/2026): grafite
   da identidade (#1f2a36, contraste de cerca de 14:1 com o branco), com um selo verde do
   WhatsApp no ícone — o verde fica só no selo, para não confundir com o
   botão do próprio WhatsApp. Também é <a> quando abre o WhatsApp (sem chat). */
.tba-chat .tba-chat-botao { display: flex; align-items: center; gap: .55rem; background: #1f2a36; color: #fff; border: 0; border-radius: 999px; padding: .65rem 1.15rem .65rem .8rem; cursor: pointer; box-shadow: 0 6px 18px rgba(31,41,55,.28); font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; }
.tba-chat a.tba-chat-botao, .tba-chat a.tba-chat-botao:visited { color: #fff; text-decoration: none; }
.tba-chat .tba-chat-botao:hover, a.tba-chat-botao:hover { background: #2c3b4c; color: #fff; }
.tba-chat .tba-chat-botao:focus-visible { outline: 3px solid #F2E726; outline-offset: 2px; }
.tba-chat-icone { position: relative; display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; }
.tba-chat-icone > svg { display: block; }
.tba-chat-selo { position: absolute; right: -5px; bottom: -4px; width: 16px; height: 16px; border-radius: 50%; background: #25D366; color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #1f2a36; }
.tba-chat-selo svg { display: block; }
.tba-chat.aberto .tba-chat-botao { background: #2c3b4c; }
.tba-chat-badge { background: #F2E726; color: #1F2937; border-radius: 999px; padding: 0 .45rem; font-size: .8em; font-weight: 700; }
.tba-chat-painel { width: min(360px, calc(100vw - 36px)); background: #fff; border: 1px solid #E4E6EA; border-radius: 10px; box-shadow: 0 12px 34px rgba(31,41,55,.22); margin-bottom: .6rem; overflow: hidden; }
.tba-chat-topo { display: flex; justify-content: space-between; align-items: center; background: #1f2a36; color: #fff; padding: .7rem .9rem; }
.tba-chat-topo strong { display: block; }
.tba-chat-sub { display: block; font-size: .78em; color: #cbd5e1; margin-top: .1rem; }
.tba-chat .tba-chat-fechar { background: none; border: 0; color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.tba-chat-lista { max-height: 44vh; overflow: auto; padding: .8rem; background: #F7F7F8; }
.tba-chat-vazio { color: #4B5563; font-size: .92em; margin: 0; }
.tba-chat-msg { margin: 0 0 .6rem; max-width: 85%; }
.tba-chat-msg.eu { margin-left: auto; text-align: right; }
.tba-chat-msg p { margin: 0; padding: .5rem .7rem; border-radius: 10px; background: #fff; border: 1px solid #E4E6EA; display: inline-block; text-align: left; }
.tba-chat-msg.eu p { background: #FDEDEF; border-color: #f3c9d0; }
.tba-chat-cab { display: block; font-size: .76em; color: #6B7280; margin-bottom: .2rem; }
.tba-chat-rodape { display: flex; gap: .4rem; padding: .6rem; border-top: 1px solid #E4E6EA; }
.tba-chat-campo { flex: 1; resize: none; border: 1px solid #E4E6EA; border-radius: 6px; padding: .45rem .6rem; font: inherit; }
.tba-chat .tba-chat-enviar { background: #C01E36; color: #fff; border: 0; border-radius: 6px; padding: 0 .9rem; cursor: pointer; font-weight: 600; }
.tba-chat .tba-chat-enviar[disabled] { opacity: .6; cursor: default; }

/* Conversa dentro do pedido */
.tba-conversa { border-top: 1px solid #E4E6EA; margin-top: 2rem; padding-top: 1rem; }
.tba-conversa-ajuda { color: #4B5563; }
.tba-conversa-lista { list-style: none; margin: 0 0 1rem; padding: 0; }
.tba-conversa-lista li { border: 1px solid #E4E6EA; border-radius: 8px; padding: .7rem .9rem; margin: 0 0 .6rem; background: #fff; max-width: 85%; }
.tba-conversa-lista li.cliente { margin-left: auto; background: #FDEDEF; border-color: #f3c9d0; }
.tba-conversa-lista .quem { font-weight: 600; margin-right: .5rem; }
.tba-conversa-lista .quando { color: #6B7280; font-size: .85em; }
.tba-conversa-lista p { margin: .3rem 0 0; }
.tba-conversa-lista .anexos img { max-width: 110px; border-radius: 6px; margin: .5rem .5rem 0 0; }
.tba-conversa-vazia { color: #6B7280; }
.tba-conversa-form textarea { width: 100%; min-height: 84px; resize: vertical; border: 1px solid #E4E6EA; border-radius: 8px; padding: .6rem .75rem; font: inherit; }
.tba-conversa-form textarea:focus { outline: 2px solid #C01E36; outline-offset: 1px; border-color: #C01E36; }
.tba-conversa-acoes { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.tba-conversa-anexo { font-size: .9em; color: #4B5563; }

/* Assistente virtual: fala com a cor neutra e o nome dele no cabeçalho */
.tba-chat-msg p { white-space: pre-line; overflow-wrap: anywhere; }
.tba-chat-msg.bot p { background: #fff; border-color: #D8DCE3; }
.tba-chat-msg p a { color: #C01E36; font-weight: 600; }
.tba-chat-digitando p { display: inline-flex; gap: 4px; padding: .7rem .8rem; }
.tba-chat-digitando p span { width: 7px; height: 7px; border-radius: 50%; background: #9CA3AF; animation: tba-digitando 1.2s infinite ease-in-out; }
.tba-chat-digitando p span:nth-child(2) { animation-delay: .2s; }
.tba-chat-digitando p span:nth-child(3) { animation-delay: .4s; }
@keyframes tba-digitando { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .tba-chat-digitando p span { animation: none; opacity: .7; } }

/* Visitante: nome e contato antes da primeira mensagem */
.tba-chat-ident { display: grid; gap: .4rem; padding: .6rem .6rem 0; border-top: 1px solid #E4E6EA; }
.tba-chat-ident[hidden] { display: none; }
.tba-chat-ident input.tba-chat-campo { width: 100%; box-sizing: border-box; }
.tba-chat-ident small { color: #6B7280; font-size: .78em; }
.tba-chat-isca { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.tba-chat-msg p a.tba-chat-link { display: inline-block; margin-top: .2rem; text-decoration: none; }
.tba-chat-msg p a.tba-chat-link:hover { text-decoration: underline; }
/* Bia v3 (04/11/2026): o convite ao cadastro (e o guia) como botão, não como link solto */
.tba-chat-msg p a.tba-chat-link.tba-chat-cta { display: inline-block; margin-top: .45rem; padding: .45rem .9rem; border-radius: 999px; background: #1f2a36; color: #fff; font-weight: 600; text-decoration: none; }
.tba-chat-msg p a.tba-chat-link.tba-chat-cta:hover { background: #2c3b4c; color: #fff; text-decoration: none; }

/* Fim da conversa: avaliação e o atalho para falar com gente */
.tba-chat-avaliar { text-align: center; margin: .4rem 0 .6rem; }
.tba-chat-avaliar p { margin: 0 0 .4rem; color: #374151; font-size: .92em; }
.tba-chat-avaliar button { background: #fff; border: 1px solid #D8DCE3; border-radius: 999px; padding: .35rem .8rem; margin: 0 .2rem; cursor: pointer; font: inherit; }
.tba-chat-avaliar button:hover { border-color: #C01E36; }
.tba-chat .tba-chat-pessoa { display: block; width: calc(100% - 1.2rem); margin: .5rem .6rem 0; background: #fff; border: 1px solid #1f2a36; border-radius: 999px; color: #1f2a36; padding: .45rem .8rem; font-size: .88em; font-weight: 600; cursor: pointer; }
.tba-chat .tba-chat-pessoa:hover { background: #1f2a36; color: #fff; }
.tba-chat .tba-chat-pessoa[hidden] { display: none; }
/* A transparência, discreta (Jean, 07/10/2026): uma linha pequena e cinza no pé da janela */
.tba-chat-nota { display: block; padding: 0 .6rem .5rem; color: #6B7280; font-size: .72em; line-height: 1.3; text-align: center; }
.tba-chat-nota[hidden] { display: none; }

/* Passagem para pessoa: as duas opções; o WhatsApp com a mensagem pronta */
.tba-chat-escolha, .tba-chat-zap { display: grid; gap: .45rem; margin: .2rem 0 .7rem; }
.tba-chat .tba-chat-op { display: block; text-align: center; background: #1f2a36; color: #fff !important; border: 0; border-radius: 8px; padding: .6rem .8rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.tba-chat .tba-chat-op:hover { background: #2c3b4c; }
.tba-chat .tba-chat-op.zap { background: #0E7A3F; } /* verde escurecido: contraste acima de 5:1 com o branco */
.tba-chat .tba-chat-op.zap:hover { background: #0B6634; }
.tba-chat .tba-chat-op[disabled] { opacity: .6; cursor: default; }
.tba-chat-zap small { color: #4B5563; font-size: .78em; line-height: 1.35; }
.tba-chat-aviso { text-align: center; color: #4B5563; font-size: .8em; margin: .2rem 0 .7rem; }
.tba-chat-msg.loja p { background: #EEF2F6; border-color: #D3DCE6; }
