/* =====================================================================
   NAVIGATION — source unique pour TOUTES les pages du site.
   Ne jamais redefinir .nav / .nav-links / .nav-cta dans une page :
   toute modification se fait ici, sinon les menus divergent a nouveau.
   Le HTML de la nav est identique sur chaque page ; seul le bouton
   .nav-cta change de libelle et d'ancre (Commander / Devis / Contact).
   ===================================================================== */

.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: clamp(0.6rem, 2vw, 2rem);
    padding: 1.4rem clamp(0.9rem, 4vw, 4rem);
    transition: background 0.4s ease, padding 0.3s ease;
}
/* Fond et voile portes par un pseudo-element, JAMAIS par .nav lui-meme :
   un backdrop-filter (ou un mix-blend-mode) sur le <nav> en ferait le bloc
   conteneur du menu mobile en position fixed, qui serait alors confine a la
   hauteur de la barre au lieu de couvrir l'ecran. Ne pas deplacer ces regles. */
.nav::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: -70px;
    background: linear-gradient(rgba(10,10,10,0.92), rgba(10,10,10,0.6) 45%, rgba(10,10,10,0));
    z-index: -1;
    pointer-events: none;
    transition: background 0.4s ease;
}
.nav.scrolled {
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.nav.scrolled::before {
    bottom: 0;
    background: rgba(10,10,10,0.94);
    backdrop-filter: blur(12px);
}

.nav-brand {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.7rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--text-light, #f0ece6);
    text-decoration: none;
    font-weight: 400;
    margin-right: auto;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(1.2rem, 2.2vw, 2.4rem);
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links a {
    position: relative;
    display: inline-block;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 300;
    color: var(--text-light, #f0ece6);
    text-decoration: none;
    opacity: 0.82;
    transition: opacity 0.3s, color 0.3s;
    white-space: nowrap;
}
.nav-links a:hover { opacity: 1; color: var(--gold-light, #cbb59d); }
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0;
    width: 0; height: 1px;
    background: var(--gold, #b8a088);
    transition: width 0.4s cubic-bezier(0.77,0,0.175,1);
}
.nav-links a:hover::after { width: 100%; }
/* Page courante */
.nav-links a.is-active { opacity: 1; color: var(--gold-light, #cbb59d); }
.nav-links a.is-active::after { width: 100%; }

/* Bouton d'action, contextuel a la page (Commander / Devis / Me contacter) */
.nav-cta {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold-light, #cbb59d);
    text-decoration: none;
    border: 1px solid rgba(184,160,136,0.55);
    padding: 0.6rem 1.2rem;
    white-space: nowrap;
    flex: 0 0 auto;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.nav-cta:hover {
    background: var(--gold, #b8a088);
    border-color: var(--gold, #b8a088);
    color: var(--dark, #0a0a0a);
}

/* Burger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    position: relative;
    flex: 0 0 auto;
    z-index: 1003;
}
.nav-toggle span {
    display: block;
    width: 26px; height: 1px;
    background: var(--text-light, #f0ece6);
    transition: transform 0.4s cubic-bezier(0.77,0,0.175,1), opacity 0.3s;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ---- Bascule burger : 6 entrees + CTA ne tiennent plus sous 900px ---- */
@media (max-width: 900px) {
    .nav-toggle { display: flex; }
    .nav-links {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100dvh;
        background: var(--dark, #0a0a0a);
        z-index: 1002;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2.4rem;
        clip-path: inset(0 0 100% 0);
        transition: clip-path 0.6s cubic-bezier(0.77,0,0.175,1);
    }
    .nav-links.open { clip-path: inset(0 0 0 0); }
    .nav-links a { font-size: 1rem; letter-spacing: 0.22em; opacity: 1; }
    body.menu-ouvert { overflow: hidden; }
}

/* ---- Barre mobile : logo + bouton d'action + burger doivent tenir
   sur 360px sans deborder ---- */
@media (max-width: 600px) {
    .nav { padding: 1.1rem 0.9rem; gap: 0.55rem; }
    .nav-brand { font-size: 0.5rem; letter-spacing: 0.11em; }
    .nav-cta { font-size: 0.5rem; letter-spacing: 0.1em; padding: 0.45rem 0.7rem; }
    .nav-toggle span { width: 22px; }
    .nav-toggle { gap: 5px; }
}
@media (max-width: 340px) {
    .nav-cta { display: none; }
}
