/* ============================================
   WHATSAPP FLOATING WIDGET
   ============================================ */

.whatsapp-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Bubble Button */
.whatsapp-bubble {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.whatsapp-bubble.active {
    background: #f44336;
    transform: rotate(90deg);
}

.whatsapp-icon {
    width: 32px;
    height: 32px;
    color: white;
    transition: all 0.3s ease;
    display: block;
}

.whatsapp-bubble.active .whatsapp-icon {
    opacity: 0;
    transform: scale(0);
}

.whatsapp-close {
    position: absolute;
    width: 28px;
    height: 28px;
    color: white;
    opacity: 0;
    transform: scale(0) rotate(-90deg);
    transition: all 0.3s ease;
}

.whatsapp-bubble.active .whatsapp-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Pulse Animation */
.whatsapp-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.5);
    animation: pulse 2s infinite;
    pointer-events: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.whatsapp-bubble.active .whatsapp-pulse {
    display: none;
}

/* Popup Card */
.whatsapp-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    overflow: hidden;
}

.whatsapp-popup.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

/* Popup Header */
.whatsapp-popup-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.whatsapp-popup-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
}

.whatsapp-popup-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.whatsapp-online {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #4CAF50;
    border: 2px solid white;
    border-radius: 50%;
    animation: online-pulse 2s infinite;
}

@keyframes online-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
    }
}

.whatsapp-popup-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.whatsapp-popup-info p {
    margin: 4px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

/* Popup Body */
.whatsapp-popup-body {
    padding: 20px;
    background: #ECE5DD;
    min-height: 100px;
}

.whatsapp-message {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    max-width: 85%;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.whatsapp-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 8px 8px 0;
    border-color: transparent white transparent transparent;
}

.whatsapp-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.whatsapp-time {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 6px;
    text-align: right;
}

/* Popup Footer */
.whatsapp-popup-footer {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.whatsapp-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.whatsapp-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
}

.whatsapp-cta svg {
    width: 20px;
    height: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .whatsapp-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-bubble {
        width: 56px;
        height: 56px;
    }
    
    .whatsapp-icon {
        width: 28px;
        height: 28px;
    }
    
    .whatsapp-popup {
        width: calc(100vw - 40px);
        max-width: 340px;
    }
}

/* Smooth entrance animation */
.whatsapp-widget {
    animation: widgetEntrance 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes widgetEntrance {
    from {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}