/*
Theme Name: Crafto Child
Theme URI: https://crafto.themezaa.com/
Author: ThemeZaa
Author URI: https://www.themezaa.com/
Description: Child theme for Crafto theme
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
Version: 1.0
License: Themeforest Split Licence
License URI: https://themeforest.net/licenses/
Text Domain: crafto-child
Tags: one-column, two-columns, three-columns, left-sidebar, right-sidebar, grid-layout, custom-background, custom-menu, editor-style, featured-images, post-formats, sticky-post, theme-options, threaded-columns, translation-ready, blog, e-commerce
Template: crafto
*/

/* ── CIPAC News – dropdowns sans scroll, tout visible ───────────────── */

/* Forcer les parents du filtre à ne pas couper le contenu */
#cipac-filter-panel,
#cipac-filter-panel .cipac-filter-row,
#cipac-filter-panel .cipac-dropdowns {
    overflow: visible !important;
}

/* Conteneurs Elementor autour du widget filtre */
.elementor-widget-html .elementor-widget-container {
    overflow: visible !important;
}

/* La liste dropdown s’étend librement en hauteur */
.cipac-dd .cipac-dd-list {
    max-height:  none     !important;
    overflow:    visible  !important;
    overflow-y:  visible  !important;
    height:      auto     !important;
}

/* Chaque dropdown en position relative pour que la liste se positionne par rapport à lui */
.cipac-dd {
    position: relative;
}

/* La liste se positionne en absolu sous le trigger, pleine largeur, pas de dépassement masqué */
.cipac-dd .cipac-dd-list {
    position:   absolute !important;
    top:        100%     !important;
    left:       0        !important;
    width:      100%     !important;
    z-index:    9999     !important;
    background: #fff;
}

/* Panneau filtre en z-index haut + overflow visible */
#cipac-filter-panel {
    position:   relative !important;
    z-index:    500      !important;
    overflow:   visible  !important;
}

.cipac-dd.open {
    z-index: 600 !important;
}

/* ============================================
   HEADER NAVBAR - RESPONSIVE CIPAC
   ============================================ */

/* 1. Desktop intermediate : réduire les éléments pour tenir sur 1 ligne */
@media (max-width: 1400px) {
    #menu-header > li > a {
        font-size: 12px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        white-space: nowrap !important;
    }
}

/* 2. Desktop small : masquer les boutons CTA, garder le menu */
@media (max-width: 1200px) {
    #masthead .elementor-widget-crafto_button {
        display: none !important;
    }
}

/* 3. Mobile / tablette : layout row strict */
@media (max-width: 1024px) {

    /* Afficher les boutons CTA */
    #masthead .elementor-widget-crafto_button {
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
    }

    /* Conteneur principal : tout sur 1 ligne */
    #masthead .e-con-inner {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Logo : ne grandit pas, reste à gauche */
    #masthead .elementor-widget-image {
        flex: 0 0 auto !important;
        margin-right: auto !important;
    }
    #masthead .elementor-widget-image img {
        max-height: 40px !important;
        width: auto !important;
    }

    /* Bouton "Nous contacter" */
    #masthead .elementor-widget-crafto_button:nth-child(3) {
        margin-left: 0 !important;
        margin-right: 6px !important;
    }

    /* Bouton "CIPAC NEWS" */
    #masthead .elementor-widget-crafto_button:nth-child(4) {
        margin-left: 0 !important;
        margin-right: 8px !important;
    }

    /* Réduire la taille des boutons */
    #masthead .elementor-widget-crafto_button .crafto-btn,
    #masthead .elementor-widget-crafto_button a {
        padding: 6px 12px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
    }

    /* Le widget container des boutons : width auto */
    #masthead .elementor-widget-crafto_button .elementor-widget-container {
        width: auto !important;
    }

    /* Simple Menu : flex: 0 0 auto */
    #masthead .elementor-widget-nav-menu {
        flex: 0 0 auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* 4. Mobile portrait : ultra compact */
@media (max-width: 600px) {
    #masthead .elementor-widget-crafto_button .crafto-btn,
    #masthead .elementor-widget-crafto_button a {
        padding: 5px 8px !important;
        font-size: 10px !important;
    }
    #masthead .e-con-inner {
        padding-left: 10px !important;
        padding-right: 10px !important;
        gap: 5px !important;
    }
    #masthead .elementor-widget-image img {
        max-height: 35px !important;
    }
}

/* === GLOBAL : empêcher le wrap dans le header (tous écrans) === */
#masthead .e-con-inner {
    flex-wrap: nowrap !important;
    align-items: center !important;
}

/* === Boutons groupés à droite : margin-left auto sur le nav-menu === */
#masthead .elementor-widget-nav-menu {
    margin-right: auto !important;
}

/* === Desktop ≤ 1500px : compacter les boutons CTA === */
@media (max-width: 1500px) {
    #masthead .elementor-widget-crafto_button .crafto-btn,
    #masthead .elementor-widget-crafto_button a {
        padding: 8px 14px !important;
        font-size: 13px !important;
    }
}

/* === FIX CRITIQUE : menu de navigation sur 1 ligne === */
#menu-header {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    align-items: center !important;
    white-space: nowrap !important;
}

#menu-header > li {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Conteneur principal du header : jamais de wrap */
#masthead .e-con,
#masthead .e-con-inner,
#masthead .elementor-container,
#masthead .elementor-row,
#masthead .elementor-section-wrap {
    flex-wrap: nowrap !important;
}
