/* === Header avec image de fond === */
.header.container-header {
    background-image: url('https://www.mob.medprym.ovh/images/sampledata/etang1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    position: relative;
    min-height: 120px; /* réduit à 120px */
    overflow: visible;
    z-index: 100;
}

/* === Logo === */
.navbar-brand {
    position: relative;
    margin: 10px auto;
    display: block;
    text-align: center;
    width: fit-content;
    max-height: 100px;
    z-index: 101;
}

/* === Container du menu === */
.container-nav {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 5px 0;
    position: relative;
    z-index: 102;
}

.navbar {
    background-color: transparent !important;
    padding: 0;
    width: 100%;
}

/* === Menu principal (Desktop) === */
.mod-menu_dropdown-metismenu {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 0;
    margin: 0 auto;
    background-color: transparent;
    width: auto;
    position: relative;
    z-index: 103;
}

.mod-menu_dropdown-metismenu > li {
    list-style: none;
    flex: 0 0 auto;
    position: relative;
    margin: 2px 4px; /* espace réduit */
}

/* === Boutons du menu === */
.mod-menu_dropdown-metismenu > li > a {
    display: inline-block;
    padding: 6px 15px;
    margin: 0;
    background-color: #001f3f;
    color: #ffd700 !important;
    border: 2px solid #ffd702;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    position: relative;
    line-height: 1.2;
    white-space: nowrap;
}

/* === Flèche rouge pour les sous-menus === */
.mod-menu_dropdown-metismenu > li.deeper > a::after,
.mod-menu_dropdown-metismenu > li.parent > a::after {
    content: " ▼";
    color: #ff0000 !important;  /* 🔥 forçage */
    font-size: 0.8rem;
    margin-left: 5px;
    position: relative;
    top: 0.1em;
}

/* === Sous-menus (Desktop) === */
.mod-menu_dropdown-metismenu li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #001f3f;
    border: 2px solid #ffd702;
    border-radius: 5px;
    padding: 5px 0;
    min-width: 200px;
    z-index: 200;
}

.mod-menu_dropdown-metismenu li:hover > ul {
    display: block;
}

.mod-menu_dropdown-metismenu li ul li {
    display: block;
    margin: 0;
}

.mod-menu_dropdown-metismenu li ul li a {
    display: block;
    padding: 6px 12px;
    background: #001f3f;
    color: #ffd700 !important;
    border-bottom: 1px solid #ffd702;
    font-size: 1rem;
    font-weight: normal;
    white-space: normal;
}

.mod-menu_dropdown-metismenu li ul li a:hover {
    background: #ffffff !important;
    color: #ff0000 !important;
}
/* Overlay sombre sur l’image */
.header.container-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* 🔥 noir avec 40% d’opacité */
    z-index: 1;
}

/* Remet le contenu au-dessus de l’overlay */
.header.container-header * {
    position: relative;
    z-index: 2;
}
/* Mobile */
@media (max-width: 991px) {
    /* Logo */
    .navbar-brand {
        margin: 10px auto !important;
    }

    /* Hamburger */
    .navbar-toggler {
        display: block !important;
        position: fixed !important;
        top: 180px !important;
        left: 20px !important;
        z-index: 1200 !important;
        width: 40px !important;
        height: 40px !important;
        border: none !important;
        background: #140554 !important;
        color: #F2F1B6 !important;
        font-size: 1.8rem !important;
        padding: 5px !important;
        border-radius: 5px !important;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
    }

    /* Slider mobile avec image de fond */
    .navbar-collapse {
        display: none !important;
        position: fixed !important;
        top: 230px !important;
        left: 0 !important;
        width: 80% !important;
        max-width: 320px !important;
        background-image: url('https://www.mob.medprym.ovh/images/sampledata/Casiers.jpg') !important;
        background-size: cover !important;
        background-position: center !important;
        z-index: 1150 !important;
        overflow-y: auto !important;
        box-shadow: 5px 0 10px rgba(0, 0, 0, 0.2) !important;
        max-height: calc(100vh - 230px) !important;
        position: relative;
    }

    .navbar-collapse::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(255, 255, 255, 0.5);
        z-index: -1;
    }

    /* Affiche le menu quand il est ouvert */
    .navbar-collapse.show {
        display: block !important;
    }

    /* Liste du menu */
    .navbar-collapse .mod-list {
        margin: 0 !important;
        padding: 10px !important;
        list-style: none !important;
        position: relative;
        z-index: 1;
    }

    /* Éléments de la liste */
    .navbar-collapse .mod-list li {
        margin: 0 0 2px 0 !important;
        padding: 0 !important;
        display: flex;
        align-items: center;
        justify-content: space-between; /* Aligne le bouton et la flèche aux extrémités */
    }

    /* Style pour les éléments de niveau supérieur (Mobile) */
    .navbar-collapse .mod-list > li > a {
        width: auto; /* Largeur automatique pour ne pas prendre toute la place */
        max-width: 80%; /* Limite la largeur maximale du bouton */
        padding: 8px 15px !important;
        margin: 0 !important;
        font-size: 1rem !important;
        color: #ffd700 !important;
        background-color: rgba(0, 31, 63, 0.8) !important;
        border: 2px solid #ffd700 !important;
        border-radius: 5px !important;
        text-decoration: none !important;
        font-weight: bold !important;
        word-break: break-word !important;
    }

    /* Flèche rouge agrandie pour les éléments avec sous-menu (Mobile) */
    .navbar-collapse .mod-list > li.deeper::after {
        content: "▼";
        margin-left: 10px;
        font-size: 1.2rem;
        color: #ff0000 !important;
        font-weight: bold;
        cursor: pointer;
        flex-shrink: 0; /* Empêche la flèche de rétrécir */
    }

    /* Style pour les sous-rubriques - Mobile */
    .navbar-collapse .mod-list > li ul {
        margin: 0 !important;
        padding-left: 20px !important;
        list-style: none !important;
    }

    .navbar-collapse .mod-list > li ul li a {
        display: block !important;
        padding: 6px 15px !important;
        margin: 0 0 2px 0 !important;
        font-size: 0.9rem !important;
        color: #ffd700 !important;
        background-color: rgba(0, 31, 63, 0.8) !important;
        border: 1px solid #ffd700 !important;
        border-radius: 3px !important;
    }

    /* Boutons actifs et survol - Mobile */
    .navbar-collapse .mod-list li.current > a,
    .navbar-collapse .mod-list li.active > a {
        color: #ffd700 !important;
        background-color: rgba(34, 139, 34, 0.8) !important;
        border-color: #ffd700 !important;
    }

    .navbar-collapse .mod-list li > a:hover {
        background-color: rgba(255, 255, 255, 0.8) !important;
        color: #ff0000 !important;
        border-color: #ff0000 !important;
    }
}
