/**
 * WhatsApp Floating Button Styles
 * Desktop: Floating icon with ripple effect
 * Mobile: Sticky bottom button with content padding
 */

/* WhatsApp Floating Button Container */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    /* Ensure it's always visible and not affected by parent overflow */
    pointer-events: auto;
    visibility: visible;
}

/* WhatsApp Button */
.whatsapp-float-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.whatsapp-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

.whatsapp-float-btn i {
    font-size: 32px;
    color: #fff;
    z-index: 2;
    position: relative;
}

/* Ripple Effect */
.whatsapp-float-btn::before,
.whatsapp-float-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.4);
    z-index: 1;
    pointer-events: none;
}

.whatsapp-float-btn::before {
    animation: whatsapp-ripple 2s ease-out infinite;
}

.whatsapp-float-btn::after {
    animation: whatsapp-ripple 2s ease-out infinite 1s;
}

@keyframes whatsapp-ripple {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.6;
    }
    100% {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}

/* Tooltip on hover (Desktop only) */
.whatsapp-tooltip {
    position: absolute;
    right: 75px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent #333;
}

.whatsapp-float-btn:hover + .whatsapp-tooltip,
.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   MOBILE STYLES
   ======================================== */

@media (max-width: 768px) {
    /* Mobile: Sticky bottom bar style - always visible on scroll */
    .whatsapp-float {
        position: fixed !important;
        bottom: 0 !important;
        left: 0;
        right: 0;
        width: 100%;
        padding: 12px 15px;
        background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
        border-radius: 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 99999 !important;
        /* Hardware acceleration for smooth scroll */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        /* Ensure visibility */
        visibility: visible !important;
        opacity: 1 !important;
    }

    .whatsapp-float-btn {
        width: 100%;
        height: auto;
        background: transparent;
        border-radius: 8px;
        box-shadow: none;
        padding: 8px 20px;
        flex-direction: row;
        gap: 10px;
    }

    .whatsapp-float-btn:hover {
        transform: none;
        box-shadow: none;
    }

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

    /* Hide ripple effect on mobile */
    .whatsapp-float-btn::before,
    .whatsapp-float-btn::after {
        display: none;
    }

    /* Show text label on mobile */
    .whatsapp-btn-text {
        display: inline-block;
        color: #fff;
        font-size: 16px;
        font-weight: 600;
        letter-spacing: 0.3px;
    }

    /* Hide tooltip on mobile */
    .whatsapp-tooltip {
        display: none;
    }

    /* Add padding to body/footer to prevent content hiding behind sticky button */

    /* Ensure footer has margin above the sticky button */
    .site-footer {
        margin-bottom: 0 !important;
        padding-bottom: 60px !important;
    }
    
    /* Ensure parent containers don't interfere with fixed positioning */
    .box-wrapper {
        overflow-x: hidden;
        overflow-y: visible;
    }
    
    html, body {
        overflow-x: hidden;
    }
}

/* Desktop: Hide text label */
@media (min-width: 769px) {
    .whatsapp-btn-text {
        display: none;
    }
}

/* Pulse animation for extra attention */
@media (min-width: 769px) {
    .whatsapp-float-btn {
        animation: whatsapp-pulse 2s ease-in-out infinite;
    }

    @keyframes whatsapp-pulse {
        0%, 100% {
            box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
        }
        50% {
            box-shadow: 0 4px 30px rgba(37, 211, 102, 0.7);
        }
    }

    .whatsapp-float-btn:hover {
        animation: none;
    }
}

