/* WhatsApp Floating Button */
.whatsapp-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999; /* Increased to highest */
}

.whatsapp-button {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-button i {
    font-size: 32px;
    color: white;
}

/* Popup Modal */
.whatsapp-popup {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9998; /* Just below the button */
    display: none;
    animation: slideUp 0.3s ease;
    pointer-events: auto;
}

.whatsapp-popup.active {
    display: block;
}

.popup-header {
    background: #25D366;
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.popup-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.popup-header p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.popup-body {
    padding: 20px;
    pointer-events: auto;
}

.working-hours {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 13px;
    color: #666;
    border-left: 3px solid #25D366;
}

.chat-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
}

.chat-option {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    pointer-events: auto;
}

.chat-option:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.chat-option i {
    font-size: 20px;
    color: #25D366;
    margin-right: 12px;
    width: 24px;
}

.option-text h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #333;
}

.option-text p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

/* Close Button */
.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
    pointer-events: auto;
}

.close-popup:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9997; /* Below popup but above everything else */
    display: none;
}

.overlay.active {
    display: block;
}

/* Mobile Fixes - Prevent touch issues and header overlap */
@media (max-width: 768px) {
    .whatsapp-popup {
        width: 90%;
        right: 5%;
        bottom: 90px; /* Increased to clear mobile header */
        -webkit-tap-highlight-color: transparent;
        z-index: 9998; /* Ensure it's above mobile menu */
    }
    
    .whatsapp-widget {
        bottom: 25px;
        right: 20px;
        z-index: 9999; /* Highest on mobile */
    }
    
    .overlay {
        z-index: 9997; /* Consistent z-index */
    }
    
    .chat-option {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .whatsapp-button {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .whatsapp-popup {
        width: 95%;
        right: 2.5%;
        bottom: 100px; /* Even more space from bottom */
        max-height: 70vh; /* Prevent it from being too tall */
        overflow-y: auto; /* Make it scrollable if content is too long */
    }
    
    .popup-body {
        padding: 15px;
    }
    
    .chat-option {
        padding: 12px;
    }
    
    .whatsapp-widget {
        bottom: 20px;
        right: 15px;
    }
}

/* Ensure all interactive elements are clickable */
.whatsapp-popup * {
    pointer-events: auto;
}

.chat-options * {
    pointer-events: auto;
}

/* Make sure WhatsApp widget stays above Bootstrap modals and other elements */
.whatsapp-widget,
.whatsapp-popup,
.overlay {
    z-index: 9999 !important;
}