/* WhatsApp Widget Styles */

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

/* Botón principal de WhatsApp */
.whatsapp-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    position: relative;
    animation: pulse-green 2s infinite;
}

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

.whatsapp-button i {
    font-size: 28px;
    color: white;
}

/* Badge de notificación */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: bounce 1s infinite;
}

/* Animaciones */
@keyframes pulse-green {
    0% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.8);
    }
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* Chat container */
.whatsapp-chat {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: bottom right;
}

.whatsapp-chat.active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Header del chat */
.whatsapp-header {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    padding: 15px;
    display: flex;
    align-items: center;
    color: white;
    position: relative;
}

.whatsapp-avatar {
    position: relative;
    margin-right: 12px;
}

.whatsapp-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4fc3f7;
    border: 2px solid white;
    border-radius: 50%;
}

.whatsapp-info {
    flex: 1;
}

.whatsapp-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 2px;
}

.whatsapp-status {
    font-size: 12px;
    opacity: 0.9;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-chat:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mensajes */
.whatsapp-messages {
    padding: 20px 15px;
    background: #f0f0f0;
    min-height: 180px;
    max-height: 300px;
    overflow-y: auto;
}

.message-received {
    margin-bottom: 15px;
    animation: slideInLeft 0.5s ease;
}

.message-bubble {
    background: white;
    padding: 12px 15px;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    line-height: 1.4;
    max-width: 85%;
    position: relative;
}

.message-bubble::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -6px;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-right-color: white;
    border-bottom: 0;
    border-left: 0;
    margin-bottom: -6px;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    margin-left: 10px;
}

/* Opciones de servicios clicables */
.service-options {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.service-option {
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid rgba(37, 211, 102, 0.3);
    color: #128c7e;
    padding: 8px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    transition: all 0.3s ease;
    font-family: inherit;
    width: 100%;
}

.service-option:hover {
    background: rgba(37, 211, 102, 0.2);
    border-color: rgba(37, 211, 102, 0.5);
    transform: translateX(3px);
}

.service-option:active {
    transform: translateX(1px);
    background: rgba(37, 211, 102, 0.3);
}

.service-option.selected {
    background: rgba(37, 211, 102, 0.25);
    border-color: #25d366;
    color: #0f5132;
    font-weight: 500;
}

/* Footer del chat */
.whatsapp-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #e5e5e5;
}

.send-whatsapp-btn {
    width: 100%;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.send-whatsapp-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.send-whatsapp-btn i {
    font-size: 18px;
}

/* Animaciones de entrada */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .whatsapp-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-chat {
        width: 280px;
        bottom: 70px;
    }
    
    .whatsapp-button {
        width: 55px;
        height: 55px;
    }
    
    .whatsapp-button i {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .whatsapp-chat {
        width: 260px;
        right: -10px;
    }
    
    .whatsapp-messages {
        min-height: 150px;
    }
}
