/* ============================================================
   GBECHI BONIFACE — NAVBAR PREMIUM v2
   Design : Apple · Stripe · Framer level
   ============================================================ */

/* ---- Variables navbar ---- */
:root {
  --nav-h:          72px;
  --nav-bg:         rgba(255,255,255,0.88);
  --nav-bg-dark:    rgba(10,14,26,0.92);
  --nav-border:     rgba(0,0,0,0.07);
  --nav-border-dark:rgba(255,255,255,0.07);
  --nav-shadow:     0 1px 0 rgba(0,0,0,0.06), 0 8px 32px rgba(0,0,0,0.06);
  --nav-radius:     0;
  --nav-link-color: #374151;
  --nav-link-hover: #1877F2;
  --nav-link-active:#1877F2;
  --nav-font-size:  .815rem;
  --nav-transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --nav-bg:         rgba(10,14,26,0.92);
  --nav-border:     rgba(255,255,255,0.07);
  --nav-link-color: rgba(255,255,255,0.78);
  --nav-link-hover: #93C5FD;
  --nav-link-active:#93C5FD;
}

/* ============================================================
   NAVBAR BASE
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--nav-border);
  transition: background var(--nav-transition),
              box-shadow var(--nav-transition),
              border-color var(--nav-transition);
  will-change: transform;
}

.navbar.scrolled {
  box-shadow: var(--nav-shadow);
  border-bottom-color: transparent;
}

/* ============================================================
   CONTAINER
   ============================================================ */
.nav-container {
  max-width: 100%;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
}
/* ============================================================
   LOGO
   ============================================================ */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 48px;
  margin-left: 16px;
  outline-offset: 4px;
  height: 100%;
}

.nav-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  display: block;
  align-self: center;
}

.nav-logo-name {
  font-family: 'Inter', 'Poppins', sans-serif;
  font-size: var(--nav-font-size);
  font-weight: 500;
  color: var(--nav-link-color);
  letter-spacing: .008em;
  white-space: nowrap;
  align-self: center;
  line-height: 1;
}

/* Logo texte — anciens éléments nettoyés */
.nav-logo-text-block,
.nav-logo-beni,
.nav-logo-text,
.nav-logo-show,
.logo-gbechi-new,
.logo-boniface-new { display: none !important; }

.nav-logo-beni {
  font-family: 'Arial', 'Helvetica Neue', sans-serif;
  font-size: .68rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: .03em;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--nav-transition);
}
.nav-logo-beni:hover { color: #fff; }

/* Béni Technologie — lien dans la nav desktop */
.nav-link-benitech {
  color: var(--nav-link-color) !important;
}
.nav-link-benitech:hover {
  color: var(--nav-link-hover) !important;
  background: rgba(29,78,216,0.06) !important;
}
/* Sur desktop : masqué dans nav-links car disponible dans nav-actions */
@media (min-width: 769px) {
  .nav-link-benitech { display: none; }
}

/* ============================================================
   NAV LINKS — Desktop
   ============================================================ */
.nav-links {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  font-family: 'Inter', 'Poppins', sans-serif;
  font-size: var(--nav-font-size);
  font-weight: 500;
  color: var(--nav-link-color);
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  transition: color var(--nav-transition),
              background var(--nav-transition);
  letter-spacing: .008em;
}

/* Underline indicator */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%; right: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--orange));
  border-radius: 2px;
  transition: left var(--nav-transition), right var(--nav-transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--nav-link-hover);
  background: rgba(29,78,216,0.06);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  left: 8px;
  right: 8px;
}

/* ============================================================
   NAV ACTIONS
   ============================================================ */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 16px;
}

/* --- Language switcher --- */
.btn-lang {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  background: transparent;
  color: var(--nav-link-color);
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 20px;
  font-family: 'Inter', 'Poppins', sans-serif;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--nav-transition),
              color var(--nav-transition),
              background var(--nav-transition);
  white-space: nowrap;
}
.btn-lang:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(29,78,216,.05);
}
.btn-lang span { font-size: .9rem; line-height: 1; }
[data-theme="dark"] .btn-lang { border-color: rgba(255,255,255,.18); }

/* --- Theme toggle --- */
.theme-toggle {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid rgba(0,0,0,0.1);
  color: var(--nav-link-color);
  font-size: .84rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--nav-transition),
              border-color var(--nav-transition),
              color var(--nav-transition),
              transform .15s ease;
}
.theme-toggle:hover {
  background: rgba(29,78,216,.08);
  border-color: var(--blue);
  color: var(--blue);
  transform: rotate(15deg);
}
[data-theme="dark"] .theme-toggle { border-color: rgba(255,255,255,.15); }

/* --- Béni Technologie link --- */
.btn-nav-beni {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 13px;
  background: transparent;
  color: var(--blue);
  border: 1.5px solid rgba(29,78,216,.25);
  border-radius: 20px;
  font-family: 'Inter', 'Poppins', sans-serif;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--nav-transition),
              border-color var(--nav-transition),
              color var(--nav-transition);
}
.btn-nav-beni:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn-nav-beni i { font-size: .68rem; }
[data-theme="dark"] .btn-nav-beni {
  color: var(--blue-xlight);
  border-color: rgba(147,197,253,.3);
}
[data-theme="dark"] .btn-nav-beni:hover {
  background: var(--blue-mid);
  border-color: var(--blue-mid);
  color: #fff;
}

/* --- CTA Button --- */
.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--blue), var(--blue-mid));
  color: #fff;
  border: none;
  border-radius: 20px;
  font-family: 'Inter', 'Poppins', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(29,78,216,.3);
  transition: box-shadow var(--nav-transition),
              transform .15s ease,
              background var(--nav-transition);
}
.btn-nav:hover {
  background: linear-gradient(135deg, var(--blue-mid), var(--blue));
  box-shadow: 0 4px 20px rgba(29,78,216,.45);
  transform: translateY(-1px);
}
.btn-nav:active { transform: translateY(0); }

/* --- Hamburger --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background var(--nav-transition);
  -webkit-tap-highlight-color: transparent;
}
.hamburger:hover { background: rgba(0,0,0,.05); }
[data-theme="dark"] .hamburger:hover { background: rgba(255,255,255,.08); }

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--nav-link-color);
  border-radius: 2px;
  transition: transform .3s cubic-bezier(0.4,0,0.2,1),
              opacity .3s ease,
              width .3s ease;
  transform-origin: center;
}
.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   RESPONSIVE — Breakpoints fluides
   Priorité : conserver les liens visibles le plus longtemps possible
   Le menu hamburger n'apparaît qu'à ≤768px
   ============================================================ */

/* ---- 1440px — léger réajustement ---- */
@media (max-width: 1440px) {
  .nav-container { padding: 0 28px; }
}

/* ---- 1280px — cacher Béni Technologie bouton outline ---- */
@media (max-width: 1280px) {
  .nav-container { padding: 0 20px; }
  .nav-logo      { margin-right: 20px; }
  .btn-nav-beni  { display: none; }
  .nav-links a   { padding: 5px 9px; font-size: .79rem; }
}

/* ---- 1180px — compression supplémentaire ---- */
@media (max-width: 1180px) {
  .nav-links a   { padding: 5px 7px; font-size: .77rem; }
  .btn-nav       { padding: 0 14px; font-size: .76rem; height: 34px; }
  .nav-actions   { gap: 5px; }
}

/* ---- 1100px — navigation plus compacte ---- */
@media (max-width: 1100px) {
  .nav-links a   { padding: 5px 6px; font-size: .74rem; }
  .nav-logo      { margin-right: 14px; }
  .btn-nav       { padding: 0 12px; font-size: .74rem; height: 33px; }
}

/* ---- 1000px — réduire encore les liens ---- */
@media (max-width: 1000px) {
  .nav-links a   { padding: 5px 6px; font-size: .72rem; letter-spacing: 0; }
  .nav-logo      { margin-right: 10px; }
  .theme-toggle  { width: 32px; height: 32px; min-width: 32px; }
  .btn-nav       { padding: 0 11px; font-size: .72rem; height: 32px; }
}

/* ---- 900px — compression maximale avant hamburger ---- */
@media (max-width: 900px) {
  .nav-links a   { padding: 4px 5px; font-size: .70rem; letter-spacing: 0; }
  .nav-logo-img  { width: 32px; height: 32px; }
  .nav-logo-name { font-size: .72rem; }
  .btn-nav       { padding: 0 10px; font-size: .70rem; height: 31px; }
  .nav-actions   { gap: 4px; }
}

/* ---- 768px — Mobile ---- */
@media (max-width: 768px) {
  :root { --nav-h: 62px; }

  .nav-container {
    padding: 0 16px;
    gap: 8px;
  }

  /* Logo */
  .nav-logo { margin-right: 0; }
  .nav-logo-img { width: 34px; height: 34px; }
  .logo-gbechi-new,
  .logo-boniface-new,
  .nav-logo-text,
  .nav-logo-show { font-size: 1rem; }

  /* Masquer desktop */
  .btn-nav      { display: none; }
  .btn-nav-beni { display: none !important; }

  /* Afficher hamburger */
  .hamburger { display: flex; }

  /* Actions */
  .nav-actions { gap: 4px; margin-left: 0; margin-right: 4px; }
  .theme-toggle { width: 32px; height: 32px; min-width: 32px; font-size: .8rem; margin-right: 2px; }

  /* ===== MENU MOBILE — PANNEAU PLEIN ÉCRAN ===== */
  .nav-links {
    display: flex !important;           /* toujours flex pour l'animation */
    flex-direction: column;
    align-items: stretch;

    /* Position : couvre tout sous la navbar */
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(100dvh - var(--nav-h));

    /* Fond opaque — empêche de voir le contenu derrière */
    background: #0a0f1e;

    padding: 12px 20px 80px;
    gap: 4px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    z-index: 999;

    /* Animation fermé → opaque 0, décalé vers le haut */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
    transition:
      opacity   .25s cubic-bezier(0.4,0,0.2,1),
      transform .25s cubic-bezier(0.4,0,0.2,1),
      visibility 0s  linear .25s;
  }

  /* ===== ÉTAT OUVERT ===== */
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition:
      opacity   .25s cubic-bezier(0.4,0,0.2,1),
      transform .25s cubic-bezier(0.4,0,0.2,1),
      visibility 0s  linear 0s;
  }

  /* Liens */
  .nav-links > a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 18px;
    font-size: .98rem;
    font-weight: 600;
    color: rgba(255,255,255,0.82);
    border-radius: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    min-height: 52px;
    text-align: center;
    transition: background .15s, color .15s;
  }
  .nav-links > a:last-of-type { border-bottom: none; }
  .nav-links > a::after       { display: none !important; }
  .nav-links > a:hover        { background: rgba(27,44,193,.2);  color: #fff; }
  .nav-links > a.active       { background: rgba(27,44,193,.28); color: #fff; font-weight: 700; }

  /* CTA dans le menu */
  .nav-mobile-cta {
    display: block;
    margin-top: 20px;
  }
  /* Béni Technologie — mobile */
  .btn-nav-beni-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    margin-bottom: 10px;
    background: transparent;
    color: rgba(255,255,255,0.85);
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s, border-color .2s, color .2s;
  }
  .btn-nav-beni-mobile:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.5);
    color: #fff;
  }
  .nav-mobile-cta .btn-nav {
    display: flex !important;
    width: 100%;
    justify-content: center;
    height: 50px;
    font-size: .95rem;
    font-family: 'Inter', 'Poppins', sans-serif;
    border-radius: 12px;
    background: linear-gradient(135deg, #1B2CC1, #2338D4) !important;
    box-shadow: 0 4px 20px rgba(27,44,193,.4);
  }
}

/* ---- 480px ---- */
@media (max-width: 480px) {
  :root { --nav-h: 58px; }
  .nav-container { padding: 0 14px; }
  .nav-logo-img  { width: 32px; height: 32px; }
  .logo-gbechi-new,
  .logo-boniface-new { font-size: .95rem; }
  .btn-lang { height: 30px; padding: 0 8px; font-size: .68rem; }
  .theme-toggle { width: 30px; height: 30px; min-width: 30px; }
  .hamburger { width: 38px; height: 38px; }
}

/* ---- 360px ---- */
@media (max-width: 360px) {
  :root { --nav-h: 56px; }
  .nav-container { padding: 0 12px; gap: 6px; }
  .logo-gbechi-new,
  .logo-boniface-new,
  .nav-logo .logo-orange { font-size: .88rem; }
  .btn-lang { display: none; } /* cacher sur 360px — inclus dans menu mobile */
}

/* ---- 320px ---- */
@media (max-width: 320px) {
  :root { --nav-h: 54px; }
  .nav-logo-img  { width: 30px; height: 30px; }
}

/* ============================================================
   LARGE SCREENS
   ============================================================ */
@media (min-width: 1441px) {
  .nav-container { padding: 0 clamp(28px, 3vw, 80px); }
  .nav-links a   { padding: 6px 13px; font-size: .84rem; }
  .nav-logo      { margin-right: 40px; }
}

@media (min-width: 1920px) {
  .nav-container { padding: 0 80px; }
}

/* ============================================================
   DARK MODE OVERRIDES
   ============================================================ */
[data-theme="dark"] .navbar {
  background: var(--nav-bg-dark);
  border-bottom-color: var(--nav-border-dark);
}
[data-theme="dark"] .navbar.scrolled {
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 8px 32px rgba(0,0,0,.4);
}
[data-theme="dark"] .hamburger span {
  background: rgba(255,255,255,.85);
}
[data-theme="dark"] .btn-lang {
  border-color: rgba(255,255,255,.18);
  color: rgba(255,255,255,.75);
}
[data-theme="dark"] .btn-lang:hover {
  border-color: var(--blue-xlight);
  color: var(--blue-xlight);
  background: rgba(147,197,253,.08);
}
[data-theme="dark"] .theme-toggle {
  border-color: rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
}
[data-theme="dark"] .theme-toggle:hover {
  background: rgba(147,197,253,.1);
  border-color: var(--blue-xlight);
  color: var(--blue-xlight);
}

/* ============================================================
   ACCESSIBILITÉ — Focus ring premium
   ============================================================ */
.nav-logo:focus-visible,
.nav-links a:focus-visible,
.btn-lang:focus-visible,
.btn-nav:focus-visible,
.btn-nav-beni:focus-visible,
.theme-toggle:focus-visible,
.hamburger:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================
   PAGES LÉGALES — Navbar simplifiée
   ============================================================ */
.navbar .logo-text-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.navbar .logo-gbechi,
.navbar .logo-boniface {
  font-family: 'Inter', 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.navbar .logo-gbechi   { color: var(--blue); }
.navbar .logo-boniface { color: var(--orange); }
.navbar .logo-tagline  {
  font-size: .68rem;
  color: var(--text-muted);
  margin-left: 8px;
  font-weight: 500;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .navbar .logo-tagline { display: none; }
  .navbar .logo-gbechi,
  .navbar .logo-boniface { font-size: .96rem; }
}

/* ============================================================
   NAVBAR HIDE ON SCROLL DOWN (mobile UX)
   ============================================================ */
.navbar {
  transition: background var(--nav-transition),
              box-shadow var(--nav-transition),
              border-color var(--nav-transition),
              transform .3s cubic-bezier(0.4,0,0.2,1);
}

/* Masquer au scroll vers le bas sur mobile uniquement */
@media (max-width: 768px) {
  .navbar.navbar-hidden {
    transform: translateY(-100%);
  }
  /* Ne jamais masquer quand le menu est ouvert */
  .navbar.navbar-hidden:has(#navLinks.open) {
    transform: translateY(0);
  }
}

/* ============================================================
   INDICATEUR PAGE ACTIVE — dot sous le lien
   ============================================================ */
.nav-links a.active {
  color: var(--nav-link-active);
  font-weight: 600;
}

/* ============================================================
   TRANSITION DOUCE — gérée dans le bloc 768px principal
   ============================================================ */

/* ============================================================
   NAV MOBILE LANG — toujours caché sur desktop
   ============================================================ */
.nav-mobile-lang,
.nav-mobile-cta {
  display: none;
}
/* Affichage mobile géré dans le bloc 768px principal */

/* ============================================================
   SAFE AREA — iPhone notch
   ============================================================ */
@supports (padding-top: env(safe-area-inset-top)) {
  .navbar {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--nav-h) + env(safe-area-inset-top));
  }
  @media (max-width: 768px) {
    .nav-links {
      top: calc(var(--nav-h) + env(safe-area-inset-top));
      padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }
  }
}

/* ============================================================
   NOM CENTRÉ DANS LA NAVBAR MOBILE
   Logo img à gauche · Nom centré absolument · Actions à droite
   ============================================================ */
@media (max-width: 768px) {

  /* Le container devient le repère de positionnement */
  .nav-container {
    position: relative;
  }

  /* Le logo : uniquement l'image, à gauche */
  .nav-logo {
    z-index: 2;
    margin-right: 0;
  }

  /* Masquer le sous-titre Béni Tech sur mobile — trop petit */
  .nav-logo-beni { display: none; }
  .nav-logo-name { font-size: 1rem; }

  /* Titre centré absolument dans la navbar */
  .navbar-title-mobile {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    white-space: nowrap;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
  }

  .navbar-title-mobile .nt-first {
    font-family: 'Arial', 'Helvetica Neue', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -.02em;
  }

  .navbar-title-mobile .nt-last {
    font-family: 'Arial', 'Helvetica Neue', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -.02em;
  }
}

@media (max-width: 480px) {
  .navbar-title-mobile .nt-first,
  .navbar-title-mobile .nt-last {
    font-size: 1.1rem;
  }
}

@media (max-width: 360px) {
  .navbar-title-mobile .nt-first,
  .navbar-title-mobile .nt-last {
    font-size: 1rem;
  }
}

/* Cacher sur desktop — le logo affiche déjà le texte */
@media (min-width: 769px) {
  .navbar-title-mobile { display: none !important; }
}
