/* ===== Widget WhatsApp - Botao Flutuante + Formulario de Lead ===== */

/* -- Reset escopado -- */
.whatsapp-widget,
.whatsapp-widget *,
.whatsapp-widget *::before,
.whatsapp-widget *::after {
  box-sizing: border-box;
}

/* -- Container fixo -- */
.whatsapp-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: "Cairo", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* -- Botao flutuante (apenas o icone, sem circulo de fundo) -- */
/* !important necessario para sobrescrever regra generica da home:
   body.page-template-page-home button:not(.close) { background-color: var(--secondary) } */
.whatsapp-widget .whatsapp-widget__button {
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  border-radius: 50% !important;
  background: #fff !important;
  background-color: #fff !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.15) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: float-infinity 3s ease-in-out infinite;
  padding: 0 !important;
  margin: 0 !important;
  outline: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  gap: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: transparent !important;
}

.whatsapp-widget .whatsapp-widget__button:hover {
  transform: scale(1.08);
  animation-play-state: paused;
  background: #fff !important;
  background-color: #fff !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), 0 3px 8px rgba(0, 0, 0, 0.2) !important;
}

.whatsapp-widget .whatsapp-widget__button img {
  width: 64px !important;
  height: 64px !important;
  filter: none !important;
}

/* Animacao lemniscata (infinito) -- oscilacao suave */
@keyframes float-infinity {
  0%, 100% { transform: translate(0, 0); }
  12.5%    { transform: translate(2px, -1.5px); }
  25%      { transform: translate(3px, 0); }
  37.5%    { transform: translate(2px, 1.5px); }
  50%      { transform: translate(0, 0); }
  62.5%    { transform: translate(-2px, -1.5px); }
  75%      { transform: translate(-3px, 0); }
  87.5%    { transform: translate(-2px, 1.5px); }
}

/* Esconder botao quando popup aberto */
.whatsapp-widget--open .whatsapp-widget__button {
  display: none;
}

/* ===== Popup (chat window) ===== */
.whatsapp-widget__popup {
  display: none;
  position: absolute;
  bottom: 0;
  right: 0;
  width: 380px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  flex-direction: column;
  transform-origin: bottom right;
  animation: whatsapp-pop-in 0.28s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes whatsapp-pop-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.whatsapp-widget--open .whatsapp-widget__popup {
  display: flex;
}

/* -- Header -- */
.whatsapp-widget__header {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  background-color: #1F2A36;
  color: #fff;
  gap: 12px;
  position: relative;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.whatsapp-widget__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
  background-color: #fff;
  padding: 4px;
  flex-shrink: 0;
}

.whatsapp-widget__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.whatsapp-widget__name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.whatsapp-widget__tagline {
  font-size: 13px;
  font-weight: 400;
  color: #cfd6df;
}

/* Botao fechar -- X de 16px bold, circulo 2.3px maior em cada lado (~21px) */
.whatsapp-widget .whatsapp-widget__close {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  color: #fff !important;
  cursor: pointer !important;
  width: 21px !important;
  height: 21px !important;
  min-width: 21px !important;
  min-height: 21px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  transition: background-color 0.15s ease;
  padding: 0 !important;
  line-height: 1 !important;
  flex-shrink: 0;
  gap: 0 !important;
}

.whatsapp-widget .whatsapp-widget__close svg {
  width: 16px !important;
  height: 16px !important;
}

.whatsapp-widget .whatsapp-widget__close:hover,
.whatsapp-widget .whatsapp-widget__close:focus-visible {
  background-color: rgba(255, 255, 255, 0.15) !important;
  outline: none !important;
}

/* -- Corpo (area de chat com background de comida) -- */
.whatsapp-widget__body {
  background-color: #1F2A36;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' fill='none' stroke='%23ffffff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' opacity='0.08'%3E%3Cg transform='translate(20,15)'%3E%3Ccircle cx='10' cy='10' r='9'/%3E%3Cpath d='M6 13 L10 3 L14 13Z'/%3E%3C/g%3E%3Cg transform='translate(70,20)'%3E%3Crect x='2' y='6' width='16' height='10' rx='2'/%3E%3Cpath d='M4 6 Q10 -2 16 6'/%3E%3Cline x1='10' y1='0' x2='10' y2='2'/%3E%3C/g%3E%3Cg transform='translate(130,10)'%3E%3Cellipse cx='10' cy='12' rx='8' ry='5'/%3E%3Cpath d='M6 12 Q6 4 10 4 Q14 4 14 12'/%3E%3Cline x1='10' y1='4' x2='10' y2='1'/%3E%3Ccircle cx='10' cy='0' r='1'/%3E%3C/g%3E%3Cg transform='translate(190,18)'%3E%3Ccircle cx='10' cy='10' r='8'/%3E%3Ccircle cx='10' cy='10' r='3'/%3E%3C/g%3E%3Cg transform='translate(15,70)'%3E%3Crect x='3' y='2' width='14' height='14' rx='3'/%3E%3Cline x1='3' y1='8' x2='17' y2='8'/%3E%3C/g%3E%3Cg transform='translate(80,75)'%3E%3Cpath d='M5 16 L10 2 L15 16'/%3E%3Cline x1='7' y1='10' x2='13' y2='10'/%3E%3C/g%3E%3Cg transform='translate(150,65)'%3E%3Ccircle cx='10' cy='10' r='9'/%3E%3Cpath d='M5 8 Q10 14 15 8'/%3E%3C/g%3E%3Cg transform='translate(200,70)'%3E%3Cline x1='10' y1='2' x2='10' y2='18'/%3E%3Cpath d='M6 6 Q10 2 14 6'/%3E%3Cline x1='6' y1='14' x2='14' y2='14'/%3E%3C/g%3E%3Cg transform='translate(30,130)'%3E%3Ccircle cx='10' cy='10' r='9'/%3E%3Cline x1='4' y1='10' x2='16' y2='10'/%3E%3Cline x1='10' y1='4' x2='10' y2='16'/%3E%3C/g%3E%3Cg transform='translate(100,125)'%3E%3Cpath d='M3 14 Q3 4 10 4 Q17 4 17 14'/%3E%3Cline x1='3' y1='14' x2='17' y2='14'/%3E%3Ccircle cx='10' cy='1' r='1'/%3E%3C/g%3E%3Cg transform='translate(165,130)'%3E%3Ccircle cx='10' cy='8' r='7'/%3E%3Cpath d='M7 15 L13 15'/%3E%3Cline x1='10' y1='8' x2='10' y2='15'/%3E%3C/g%3E%3Cg transform='translate(20,185)'%3E%3Crect x='2' y='4' width='16' height='12' rx='2'/%3E%3Cpath d='M6 4 L6 2 Q10 -1 14 2 L14 4'/%3E%3C/g%3E%3Cg transform='translate(85,190)'%3E%3Ccircle cx='10' cy='10' r='8'/%3E%3Cpath d='M6 7 L14 7 M6 13 L14 13'/%3E%3C/g%3E%3Cg transform='translate(155,185)'%3E%3Cpath d='M4 16 L10 2 L16 16Z'/%3E%3C/g%3E%3Cg transform='translate(210,185)'%3E%3Ccircle cx='8' cy='10' r='7'/%3E%3Cpath d='M5 7 Q8 12 11 7'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 240px 240px;
  padding: 14px 20px 18px;
}

/* Balao de mensagem */
.whatsapp-widget__bubble {
  background-color: #2C3744;
  color: #fff;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

/* -- Formulario (integrado ao card escuro) -- */
.whatsapp-widget__form {
  background-color: #1F2A36;
  background-image: inherit;
  background-repeat: repeat;
  background-size: 240px 240px;
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.whatsapp-widget__input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 16px;
  font-family: "Cairo", sans-serif;
  color: #1F2A36;
  background-color: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.whatsapp-widget__input::placeholder {
  color: #6b7785;
  font-weight: 400;
}

.whatsapp-widget__input:focus {
  border-color: #fff;
  box-shadow: 0 0 0 2px #fff;
}

.whatsapp-widget__input--error {
  border-color: #e74c3c;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.25);
}

.whatsapp-widget__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #cfd6df;
  line-height: 1.4;
  padding: 4px 0;
}

.whatsapp-widget__consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 1px;
  accent-color: #34D17A;
  cursor: pointer;
}

.whatsapp-widget__consent a {
  color: #34D17A;
  text-decoration: underline;
}

.whatsapp-widget__submit {
  background-color: #ff007c;
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 700;
  font-family: "Cairo", sans-serif;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
  align-self: center;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 6px;
}

.whatsapp-widget__submit:hover {
  background-color: #e0006e;
}

.whatsapp-widget__submit:active {
  transform: translateY(1px);
}

.whatsapp-widget__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Animacao de loading no botao (Enviando...) */
.whatsapp-widget__dots::after {
  content: '';
  animation: whatsapp-dots 1.2s steps(4, end) infinite;
}

@keyframes whatsapp-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* Mensagem de erro/sucesso */
.whatsapp-widget__message {
  font-size: 13px;
  text-align: center;
  padding: 4px 0;
}

.whatsapp-widget__message--error {
  color: #e74c3c;
}

.whatsapp-widget__message--success {
  color: #34D17A;
}

/* ===== Responsivo ===== */
@media (max-width: 480px) {
  .whatsapp-widget {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }

  .whatsapp-widget__popup {
    width: 100%;
    max-width: 100%;
    right: 0;
    bottom: 0;
    max-height: calc(100vh - 100px);
  }
}

@media (min-width: 481px) and (max-width: 768.98px) {
  .whatsapp-widget__popup {
    width: calc(100vw - 48px);
    max-width: 380px;
  }
}
