/* ==========================================
   JELODA Global Floating WhatsApp Button
   Aparece en todas las páginas (excepto /whatsapp)
   Posición fija inferior-izquierda, sigue el lenguaje visual de la marca
   ========================================== */

.wa-float {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 9998;                   /* debajo del preloader (10000) pero sobre todo lo demás */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    box-shadow:
        0 10px 30px rgba(37, 211, 102, 0.45),
        0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: waFloatEntry 0.6s 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.5) backwards;
}

.wa-float:hover {
    transform: translateY(-4px) scale(1.06);
    box-shadow:
        0 16px 40px rgba(37, 211, 102, 0.6),
        0 6px 16px rgba(0, 0, 0, 0.3);
}

.wa-float:active {
    transform: translateY(-1px) scale(1.02);
}

/* Ícono SVG dentro del botón */
.wa-float__icon {
    width: 32px;
    height: 32px;
    fill: #ffffff;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.wa-float:hover .wa-float__icon {
    transform: rotate(-8deg) scale(1.08);
}

/* Anillos de pulso (atención sutil) */
.wa-float__pulse,
.wa-float__pulse::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(37, 211, 102, 0.55);
    animation: waFloatPulse 2.4s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    pointer-events: none;
}

.wa-float__pulse::before {
    inset: -1px;
    animation-delay: 1.2s;
    border-color: rgba(37, 211, 102, 0.4);
}

/* Tooltip (texto al hover en desktop) */
.wa-float__tooltip {
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(-8px);
    background: rgba(20, 20, 22, 0.92);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.wa-float__tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: rgba(20, 20, 22, 0.92);
}

.theme--light .wa-float__tooltip {
    background: rgba(255, 255, 255, 0.95);
    color: #111;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.theme--light .wa-float__tooltip::before {
    border-right-color: rgba(255, 255, 255, 0.95);
}

.wa-float:hover .wa-float__tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Badge "online" verde sutil */
.wa-float__badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4ade80;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    animation: waBadgePulse 1.8s ease-in-out infinite;
}

/* Ocultar en la propia página de redirect para evitar redundancia */
body[data-page="whatsapp"] .wa-float {
    display: none !important;
}

/* ── Animaciones ── */
@keyframes waFloatPulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.55);
        opacity: 0;
    }
}

@keyframes waBadgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    50%       { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}

@keyframes waFloatEntry {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.6);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Responsive ── */
@media (max-width: 599px) {
    .wa-float {
        bottom: calc(18px + env(safe-area-inset-bottom));
        left: calc(18px + env(safe-area-inset-left));
        width: 54px;
        height: 54px;
    }
    .wa-float__icon {
        width: 28px;
        height: 28px;
    }
    .wa-float__tooltip {
        display: none;        /* En móvil el tooltip estorba */
    }
}

/* ── iOS: evitar animaciones constantes que consumen batería y throttle-an CPU ── */
@media (prefers-reduced-motion: reduce) {
    .wa-float,
    .wa-float__pulse,
    .wa-float__pulse::before,
    .wa-float__badge {
        animation: none !important;
    }
}

/* Si hubiera un sidebar/scroll button al lado derecho, este no estorba */
