/* ═══════════════════════════════════════════════════════════════
   NAVBAR — Logo gauche · Menus droite (desktop) · Drawer (mobile)
   80px desktop → 64px mobile
   ═══════════════════════════════════════════════════════════════ */

/* ── Barre fixe desktop ─────────────────────────────────────── */

.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-family-base);
  overflow: visible;
  z-index: 1000;
}

/* ── Logo ─────────────────────────────────────────────────────── */

.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 10px 0;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.nav-logo img {
  height: 110px;
  width: auto;
  display: block;
  position: relative;
  z-index: 1;
}
.nav-logo:hover {
  opacity: 0.75;
}

/* ── Groupe menus ──────────────────────────────────────────────── */

.nav-content {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
  flex-shrink: 0;
}
.nav-separator {
  display: none;
}

/* ── Menus déroulants ─────────────────────────────────────────── */

.nav-dropdown {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-dropdown-toggle {
  height: 100%;
  padding: 0 18px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--color-text-tertiary);
  font-family: var(--font-family-base);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle[aria-expanded="true"] {
  color: var(--color-text-primary);
  background: var(--color-bg-tertiary);
}

.dropdown-icon {
  font-size: 0.55em;
  color: var(--color-text-quaternary);
  flex-shrink: 0;
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}
.nav-dropdown-toggle[aria-expanded="true"] .dropdown-icon {
  transform: rotate(180deg);
  color: var(--color-text-tertiary);
}

.nav-dropdown-content {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 230px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    max-height 0.28s ease,
    opacity 0.2s ease;
  z-index: 1010;
}
.nav-dropdown-toggle[aria-expanded="true"] + .nav-dropdown-content {
  max-height: 600px;
  opacity: 1;
  pointer-events: auto;
}

.nav-dropdown-content a {
  display: block;
  padding: 11px 18px;
  color: var(--color-text-secondary);
  font-size: 0.83rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-left: 2px solid transparent;
  white-space: nowrap;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}
.nav-dropdown-content a:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-tertiary);
  border-left-color: var(--color-accent);
}

/* ── Éléments mobile cachés en desktop ────────────────────────── */

.nav-collapse-btn,
.nav-mobile-toggle,
.nav-overlay {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE ≤ 900px
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  /* Drawer latéral */
  .main-nav {
    position: fixed;
    top: 0;
    left: -290px;
    right: auto;
    width: 290px;
    height: 100vh;
    padding: 24px 16px;
    border-right: 1px solid var(--color-border);
    border-bottom: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    overflow-y: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
  }
  .main-nav.mobile-open {
    left: 0;
  }

  /* Logo dans le drawer */
  .nav-logo {
    justify-content: center;
    padding: 8px 0 20px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 8px;
  }
  .nav-logo img {
    height: 80px;
    position: static;
  }

  /* Bouton fermer */
  .nav-collapse-btn {
    display: flex;
    align-self: flex-end;
    padding: 6px 12px;
    margin-bottom: 12px;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-secondary);
    font-family: var(--font-family-base);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition:
      background 0.2s ease,
      color 0.2s ease;
  }
  .nav-collapse-btn::before {
    content: "✕ Fermer";
  }
  .nav-collapse-btn:hover {
    background: var(--color-border);
    color: var(--color-text-primary);
  }

  /* Menus verticaux */
  .nav-content {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    height: auto;
  }
  .nav-separator {
    display: block;
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 8px 0;
    opacity: 0.4;
  }
  .nav-dropdown {
    position: static;
    height: auto;
    display: block;
  }

  .nav-dropdown-toggle {
    width: 100%;
    height: auto;
    padding: 13px 16px;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    border-radius: 4px;
  }
  .nav-dropdown-toggle:hover,
  .nav-dropdown-toggle[aria-expanded="true"] {
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
  }

  .nav-dropdown-content {
    position: static;
    min-width: unset;
    box-shadow: none;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    margin: 3px 0 3px 8px;
    background: var(--color-bg-primary);
    opacity: 1;
    pointer-events: auto;
    overflow: hidden;
  }
  .nav-dropdown-toggle[aria-expanded="true"] + .nav-dropdown-content {
    max-height: 600px;
  }
  .nav-dropdown-content a {
    padding: 11px 16px;
    white-space: normal;
    font-size: 0.82rem;
  }
  .nav-dropdown-content a:hover {
    background: var(--color-bg-tertiary);
  }

  /* Overlay */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 998;
  }
  .nav-overlay.active {
    display: block;
  }

  /* Barre hamburger */
  .nav-mobile-toggle {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    align-items: center;
    padding: 0 16px;
    gap: 14px;
    z-index: 997;
  }

  .nav-mobile-toggle__burger {
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-tertiary);
    padding: 7px 11px;
    font-size: 1.1em;
    line-height: 1;
    flex-shrink: 0;
    cursor: pointer;
    transition:
      background 0.2s ease,
      color 0.2s ease,
      border-color 0.2s ease;
  }
  .nav-mobile-toggle__burger:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-text-quaternary);
    color: var(--color-text-primary);
  }

  .nav-mobile-toggle__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex: 1;
    min-width: 0;
  }
  .nav-mobile-toggle__logo img {
    height: 44px;
    width: auto;
    display: block;
    max-width: 100%;
    object-fit: contain;
  }

  body {
    padding-top: 64px !important;
    padding-left: 0 !important;
  }
}
