/* Floating WhatsApp Widget
   ========================================================================== */

.whatsapp-widget {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1000;
    font-family: var(--font-body);
}

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

.whatsapp-widget__button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
}

/* Pulse Animation */
.whatsapp-widget__pulse {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid #25D366;
    border-radius: 50%;
    animation: pulse 2s infinite;
    opacity: 0.6;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Chat Window */
.whatsapp-widget__chat {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s ease;
    overflow: hidden;
}

.whatsapp-widget.active .whatsapp-widget__chat {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

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

.whatsapp-widget__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    padding: 2px;
}

.whatsapp-widget__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.whatsapp-widget__info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.whatsapp-widget__info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
    color: white;
}

.whatsapp-widget__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.whatsapp-widget__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Body */
.whatsapp-widget__body {
    padding: 20px 16px;
    background: #f0f0f0;
}

.whatsapp-widget__message {
    background: white;
    padding: 12px 16px;
    border-radius: 12px 12px 12px 4px;
    position: relative;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

.whatsapp-widget__message p {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.whatsapp-widget__message p:last-of-type {
    margin-bottom: 0;
}

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

/* Chat Footer */
.whatsapp-widget__footer {
    padding: 16px;
    background: white;
    border-top: 1px solid #eee;
}

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

.whatsapp-widget__send:hover {
    background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-widget__send svg {
    width: 18px;
    height: 18px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .whatsapp-widget {
        left: 15px;
        bottom: 15px;
    }
    
    .whatsapp-widget__button {
        width: 55px;
        height: 55px;
    }
    
    .whatsapp-widget__button svg {
        width: 24px;
        height: 24px;
    }
    
    .whatsapp-widget__chat {
        width: 280px;
        bottom: 75px;
    }
}

@media (max-width: 480px) {
    .whatsapp-widget {
        left: 10px;
        bottom: 10px;
    }
    
    .whatsapp-widget__button {
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-widget__button svg {
        width: 22px;
        height: 22px;
    }
    
    .whatsapp-widget__chat {
        width: calc(100vw - 40px);
        max-width: 300px;
        bottom: 70px;
        left: 50%;
        transform: translateX(-50%) translateY(20px) scale(0.9);
    }
    
    .whatsapp-widget.active .whatsapp-widget__chat {
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* Animation for widget appearance */
.whatsapp-widget {
    animation: slideInLeft 0.5s ease-out;
}

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

/* Hide widget on very small screens if needed */
@media (max-width: 320px) {
    .whatsapp-widget__chat {
        width: calc(100vw - 20px);
    }
}