/* WhatsApp Widget Styles */
.whatsapp-widget {
  /* Container fixo do widget flutuante do WhatsApp */
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.whatsapp-preview {
  /* Card de apresentação do atendimento via WhatsApp */
  width: min(320px, calc(100vw - 40px));
  margin-bottom: 14px;
  padding: 18px 18px 18px 20px;
  color: #eafff3;
  background: linear-gradient(145deg, rgba(6, 22, 47, 0.96), rgba(18, 63, 120, 0.95));
  border: 1px solid rgba(167, 243, 208, 0.22);
  border-left: 5px solid #25D366;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.whatsapp-preview-status {
  /* Selo de status no card do WhatsApp */
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  padding: 6px 10px;
  color: #bbf7d0;
  background: rgba(37, 211, 102, 0.14);
  border: 1px solid rgba(37, 211, 102, 0.24);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.whatsapp-preview-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #25D366;
  box-shadow: 0 0 0 5px rgba(37, 211, 102, 0.16);
}

.whatsapp-preview strong {
  display: block;
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 800;
}

.whatsapp-preview p {
  margin: 0;
  color: #dbeafe;
  font-size: 0.95rem;
  line-height: 1.55;
}

.whatsapp-button {
  /* Botão principal do WhatsApp */
  width: 66px;
  height: 66px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(18, 140, 126, 0.36);
  transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
  animation: pulse 2s infinite;
  position: relative;
  overflow: hidden;
}

.whatsapp-button::before {
  content: "";
  position: absolute;
  inset: 9px 9px auto auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
}

.whatsapp-button::after {
  content: "";
  position: absolute;
  inset: -35%;
  background: linear-gradient(120deg, transparent 35%, rgba(255,255,255,0.42), transparent 65%);
  transform: translateX(-110%) rotate(15deg);
  transition: transform 0.6s ease;
}

.whatsapp-button:hover {
  transform: translateY(-4px) scale(1.07);
  filter: brightness(1.05);
  box-shadow: 0 20px 38px rgba(18, 140, 126, 0.48);
}

.whatsapp-button:hover::after {
  transform: translateX(110%) rotate(15deg);
}

.whatsapp-widget.is-active .whatsapp-preview,
.whatsapp-widget:hover .whatsapp-preview {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.whatsapp-widget.is-opening .whatsapp-button {
  animation: whatsapp-click 0.55s ease;
  box-shadow: 0 0 0 12px rgba(37, 211, 102, 0.12), 0 20px 42px rgba(18, 140, 126, 0.52);
}

.whatsapp-widget.is-opening .whatsapp-preview {
  opacity: 1;
  transform: translateY(0) scale(1.02);
}

.whatsapp-button i {
  position: relative;
  z-index: 1;
  font-size: 31px;
  color: white;
}

.whatsapp-tooltip {
  /* Tooltip curto abaixo do card do WhatsApp */
  position: absolute;
  right: 0;
  bottom: 78px;
  background: rgba(6, 22, 47, 0.94);
  color: white;
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.whatsapp-tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(6, 22, 47, 0.94);
}

.whatsapp-widget:hover .whatsapp-tooltip,
.whatsapp-widget.is-active .whatsapp-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* Animação de pulso */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* Animação de clique antes de abrir o WhatsApp */
@keyframes whatsapp-click {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.92);
  }
  100% {
    transform: scale(1.08);
  }
}

/* Responsividade */
@media (max-width: 768px) {
  .whatsapp-widget {
    bottom: 18px;
    right: 15px;
  }
  
  .whatsapp-button {
    width: 56px;
    height: 56px;
  }
  
  .whatsapp-button i {
    font-size: 24px;
  }
  
  .whatsapp-tooltip {
    bottom: 68px;
    font-size: 12px;
    padding: 6px 10px;
  }
}

@media (max-width: 480px) {
  .whatsapp-widget {
    bottom: 18px;
    right: 10px;
  }
  
  .whatsapp-button {
    width: 52px;
    height: 52px;
  }
  
  .whatsapp-button i {
    font-size: 20px;
  }

  .whatsapp-tooltip {
    bottom: 64px;
  }
}

/* Modo escuro */
body.dark .whatsapp-tooltip {
  background: #2d2d2d;
  color: #ffffff;
}

body.dark .whatsapp-tooltip::after {
  border-top-color: #2d2d2d;
}
