/* 16-img_carousel */
/* --- 1. La Boîte (Le cadre de la diapositive) --- */
.img_carousel .swiper-slide {
    /* Hauteur fixe sur PC */
    height: 500px; 
    
    /* On retire le centrage et on force l'affichage en bloc */
    display: block !important;
    
    /* SÉCURITÉ : On enlève les marges internes qui pourraient créer du vide */
    padding: 0 !important;
    margin: 0 !important;
}

/* --- 1.b SÉCURITÉ SUPPLÉMENTAIRE (Si Elementor met une balise <figure>) --- */
.img_carousel .swiper-slide figure {
    margin: 0 !important;
    height: 100% !important;
    width: 100% !important;
}

/* --- 2. L'Image (La photo de la chambre) --- */
.img_carousel .swiper-slide img {
    /* L'image doit remplir 100% de la largeur et de la hauteur */
    width: 100% !important;
    height: 100% !important;
    
    /* Force l'image à toucher les bords même si elle est petite de base */
    min-width: 100%; 
    
    /* 'cover' zoome pour remplir sans déformer */
    object-fit: cover !important; 
    object-position: center center;
    
    /* Retire toutes les limitations de taille */
    max-height: none !important; 
    max-width: none !important;
    
    /* Enlève les petits espaces fantômes sous les images */
    display: block !important;
    
    /* Transition douce */
    transition: transform 0.5s ease;
}

/* Petit zoom au survol */
.img_carousel .swiper-slide img:hover {
    transform: scale(1.05);
}

/* --- 3. Ajustement Mobile --- */
@media (max-width: 767px) {
    .img_carousel .swiper-slide {
        /* On réduit la hauteur sur mobile */
        height: 300px; 
    }
}

/* 18-animation-fluide-mega-menu */
/* ==================================================
   ANIMATION FLUIDE MEGA MENU (ORDI UNIQUEMENT)
   ================================================== */

@media (min-width: 1025px) {

    /* 1. CORRECTIF ANTI-DOUBLON (Pour éviter le "fantôme" derrière) */
    .elementskit-navbar-nav li.elementskit-megamenu-has > .elementskit-submenu-panel {
        display: none !important;
    }

    /* 2. ÉTAT INITIAL (Pour le Mega Menu et les Menus Simples restants) */
    .elementskit-navbar-nav .elementskit-megamenu-panel,
    .elementskit-navbar-nav .elementskit-submenu-panel {
        display: block !important;      /* On force la présence pour l'anim */
        opacity: 0 !important;          /* Totalement transparent au début */
        visibility: hidden !important;  /* Invisible pour la souris */
        transform: translateY(20px) !important; /* Départ un peu plus bas */
        transition: all 0.4s ease-out !important; /* Vitesse fluide */
        pointer-events: none !important; /* On ne peut pas cliquer quand c'est invisible */
    }

    /* 3. SÉCURITÉ : On réapplique le masquage anti-fantôme */
    .elementskit-navbar-nav li.elementskit-megamenu-has > .elementskit-submenu-panel {
        display: none !important;
    }

    /* 4. ÉTAT AU SURVOL (Apparition) */
    .elementskit-navbar-nav li:hover > .elementskit-megamenu-panel,
    .elementskit-navbar-nav li:hover > .elementskit-submenu-panel {
        opacity: 1 !important;          /* Devient visible */
        visibility: visible !important;
        transform: translateY(0px) !important; /* Remonte doucement à sa place */
        pointer-events: auto !important; /* Réactive les clics */
    }

}

/* 20-logo_carousel */
/* ==================================================
   CARROUSEL LOGOS : STYLE ET FLUIDITÉ
   ================================================== */

/* --- 1. La Boîte (Le conteneur du logo) --- */
.logo_carousel .swiper-slide {
    /* On définit une hauteur fixe pour la ligne de logos */
    height: 150px; 
    
    /* Ces 3 lignes centrent parfaitement le logo (Haut/Bas et Gauche/Droite) */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- 2. L'Image (Le logo lui-même) --- */
.logo_carousel .swiper-slide img {
    /* Le logo ne pourra jamais dépasser cette hauteur (c'est ça qui équilibre) */
    max-height: 100px; 
    
    /* On laisse la largeur s'adapter automatiquement pour ne pas déformer */
    width: auto !important; 
    max-width: 100%;
    
    /* Sécurité pour que le logo soit entier */
    object-fit: contain; 
    
    /* Enlève les ombres ou bordures par défaut d'Elementor si besoin */
    box-shadow: none !important;
    border: none !important;
}

/* --- 3. Optionnel : Ajustement Mobile --- */
@media (max-width: 767px) {
    .logo_carousel .swiper-slide {
        height: 130px; /* Boîte plus petite sur mobile */
    }
    .logo_carousel .swiper-slide img {
        max-height: 80px; /* Logo plus petit sur mobile */
    }
}

/* --- 4. FLUIDITÉ TOTALE (NOUVEAU) --- */
/* Nécessite : Vitesse lecture auto = 0 / Vitesse animation = 5000+ */
.logo_carousel .swiper-wrapper {
    -webkit-transition-timing-function: linear !important;
    transition-timing-function: linear !important;
}

/* ==================================================
   OPTION : LOGOS N&B (AVEC FORT CONTRASTE)
   ================================================== */

/* 1. État par défaut : Gris + Contraste boosté */
.logo_carousel.logo-gris .swiper-slide img {
    /* grayscale(100%) = enlève la couleur */
    /* contrast(150%) = rend les noirs profonds et les blancs éclatants */
    filter: grayscale(100%) contrast(110%);
    
    opacity: 1; /* J'ai retiré la transparence pour un rendu bien net */
    transition: all 0.4s ease; /* Transition fluide */
}

/* 2. Au survol de L'IMAGE : Retour couleur naturelle */
.logo_carousel.logo-gris .swiper-slide img:hover {
    /* On remet le gris à 0 et le contraste à la normale (100%) */
    filter: grayscale(0%) contrast(100%);
    
    transform: scale(1.05); /* Petit zoom */
    opacity: 1;
}

/* ==================================================
   OPTION : ZOOM AU SURVOL (SANS NOIR ET BLANC)
   ================================================== */

/* 1. Prépare l'image pour que l'animation soit fluide */
.logo_carousel .swiper-slide img {
    transition: all 0.4s ease;
}

/* 2. Au survol : ajoute uniquement le zoom */
.logo_carousel .swiper-slide img:hover {
    transform: scale(1.05); /* Petit zoom de 5% */
}

/* 21-header-scroll-effect */
/* =========================================================
   HEADER TRANSPARENT : CODE FINAL (ASTRA + ELEMENTS KIT)
   ========================================================= */

/* --- 1. LE MENU (ORDI SEULEMENT) --- */
@media (min-width: 1025px) {
    /* TEXTE BLANC */
    body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .ekit-menu-nav-link {
        color: #ffffff !important;
    }

    /* FLÈCHE (ICÔNE) BLANCHE */
    body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .ekit-menu-nav-link .elementskit-submenu-indicator {
        color: #ffffff !important;
    }
    
    /* SURVOL */
    body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .ekit-menu-nav-link:hover {
        color: #ffffff !important;
        opacity: 0.8;
    }
}


/* --- 2. LE MENU BURGER (MOBILE) --- */

/* A. Fond transparent pour le bouton global */
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-menu-toggle,
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementskit-menu-hamburger {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* B. FORCER LES TRAITS EN BLANC (La solution est ici) */

/* 1. Cible les lignes dessinées en CSS (span) - Très courant sur ElementsKit */
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementskit-menu-hamburger span,
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementskit-menu-hamburger .ekit-menu-icon span {
    background-color: #ffffff !important;
}

/* 2. Cible les icônes vectorielles (SVG / Police) - Sécurité supplémentaire */
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-menu-toggle i,
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-menu-toggle svg,
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementskit-menu-hamburger .ekit-menu-icon,
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementskit-menu-hamburger i,
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementskit-menu-hamburger svg,
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementskit-menu-hamburger svg path {
    color: #ffffff !important;
    fill: #ffffff !important;
    stroke: #ffffff !important;
}


/* --- 3. LES BOUTONS (AVEC EXCLUSIONS MULTIPLES) --- */

/* Bordure complète (SAUF pour btn-couleur-origine, btn-sans-bordure, btn-souligne ET btn-fond-clair) */
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-widget-button:not(.cb-btn):not(.btn-couleur-origine):not(.btn-sans-bordure):not(.btn-souligne):not(.btn-fond-clair) .elementor-button {
    border-width: 1px !important;
    border-style: solid !important;
    border-color: #ffffff !important;
    background-color: transparent !important;
}

/* Contenu blanc (SAUF pour btn-couleur-origine ET btn-fond-clair) */
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-widget-button:not(.cb-btn):not(.btn-couleur-origine):not(.btn-fond-clair) .elementor-button * {
    color: #ffffff !important;
    fill: #ffffff !important;
}

/* Survol (SAUF pour btn-couleur-origine ET btn-fond-clair) */
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-widget-button:not(.cb-btn):not(.btn-couleur-origine):not(.btn-fond-clair) .elementor-button:hover {
    border-color: #ffffff !important;
}
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-widget-button:not(.cb-btn):not(.btn-couleur-origine):not(.btn-fond-clair) .elementor-button:hover * {
    color: #ffffff !important;
}


/* --- 4. EXCEPTIONS DE BORDURES ET COULEURS --- */

/* Exception A : Bouton 100% sans bordure */
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .btn-sans-bordure:not(.cb-btn) .elementor-button {
    border: none !important;
    background-color: transparent !important;
}

/* Exception B : Bouton souligné */
.btn-souligne:not(.cb-btn) .elementor-button {
    border-width: 0 0 2px 0 !important;
    border-style: solid !important;
}
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .btn-souligne:not(.cb-btn) .elementor-button {
    border-color: transparent transparent #ffffff transparent !important;
    background-color: transparent !important;
}

/* Exception C : Bouton avec fond crème et texte vert (Avant scroll) */
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .btn-fond-clair:not(.cb-btn) .elementor-button {
    background-color: #FFFDF0 !important;
    border-color: #FFFDF0 !important; /* Rend la bordure de la même couleur que le fond pour éviter un trait disgracieux */
}
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .btn-fond-clair:not(.cb-btn) .elementor-button * {
    color: #4B6146 !important;
    fill: #4B6146 !important;
}

/* --- 5. LOGO ET IMAGES (FILTRE BLANC) --- */
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-widget-image img,
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-widget-theme-site-logo img {
    filter: brightness(0) saturate(100%) invert(92%) sepia(7%) saturate(286%) hue-rotate(329deg) brightness(108%) contrast(100%) !important;
    transition: filter 0.3s ease;
}


/* --- 6. LISTE D'ICÔNES (AVEC DÉCALAGE) --- */

/* A. LE DÉCALAGE */
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-widget-icon-list:not(.cb-interactive) {
    transform: translateX(-2px) !important; 
    transition: transform 0.3s ease;
}

/* B. Tout le contenu en blanc */
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-widget-icon-list:not(.cb-interactive) .elementor-icon-list-text,
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-widget-icon-list:not(.cb-interactive) .elementor-icon-list-icon i {
    color: #ffffff !important;
}
/* SVG en blanc */
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-widget-icon-list:not(.cb-interactive) .elementor-icon-list-icon svg {
    fill: #ffffff !important;
}

/* C. Au survol */
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-widget-icon-list:not(.cb-interactive) .elementor-icon-list-item:hover .elementor-icon-list-text,
body:is(.home, .ast-theme-transparent-header) .header-scroll-effect:not(.elementor-sticky--effects) .elementor-widget-icon-list:not(.cb-interactive) .elementor-icon-list-item:hover .elementor-icon-list-icon i {
    color: #ffffff !important;
    opacity: 0.8;
}

/* --- 7. TRANSITIONS DOUCES AU SCROLL (ANTI-SAUT BRUSQUE) --- */
.header-scroll-effect .ekit-menu-nav-link,
.header-scroll-effect .elementor-button,
.header-scroll-effect .elementor-button *,
.header-scroll-effect .elementskit-menu-hamburger span,
.header-scroll-effect .elementor-widget-icon-list * {
    transition: color var(--cb-interaction-duration-base) var(--cb-interaction-ease), background-color var(--cb-interaction-duration-base) var(--cb-interaction-ease), border-color var(--cb-interaction-duration-base) var(--cb-interaction-ease), fill var(--cb-interaction-duration-base) var(--cb-interaction-ease) !important;
}

@media (prefers-reduced-motion: reduce) {
    .header-scroll-effect .ekit-menu-nav-link,
    .header-scroll-effect .elementor-button,
    .header-scroll-effect .elementor-button *,
    .header-scroll-effect .elementskit-menu-hamburger span,
    .header-scroll-effect .elementor-widget-icon-list * {
        transition-duration: var(--cb-interaction-duration-reduced) !important;
    }
}

/* 23-elementskit-nav-correction */
/* ==================================================
   CORRECTIF GLOBAL MENU MOBILE (EXCLUSIF ANDROID)
   ================================================== */

@media (max-width: 1024px) {

    /* La ligne magique : On applique ce correctif UNIQUEMENT si l'appareil n'est PAS un appareil Apple (iPhone/iPad) */
    @supports not (-webkit-touch-callout: none) {

        /* --- 1. CORRECTIF "FANTÔME" AU CHARGEMENT --- */
        .elementskit-menu-offcanvas-elements {
            visibility: hidden !important; 
            opacity: 0 !important;
            transform: translateX(-100%) !important; 
            transition: transform 0.4s ease, opacity 0.4s ease, visibility 0.4s ease !important;
            z-index: 999999 !important;
            pointer-events: none; 
        }

        /* --- 2. ÉTAT OUVERT (ACTIVE) --- */
        .elementskit-menu-offcanvas-elements.active {
            visibility: visible !important;
            opacity: 1 !important;
            transform: translateX(0) !important; 
            pointer-events: auto !important; 
        }

        /* --- 3. CORRECTIF "SOUS-MENU BLOQUÉ" --- */
        .elementskit-menu-offcanvas-elements:not(.active) .elementskit-submenu-panel,
        .elementskit-menu-offcanvas-elements:not(.active) .elementskit-megamenu-panel {
            display: none !important;      
            opacity: 0 !important;         
            visibility: hidden !important; 
            pointer-events: none !important;
            width: 0 !important;            
            height: 0 !important;
        }

        /* --- 4. GESTION DU FOND GRIS (OVERLAY) --- */
        .elementskit-menu-overlay {
            z-index: 999000 !important; 
            background: rgba(0,0,0,0.5) !important;
            transform: none !important; 
            transition: opacity 0.3s ease !important;
            opacity: 0 !important;
            visibility: hidden !important;
            pointer-events: none !important;
        }

        /* Quand on active l'overlay */
        .elementskit-menu-overlay.active {
            opacity: 1 !important;
            visibility: visible !important;
            pointer-events: auto !important; 
        }
    }
}

/* 23-videos-elements-kit-plus */
/* ==================================================
   1. MODE CINÉMA (Toutes les vidéos SAUF la verticale)
   ================================================== */
@media (min-width: 768px) {
    .mfp-wrap:has(iframe) .mfp-content, 
    .mfp-wrap:has(video):not(:has(video[src*="Full-video-page-Mariage"])) .mfp-content {
        width: 90vw !important;
        max-width: 1600px !important;
        margin: 0 auto !important;
    }
    
    .mfp-wrap:has(iframe) .mfp-close,
    .mfp-wrap:has(video):not(:has(video[src*="Full-video-page-Mariage"])) .mfp-close {
        font-size: 40px !important;
        top: -40px !important;
        right: 0 !important;
        color: white !important;
    }
}

/* ==================================================
   2. MODE VERTICAL (UNIQUEMENT pour "Full-video-page-Mariage")
   ================================================== */
@media (min-width: 768px) {
    
    /* On force les proportions exactes 9:16 basées sur la hauteur de l'écran */
    .mfp-wrap:has(video[src*="Full-video-page-Mariage"]) .mfp-content {
        height: 85vh !important;
        /* 0.5625 correspond au ratio 9/16. La largeur se calcule toute seule ! */
        width: calc(85vh * 0.5625) !important; 
        max-width: none !important;
        margin: 0 auto !important;
    }

    /* On détruit le format 16:9 forcé par Elementor et on remplit la nouvelle boîte */
    .mfp-wrap:has(video[src*="Full-video-page-Mariage"]) .elementor-video-container {
        padding-bottom: 0 !important; 
        height: 100% !important; 
        width: 100% !important;
    }

    /* La vidéo prend toute la place disponible sans bandes noires */
    .mfp-wrap:has(video[src*="Full-video-page-Mariage"]) video {
        height: 100% !important;
        width: 100% !important;
        object-fit: cover !important; 
        border-radius: 12px !important;
        box-shadow: 0 15px 50px rgba(0,0,0,0.8) !important;
    }
    
    /* Bouton fermer décalé sur le côté droit de la vidéo */
    .mfp-wrap:has(video[src*="Full-video-page-Mariage"]) .mfp-close {
        color: white !important;
        font-size: 40px !important;
        right: -50px !important;
        top: 0 !important;
    }
}

/* 41-fix-centrage-icone */
/* Forcer le centrage de l'icône vidéo ElementsKit */
.ekit-video-popup-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

/* Nettoyer les espacements parasites de l'icône */
.ekit-video-popup-btn i {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    display: flex !important;
}

/* 19-immersive-mode-hero */
/* 1. Transition standard pour les éléments isolés (texte de la vidéo, Trustindex) */
.element-immersif, .ti-widget-container, .ti-widget {
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out !important;
}

/* 2. On cache les éléments quand le corps de la page est en mode immersif */
body.mode-immersif .element-immersif,
body.mode-immersif .ti-widget-container,
body.mode-immersif .ti-widget {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important; 
}

/* 3. LA CORRECTION DU HEADER : 
   On applique l'opacité ET la transition UNIQUEMENT quand il n'est pas sticky. 
   Dès le scroll, Elementor reprend le contrôle total de l'animation. */
body.mode-immersif header:not(.elementor-sticky--effects),
body.mode-immersif .elementor-location-header:not(.elementor-sticky--effects),
body.mode-immersif .site-header:not(.elementor-sticky--effects) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out !important;
}

/* 20-smart-header-cache-boutons-scroll */
/* --- 1. ÉTAT NORMAL (Visible) --- */
.cache-boutons-scroll {
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.4s ease, margin 0.4s ease !important;
    max-height: 120px; /* La hauteur max de ta rangée de boutons. Si le glitch persiste, baisse ce chiffre (ex: 80px) */
    opacity: 1;
    overflow: hidden !important;
    min-height: 0px !important; /* On casse la hauteur minimum d'Elementor */
}

/* ANTI-SAUTILLEMENT : On interdit aux éléments de passer à la ligne pendant l'écrasement */
.cache-boutons-scroll * {
    white-space: nowrap !important;
}

/* --- 2. ÉTAT CACHÉ (Quand on scrolle vers le bas) --- */
body.scroll-vers-le-bas .cache-boutons-scroll {
    max-height: 0 !important; /* La boîte s'écrase totalement, le menu remonte ! */
    opacity: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    pointer-events: none !important;
}
