/* ═══════════════════════════════════════════
   NeuroDrift V5 — Navigation unifiée
   Inclure sur TOUTES les pages
   ═══════════════════════════════════════════ */

/* Beta banner */
.nd-banner {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    background-size: 200% 200%;
    animation: nd-gs 8s ease-in-out infinite;
    text-align: center; padding: 0.45rem 1rem;
    font-size: 0.72rem; font-weight: 700; color: white;
    letter-spacing: 0.03em;
}
.nd-banner a { color: white; text-decoration: underline; text-underline-offset: 2px; }

/* Nav bar */
.nd-nav {
    position: fixed !important; top: 32px !important; left: 0; right: 0; z-index: 100;
    padding: 0.8rem 2rem !important;
    display: flex !important; justify-content: space-between; align-items: center;
    background: linear-gradient(135deg, #0a0a0a 0%, #1e1b4b 100%) !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Nav links container */
.nd-nav .nav-links,
.nd-nav .nd-links {
    display: flex; align-items: center; gap: 1.2rem;
}
.nd-nav .nav-links a,
.nd-nav .nd-links a {
    color: rgba(255,255,255,0.7); font-size: 0.82rem; font-weight: 500;
    transition: all 0.3s ease; position: relative; text-decoration: none;
}
.nd-nav .nav-links a:hover,
.nd-nav .nd-links a:hover,
.nd-nav .nav-links a.active,
.nd-nav .nd-links a.active { color: white; }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > a::after { display: none !important; }
.nav-dropdown-trigger { display: flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.nav-dropdown-trigger svg { width: 12px; height: 12px; transition: transform 0.3s ease; }
.nav-dropdown:hover .nav-dropdown-trigger svg { transform: rotate(180deg); }
.nav-dropdown-menu {
    position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%);
    min-width: 280px; padding: 0.8rem;
    background: rgba(10,10,10,0.98); backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    opacity: 0; visibility: hidden; transform: translateX(-50%) translateY(8px);
    transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem;
}
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.nav-dropdown-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.75rem; border-radius: 8px;
    transition: background 0.2s ease; font-size: 0.78rem; font-weight: 600;
    color: rgba(255,255,255,0.8) !important;
}
.nav-dropdown-item:hover { background: rgba(255,255,255,0.06); color: white !important; }
.nav-dropdown-item::after { display: none !important; }
.nav-dropdown-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.nav-dropdown-section-label {
    grid-column: 1 / -1;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 0.5rem 0.75rem 0.3rem;
    margin-top: 0.3rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    pointer-events: none;
    cursor: default;
}
.nav-dropdown-menu > .nav-dropdown-section-label:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0.2rem;
}

/* CTA buttons */
.btn-nav-abo {
    padding: 0.5rem 1.1rem !important;
    background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899) !important;
    background-size: 200% 200% !important;
    color: white !important; border-radius: 12px !important;
    font-weight: 700 !important; font-size: 0.78rem !important;
    animation: nd-gs 8s ease-in-out infinite;
    white-space: nowrap;
}
.btn-nav-abo::after { display: none !important; }
.btn-nav-abo:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.4); }

.btn-nav-espace {
    padding: 0.45rem 0.9rem !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 12px !important; font-size: 0.78rem !important;
    color: rgba(255,255,255,0.8) !important; font-weight: 600 !important;
    background: transparent !important;
}
.btn-nav-espace::after { display: none !important; }
.btn-nav-espace:hover { border-color: rgba(255,255,255,0.5) !important; color: white !important; }

/* Hamburger — couvre .nd-toggle ET .menu-toggle dans la nd-nav */
.nd-toggle,
.nd-nav .menu-toggle {
    display: none; cursor: pointer; padding: 8px; z-index: 101;
    background: none; border: none;
    flex-direction: column; gap: 5px;
}
.nd-toggle span,
.nd-nav .menu-toggle span {
    display: block; width: 24px; height: 2.5px;
    background: white; margin: 0;
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.nd-toggle:hover span,
.nd-nav .menu-toggle:hover span { background: #a855f7; }

@keyframes nd-gs {
    0%,100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Tablette + Mobile (hamburger dès iPad Air portrait) */
@media (max-width: 1024px) {
    .nd-nav { padding: 0.7rem 1.4rem !important; }
    .nd-nav .nav-links,
    .nd-nav .nd-links { display: none !important; }
    .nd-toggle,
    .nd-nav .menu-toggle { display: flex !important; }
    .nd-nav .nav-links.open,
    .nd-nav .nd-links.open {
        display: flex !important; flex-direction: column;
        position: absolute; top: 100%; left: 0; right: 0;
        background: rgba(10,10,10,0.98); backdrop-filter: blur(20px);
        padding: 1.5rem 2rem 2rem; gap: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        /* menu défilable sur écran court (iPhone 13 mini, etc.) — correctif B1.14 */
        max-height: calc(100dvh - 5.5rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .nd-nav .nav-links.open .nav-dropdown-menu,
    .nd-nav .nd-links.open .nav-dropdown-menu {
        position: static; transform: none; opacity: 1; visibility: visible;
        min-width: 100%; background: rgba(255,255,255,0.03);
        border: none; margin-top: 0.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .nd-nav { padding: 0.6rem 1.2rem !important; top: 28px !important; }
    .nd-banner { font-size: 0.65rem; padding: 0.35rem 0.5rem; }
}

/* Mobile S (< 480px) */
@media (max-width: 480px) {
    .nd-nav { padding: 0.5rem 0.9rem !important; }
    .nd-banner { font-size: 0.6rem; padding: 0.3rem 0.4rem; }
    .nd-nav .nav-links.open,
    .nd-nav .nd-links.open { padding: 1.2rem 1.2rem 1.5rem; gap: 0.75rem; }
}

/* ═══════════════════════════════════════════════════════════════
   Beta banner — texte adaptatif + garantie 1 ligne
   Empêche le débordement / chevauchement avec la nav sur mobile
═══════════════════════════════════════════════════════════════ */
.beta-banner {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.4 !important;
}
.beta-text-short { display: none; }

/* Sur mobile et petit tablette, on utilise la version courte du texte */
@media (max-width: 600px) {
    .beta-text-full { display: none; }
    .beta-text-short { display: inline; }
    .beta-banner {
        font-size: 0.62rem !important;
        padding: 0.3rem 0.5rem !important;
    }
}

/* Très petit mobile : encore plus compact pour garantir 1 ligne */
@media (max-width: 380px) {
    .beta-banner {
        font-size: 0.58rem !important;
        padding: 0.28rem 0.4rem !important;
    }
}

/* ===== Filet anti-débordement horizontal mobile — correctif B1 (2026-06-10) =====
   nav.css est chargé en dernier sur toutes les pages : ces règles écrasent les
   styles inline qui oubliaient le passage en 1 colonne sur petit écran.
   - footer-right : les liens restaient sur 1 ligne (associations)
   - packs-grid / offres-grid / explorer-grid : grilles bloquées en N colonnes
     (nutrition, professionnels, index) */
@media (max-width: 600px) {
    .packs-grid { grid-template-columns: 1fr !important; }
    .offres-grid { grid-template-columns: 1fr !important; }
    .explorer-grid { grid-template-columns: 1fr !important; }
    /* cartes diagnostics (home #diagnostic) : grille inline repeat(4) → 2 colonnes */
    .diag-section [style*="repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
    .footer-inner { flex-direction: column !important; gap: 1rem !important; }
    .footer-left { flex-direction: column !important; }
    .footer-right { flex-wrap: wrap !important; justify-content: center !important; row-gap: 0.4rem !important; }
}

/* Très petit mobile (iPhone SE ~320px) : grille de constats en 1 colonne */
@media (max-width: 360px) {
    .constats-grid { grid-template-columns: 1fr !important; }
}

/* Sous-titre des piliers (home) : l'élargissement inline width:110%/margin-left:-5%
   déborde entre ~670 et 1100px → on le recentre normalement sous 1100px
   (l'effet est conservé au-dessus, en plein desktop). */
@media (max-width: 1100px) {
    #pillars .section-subtitle { width: auto !important; margin-left: auto !important; margin-right: auto !important; }
}
