/* 08-whatsapp.css — Conversa no WhatsApp dentro do iPhone.
   Os arquivos css/ são carregados em ordem numérica pelo index.html: a ordem importa (cascata). */
/* ---------- Conversa no WhatsApp (iPhone 3D) ----------
   Recria o WhatsApp dentro da mesma moldura do iPhone 17 Pro Max do rastreio:
   cabeçalho com "digitando…", papel de parede, balões com hora e tiques, campo de
   mensagem onde as mensagens do cliente são digitadas antes de enviar.
   As mensagens ficam no HTML (sem JS a conversa aparece inteira); o script
   "Conversa no WhatsApp" esconde e revela uma a uma. Quadro fixo 380x640,
   reduzido com zoom (--k) para o texto ficar nítido. */
.wa3d {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  --w-bg: #efeae2;
  --w-head: #f0f2f5;
  --w-tx: #111b21;
  --w-mu: #667781;
  --w-in: #ffffff;
  --w-out: #d9fdd3;
  --w-green: #008069;
  --w-tick: #53bdeb;
  --w-bar: #f0f2f5;
  --w-field: #ffffff;
  --w-doodle: rgba(84, 101, 111, 0.07);
}
.wa-stage {
  position: relative;
  aspect-ratio: 380/640;
}
.wa-fit {
  position: absolute;
  left: 0;
  top: 0;
  width: 380px;
  height: 640px;
  zoom: var(--k, 1);
}
/* sem 3D: 3D + zoom faz o Chrome às vezes sumir com a camada (o celular "some do nada") */
.wa-rig {
  position: absolute;
  inset: 0;
  transition:
    transform 1.1s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.6s;
}
.wa3d.wa-off .wa-rig {
  transform: translateY(70px) scale(0.94);
  opacity: 0;
}
.wa-sway {
  position: absolute;
  inset: 0;
  animation: t3Float 6.5s ease-in-out -2s infinite;
}
.wa-phone {
  position: absolute;
  left: 40px;
  top: 10px;
  width: 300px;
  height: 612px;
}
.wa-phone .frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 36px 44px rgba(0, 0, 0, 0.5));
}
/* fundo preto sob a tela, escondido pela borda da moldura: cobre a fresta de ~1px
   entre a tela e a moldura, para o fundo da seção não aparecer em volta da tela */
.wa-phone::before {
  content: '';
  position: absolute;
  inset: 2% 4.35%;
  border-radius: 15.5% / 7.2%;
  background: #000;
}
.wa-screen {
  position: absolute;
  left: 5.2381%;
  top: 2.2667%;
  width: 89.4558%;
  height: 95.4333%;
  border-radius: 41px;
  overflow: hidden;
  background: var(--w-bg);
}
.wa-app {
  position: absolute;
  left: 0;
  top: 0;
  width: 360px;
  height: 784px;
  zoom: 0.7456;
  display: flex;
  flex-direction: column;
  background: var(--w-bg);
  color: var(--w-tx);
  font-family: -apple-system, 'SF Pro Text', 'Inter', system-ui, sans-serif;
  font-size: 15.5px;
  line-height: 1.35;
}
.wa-status {
  flex: none;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 34px 0 40px;
  font-weight: 600;
  font-size: 16px;
  background: var(--w-head);
  color: var(--w-tx);
}
.wa-status span:last-child {
  display: flex;
  gap: 6px;
  align-items: center;
}
.wa-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 10px 8px;
  background: var(--w-head);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.wa-head .back {
  color: var(--w-green);
  display: flex;
  align-items: center;
}
.wa-head .av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  padding: 5px;
  flex: none;
}
.wa-head .av img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.wa-head .who {
  flex: 1;
  min-width: 0;
}
.wa-head .who b {
  display: block;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.15;
}
.wa-head .who small {
  display: block;
  font-size: 12.5px;
  color: var(--w-mu);
  transition: color 0.2s;
}
.wa3d.is-typing .wa-head .who small {
  color: var(--w-green);
}
.wa-head .ic {
  display: flex;
  gap: 20px;
  color: var(--w-green);
}
.wa-body {
  position: relative;
  flex: 1;
  overflow: hidden;
  background-color: var(--w-bg);
  background-image:
    radial-gradient(var(--w-doodle) 1.4px, transparent 1.6px),
    radial-gradient(var(--w-doodle) 1.4px, transparent 1.6px);
  background-size: 26px 26px;
  background-position:
    0 0,
    13px 13px;
}
.wa-roll {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
/* recomeço do ciclo: a conversa sobe e esmaece antes de reiniciar */
.wa3d.wa-clear .wa-roll {
  opacity: 0;
  transform: translateY(-40px);
}
.wa-day {
  align-self: center;
  margin: 4px 0 8px;
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--w-head);
  color: var(--w-mu);
  font-size: 12.5px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}
.wa-msg {
  position: relative;
  max-width: 80%;
  padding: 7px 9px 8px 10px;
  border-radius: 9px;
  font-size: 15.5px;
  line-height: 1.36;
  color: var(--w-tx);
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  transform-origin: var(--o, 0 100%);
  transition:
    transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1),
    opacity 0.25s;
}
.wa-msg.in {
  align-self: flex-start;
  background: var(--w-in);
  border-top-left-radius: 0;
  --o: 0 0;
}
.wa-msg.out {
  align-self: flex-end;
  background: var(--w-out);
  border-top-right-radius: 0;
  --o: 100% 0;
}
.wa-msg.in::before,
.wa-msg.out::before {
  content: '';
  position: absolute;
  top: 0;
  width: 10px;
  height: 13px;
}
.wa-msg.in::before {
  left: -8px;
  background: var(--w-in);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}
.wa-msg.out::before {
  right: -8px;
  background: var(--w-out);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.wa-msg.in + .wa-msg.in,
.wa-msg.out + .wa-msg.out {
  border-radius: 9px;
}
.wa-msg.in + .wa-msg.in::before,
.wa-msg.out + .wa-msg.out::before {
  display: none;
}
.wa-meta {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 6px 0 -4px 10px;
  font-size: 11.5px;
  color: var(--w-mu);
  line-height: 1;
}
.wa-tick {
  color: var(--w-mu);
  transition: color 0.3s;
}
.wa-tick.read {
  color: var(--w-tick);
}
.wa-tick .t2 {
  opacity: 0;
  transition: opacity 0.2s;
}
.wa-tick.dlv .t2,
.wa-tick.read .t2 {
  opacity: 1;
}
.wa-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 9px;
  border-top-left-radius: 0;
  background: var(--w-in);
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  transform: scale(0);
  transform-origin: 0 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.5, 0.64, 1);
}
.wa-typing.on {
  transform: none;
}
.wa-typing i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--w-mu);
  animation: blink 1.2s infinite;
}
.wa-typing i:nth-child(2) {
  animation-delay: 0.2s;
}
.wa-typing i:nth-child(3) {
  animation-delay: 0.4s;
}
/* estados controlados pelo JS */
.wa3d.wa-js .wa-msg.hide {
  display: none;
}
.wa-msg.pop {
  transform: scale(0.4);
  opacity: 0;
}
.wa-bar {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 10px 26px;
  background: var(--w-bar);
}
.wa-bar .plus {
  color: var(--w-mu);
  padding-bottom: 9px;
}
.wa-field {
  flex: 1;
  min-height: 38px;
  max-height: 92px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--w-field);
  font-size: 15.5px;
  color: var(--w-mu);
  line-height: 1.3;
}
.wa-field.has {
  color: var(--w-tx);
}
.wa-field .caret {
  display: inline-block;
  width: 2px;
  height: 18px;
  margin-left: 1px;
  vertical-align: -3px;
  background: var(--w-green);
  animation: blink 1s steps(1) infinite;
}
.wa-send {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--w-green);
  color: #fff;
  transition: transform 0.15s;
}
.wa-send.tap {
  transform: scale(0.82);
}
.wa-send .snd {
  display: none;
}
.wa-bar.has .wa-send .mic {
  display: none;
}
.wa-bar.has .wa-send .snd {
  display: block;
}
/* botão real, fora do celular */
.wa-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.4rem auto 0;
  max-width: 330px;
  background: #25d366;
  color: #fff;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.5);
  transition:
    transform 0.18s ease,
    filter 0.18s;
}
.wa-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
@media (prefers-reduced-motion: reduce) {
  .wa3d * {
    animation: none !important;
    transition: none !important;
  }
}
