/* nav.css — Fatima Rabia Immobilier
   Complète main.css — aucun reset global, aucune redéfinition de variables.
   ------------------------------------------------------------------ */

/* ── Desktop nav wrapper ─────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  flex: 1;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: .1rem;
  list-style: none;
  padding: 0;
  margin: 0;
  height: var(--header-h, 72px);
}

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

/* ── Liens et boutons de nav ─────────────────────────────────────── */
.nav__link,
.nav__toggle {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .5rem .75rem;
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  font-size: .9rem;
  font-weight: 500;
  color: var(--clr-text, #1a1a2e);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm, 4px);
  white-space: nowrap;
  position: relative;
  transition: color .2s ease, background .2s ease;
}

.nav__link:hover,
.nav__toggle:hover {
  color: var(--clr-primary, #1a3c5e);
  background: rgba(26, 60, 94, .06);
}

/* Indicateur actif — barre or en bas */
.nav__link.active,
.nav__toggle.active {
  color: var(--clr-primary, #1a3c5e);
  font-weight: 600;
}

.nav__link.active::after,
.nav__toggle.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: .5rem;
  right: .5rem;
  height: 2px;
  background: var(--clr-accent, #c9a84c);
  border-radius: 2px 2px 0 0;
}

/* ── Chevron ─────────────────────────────────────────────────────── */
.nav__caret {
  font-size: .65rem;
  color: var(--clr-text-muted, #6b7280);
  line-height: 1;
  transition: transform .2s ease;
}

.has-submenu:hover .nav__caret,
.has-submenu:focus-within .nav__caret {
  transform: rotate(180deg);
}

/* ── Buffer invisible (évite le gap entre lien et dropdown) ─────── */
.has-submenu::after {
  content: "";
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  height: 12px;
}

/* ── Dropdown ────────────────────────────────────────────────────── */
.submenu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 210px;
  background: var(--clr-white, #fff);
  border: 1px solid var(--clr-border, #e5e0d8);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(10, 20, 35, .14);
  padding: .4rem;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity .2s ease,
    transform .2s ease,
    visibility .2s ease;
  z-index: 200;
}

.has-submenu:hover .submenu,
.has-submenu:focus-within .submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.submenu li {
  list-style: none;
}

/* Liens du dropdown */
.submenu__link {
  display: block;
  padding: .6rem .875rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--clr-text, #1a1a2e);
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.submenu__link:hover,
.submenu__link:focus-visible {
  background: var(--clr-bg, #f8f7f4);
  color: var(--clr-primary, #1a3c5e);
}
.submenu__link.active {
  color: var(--clr-primary, #1a3c5e);
  font-weight: 600;
  background: var(--clr-bg, #f8f7f4);
}
/* Rétrocompatibilité — les <a> directs dans .submenu */
.submenu a {
  display: block;
  padding: .6rem .875rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--clr-text, #1a1a2e);
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.submenu a:hover { background: var(--clr-bg, #f8f7f4); color: var(--clr-primary, #1a3c5e); }
.submenu a.active { color: var(--clr-primary, #1a3c5e); font-weight: 600; background: var(--clr-bg, #f8f7f4); }

/* ── Séparateur de section dans le dropdown ─────────────────────── */
.submenu__section-label {
  padding: .75rem .875rem .3rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--clr-accent, #c9a84c);
  list-style: none;
  pointer-events: none;
}
.submenu__section-label:not(:first-child) {
  margin-top: .25rem;
  border-top: 1px solid var(--clr-border, #e5e0d8);
  padding-top: .75rem;
}

/* ── Ligne de séparation ─────────────────────────────────────────── */
.submenu__divider {
  height: 1px;
  background: var(--clr-border, #e5e0d8);
  margin: .35rem .875rem;
  list-style: none;
}

/* ── Dropdown large (2 colonnes) ────────────────────────────────── */
.submenu--wide {
  min-width: 320px;
  columns: 2;
  column-gap: 0;
}
.submenu--wide li {
  break-inside: avoid;
}
.submenu--wide .submenu__section-label,
.submenu--wide .submenu__divider {
  column-span: all;
}

/* ── Liens désactivés ────────────────────────────────────────────── */
.disabled-link {
  display: block;
  padding: .6rem .875rem;
  font-size: .875rem;
  border-radius: 8px;
  color: var(--clr-text-muted, #6b7280);
  cursor: default;
  opacity: .55;
  text-decoration: none;
}
.disabled-link:hover {
  background: none !important;
  color: var(--clr-text-muted, #6b7280) !important;
  cursor: default;
}

/* ── Mobile : labels de section ─────────────────────────────────── */
.mobile-sub__label {
  padding: .65rem 1rem .3rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--clr-accent, #c9a84c);
  list-style: none;
  pointer-events: none;
}
.mobile-sub__label:not(:first-child) {
  margin-top: .25rem;
  border-top: 1px solid var(--clr-border, #e5e0d8);
  padding-top: .65rem;
}
.mobile-sub__divider {
  height: 1px;
  background: var(--clr-border, #e5e0d8);
  margin: .35rem 1rem;
  list-style: none;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .nav__link,
  .nav__toggle {
    padding-inline: .55rem;
    font-size: .85rem;
  }
}

@media (max-width: 768px) {
  /* Le nav desktop est masqué — la burger + nav-mobile prend le relais */
  .nav {
    display: none;
  }
}
