/* Floating WhatsApp button styles (agent W1)
   The template's .scroll-to-top is fixed at right: 30px / bottom: 30px, 50 x 50 px,
   z-index 90000. This button sits directly above it (same horizontal centre) so
   the two never overlap, and one z-index higher so it stays on top. */

.whatsapp-float {
  position: fixed;
  right: calc(27px + env(safe-area-inset-right, 0px));
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  z-index: 90001;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  outline: none;
}

.whatsapp-float__icon {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.whatsapp-float__icon i {
  display: block;
  line-height: 1;
}

/* subtle pulse ring behind the button */
.whatsapp-float__icon::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.55);
  animation: whatsapp-float-pulse 2.4s ease-out infinite;
}

@keyframes whatsapp-float-pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

.whatsapp-float:hover .whatsapp-float__icon,
.whatsapp-float:focus-visible .whatsapp-float__icon {
  background: #1ebe5d;
  transform: scale(1.06);
}

.whatsapp-float:focus-visible .whatsapp-float__icon {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #25D366;
}

/* label bubble: hidden until hovered (desktop) or focused via keyboard */
.whatsapp-float__label {
  order: -1;
  padding: 8px 14px;
  border-radius: 20px;
  background: #fff;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.whatsapp-float:focus-visible .whatsapp-float__label {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

@media (hover: hover) and (pointer: fine) {
  .whatsapp-float:hover .whatsapp-float__label {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-float__icon::before {
    animation: none;
  }

  .whatsapp-float__icon,
  .whatsapp-float__label {
    transition: none;
  }
}

@media print {
  .whatsapp-float {
    display: none;
  }
}
