.whatsapp-contact {
  --whatsapp-size: 44px;
  --whatsapp-edge: 20px;
  --whatsapp-label-shift: 100%;
  position: fixed;
  inset-inline-end: var(--whatsapp-edge);
  bottom: var(--whatsapp-offset, var(--whatsapp-edge));
  width: var(--whatsapp-size);
  height: var(--whatsapp-size);
  /* Keep the floating contact action reachable above the mobile navigation. */
  z-index: 45;
}
html[dir="rtl"] .whatsapp-contact { --whatsapp-label-shift: -100%; }
.whatsapp-contact__link {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: transparent;
}
.whatsapp-contact__link:focus-visible { outline: 3px solid #075e54; outline-offset: 4px; }
.whatsapp-contact__icon { display: block; width: 28px; height: 28px; }
.whatsapp-contact__label-slot {
  position: absolute;
  inset-inline-end: calc(100% - 2px);
  top: -6px;
  height: calc(100% + 12px);
  width: 144px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  pointer-events: none;
}
.whatsapp-contact__label {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  color: #222;
  font: 500 13px/18px Arial, sans-serif;
  white-space: nowrap;
  box-shadow: 0 2px 7px #0002;
  transform: translateX(var(--whatsapp-label-shift));
  opacity: 0;
  visibility: hidden;
  transition: transform 450ms ease-in-out, opacity 450ms ease-in-out, visibility 0s 450ms;
}
.whatsapp-contact.is-revealed .whatsapp-contact__label,
.whatsapp-contact:focus-within .whatsapp-contact__label {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
@media (hover: hover) and (pointer: fine) {
  .whatsapp-contact:hover .whatsapp-contact__label {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }
}
@media (max-width: 760px) {
  .whatsapp-contact { --whatsapp-size: 40px; --whatsapp-edge: 14px; }
  /* Clear the 70px bottom bar plus its lower margin on short mobile viewports. */
  .whatsapp-contact { --whatsapp-offset: calc(108px + env(safe-area-inset-bottom, 0px)); }
  /* Extend the hit area to 44px without enlarging the visible icon. */
  .whatsapp-contact__link::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; }
  .whatsapp-contact__icon { width: 24px; height: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .whatsapp-contact__label { transition: none; }
}
