* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Arial, sans-serif; font-size: 15px; color: #fff; }

.site-header 
{ 
    background: #ffffff; 
    width: 100%; 
    border-bottom: 1px solid #e2e8f0; 
}

.logo-wrapper 
{
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 0;
    min-height: 60px;
    background: url('../img/fond/fond2.png') center bottom / cover no-repeat;
    
    /* Bandeau haut au-dessus du menu */
    z-index: 100 !important;
}

.main-logo { height: 45px;  }

.service-content 
{
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    
    /* Contenu de droite au premier plan */
    z-index: 101 !important;
}

.btn-connexion 
{
    color: #2d3788;
    text-decoration: none;
    border: 1px solid #f8fafc;
    padding: 6px 18px;
    border-radius: 6px;
    font-size: 14px;
    background: rgba(255,255,255,0.3);
    transition: 0.3s;
}

.btn-connexion:hover { background: rgba(75, 100, 220, 0.2); }

.lang-selector { display: flex; gap: 8px; }
.lang-selector img { opacity: 0.5; transition: 0.3s; cursor: pointer; height: 20px; }
.lang-selector img.active, 
.lang-selector img:hover { opacity: 1; }


.main-nav { 
    background: #f8fafc;
    border-top: 1px solid #e2e8f0; 
    display: flex; 
    justify-content: center; 
    position: relative; 
}

.menu-list { display: flex; list-style: none; }
.menu-list > li { position: relative; display: flex; align-items: center; }
.menu-list > li > a {
    display: block;
    padding: 15px 25px;
    color: #2d3748; 
    text-decoration: none;
    transition: 0.2s;
    font-weight: 500; 
}
.menu-list > li > a:hover, 
.has-dropdown:hover > a,
.menu-list > li > a.active { 
    background: #edf2f7; 
    color: #2b6cb0; 
}

/* Chevron indiquant un menu déroulant (pivote à l'ouverture) */
.has-dropdown > a::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-3px) rotate(45deg);
    transition: transform 0.2s;
}
.has-dropdown:hover > a::after { transform: translateY(0) rotate(-135deg); }

/* Contrôles mobile (cachés sur PC) */
.menu-checkbox, .menu-burger, .submenu-toggle, .submenu-label { display: none; }


.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    list-style: none;
    padding: 8px 0;
    background: #ffffff;
    backdrop-filter: blur(10px);
    min-width: 280px;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); 
    border: 1px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
}


.has-dropdown:hover .dropdown-menu { display: block; }

/* Clavier (PC) : sous-menu ouvert quand un de ses liens a le focus */
.has-dropdown:focus-within .dropdown-menu { display: block; }
.has-dropdown:focus-within > a { background: #edf2f7; color: #2b6cb0; }
.has-dropdown:focus-within > a::after { transform: translateY(0) rotate(-135deg); }

.dropdown-menu li a {
    display: block;
    padding: 12px 25px;
    color: #4a5568; 
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    transition: 0.2s;
}
.dropdown-menu li:last-child a { border-bottom: none; }
.dropdown-menu li a:hover { 
    background: #f0f7ff; 
    color: #3182ce; 
    padding-left: 30px; 
}


.search-item { display: flex; align-items: center; padding-left: 15px; }
.search-item input {
    background: rgba(227, 235, 248);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #8e9299;;
    padding: 8px 15px;
    border-radius: 20px;
    outline: none;
    transition: 0.3s;
    width: 150px;
}
.search-item input:focus { width: 220px; border-color: #99c2f5; background: rgba(227,235,248,0.5); }

/* ==========================================================================
    RESPONSIVE MOBILE (< 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    /* Bandeau logo */
    .logo-wrapper { 
        min-height: 70px; 
        padding: 10px 15px 10px 55px; /* place du burger à gauche */
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: none; 
        background-color: #ffffff; 
        position: relative;
        z-index: 100 !important;
    }

    .logo-area { 
        margin-left: 0; 
    }

    /* Bouton burger, centré verticalement */
    .menu-burger { 
        display: flex !important; 
        flex-direction: column; 
        justify-content: center;
        gap: 5px; 
        cursor: pointer; 
        padding: 10px; 
        position: absolute; 
        left: 10px; 
        top: 50%; 
        transform: translateY(-50%); 
        z-index: 102 !important; 
    }

    .menu-burger span { 
        width: 25px; 
        height: 3px; 
        background: #2d3748; 
        border-radius: 2px; 
        display: block;
    }

    /* Connexion / Langues sur mobile */
    .service-content {
        position: static;
        transform: none;
        gap: 10px;
        z-index: 101 !important;
    }

    .btn-connexion {
        padding: 6px 12px;
        font-size: 13px;
        text-align: center;
        white-space: nowrap;
        background: #f1f5f9;
    }

    .lang-selector { gap: 5px; }
    .lang-selector img { height: 18px; }

    /* Barre de navigation masquée par défaut */
.main-nav { 
        position: relative;
        width: 100%;
        background: transparent;
        border: none;
    }

    /* Menu déroulant principal (ouvert par le burger) */
.menu-list { 
        display: none; 
        flex-direction: column; 
        position: absolute; 
        top: 0; 
        left: 0; 
        width: 100%; 
        background: #ffffff; 
        z-index: 99999 !important; 
        padding: 0; 
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    }
    /* Cases à cocher du burger et des sous-menus : invisibles mais utilisables au clavier */
    .menu-checkbox, .submenu-toggle {
        display: block !important;
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        opacity: 0;
    }
    .menu-checkbox:focus-visible ~ .logo-wrapper .menu-burger,
    .submenu-toggle:focus-visible ~ .submenu-label {
        outline: 3px solid #2b6cb0;
        outline-offset: -3px;
    }

    /* Ouverture du menu par la case à cocher */
.menu-checkbox:checked ~ .main-nav .menu-list { 
        display: flex !important; 
    }
    
    .menu-list > li { 
        width: 100%; 
        display: block; 
        border-bottom: 1px solid #f1f5f9; 
        background: #ffffff; 
    }

    .menu-list > li > a { 
        padding: 15px 25px; 
        width: 100%; 
        font-size: 16px; 
    }

    /* Sous-menus */
    .has-dropdown { position: relative; }
    .has-dropdown:hover .dropdown-menu { display: none; } 

    .submenu-label {
        display: block;
        position: absolute;
        top: 0; 
        left: 0; 
        width: 100%; 
        height: 50px; 
        z-index: 10;
        cursor: pointer;
    }

    .dropdown-menu { 
        display: none !important; 
        position: static; 
        width: 100%; 
        background: #f8fafc; 
        box-shadow: none; 
        border: none; 
        border-radius: 0;
    }

    .submenu-toggle:checked ~ .dropdown-menu { display: block !important; }
    .submenu-toggle:checked ~ a { background: #edf2f7; color: #2b6cb0; }

    /* Chevron à droite, pivote à l'ouverture */
    .has-dropdown > a { position: relative; }
    .has-dropdown > a::after { position: absolute; right: 25px; top: 50%; margin-top: -5px; }
    .has-dropdown:hover > a::after { transform: translateY(-3px) rotate(45deg); }
    .submenu-toggle:checked ~ a::after { transform: translateY(0) rotate(-135deg); }

    .dropdown-menu li a { font-size: 15px; padding: 12px 40px; }

    /* Recherche */
    .search-item { padding: 15px 20px; width: 100%; background: #f8fafc; }
    .search-item input { 
        width: 100% !important; 
        height: 42px; 
        border-radius: 8px; 
        background: #ffffff;
        border: 1px solid #cbd5e0;
        color: #333; 
    }
}


/* ==========================================================================
   SUGGESTIONS DE RECHERCHE (JQUERY UI AUTOCOMPLETE)
   ========================================================================== */

/* Liste */
.ui-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999 !important;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px 0;
    margin: 5px 0 0 0;
    
    background-color: #ffffff;
    border: 1px solid rgba(26, 42, 90, 0.15);
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    
    list-style: none;
    
    /* Police du site */
    font-family: 'Montserrat', 'Segoe UI', Helvetica, Arial, sans-serif; 
    font-size: 12px;
}

/* Ligne de suggestion */
.ui-autocomplete .ui-menu-item {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Lien de la ligne */
.ui-autocomplete .ui-menu-item-wrapper {
    display: block;
    padding: 10px 15px;
    color: #333333;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-weight: 500;
}

/* Survol / sélection au clavier */
.ui-autocomplete .ui-menu-item-wrapper.ui-state-active,
.ui-autocomplete .ui-menu-item-wrapper:hover {
    background-color: var(--blue-amix, #1a2a5a) !important;
    color: #ffffff !important;
    border: none !important;
    margin: 0 !important;
}

/* Barre de défilement */
.ui-autocomplete::-webkit-scrollbar {
    width: 6px;
}
.ui-autocomplete::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}
.ui-autocomplete::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 6px;
}
.ui-autocomplete::-webkit-scrollbar-thumb:hover {
    background: #999;
}
/* ==========================================================================
   MENU DÉROULANT ESPACE CLIENT
   ========================================================================== */

/* Conteneur du bouton (repère du menu) */
.user-menu-container {
    position: relative;
    display: inline-block;
}

/* Boîte du menu */
.user-dropdown-box {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: #ffffff;
    min-width: 150px;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    z-index: 10000 !important;
    overflow: hidden;
}

/* Affichage au survol */
.user-menu-container:hover .user-dropdown-box,
.user-menu-container:focus-within .user-dropdown-box {
    display: block;
}

/* Liens */
.user-dropdown-box a {
    display: block;
    padding: 10px 15px;
    color: #2d3748;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.user-dropdown-box a:hover {
    background: #f7fafc;
    color: #2b6cb0;
}

/* Lien Déconnexion */
.user-dropdown-box a.logout-link {
    color: #e53e3e;
    border-top: 1px solid #edf2f7;
}

.user-dropdown-box a.logout-link:hover {
    background: #fff5f5;
    color: #c53030;
}

/* ==========================================================================
    ACCESSIBILITÉ
   ========================================================================== */

/* Contour visible au clavier (Tab), pas au clic */
:focus-visible {
    outline: 3px solid #2b6cb0 !important;
    outline-offset: 2px;
}

/* Texte pour lecteurs d'écran, masqué à l'écran */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Lien « Aller au contenu » : visible seulement avec le focus */
.lien-evitement {
    position: absolute;
    left: 10px;
    top: -60px;
    z-index: 10000;
    padding: 10px 16px;
    background: #1a2a5a;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
}
.lien-evitement:focus {
    top: 10px;
}
/* Cible du lien « Aller au contenu » (sans contour) */
#contenu:focus {
    outline: none;
}
