﻿:root {
    --wa: #25D366; /* color principal */
    --pulse-duration: 3.0s; /* velocidad de cada pulso */
    --delay-step: 1s; /* separación entre pulsos */
    --max-scale: 2.5; /* alcance máximo del pulso */
    --base-opacity: .25; /* opacidad inicial del pulso */
}

/* --------- Layout demo --------- */
/*body {
    min-height: 100vh;
    background: #0f0f12;
    color: #e6e6e6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px 120px;
    font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,Apple Color Emoji,Segoe UI Emoji;
}
*/
/*.demo-card {
    max-width: 920px;
    width: 100%;
    background: #14161b;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
    padding: 28px;
}

    .demo-card h1 {
        font-size: 1.6rem;
        margin-bottom: 8px;
    }

    .demo-card p {
        color: #c9c9c9;
    }*/

/* --------- Botón WhatsApp con AURA SÓLIDA + múltiples pulsos --------- */
.whatsapp-float {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--wa);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(0,0,0,.18), 0 6px 12px rgba(0,0,0,.10);
    z-index: 9999;
    isolation: isolate; /* separa los efectos del fondo */
    overflow: visible;
}

    .whatsapp-float i {
        font-size: 30px;
        line-height: 1;
        position: relative;
        z-index: 5;
    }

    /* Aura base continua que nace al borde (sin hueco) */
    .whatsapp-float::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 50%;
        background: var(--wa);
        opacity: .20;
        transform: scale(1);
        filter: blur(.0px);
        z-index: 1;
        animation: ambient 4.5s ease-in-out infinite alternate;
        box-shadow: 0 0 24px rgba(37,211,102,.45), 0 0 64px rgba(37,211,102,.25), 0 0 120px rgba(37,211,102,.15);
    }

@keyframes ambient {
    0% {
        opacity: .18;
        filter: blur(0px);
    }

    100% {
        opacity: .30;
        filter: blur(.2px);
    }
}

/* Contenedor de pulsos */
.pulses {
    position: absolute;
    inset: 0;
    z-index: 2; /* sobre el aura base y bajo el ícono */
}

/* Cada pulso nace exactamente en el borde (scale:1) y se expande */
.pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--wa);
    transform: scale(1);
    opacity: var(--base-opacity);
    box-shadow: 0 0 24px rgba(37,211,102,.45), 0 0 60px rgba(37,211,102,.25), 0 0 120px rgba(37,211,102,.18);
    animation: pulseExpand var(--pulse-duration) ease-out infinite;
    animation-delay: calc(var(--i) * var(--delay-step));
    will-change: transform, opacity;
    pointer-events: none;
}

@keyframes pulseExpand {
    0% {
        transform: scale(1);
        opacity: var(--base-opacity);
    }

    70% {
        transform: scale(calc(var(--max-scale) - .5));
        opacity: .14;
    }

    100% {
        transform: scale(var(--max-scale));
        opacity: 0;
    }
}

/* Borde más blando para cada pulso (gradiente radial superpuesto) */
.pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37,211,102,.32) 0%, rgba(37,211,102,.22) 55%, rgba(37,211,102,.10) 75%, rgba(37,211,102,0) 100%);
    mix-blend-mode: screen;
}

/* Hover: acelera levemente todos los pulsos */
.whatsapp-float:hover .pulse {
    animation-duration: calc(var(--pulse-duration) * .8);
}

/* Tooltip lateral (desktop) */
.whatsapp-float .label {
    position: absolute;
    right: 75px;
    background: var(--wa);
    color: #fff;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 6px 14px rgba(0,0,0,.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 2px solid rgba(255,255,255,.2);
    user-select: none;
    pointer-events: none;
    z-index: 6;
}

    .whatsapp-float .label::after {
        content: "";
        position: absolute;
        right: -6px;
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
        width: 12px;
        height: 12px;
        background: var(--wa);
        border-right: 2px solid rgba(255,255,255,.2);
        border-bottom: 2px solid rgba(255,255,255,.2);
        border-radius: 2px;
    }

@media (max-width: 767.98px) {
    .whatsapp-float .label {
        display: none;
    }
}

/* --------- Responsivo --------- */
@media (max-width: 480px) {
    .whatsapp-float {
        right: 16px;
        bottom: 16px;
        width: 56px;
        height: 56px;
    }

        .whatsapp-float i {
            font-size: 26px;
        }
}
