.whatsapp {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 500;
  isolation: isolate;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  transition: transform .22s ease, box-shadow .22s ease;
  animation: whatsapp-attention 3s ease-in-out infinite;
}

.whatsapp::before,
.whatsapp::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  border: 2px solid #25d366;
  border-radius: inherit;
  content: "";
  pointer-events: none;
  animation: whatsapp-ripple 2.4s ease-out infinite;
}

.whatsapp::after {
  animation-delay: 1.2s;
}

.whatsapp svg {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
}

.whatsapp-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  z-index: 2;
  width: max-content;
  max-width: min(280px, calc(100vw - 100px));
  padding: 9px 12px;
  border-radius: 8px;
  background: #0d2242;
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(4px, -50%);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  visibility: hidden;
}

.whatsapp:hover,
.whatsapp:focus-visible {
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
  transform: scale(1.06);
}

.whatsapp:hover .whatsapp-tooltip,
.whatsapp:focus-visible .whatsapp-tooltip {
  opacity: 1;
  transform: translate(0, -50%);
  visibility: visible;
}

.whatsapp:focus-visible {
  outline: 3px solid #0d2242;
  outline-offset: 4px;
}

@keyframes whatsapp-ripple {
  0% {
    opacity: .45;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.85);
  }
}

@keyframes whatsapp-attention {
  0%, 100% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  }

  50% {
    box-shadow: 0 12px 31px rgba(37, 211, 102, .32);
  }
}

@media (max-width: 680px) {
  .whatsapp {
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 58px;
    height: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp,
  .whatsapp::before,
  .whatsapp::after,
  .whatsapp-tooltip {
    animation: none;
    transition: none;
  }

  .whatsapp:hover,
  .whatsapp:focus-visible {
    transform: none;
  }
}
