/* CRITICAL OVERLAP FIXES - HIGHEST PRIORITY */

/* Force Hide Conflicting Elements */
.crisp-client,
#crisp-chatbox,
.intercom-messenger-frame,
.tawk-min-container {
    display: none !important;
    visibility: hidden !important;
}

/* WhatsApp - Bottom Right Corner Only */
#whatsapp-support {
    position: fixed !important;
    bottom: 1rem !important;
    right: 1rem !important;
    left: auto !important;
    z-index: 30 !important;
    transform: none !important;
}

/* Guarantee Badge - Bottom Left Corner Only */
div[class*="guarantee"],
div[id*="guarantee"],
.guarantee-badge {
    position: fixed !important;
    bottom: 1rem !important;
    left: 1rem !important;
    right: auto !important;
    z-index: 25 !important;
    transform: none !important;
}

/* Social Proof - Left Side, Above Guarantee */
#social-proof-container {
    position: fixed !important;
    bottom: 6rem !important;
    left: 1rem !important;
    right: auto !important;
    z-index: 20 !important;
    max-width: 280px !important;
}

/* Hide Chat Trigger Buttons on Mobile/Small Screens */
@media (max-width: 768px) {
    .chat-trigger-btn,
    button[class*="chat"],
    div[class*="chat-trigger"] {
        display: none !important;
    }
}

/* Chat Trigger - Above WhatsApp on Larger Screens */
@media (min-width: 769px) {
    .chat-trigger-btn {
        position: fixed !important;
        bottom: 6rem !important;
        right: 1rem !important;
        z-index: 35 !important;
    }
}

/* Exit Intent Modal - Always on Top */
#exit-intent-modal {
    z-index: 9999 !important;
}

/* WhatsApp Bubble Positioning Fix - FORCE HIDE WHEN OVERLAPPING */
#whatsapp-bubble {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Only show WhatsApp button, hide the chat bubble entirely */
#whatsapp-support .whatsapp-bubble,
#whatsapp-support [class*="bubble"],
#whatsapp-support [id*="bubble"] {
    display: none !important;
    visibility: hidden !important;
}

/* Prevent Content Overlap */
body {
    padding-bottom: 8rem !important;
}

main, .main-content {
    margin-bottom: 8rem !important;
}

/* Clear Floating Layout */
@media (max-width: 640px) {
    /* Mobile Layout: 
       - WhatsApp: Bottom right 
       - Guarantee: Bottom left
       - Social Proof: Above guarantee (left)
       - Chat triggers: Hidden
    */
    
    #whatsapp-support {
        bottom: 1rem !important;
        right: 1rem !important;
    }
    
    div[class*="guarantee"],
    div[id*="guarantee"],
    .guarantee-badge {
        bottom: 1rem !important;
        left: 1rem !important;
    }
    
    #social-proof-container {
        bottom: 6rem !important;
        left: 1rem !important;
        max-width: 250px !important;
    }
    
    body {
        padding-bottom: 10rem !important;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    /* Tablet Layout */
    #whatsapp-support {
        bottom: 1rem !important;
        right: 1rem !important;
    }
    
    div[class*="guarantee"],
    div[id*="guarantee"],
    .guarantee-badge {
        bottom: 1rem !important;
        left: 1rem !important;
    }
    
    #social-proof-container {
        bottom: 1rem !important;
        left: 20rem !important;
    }
    
    .chat-trigger-btn {
        bottom: 6rem !important;
        right: 1rem !important;
    }
}

@media (min-width: 1025px) {
    /* Desktop Layout */
    #whatsapp-support {
        bottom: 1rem !important;
        right: 1rem !important;
    }
    
    div[class*="guarantee"],
    div[id*="guarantee"],
    .guarantee-badge {
        bottom: 1rem !important;
        left: 1rem !important;
    }
    
    #social-proof-container {
        bottom: 1rem !important;
        left: 25rem !important;
    }
    
    .chat-trigger-btn {
        bottom: 6rem !important;
        right: 1rem !important;
    }
}

/* Emergency Reset for All Floating Elements */
[class*="fixed"][class*="bottom"],
[style*="position: fixed"][style*="bottom"] {
    pointer-events: all !important;
    transition: all 0.3s ease !important;
}

/* Ensure No Stacking */
#whatsapp-support ~ #whatsapp-support,
.guarantee-badge ~ .guarantee-badge,
#social-proof-container ~ #social-proof-container {
    display: none !important;
}

/* Force blue chat circles to stay in their designated area */
.bg-blue-500,
.bg-blue-600,
[class*="bg-blue"] {
    position: relative !important;
    z-index: 31 !important;
}

/* Ensure WhatsApp doesn't expand beyond button */
#whatsapp-support {
    width: 56px !important;
    height: 56px !important;
    overflow: hidden !important;
}

/* Hide any expanding chat interfaces */
#whatsapp-support > *:not(.whatsapp-button):not(button) {
    display: none !important;
}

/* Force Visibility Control */
.modal-open .hide-floating {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.8) translateY(20px) !important;
}

/* Language Dropdown Fix */
.language-dropdown {
    z-index: 10000 !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    min-width: 200px !important;
    max-width: 280px !important;
    margin-top: 0.5rem !important;
}

/* Ensure parent container doesn't clip dropdown */
.language-dropdown {
    transform: translateX(0) !important;
}

/* Mobile language dropdown adjustments */
@media (max-width: 768px) {
    .language-dropdown {
        right: -1rem !important;
        min-width: 220px !important;
        max-width: calc(100vw - 2rem) !important;
    }
}

/* Fix navbar overflow for dropdown */
.navbar-container,
header,
nav {
    overflow: visible !important;
}

/* Language switcher container */
.language-switcher-container {
    position: relative !important;
    z-index: 10000 !important;
}

/* Ensure dropdown appears above everything */
.language-dropdown {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}