/* =========================================================================
   Header du site (refonte 23/09/2026) — remplace les anciennes règles
   .site-nav / .nav-cta / .nav-compte, devenues inertes (classes retirées
   du markup). Chargé après site.css : ce fichier fait autorité.
   Structure : logo | navigation | actions (favoris, compte) | hamburger.
   ========================================================================= */

.hdr {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.hdr-in {
    max-width: 1280px; margin: 0 auto; padding: 0 24px;
    height: 68px; display: flex; align-items: center; gap: 10px;
}

/* --- Logo --- */
.hdr-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-right: 6px; }
.hdr-logo:hover { text-decoration: none; }
.hdr-logo-carre {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: grid; place-items: center;
    box-shadow: 0 6px 14px -6px rgba(79, 70, 229, .7);
}
.hdr-logo-carre img { width: 18px; height: 18px; display: block; }
.hdr-logo-nom { font-size: 16.5px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.hdr-logo-nom i { font-style: normal; color: var(--indigo); }

/* --- Navigation --- */
.hdr-nav { display: flex; align-items: center; gap: 2px; margin-right: auto; }
.hdr-nav > a, .hdr-menu-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 13px; border-radius: 10px;
    font-family: inherit; font-size: 14px; font-weight: 600; color: #475569;
    background: none; border: 0; cursor: pointer; white-space: nowrap;
    transition: background .13s, color .13s;
}
.hdr-nav > a:hover, .hdr-menu-btn:hover { background: #f1f5f9; color: var(--ink); text-decoration: none; }
.hdr-nav > a[aria-current="page"] { background: #eef2ff; color: var(--indigo-dark); }

/* --- Menu déroulant « Outils » --- */
.hdr-menu { position: relative; }
.hdr-menu-btn svg { width: 10px; height: 6px; transition: transform .15s; opacity: .7; }
.hdr-menu:hover .hdr-menu-btn, .hdr-menu:focus-within .hdr-menu-btn { background: #f1f5f9; color: var(--ink); }
.hdr-menu:hover .hdr-menu-btn svg, .hdr-menu:focus-within .hdr-menu-btn svg { transform: rotate(180deg); }
.hdr-menu-panneau {
    position: absolute; top: calc(100% + 6px); left: 0;
    display: none; z-index: 60; min-width: 250px; padding: 7px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 24px 50px -20px rgba(15, 15, 50, .3);
}
.hdr-menu:hover .hdr-menu-panneau, .hdr-menu:focus-within .hdr-menu-panneau { display: block; }
.hdr-menu-panneau a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
    font-size: 13.5px; font-weight: 600; color: var(--ink);
    transition: background .12s, color .12s;
}
.hdr-menu-panneau a:hover { background: #eef2ff; color: var(--indigo-dark); text-decoration: none; }
.hdr-menu-panneau svg { width: 16px; height: 16px; color: var(--indigo); flex-shrink: 0; }

/* --- Actions (droite) --- */
.hdr-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hdr-sep { width: 1px; height: 26px; background: var(--line); margin: 0 2px; }
.hdr-fav {
    position: relative; display: grid; place-items: center;
    width: 38px; height: 38px; border-radius: 10px; color: #64748b; font-size: 15px;
    transition: background .13s, color .13s;
}
.hdr-fav:hover { background: #fef2f2; color: #e11d48; text-decoration: none; }
.hdr-fav .fav-badge {
    position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px; background: #e11d48; color: #fff;
    font-size: 10.5px; font-weight: 800; line-height: 16px; text-align: center;
    display: none;
}
.hdr-connexion {
    padding: 9px 13px; border-radius: 10px; font-size: 14px; font-weight: 600; color: #475569; white-space: nowrap;
    transition: background .13s, color .13s;
}
.hdr-connexion:hover { background: #f1f5f9; color: var(--ink); text-decoration: none; }
.hdr-cta {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 17px; border-radius: 11px; white-space: nowrap;
    background: linear-gradient(135deg, #4f46e5, #6d28d9); color: #fff;
    font-size: 14px; font-weight: 700;
    box-shadow: 0 8px 18px -8px rgba(79, 70, 229, .8);
    transition: transform .13s, box-shadow .13s;
}
.hdr-cta:hover { color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 12px 22px -8px rgba(79, 70, 229, .85); }
.hdr-compte { display: inline-flex; align-items: center; gap: 9px; padding: 6px 13px 6px 6px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; transition: border-color .13s, background .13s; }
.hdr-compte:hover { background: #f8fafc; border-color: #c7d2fe; text-decoration: none; }
.hdr-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff;
    display: grid; place-items: center; font-size: 12.5px; font-weight: 800;
}
.hdr-compte-nom { font-size: 13.5px; font-weight: 700; color: var(--ink); }

/* --- Hamburger --- */
.hdr-burger {
    display: none; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; border: 0; background: none; cursor: pointer;
    border-radius: 10px; flex-shrink: 0; position: relative; z-index: 60;
}
.hdr-burger:hover { background: #f1f5f9; }
.hdr-burger span { display: block; width: 20px; height: 2px; margin: 0 auto; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.hdr-burger.nav-toggle-actif span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hdr-burger.nav-toggle-actif span:nth-child(2) { opacity: 0; }
.hdr-burger.nav-toggle-actif span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Bloc compte visible seulement dans le tiroir mobile --- */
.hdr-nav-mobile { display: none; }
.hdr-nav > a.hdr-nav-mobile-pro { display: none; }

/* --- Voile du tiroir --- */
.nav-overlay { display: none; position: fixed; inset: 68px 0 0 0; z-index: 45; background: rgba(15, 15, 35, .45); backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s; }
.nav-overlay-visible { display: block; opacity: 1; }
body.nav-verrou-scroll { overflow: hidden; }

/* --- Écrans intermédiaires : on allège avant de passer au tiroir --- */
@media (max-width: 1080px) {
    .hdr-connexion { display: none; }
    .hdr-nav > a, .hdr-menu-btn { padding: 9px 10px; }
}

/* --- Mobile / tablette : tiroir --- */
@media (max-width: 900px) {
    .hdr-in { height: 60px; padding: 0 16px; gap: 6px; }
    .hdr-burger { display: flex; }
    .hdr-nav {
        position: fixed; top: 60px; left: 0; right: 0; z-index: 46;
        flex-direction: column; align-items: stretch; gap: 0; margin: 0;
        background: #fff; padding: 6px 0 16px;
        max-height: calc(100vh - 60px); overflow-y: auto;
        box-shadow: 0 20px 40px -20px rgba(15, 15, 50, .3);
        transform: translateY(-8px); opacity: 0; visibility: hidden; pointer-events: none;
        transition: transform .18s ease, opacity .18s ease;
    }
    .hdr-nav.site-nav-ouvert { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
    .hdr-nav > a { font-size: 15.5px; padding: 14px 20px; border-radius: 0; border-bottom: 1px solid #f1f5f9; }
    .hdr-nav > a[aria-current="page"] { background: #eef2ff; }
    .hdr-menu { position: static; }
    .hdr-menu-btn { display: none; }
    .hdr-menu-panneau { display: block; position: static; min-width: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
    .hdr-menu-panneau a { font-size: 15.5px; padding: 14px 20px; border-radius: 0; border-bottom: 1px solid #f1f5f9; }

    /* Le compte passe dans le tiroir, en tête */
    .hdr-nav-mobile { display: block; padding: 12px 16px 14px; border-bottom: 8px solid #f8fafc; }
    .hdr-nav-mobile .hdr-cta, .hdr-nav-mobile .hdr-compte { display: flex; justify-content: center; width: 100%; padding: 13px; border-radius: 12px; }
    .hdr-nav-mobile .hdr-compte { justify-content: flex-start; }
    .hdr-nav-mobile-lien { display: block; text-align: center; padding: 11px 0 2px; font-size: 14px; font-weight: 600; color: #475569; }
    .hdr-nav > a.hdr-nav-mobile-pro { display: block; padding: 13px 20px; font-size: 14.5px; font-weight: 600; color: #475569; border-top: 8px solid #f8fafc; }

    /* À droite du logo : seulement les favoris, le reste est dans le tiroir */
    .hdr-actions .hdr-sep, .hdr-actions .hdr-cta, .hdr-actions .hdr-compte, .hdr-actions .hdr-connexion { display: none; }
    .nav-overlay { inset: 60px 0 0 0; }
}
