/* ===== WhatsApp flotante ===== */
.whatsapp-float {
    position: fixed;
    right: clamp(16px, 3vw, 32px);
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 10px;
    border: 1px solid rgba(37, 211, 102, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .18), 0 2px 8px rgba(37, 211, 102, .18);
    color: #075e54;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: transform .25s ease, box-shadow .25s ease, padding .25s ease, gap .25s ease;
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
    color: #075e54;
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, .22), 0 4px 12px rgba(37, 211, 102, .24);
}

.whatsapp-float__icon {
    display: block;
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex: 0 0 52px;
}

.whatsapp-float__label {
    max-width: 90px;
    overflow: hidden;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    opacity: 1;
    transform: translateX(0);
    transition: max-width .25s ease, opacity .2s ease, transform .25s ease;
}

.whatsapp-float.is-scrolling {
    gap: 0;
    padding: 6px;
}

.whatsapp-float.is-scrolling .whatsapp-float__label {
    max-width: 0;
    opacity: 0;
    transform: translateX(8px);
}

/* El botón azul de subir queda arriba del WhatsApp, con espacio entre ambos. */
.scroll-top {
    bottom: calc(100px + env(safe-area-inset-bottom));
}

@media (max-width: 480px) {
    .whatsapp-float {
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        gap: 7px;
        padding: 6px 11px 6px 7px;
    }

    .whatsapp-float__icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .whatsapp-float__label {
        font-size: .88rem;
    }

    .scroll-top {
        right: 14px;
        bottom: calc(76px + env(safe-area-inset-bottom));
        width: 38px;
        height: 38px;
        font-size: 17px;
    }
}

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