/* Styles pour le popup frontend - Version ultra renforcée anti-conflit */

/* Overlay - Fond noir - Spécificité maximale */
#custom-popup-overlay.popup-overlay {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.85) !important;
    z-index: 999999 !important;
    animation: fadeIn 0.3s ease-in-out !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
}

#custom-popup-overlay.popup-overlay.popup-show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Container - Boîte blanche centrée - Protection maximale */
#custom-popup-overlay .popup-container {
    position: relative !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    width: auto !important;
    height: auto !important;
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6) !important;
    animation: slideIn 0.3s ease-in-out !important;
    padding: 20px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: inline-block !important;
    border: none !important;
    float: none !important;
    transform: none !important;
}

/* Bouton de fermeture - Style moderne et discret */
#custom-popup-overlay .popup-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    background: rgba(0, 0, 0, 0.5) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 24px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    z-index: 10 !important;
    transition: all 0.25s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    font-weight: 300 !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: none !important;
    text-decoration: none !important;
    float: none !important;
    transform: none !important;
}

#custom-popup-overlay .popup-close:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    transform: scale(1.1) !important;
    color: #fff !important;
}

#custom-popup-overlay .popup-close:focus {
    outline: 3px solid #fff !important;
    outline-offset: 3px !important;
}

/* Contenu - Protection contre les styles Elementor */
#custom-popup-overlay .popup-content {
    display: block !important;
    line-height: 0 !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-sizing: border-box !important;
    float: none !important;
    position: relative !important;
    transform: none !important;
}

/* Image - PROTECTION MAXIMALE contre tous les styles externes */
#custom-popup-overlay .popup-content .popup-image,
#custom-popup-overlay .popup-image {
    display: block !important;
    max-width: calc(90vw - 40px) !important;
    max-height: calc(90vh - 40px) !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    box-sizing: content-box !important;
    object-fit: none !important;
    object-position: center center !important;
    position: relative !important;
    float: none !important;
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: visible !important;
}

/* Reset de tous les styles possibles qui pourraient venir d'Elementor */
#custom-popup-overlay *,
#custom-popup-overlay *::before,
#custom-popup-overlay *::after {
    box-sizing: border-box !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation de fermeture */
#custom-popup-overlay.popup-overlay.popup-closing {
    animation: fadeOut 0.3s ease-in-out !important;
}

#custom-popup-overlay.popup-overlay.popup-closing .popup-container {
    animation: slideOut 0.3s ease-in-out !important;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* Responsive - Tablette */
@media screen and (max-width: 768px) {
    #custom-popup-overlay .popup-container {
        max-width: 95vw !important;
        max-height: 90vh !important;
        padding: 15px !important;
        border-radius: 10px !important;
    }
    
    #custom-popup-overlay .popup-close {
        top: 8px !important;
        right: 8px !important;
        width: 34px !important;
        height: 34px !important;
        font-size: 22px !important;
    }
    
    #custom-popup-overlay .popup-image {
        max-width: calc(95vw - 30px) !important;
        max-height: calc(90vh - 30px) !important;
    }
}

/* Responsive - Mobile */
@media screen and (max-width: 480px) {
    #custom-popup-overlay .popup-container {
        max-width: 98vw !important;
        max-height: 90vh !important;
        padding: 10px !important;
        border-radius: 8px !important;
    }
    
    #custom-popup-overlay .popup-close {
        top: 6px !important;
        right: 6px !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 20px !important;
    }
    
    #custom-popup-overlay .popup-image {
        max-width: calc(98vw - 20px) !important;
        max-height: calc(90vh - 20px) !important;
    }
}

/* Protection spécifique contre les styles Elementor courants */
#custom-popup-overlay img {
    vertical-align: middle !important;
}

#custom-popup-overlay .elementor-widget-container,
#custom-popup-overlay .elementor-image,
#custom-popup-overlay .elementor-element {
    all: unset !important;
}
