.whatsapp-float {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  z-index: 1090;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  overflow: hidden;
  box-shadow:
    0 8px 24px rgba(37, 211, 102, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.12);
  transition:
    width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.whatsapp-float::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid rgba(37, 211, 102, 0.45);
  animation: whatsapp-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

.whatsapp-float i {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  line-height: 1;
}

.whatsapp-float__label {
  flex: 0 0 auto;
  max-width: 0;
  opacity: 0;
  padding-right: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  transition:
    max-width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease,
    padding 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (hover: hover) and (pointer: fine) {
  .whatsapp-float:hover,
  .whatsapp-float:focus-visible {
    width: 176px;
    color: #fff;
    background: #1ebe57;
    box-shadow:
      0 12px 28px rgba(37, 211, 102, 0.42),
      0 4px 12px rgba(0, 0, 0, 0.14);
  }

  .whatsapp-float:hover .whatsapp-float__label,
  .whatsapp-float:focus-visible .whatsapp-float__label {
    max-width: 100px;
    opacity: 1;
    padding-right: 20px;
  }
}

.whatsapp-float:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@keyframes whatsapp-pulse {
  0% {
    transform: scale(1);
    opacity: 0.75;
  }

  70% {
    transform: scale(1.12);
    opacity: 0;
  }

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

@media (max-width: 767.98px) {
  .whatsapp-float {
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    width: 52px;
    height: 52px;
  }

  .whatsapp-float i {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
  }
}

@media (max-width: 399.98px) {
  .whatsapp-float {
    width: 48px;
    height: 48px;
  }

  .whatsapp-float i {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }
}

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