/**
 * WhatsApp Floating Button
 *
 * Fixed-position chat button, bottom-right corner.
 * Positioned above the mobile bottom navigation bar on small screens.
 *
 * @package Ratna_Gems
 * @since   3.6.0
 */

/* ==========================================================================
   Button
   ========================================================================== */

.rg-whatsapp-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.rg-whatsapp-btn:hover,
.rg-whatsapp-btn:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    animation: none;
}

.rg-whatsapp-btn:focus-visible {
    outline: 3px solid var(--ast-global-color-0, #2563eb);
    outline-offset: 3px;
}

/* White ring border */
.rg-whatsapp-btn::before {
    content: "";
    position: absolute;
    inset: -2px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
}

/* ==========================================================================
   Icon
   ========================================================================== */

.rg-whatsapp-btn svg {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

/* ==========================================================================
   Pulse Animation (respects reduced-motion preference)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    .rg-whatsapp-btn {
        animation: rg-whatsapp-pulse 2s infinite;
    }
}

@keyframes rg-whatsapp-pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ==========================================================================
   Mobile — above bottom navigation bar (54px + safe-area-inset)
   ========================================================================== */

@media (max-width: 1024px) {
    .rg-whatsapp-btn {
        bottom: calc(54px + env(safe-area-inset-bottom, 0px) + 16px);
        right: 16px;
        width: 50px;
        height: 50px;
    }

    .rg-whatsapp-btn svg {
        width: 28px;
        height: 28px;
    }
}
