/* ----------------------------------------------------
   NIBIRU WHATSAPP WIDGET STYLES
   - Floating button stacked above the AI chat launcher,
     styled to feel like part of the same "premium" family
     (glow-pulse ring, soft pop-in, glossy border) but in
     WhatsApp's own green so it stays instantly recognizable.
   - Small inline icon shown next to phone numbers site-wide.
   ---------------------------------------------------- */

.nibiru-whatsapp-float {
    position: fixed;
    bottom: 114px;
    right: 32px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #3fe374 0%, #22c35e 55%, #128c4e 100%);
    border: 3px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 8px 24px rgba(18, 140, 78, 0.45);
    z-index: 9999;
    cursor: pointer;
    text-decoration: none;
    animation:
        nibiru-whatsapp-pulse 2.8s infinite,
        nibiru-whatsapp-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.4s both;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.25s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease;
}

.nibiru-whatsapp-float:hover {
    transform: scale(1.12) rotate(-6deg);
    border-color: #ffffff;
    animation-play-state: paused;
    box-shadow: 0px 12px 32px rgba(18, 140, 78, 0.6);
}

.nibiru-whatsapp-float i {
    font-size: 30px;
    color: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
    transition: transform 0.3s ease;
}

.nibiru-whatsapp-float:hover i {
    transform: scale(1.1);
}

/* Little tooltip that pops up to the left on hover (desktop) */
.nibiru-whatsapp-float::after {
    content: "¡Escríbenos!";
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: #128c4e;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.nibiru-whatsapp-float::before {
    content: "";
    position: absolute;
    right: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #128c4e;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.nibiru-whatsapp-float:hover::after,
.nibiru-whatsapp-float:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Soft glow ring, same "premium" feel as the AI launcher's pulse */
@keyframes nibiru-whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55), 0px 8px 24px rgba(18, 140, 78, 0.45);
    }

    70% {
        box-shadow: 0 0 0 16px rgba(37, 211, 102, 0), 0px 8px 24px rgba(18, 140, 78, 0.45);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0), 0px 8px 24px rgba(18, 140, 78, 0.45);
    }
}

/* Gentle pop-in the moment the button first appears on the page */
@keyframes nibiru-whatsapp-pop {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Hidden while the AI chat window is open, so both widgets never overlap */
.nibiru-whatsapp-float-hidden {
    opacity: 0 !important;
    transform: scale(0.6) !important;
    pointer-events: none;
    animation: none !important;
}

.nibiru-whatsapp-float-hidden::after,
.nibiru-whatsapp-float-hidden::before {
    opacity: 0 !important;
}

@media (max-width: 576px) {
    .nibiru-whatsapp-float {
        bottom: 93px;
        right: 22px;
        width: 50px;
        height: 50px;
        border-width: 2px;
    }

    .nibiru-whatsapp-float i {
        font-size: 24px;
    }

    /* No hover on touch devices — skip the tooltip to avoid a stuck bubble */
    .nibiru-whatsapp-float::after,
    .nibiru-whatsapp-float::before {
        display: none;
    }
}

/* Inline WhatsApp icon shown next to phone numbers across the site */
.nibiru-whatsapp-inline-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-left: 8px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.12);
    color: #22c35e;
    font-size: 0.95em;
    vertical-align: middle;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nibiru-whatsapp-inline-link:hover {
    background: #25D366;
    color: #ffffff;
    transform: scale(1.15);
}
