/* Balão flutuante de WhatsApp + popup de captação de lead (2026-10-05). Isolado: nada aqui afeta o resto da página. */
#wl-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 100000;
  width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%;
  background: #25d366; color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
  transition: transform .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}
#wl-fab:hover { transform: scale(1.06); box-shadow: 0 8px 24px rgba(0, 0, 0, .34); }
#wl-fab:active { transform: scale(.97); }
#wl-fab:focus-visible, #wl-panel .wl-close:focus-visible, #wl-panel .wl-submit:focus-visible, #wl-panel .wl-field input:focus-visible {
  outline: 3px solid #1b1b1b; outline-offset: 2px;
}
#wl-fab svg { width: 34px; height: 34px; display: block; }
#wl-fab::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); animation: wl-pulse 2.4s ease-out infinite; pointer-events: none;
}
#wl-fab[aria-expanded="true"]::after { animation: none; }
@keyframes wl-pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); } 70%, 100% { box-shadow: 0 0 0 18px rgba(37, 211, 102, 0); } }

#wl-panel {
  position: fixed; right: 16px; bottom: 88px; z-index: 100001;
  width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 104px); max-height: calc(100dvh - 104px); overflow-y: auto;
  box-sizing: border-box; padding: 20px; background: #fff; color: #1b1b1b;
  border-radius: 28px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
  font-family: "Poppins", system-ui, sans-serif; font-size: 16px; line-height: 1.5;
  transform-origin: bottom right; animation: wl-in .2s ease-out;
}
#wl-panel[hidden] { display: none; }
@keyframes wl-in { from { opacity: 0; transform: scale(.95) translateY(8px); } to { opacity: 1; transform: none; } }
#wl-panel .wl-head { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 14px; }
#wl-panel .wl-head-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: #25d366; display: flex; align-items: center; justify-content: center; }
#wl-panel .wl-head-icon svg { width: 24px; height: 24px; }
#wl-panel .wl-title { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
#wl-panel .wl-sub { margin: 2px 0 0; font-size: 14px; color: #555; }
#wl-panel .wl-close {
  margin: -6px -8px 0 auto; flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: #333; cursor: pointer; font-size: 26px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
#wl-panel .wl-close:hover { background: #f0f0f0; }
#wl-panel .wl-field { margin: 0 0 12px; }
#wl-panel .wl-field label { display: block; margin: 0 0 4px 16px; font-size: 13px; font-weight: 500; color: #444; }
#wl-panel .wl-field input {
  display: block; width: 100%; min-height: 48px; box-sizing: border-box; padding: 0 20px;
  border: 1px solid #dcdcdc; border-radius: 24px; background: #fff; color: #1b1b1b;
  font: inherit; font-size: 16px;
}
#wl-panel .wl-field input::placeholder { color: #767676; }
#wl-panel .wl-field input[aria-invalid="true"] { border-color: #c62828; }
#wl-panel .wl-error { display: none; margin: 4px 0 0 16px; font-size: 13px; color: #b3261e; }
#wl-panel .wl-field input[aria-invalid="true"] + .wl-error { display: block; }
#wl-panel .wl-submit {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 4px;
  padding: 0 20px; border: 0; border-radius: 24px; background: #000; color: #fff; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em;
  transition: transform .15s ease, opacity .15s ease;
}
#wl-panel .wl-submit:hover { opacity: .88; }
#wl-panel .wl-submit:active { transform: scale(.98); }
#wl-panel .wl-submit[disabled] { opacity: .6; cursor: progress; }
#wl-panel .wl-submit svg { width: 18px; height: 18px; flex: none; }
#wl-panel .wl-note { margin: 10px 0 0; font-size: 12px; color: #666; text-align: center; }

@media (max-width: 480px) {
  #wl-fab { right: 12px; bottom: 12px; }
  #wl-panel { right: 12px; left: 12px; width: auto; bottom: 84px; padding: 16px; }
  body.home #wl-fab { bottom: 72px; }
}
@media (max-width: 320px) { #wl-panel { right: 8px; left: 8px; } #wl-fab { right: 8px; bottom: 8px; } }
@media (prefers-reduced-motion: reduce) {
  #wl-fab::after, #wl-panel { animation: none; }
  #wl-fab, #wl-panel .wl-submit { transition: none; }
}

/* Blindagem contra estilos globais do tema (button/h2/svg do Vamtam/Elementor). */
#wl-fab, #wl-panel .wl-close, #wl-panel .wl-submit {
  font-family: "Poppins", system-ui, sans-serif; text-shadow: none; box-shadow-color: initial; min-width: 0; height: auto; margin-block: 0;
}
#wl-fab { width: 60px !important; height: 60px !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: #25d366 !important; color: #fff !important; box-shadow: 0 6px 20px rgba(0,0,0,.28) !important; }
#wl-fab:hover, #wl-fab:focus { background: #25d366 !important; color: #fff !important; }
#wl-fab svg, #wl-panel .wl-head-icon svg { display: block !important; fill: none; }
#wl-fab svg { width: 34px !important; height: 34px !important; }
#wl-fab svg path, #wl-panel .wl-head-icon svg path { fill: #fff !important; }
#wl-panel .wl-title { font-family: "Poppins", system-ui, sans-serif !important; font-size: 17px !important; font-weight: 600 !important; line-height: 1.3 !important; color: #1b1b1b !important; letter-spacing: 0 !important; word-spacing: normal !important; text-transform: none !important; margin: 0 !important; }
#wl-panel .wl-sub { color: #555 !important; font-size: 14px !important; margin: 2px 0 0 !important; }
#wl-panel .wl-close { width: 44px !important; height: 44px !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: transparent !important; color: #333 !important; font-size: 28px !important; font-weight: 400 !important; line-height: 1 !important; text-transform: none !important; }
#wl-panel .wl-close:hover { background: #f0f0f0 !important; color: #000 !important; }
#wl-panel .wl-submit { background: #000 !important; color: #fff !important; border: 0 !important; border-radius: 24px !important; min-height: 48px !important; padding: 0 20px !important; font-size: 14px !important; font-weight: 600 !important; text-transform: uppercase !important; }
#wl-panel .wl-submit svg { width: 18px !important; height: 18px !important; display: block !important; fill: none !important; stroke: currentColor !important; }
#wl-panel .wl-submit svg path { fill: none !important; stroke: currentColor !important; }
#wl-panel .wl-field label { text-transform: none !important; color: #444 !important; font-size: 13px !important; font-weight: 500 !important; margin: 0 0 4px 16px !important; }
#wl-panel .wl-field input { height: auto !important; min-height: 48px !important; border-radius: 24px !important; padding: 0 20px !important; background: #fff !important; color: #1b1b1b !important; border: 1px solid #dcdcdc !important; font-size: 16px !important; }
#wl-panel .wl-field input[aria-invalid="true"] { border-color: #c62828 !important; }

/* Campos opcionais das páginas de módulo (campo extra + pedidos por dia). Nunca required; alvos de toque >= 44 px. */
#wl-panel .wl-opt { font-weight: 400; color: #666; }
#wl-panel .wl-field--opt input, #wl-panel .wl-field--opt select { min-height: 44px; }
#wl-panel .wl-field select {
  display: block; width: 100%; box-sizing: border-box; padding: 0 44px 0 20px; border: 1px solid #dcdcdc; border-radius: 24px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 8' fill='none' stroke='%23444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 18px center / 14px 8px;
  color: #1b1b1b; font: inherit; font-size: 16px; -webkit-appearance: none; appearance: none; cursor: pointer;
}
#wl-panel .wl-field select:focus-visible { outline: 3px solid #1b1b1b; outline-offset: 2px; }
#wl-panel .wl-group { margin: 0 0 12px; padding: 0; border: 0; min-width: 0; }
#wl-panel .wl-group legend { display: block; float: none; width: auto; padding: 0; margin: 0 0 6px 16px; font-size: 13px; font-weight: 500; color: #444; }
#wl-panel .wl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#wl-panel .wl-chip { position: relative; display: inline-flex; margin: 0; }
#wl-panel .wl-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
#wl-panel .wl-chip span {
  display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; padding: 0 16px; border: 1px solid #dcdcdc; border-radius: 22px;
  background: #fff; color: #1b1b1b; font-size: 14px; line-height: 1.2;
}
#wl-panel .wl-chip input:checked + span { background: #f1e4f9; border-color: #600e8f; color: #4a0a6e; font-weight: 600; }
#wl-panel .wl-chip input:focus-visible + span { outline: 3px solid #1b1b1b; outline-offset: 2px; }
/* Com campos opcionais o painel ganha espaço vertical: cabeçalho e respiros mais curtos. */
#wl-panel.wl-panel--extras .wl-head { margin-bottom: 10px; }
#wl-panel.wl-panel--extras .wl-field { margin-bottom: 8px; }
#wl-panel.wl-panel--extras .wl-group { margin-bottom: 8px; }
#wl-panel.wl-panel--extras .wl-field label { margin-bottom: 2px !important; }
/* Em tela baixa o painel rola; o botão de enviar fica fixo no rodapé do painel e nunca some atrás dos campos opcionais. */
#wl-panel.wl-panel--extras .wl-submit { position: sticky; bottom: 4px; z-index: 1; margin-top: 10px; box-shadow: 0 0 0 10px #fff; }

/* Em aparelhos estreitos o placeholder do telefone precisa caber inteiro. */
@media (max-width: 320px) {
  #wl-panel .wl-field input::placeholder { font-size: 14px; }
}

/* Opt-in por página: some sem deslocar o layout e sai de clique/foco enquanto o CTA do hero está visível. */
body[data-fab-oculta-no-hero="true"] #wl-fab {
  transition: opacity .2s ease, visibility 0s linear, transform .2s ease, box-shadow .2s ease;
}
body[data-fab-oculta-no-hero="true"] #wl-fab.wl-fab--oculto-no-hero {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition-delay: 0s, .2s, 0s, 0s;
}
@media (prefers-reduced-motion: reduce) {
  body[data-fab-oculta-no-hero="true"] #wl-fab { transition: none; }
}

/* Nas páginas de módulo, mantenha o alvo de toque de 44 px na faixa livre do hero. */
@media (max-width: 480px) {
  body.page-modulo #wl-fab {
    right: 12px !important;
    bottom: 12px !important;
    width: 44px !important;
    height: 44px !important;
  }
  body.page-modulo #wl-fab svg { width: 24px !important; height: 24px !important; }
}
