/**
 * Floating WhatsApp button.
 *
 * Fixed to the viewport corner rather than the page, so it stays put while
 * the theme's ScrollSmoother translates the content. It is printed after
 * #smooth-wrapper in the footer, which is what keeps position: fixed honest.
 *
 * The green is WhatsApp's own brand colour; override --tan-wa-colour to use a
 * different one without touching the rest of the rules.
 */

.tan-wa-float {
    --tan-wa-colour: #25d366;
    --tan-wa-colour-dark: #1fba59;

    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9998;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background-color: var(--tan-wa-colour);
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.12);

    text-decoration: none;
    outline: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.tan-wa-float:hover,
.tan-wa-float:focus-visible {
    background-color: var(--tan-wa-colour-dark);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24), 0 3px 8px rgba(0, 0, 0, 0.14);
}

.tan-wa-float:focus-visible {
    outline: 3px solid rgba(37, 211, 102, 0.45);
    outline-offset: 3px;
}

.tan-wa-float__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.tan-wa-float__icon svg {
    display: block;
    width: 30px;
    height: 30px;
    fill: currentColor;
}

/* Hover label. Absolutely positioned so the button itself stays a circle,
   and hidden from pointer events so it never blocks the click. */
.tan-wa-float__label {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);

    padding: 9px 14px;
    border-radius: 999px;
    background-color: #fff;
    color: #1f2937;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.tan-wa-float:hover .tan-wa-float__label,
.tan-wa-float:focus-visible .tan-wa-float__label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* On phones there is no hover state, and the label would sit over content. */
@media (max-width: 767px) {
    .tan-wa-float {
        right: 16px;
        bottom: 16px;
        width: 54px;
        height: 54px;
    }

    .tan-wa-float__icon svg {
        width: 28px;
        height: 28px;
    }

    .tan-wa-float__label {
        display: none;
    }
}

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

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