/* ==========================================================================
   DMW-Performance — Floating WhatsApp button
   ==========================================================================
   Round icon pinned to the bottom right of every page. Markup comes from
   inc/whatsapp-button.php.
   ========================================================================== */

.wa-float {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  /* Below the consent banner (--z-toast), above everything in the document
     flow — the banner must stay reachable while it is open. */
  z-index: var(--z-modal);

  display: flex;
  align-items: center;
  justify-content: center;
  /* 56px keeps the tap target well above the 44px minimum. */
  width: 3.5rem;
  height: 3.5rem;

  color: #ffffff;
  font-size: var(--text-xl);
  line-height: 1;
  text-decoration: none;

  background-color: var(--color-whatsapp);
  border-radius: var(--radius-full);
  /* The shadow does the work of separating the button from the page — green
     on the light background alone is not enough of an edge. */
  box-shadow: var(--shadow-lg);

  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.wa-float:hover,
.wa-float:focus-visible {
  background-color: var(--color-whatsapp-dark);
  color: #ffffff;
  transform: translateY(-2px);
}

.wa-float:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* While the consent banner is open it covers the full width of the bottom
   edge, so the button would sit behind it. The banner ships with `hidden`
   and is only revealed by cookie-consent.js, and the button is rendered
   after it (wp_footer priority 20) — which makes this sibling selector
   enough to step aside without any JavaScript of our own. */
.cookie-consent:not([hidden]) ~ .wa-float {
  opacity: 0;
  visibility: hidden;
}

@media (max-width: 768px) {
  .wa-float {
    right: var(--space-3);
    bottom: var(--space-3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-float {
    transition: none;
  }

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