/*
 * templatecss/header-menu.css
 * Nouveau header Autocadre 2026 — desktop + mobile responsive
 *
 * Composants : logo/slogan, navbar, burger, menu slide, overlay, sticky
 * Breakpoint mobile : 700px (aligné avec resp.css / #only_phone)
 * Préfixe .header- pour éviter tout conflit avec le CSS existant.
 * Fichier UTF-8 — les accents dans le HTML rendu sont en entités HTML.
 */


/* =========================================================
   RESET INTERNE — ne pas polluer le reste du site
   ========================================================= */
.site-header *,
.header-mobile-menu * {
    box-sizing: border-box;
}


/* =========================================================
   HEADER — CONTENEUR PRINCIPAL
   Sticky : reste en haut de page, se masque en scroll bas
   ========================================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    min-width: 0;
}

/* Scroll bas → tout masqué */
.site-header.is-hidden {
    transform: translateY(-100%);
}

/* Scroll haut (pas en top) → position fixed + navbar seule */
.site-header.is-compact {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}
.site-header.is-compact #header {
    display: none;
}

/* Contraindre #header (logo+firstline) à 1000px centré comme il était dans #page */
.site-header #header {
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
    padding-bottom: 8px;
    overflow: visible;
}



/* =========================================================
   NAVBAR — BARRE DE NAVIGATION (fond transparent, entre 2 barres grises)
   ========================================================= */
.header-navbar {
    background: transparent;
    border-top: 1px solid #d0d0d0;
    border-bottom: 1px solid #d0d0d0;
}

/* Wrapper interne — aligne le contenu sur les 1000px du site */
.header-navbar-inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 10px 0 0;
    height: 40px;
    gap: 0;
    box-sizing: border-box;
}

/* Spacer gauche invisible = équilibre le CTA à droite pour centrage parfait des liens */
.header-nav-spacer {
    display: block;
    flex: 0 0 auto;
    width: 150px;  /* largeur approx du bouton + padding-right de l'inner */
    visibility: hidden;
}


/* =========================================================
   BURGER — VISIBLE UNIQUEMENT SUR MOBILE
   ========================================================= */
.header-burger {
    display: none;           /* masqué sur desktop, affiché en @media 700px */
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 6px;
    border-radius: 6px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.header-burger:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* 3 barres du burger */
.header-burger__bars {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.header-burger__bars span {
    display: block;
    width: 22px;
    height: 2px;
    background: #333333;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.header-burger__label {
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    line-height: 1;
    display: none; /* affiché uniquement sur mobile via @media */
}

/* Animation → croix à l'ouverture */
.header-burger.is-active .header-burger__bars span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.header-burger.is-active .header-burger__bars span:nth-child(2) {
    opacity: 0;
}
.header-burger.is-active .header-burger__bars span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}


/* =========================================================
   LIENS DE NAVIGATION — DESKTOP UNIQUEMENT
   ========================================================= */
.header-nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
}

.header-nav-links li a {
    display: block;
    color: #333333;
    text-decoration: none;
    padding: 0 24px;
    line-height: 40px;
    font-size: 16px;
    font-family: Arial, Helvetica, sans-serif;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.header-nav-links li a:hover {
    color: #2977dc;
    text-decoration: none;
}

/* Page courante : soulignement bas discret */
.header-nav-links li a.nav-active {
    color: #2977dc;
    box-shadow: inset 0 -3px 0 0 #2977dc;
}


/* =========================================================
   CTA — BOUTON JAUNE (header + menu mobile)
   ========================================================= */
.header-cta {
    display: inline-flex;
    align-items: center;
    background: #febc35;
    color: #333333;
    font-weight: 700;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    text-decoration: none;
    border-radius: 5px;
    padding: 6px 13px;
    white-space: nowrap;
    border: 1px solid #e0a800;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.header-cta:hover {
    background: #ffd060;
    color: #333333;
    text-decoration: none;
}

.header-cta:active {
    background: #e5a800;
}

/* Texte du CTA selon contexte desktop/mobile */
.header-cta__mobile  { display: none; }
.header-cta__desktop { display: inline; }

/* CTA pleine largeur dans le menu mobile slide */
.header-cta--full {
    display: flex;
    justify-content: center;
    width: 100%;
    font-size: 16px;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
}


/* =========================================================
   MENU MOBILE SLIDE — panneau depuis la gauche
   ========================================================= */
.header-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: auto;
    width: 100%;
    max-width: 100%;
    background: #2977dc;
    z-index: 99999;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header-mobile-menu.is-open {
    transform: translateY(0);
}

/* En-tête du panneau : logo centré + bouton fermer — fond blanc comme le modèle */
.header-mobile-menu__top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 12px 16px;
    background: #ffffff;
    flex-shrink: 0;
}

.header-mobile-menu__top img {
    padding: 0 !important;
    height: 34px;
    width: auto;
}

/* Bouton close stylisé burger — à gauche dans header-mobile-menu__top */
.header-mobile-menu__close-burger {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    color: #333333;
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    transition: background 0.2s;
}
.header-mobile-menu__close-burger:hover {
    background: rgba(0, 0, 0, 0.06);
}
/* Barres du burger en × */
.header-mobile-menu__close-burger .header-burger__bars {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.header-mobile-menu__close-burger .header-burger__bars span {
    display: block;
    width: 22px;
    height: 2px;
    background: #333333;
    transform-origin: center;
}
.header-mobile-menu__close-burger .header-burger__bars span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.header-mobile-menu__close-burger .header-burger__bars span:nth-child(2) {
    opacity: 0;
}
.header-mobile-menu__close-burger .header-burger__bars span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Bandeau titre "≡ Menu" */
.header-mobile-menu__title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 10px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    font-family: Arial, Helvetica, sans-serif;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

/* Icônes Lucide dans le menu mobile */
.header-mobile-menu svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    vertical-align: middle;
    flex-shrink: 0;
}
.header-mobile-menu__title svg {
    width: 16px;
    height: 16px;
}
.header-cta svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    vertical-align: middle;
    margin-right: 5px;
    flex-shrink: 0;
}
.header-cta--full svg {
    width: 18px;
    height: 18px;
}

/* Liens de navigation dans le panneau */
.header-mobile-menu__nav {
    flex: 0 0 auto;
}

.header-mobile-menu__nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px 20px;
    color: #ffffff;
    text-decoration: none;
    font-size: 18px;
    font-family: Arial, Helvetica, sans-serif;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: padding-left 0.15s ease, background 0.15s ease;
}

.header-mobile-menu__nav a:hover {
    padding-left: 28px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
}

/* Pied : CTA + mention "Depuis 2003" */
.header-mobile-menu__footer {
    padding: 20px 16px 24px;
    background: linear-gradient(to bottom, #c2c2c2, #d8d8d8);
    box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.header-mobile-menu__since {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 0 0;
    color: rgba(0, 0, 0, 0.4);
    font-size: 13px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 400;
}
.header-mobile-menu__since::before,
.header-mobile-menu__since::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.2);
}


/* =========================================================
   OVERLAY — fond sombre derrière le menu mobile
   ========================================================= */
.header-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;           /* cliquable uniquement quand actif */
    transition: opacity 0.3s ease;
}

.header-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}


/* =========================================================
   RESPONSIVE — MOBILE (≤ 700px)
   Aligne sur le breakpoint #only_phone de resp.css
   ========================================================= */
@media (min-width: 701px) and (max-width: 980px) {
    .header-nav-links li a {
        padding: 0 14px;
        font-size: 14px;
    }
    .header-nav-spacer {
        width: 120px;
    }
}

@media (max-width: 700px) {

    /* Hiérarchie H1 vs slogan plus marquée sur mobile */
    .site-header #firstline h1 {
        font-size: 17px !important;
        line-height: 1.3;
        margin-bottom: 4px !important;
    }
    .site-header #firstline .header-subtitle {
        font-size: 11px !important;
        line-height: 1.4;
    }

    /* Afficher le burger, masquer les liens desktop */
    .header-burger {
        display: flex;
    }

    .header-nav-links {
        display: none;
    }

    /* Navbar mobile : fond bleu dégradé, sans les 2 barres grises */
    .header-navbar {
        border-top: none;
        border-bottom: none;
        background: linear-gradient(to bottom, #3585e8, #1f65c0);
    }
    .header-navbar-inner {
        padding: 0 10px;
        justify-content: space-between;
        max-width: 100%;
        height: 48px;
    }
    .header-nav-spacer {
        display: none !important;
    }

    /* Burger mobile : row (barres + "Menu" côte à côte), blancs */
    .header-burger {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    .header-burger__bars span {
        background: #ffffff;
    }
    .header-burger__label {
        display: block;
        color: #ffffff;
    }
    .header-burger:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    /* CTA mobile */
    .header-navbar .header-cta {
        font-size: 15px;
        padding: 8px 16px;
    }

    /* Basculer les libellés du CTA */
    .header-cta__desktop { display: none;   }
    .header-cta__mobile  { display: inline; }

    .header-top {
        padding: 6px 12px 3px;
    }

    .header-slogan {
        font-size: 11px;
    }
}
