/* ===== HEADER & NAVIGATION ===== */
:root {
    --primary-color: #00923f;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --transition: all 0.3s ease;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
}

body {
    padding-top: 80px;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 15px 0;
}

.nav-container {
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

#logo-wrapper img {
    height: 50px;
    width: auto;
    transition: transform 0.3s;
}

#logo-wrapper img:hover {
    transform: scale(1.05);
}

/* Menu principal - Desktop */
.main-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 25px;
}

.main-menu > li {
    position: relative;
}

.main-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 500;
    padding: 10px 0;
    display: flex;
    align-items: center;
    transition: var(--transition);
    position: relative;
}

/* Effet de soulignement animé */
.main-menu a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.main-menu a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.main-menu a:hover {
    color: var(--primary-color);
}

/* Dropdown - Desktop */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    list-style: none;
    padding: 10px 0;
    margin: 10px 0 0 0;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1001;
    border: 1px solid var(--light-gray);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    margin-top: 0;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    padding: 10px 20px;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background: var(--light-gray);
}

/* Bouton Hamburger */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1002;
    order: -1; /* Place à gauche */
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    margin: 5px 0;
    transition: var(--transition);
}

/* ===== VERSION MOBILE ===== */
@media (max-width: 992px) {
    body {
        padding-top: 70px;
    }

    .nav-container {
        padding: 0 15px;
    }

    .hamburger-btn {
        display: block;
        margin-right: auto; /* Pousse le logo à droite */
    }

    #logo-wrapper {
        margin-left: auto; /* Logo à droite */
    }

    .main-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 85%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
        transition: left 0.3s;
        z-index: 1000;
        gap: 0;
        overflow-y: auto;
    }

    .main-menu.active {
        left: 0;
    }

    .main-menu > li {
        padding: 12px 0;
        border-bottom: 1px solid var(--light-gray);
    }

    /* Dropdown - Mobile */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        opacity: 1;
        visibility: visible;
        transition: max-height 0.3s;
        background: #f9f9f9;
        border: none;
        border-radius: 0;
        margin: 0;
    }

    .dropdown.active .dropdown-menu {
        max-height: 500px;
        padding: 10px 0;
        margin-top: 10px;
    }

    .dropdown-toggle::after {
        content: "+";
        margin-left: auto;
        padding-left: 15px;
        color: var(--primary-color);
        font-weight: bold;
    }

    .dropdown.active .dropdown-toggle::after {
        content: "-";
    }

    /* Animation hamburger */
    .hamburger-btn.active .hamburger-line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger-btn.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .hamburger-btn.active .hamburger-line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* ===== VERSION TABLETTE ===== */
@media (min-width: 769px) and (max-width: 992px) {
    .main-menu {
        width: 70%;
    }

    .main-menu a {
        font-size: 1.1rem;
    }
}

/* ===== CORRECTION SAFARI iOS ===== */
@supports (-webkit-touch-callout: none) {
    header {
        padding-top: env(safe-area-inset-top);
    }
    body {
        padding-top: calc(70px + env(safe-area-inset-top));
    }
}

/* Permettre le scroll du menu sur mobile */
@media (max-width: 768px) {
    .main-menu {
        max-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        z-index: 1000;
        width: 100%;
        display: none;
        flex-direction: column;
    }
    .main-menu.active {
        display: flex;
    }
}
