/* ==========================================================================
   WHATSAPP FLOATING BUTTON
   Self-contained: literal values (no :root token dependency) so it renders
   identically on the homepage (styles.css) and sub-pages (cookie-banner.css).
   z-index 999 sits below the mobile drawer/overlay (1000/1001) and nav (1000),
   and well below modals/banners (9999+). It is above all normal page content
   (z-index ≤ 10) and, being fixed at bottom-right, never overlaps the top nav.
   ========================================================================== */

.whatsapp-float {
    --waf-size: 65px;
    --waf-edge: 30px;
    --waf-green-1: #25D366;
    --waf-green-2: #128C7E;
    --waf-shadow: rgba(37, 211, 102, 0.4);

    position: fixed;
    right: var(--waf-edge);
    bottom: var(--waf-edge);
    width: var(--waf-size);
    height: var(--waf-size);
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--waf-green-1) 0%, var(--waf-green-2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px var(--waf-shadow);
    z-index: 999;
    text-decoration: none;
    transition: transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 300ms ease;
    animation: pulse-whatsapp 2s infinite;
    -webkit-tap-highlight-color: transparent;
}

/* Hover + keyboard focus share the same lift (parity for pointer & keyboard). */
.whatsapp-float:hover,
.whatsapp-float:focus-visible {
    transform: scale(1.1) translateY(-5px);
}

/*
 * Visible focus ring via OUTLINE (not box-shadow). The element's infinite
 * pulse animation continuously animates box-shadow, and CSS animations
 * override :focus-visible box-shadow — so a shadow ring would be masked.
 * Outline paints above animations, so it always renders. currentColor adapts
 * to the site theme (light text on dark theme, dark on light) for contrast.
 */
.whatsapp-float:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.whatsapp-float svg {
    width: 35px;
    height: 35px;
    fill: #ffffff;
    pointer-events: none;
}

/* Tooltip — never steals clicks (pointer-events: none) */
.whatsapp-float__tooltip {
    position: absolute;
    right: calc(var(--waf-size) + 15px);
    top: 50%;
    transform: translate(10px, -50%);
    background: #ffffff;
    color: #064e32;
    padding: 12px 20px;
    border-radius: 12px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
}

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

@keyframes pulse-whatsapp {
    0%, 100% { box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4); }
    50%      { box-shadow: 0 8px 35px rgba(37, 211, 102, 0.6); }
}

/* ---------- Print: never show on paper/PDF ---------- */
@media print {
    .whatsapp-float {
        display: none !important;
    }
}

/* ---------- Mobile: clear safe-areas, hide touch-awkward tooltip ---------- */
@media (max-width: 480px) {
    .whatsapp-float {
        --waf-size: 58px;
        --waf-edge: 20px;
    }

    .whatsapp-float svg {
        width: 30px;
        height: 30px;
    }

    .whatsapp-float__tooltip {
        display: none;
    }
}

/* ---------- Reduced motion: kill pulse + transform ----------
   Scoped to the button. (The homepage has a global * kill-switch in
   styles.css, but sub-pages do not, so this guarantees motion-safety
   everywhere the button appears.) */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-float,
    .whatsapp-float__tooltip {
        animation: none !important;
        transition: none !important;
    }

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