/* ════════ Barre du haut de la page d'accueil (#hp-topbar) ════════
   Barre blanche fixe : logo, liens au centre, « Se connecter » et bouton d'essai à droite.
   Sur téléphone et petite tablette, les liens passent dans un menu ouvert par le bouton ☰
   (scripts/index-topbar.js). Largeur alignée sur le hero : 2000px max. */
#hp-topbar {
    --tb-h: 72px;
    --tb-navy: #1b3446;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 996;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid transparent;
    font-family: "Poppins", sans-serif;
    transition: box-shadow .2s ease, border-color .2s ease;
}

#hp-topbar.tb-scrolled {
    border-bottom-color: #e6ebf1;
    box-shadow: 0 6px 20px -12px rgba(27, 52, 70, .35);
}

main {
    padding-top: var(--tb-h, 72px);
}

/* Ancres : la section commence sous la barre */
main section[id] {
    scroll-margin-top: 72px;
}

/* Le hero remplit l'écran sous la barre */
.hp-hero.hp-hero-home {
    min-height: calc(100vh - 72px);
}

#hp-topbar .tb-inner {
    max-width: 2000px;
    height: var(--tb-h);
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 64px);
    display: flex;
    align-items: center;
    gap: 24px;
}

/* ── Logo ── */
#hp-topbar .tb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: var(--tb-navy);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.3px;
    text-decoration: none;
}

#hp-topbar .tb-brand img {
    width: 40px;
    height: 40px;
}

/* ── Liens ── */
#hp-topbar .tb-links {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 1.6vw, 28px);
}

#hp-topbar .tb-links > a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 8px 10px;
    font-family: "Poppins", sans-serif !important;
    font-size: 15px;
    font-weight: 500;
    color: #34445a;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease;
}

#hp-topbar .tb-links > a:hover {
    color: var(--tb-navy);
    background: #f1f5f9;
}

/* Section affichée à l'écran : petit trait ambre sous le lien (le lien est en position relative : sans elle, le
   trait s'étalait sur toute la largeur de la barre) */
#hp-topbar .tb-links > a.active {
    color: var(--tb-navy);
    font-weight: 600;
}

#hp-topbar .tb-links > a.active::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: #ffa000;
}











/* ── Boutons de droite ── */
#hp-topbar .tb-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

#hp-topbar .tb-login {
    font-size: 15px;
    font-weight: 500;
    color: #34445a;
    text-decoration: none;
    white-space: nowrap;
}

#hp-topbar .tb-login:hover {
    color: var(--tb-navy);
    text-decoration: underline;
    text-underline-offset: 4px;
}

#hp-topbar .tb-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px 6px 18px;
    font-size: 15px;
    font-weight: 700;
    color: var(--tb-navy);
    background: linear-gradient(135deg, #ffca28, #ffa000);
    border-radius: 999px;
    box-shadow: 0 8px 18px -10px rgba(255, 160, 0, .9);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease;
}

#hp-topbar .tb-cta:hover,
#hp-topbar .tb-cta:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px -10px rgba(255, 160, 0, 1);
    color: var(--tb-navy);
}

#hp-topbar .tb-cta .material-icons {
    font-size: 18px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--tb-navy);
    color: #ffca28;
}

#hp-topbar .tb-cta-short {
    display: none;
}

#hp-topbar .tb-burger {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--tb-navy);
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

/* Liens « Se connecter / Mon compte » du menu déroulé : seulement sur téléphone */
#hp-topbar .tb-links-actions {
    display: none;
}

/* ── Connecté / pas connecté (classes posées par scripts/index-topbar.js) ── */
#hp-topbar .logged-in-only,
#hp-topbar .logged-out-only {
    display: none !important;
}

#hp-topbar.tb-auth-ready:not(.tb-logged-in) .logged-out-only,
#hp-topbar.tb-auth-ready.tb-logged-in .logged-in-only {
    display: inline-flex !important;
}

/* ── Écrans moyens : liens resserrés ── */
@media (max-width: 1180px) {
    #hp-topbar .tb-inner {
        gap: 12px;
    }

    #hp-topbar .tb-links > a {
        font-size: 14px;
        padding: 8px 6px;
    }

    #hp-topbar .tb-cta-long {
        display: none;
    }

    #hp-topbar .tb-cta-short {
        display: inline;
    }
}

/* ── Tablette et téléphone : menu ☰ ── */
@media (max-width: 900px) {
    #hp-topbar {
        --tb-h: 60px;
    }

    main {
        padding-top: 60px;
    }

    main section[id] {
        scroll-margin-top: 60px;
    }

    .hp-hero.hp-hero-home {
        min-height: calc(100vh - 60px);
    }

    #hp-topbar .tb-brand {
        font-size: 19px;
    }

    #hp-topbar .tb-brand img {
        width: 30px;
        height: 30px;
    }

    #hp-topbar .tb-burger {
        display: inline-flex;
    }

    #hp-topbar .tb-actions {
        margin-left: auto;
        gap: 10px;
    }

    #hp-topbar.tb-auth-ready .tb-actions .tb-login {
        display: none !important;
    }

    #hp-topbar .tb-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 10px 16px 18px;
        background: #fff;
        border-top: 1px solid #e6ebf1;
        box-shadow: 0 18px 30px -18px rgba(27, 52, 70, .45);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        display: none;
    }

    #hp-topbar.tb-menu-open .tb-links {
        display: flex;
    }

    #hp-topbar .tb-links > a {
        width: 100%;
        justify-content: space-between;
        font-size: 16px;
        padding: 12px 10px;
    }

    #hp-topbar .tb-links > a.active::after {
        display: none;
    }





    #hp-topbar .tb-links-actions {
        display: block;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid #e6ebf1;
    }

    #hp-topbar .tb-links-actions .tb-login {
        padding: 8px 10px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    #hp-topbar .tb-brand span {
        display: none;
    }
}

@media (max-width: 900px) {
}

/* Pages produits : le module de la page est mis en évidence dans le menu « Modules » */
