/* Reset & base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    overflow-x: hidden !important;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    background: linear-gradient(90deg, #0066B1, #1B365D, #E60012);
    color: #fff;
    overflow-x: hidden;
}

/* Palette BMW M */
:root {
    --m-blue-light: #00AEEF;
    --m-blue-dark: #00205B;
    --m-red: #C1272D;
    --m-gray: #1A1A1A;
    --m-white: #FFFFFF;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 999;
    padding: 15px 0;
}
.navbar ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    list-style: none;
    padding: 0 20px;
}
.navbar a {
    color: var(--m-white);
    text-decoration: none;
    font-size: 1rem;
    position: relative;
    transition: opacity 0.3s ease;
}
.navbar a::after {
    content: "";
    display: block;
    height: 3px;
    width: 0;
    background: linear-gradient(to right, var(--m-blue-light), var(--m-red));
    transition: width 0.3s ease;
    margin: auto;
}
.navbar a:hover::after {
    width: 100%;
}

/* Sections */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 40px 80px;
    text-align: center;
    flex-direction: column;
}
.fullscreen {
    background: url('https://cdn.bmwblog.com/wp-content/uploads/2022/07/bmw-m3-g80-m-performance-parts-01.jpg') no-repeat center center/cover;
}
.section h1, .section h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.2;
}
.section p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 30px;
    line-height: 1.6;
}
.section img {
    width: 100%;
    max-width: 1020px;
    border-radius: 12px;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* Light / Dark backgrounds */
.light {
    background: var(--m-white);
    color: var(--m-gray);
}
.dark {
    background: var(--m-gray);
    color: var(--m-white);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 10px;
    font-size: 0.9rem;
    background: #111;
    color: #999;
}

/* BMW M Button */
.btn-m {
    background: linear-gradient(to right, var(--m-blue-light), var(--m-red));
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease;
}
.btn-m:hover {
    opacity: 0.85;
}

/* Responsive */
@media (max-width: 1024px) {
    .section h1, .section h2 {
        font-size: 2.5rem;
    }
    .section p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .navbar ul {
        gap: 15px;
        flex-direction: row;
        flex-wrap: wrap;
        font-size: 0.9rem;

    }

    .section {
        padding: 100px 20px 60px;
    }

    .section img{
        max-width: 768px;
    }

    .section h1, .section h2 {
        font-size: 2rem;
    }

    .section p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .section h1, .section h2 {
        font-size: 1.7rem;
    }

    .section p {
        font-size: 0.95rem;
    }

    .navbar ul {
        flex-direction: column;
        align-items: center;
    }
}


/* Bouton hamburger caché par défaut */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--m-white);
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 1001;
}

/* Affiche le bouton hamburger en mobile */
@media (max-width: 480px) {
    .navbar-toggle {
        display: block;
    }

    /* Cache la liste par défaut et stylise le menu mobile */
    .navbar ul {
        display: none;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.9);
        position: fixed;
        top: 60px; /* juste sous la navbar */
        right: 0;
        width: 220px;
        padding: 20px;
        gap: 15px;
        height: calc(100vh - 60px);
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
        transition: transform 0.3s ease;
        transform: translateX(100%);
        z-index: 1000;
    }

    /* Quand la navbar est ouverte, affiche le menu */
    .navbar.open ul {
        display: flex;
        transform: translateX(0);
    }
}
