/* ===================================================
   HEADER — Structure
   =================================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    padding: 0 2rem;

    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(var(--background-blur));
    -webkit-backdrop-filter: blur(var(--background-blur));
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

    display: flex;
    align-items: center;
    justify-content: center;

    transition: transform 0.3s ease-in-out;
}

header.header--hidden {
    transform: translateY(-100%);
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
}

/* ===================================================
   HEADER — Logo
   =================================================== */
.header-logo img {
    height: 50px;
    display: block;
    transition: transform 0.3s ease;
}

.header-logo:hover img {
    transform: scale(1.1);
}

/* ===================================================
   HEADER — Menu Desktop
   =================================================== */
.header-menu > ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    gap: 1rem;
}

.header-menu a {
    text-decoration: none;
    color: var(--color-text);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    position: relative;
    transition:
        color 0.3s ease,
        background-color 0.3s ease;
    font-weight: 500;
}

.header-menu a:hover {
    color: var(--main-color);
    background-color: rgba(20, 94, 60, 0.1);
}

a.disabled-link {
    color: #999;
    cursor: not-allowed;
}

/* ===================================================
   HEADER — Sous-menus Desktop
   =================================================== */
.has-submenu {
    position: relative;
}

.submenu {
    display: none;
    position: absolute;
    top: 110%;
    left: 0;
    min-width: 200px;
    padding: 0.5rem;
    list-style: none;

    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(var(--background-blur));
    -webkit-backdrop-filter: blur(var(--background-blur));
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.submenu a {
    display: block;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.has-submenu:hover .submenu {
    display: block;
}

/* ===================================================
   HEADER — Bouton Hamburger
   =================================================== */
.header-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger-bar {
    width: 30px;
    height: 3px;
    background-color: var(--color-text);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* ===================================================
   HEADER — Menu Mobile
   =================================================== */
@media (max-width: 992px) {
    .header-menu {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);

        flex-direction: column;
        justify-content: center;
        align-items: center;

        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }

    .header-menu.open {
        display: flex;
        transform: translateX(0);
    }

    .header-menu ul {
        flex-direction: column;
        text-align: left;
        list-style: none;
        width: 90%;
        padding: 0;
        margin: 0;
        gap: 0;
    }

    .header-menu > ul > li {
        border-bottom: 1px solid rgba(20, 94, 60, 0.2);
        width: 100%;
    }

    .header-menu > ul > li:last-child {
        border-bottom: none;
    }

    .header-menu a {
        font-size: 1.2rem;
        font-weight: 500;
        color: var(--color-text);
        padding: 1rem 0.5rem;
        display: block;
    }

    .submenu {
        position: static;
        display: none;
        background: none;
        backdrop-filter: none;
        box-shadow: none;
        border: none;
        padding-left: 1.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .submenu a {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        font-size: 1.1rem;
        color: #444;
    }

    .submenu.open {
        display: block;
        padding-bottom: 1rem;
    }

    .header-menu .has-submenu > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .has-submenu > a::after {
        content: "▼";
        font-size: 1rem;
        padding: 0.5rem;
        transition: transform 0.3s ease-in-out;
    }

    .has-submenu.open > a::after {
        transform: rotate(180deg);
    }

    .header-menu-toggle {
        display: flex;
    }

    .header-menu-toggle.open .hamburger-bar:nth-child(1) {
        transform: rotate(45deg);
    }

    .header-menu-toggle.open .hamburger-bar:nth-child(2) {
        opacity: 0;
        transform: translateX(-20px);
    }

    .header-menu-toggle.open .hamburger-bar:nth-child(3) {
        transform: rotate(-45deg);
    }
}

/* ===================================================
   PICTO DON
   =================================================== */
#picto-don {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    right: 0;
    top: 200%;
    background-color: var(--color-secondary);
    border-radius: 8px;
    padding: 0.5rem;
    z-index: 1000;
    transition: all 0.2s;
    text-decoration: none;
}

#picto-don img {
    height: 75px;
    width: 75px;
    cursor: pointer;
}

#picto-don:hover {
    transform: scale(1.1);
    background-color: var(--color-accent);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.picto-don-label {
    color: var(--color-white);
    font-size: 0.7rem;
    font-weight: bold;
    text-align: center;
    margin-top: 0.2rem;
    line-height: 1.2;
    text-decoration: none;
}

/* ===================================================
   FOOTER
   =================================================== */
footer {
    background: var(--color-white);
    color: var(--color-dark);
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
    text-align: center;
    padding: 2rem 1rem;
    scroll-snap-align: end;
}

footer img {
    height: 50px;
    margin: 0 5px;
}

footer a {
    color: var(--color-accent);
    transition: color 0.2s;
}

footer a:hover {
    color: var(--color-dark);
}

footer > div {
    flex: 1 1 250px;
}

footer > div p {
    margin: 0.5rem 0;
}

/* ===================================================
   RESPONSIVE FOOTER & HEADER
   =================================================== */
@media (max-width: 768px) {
    footer {
        flex-direction: column;
    }

    #picto-don img {
        height: 50px;
        width: 50px;
    }
}
