body {
    margin: 0;
    font-family: sans-serif;
}

h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
    color: black;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #f5f5f5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    margin-left: auto;
    background-color: yellow;
}

nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.dropdown-btn {
    padding: 5px 40px;
    font-weight: 600;
    border:1px solid black;
}

nav a {
    cursor: pointer;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    padding: 5px 8px;
    border-radius: 4px;
    user-select: none;
}

nav a:hover, .dropdown-btn:hover {
    background-color: #ddd;
}

/* Dropdown styles */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 35px;
    background-color: white;
    min-width: 156px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border-radius: 4px;
    z-index: 100;
}

.dropdown-content a {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.dropdown-content a:hover {
    background-color: yellow;
}

/* Show dropdown when open */
.dropdown.show .dropdown-content {
    display: block;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
    header {
        flex-wrap: wrap;
        padding: 8px 12px;
    }

    .menu-toggle {
        display: block;
        vertical-align:top;
        height: auto;

    }

    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: #f5f5f5;
        gap: 0;
        align-items: flex-start;
        padding: 0;
        display: none;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        z-index: 20;
    }
    nav.mobile-open {
        display: flex;
    }

    .dropdown {
        width: 100%;
    }

    .dropdown-btn {
        width: 100%;
        padding: 12px 18px;
        border-radius: 0;
        font-size: 1rem;
        box-sizing: border-box;
        border:0px;
        border-top:1px solid black;

    }


    nav a {
        width: 100%;
        padding: 12px 18px;
        border-radius: 0;
        font-size: 1rem;
        box-sizing: border-box;
        border:0px;

    }

    .dropdown-content {
        position: static;
        background: #ededed;
        box-shadow: none;
        min-width: 100%;  /* Prend toute la largeur de nav */
        border-radius: 0;
        width: 100%;  /* Important pour uniformiser la largeur */
        left: 0 !important; /* colle bien à gauche */
        right: auto !important;
    }

    .dropdown-content a {
        display: block;
        padding: 12px 18px; /* Cohérent avec les autres liens */
        font-size: 1rem;
        width: 100%;
        box-sizing: border-box;
        display: block;
    }

    /* optionnel: referme le dropdown si menu mobile ferme */
    nav:not(.mobile-open) .dropdown-content {
        display: none !important;
    }
}
