/* ============================================
   BOTÓ FLOTANT DE WHATSAPP — whatsapp.css
   Mobilitza't Argentona
   ============================================ */

.wa-float {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 998; /* Per sota de l'overlay de cookies (999) */
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35), 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wa-float:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.45), 0 2px 8px rgba(0, 0, 0, 0.12);
}

.wa-float:focus-visible {
    outline: 2px solid #00B1E2;
    outline-offset: 3px;
}

/* ——— BOTÓ TORNAR A DALT (sobre el de WhatsApp) ——— */
.to-top {
    position: fixed;
    right: calc(1.5rem + 6px); /* centrat amb el botó de WhatsApp (60px) */
    bottom: calc(1.5rem + 60px + 0.75rem);
    z-index: 998;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 0.625rem;
    background: #1a1a1a;
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.to-top:hover {
    transform: translateY(-3px);
}

.to-top:focus-visible {
    outline: 2px solid #00B1E2;
    outline-offset: 3px;
}

/* ——— RESPONSIVE ——— */
@media (max-width: 600px) {
    .to-top {
        right: calc(1rem + 5px); /* centrat amb el botó de WhatsApp (54px) */
        bottom: calc(1rem + 54px + 0.625rem);
        width: 44px;
        height: 44px;
        border-radius: 0.5rem;
    }

    .wa-float {
        right: 1rem;
        bottom: 1rem;
        width: 54px;
        height: 54px;
    }

    .wa-float svg {
        width: 26px;
        height: 26px;
    }
}

/* ——— BADGE DEL reCAPTCHA (Contacte, amb consentiment) ———
   El badge de Google fa 70px d'alt i va a 14px del peu: pugem els botons per sobre */
html:has(.grecaptcha-badge) .wa-float {
    bottom: calc(14px + 70px + 0.75rem);
}

html:has(.grecaptcha-badge) .to-top {
    bottom: calc(14px + 70px + 0.75rem + 60px + 0.75rem);
}

@media (max-width: 600px) {
    html:has(.grecaptcha-badge) .to-top {
        bottom: calc(14px + 70px + 0.75rem + 54px + 0.625rem);
    }
}

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