/* ==========================================================================
   LEGACI — Navigation & mise en page (mobile-first)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(243, 236, 224, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}
.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(32, 28, 24, 0.1);
  background: rgba(243, 236, 224, 0.98);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: 0.7rem;
}

.logo-link { display: flex; align-items: center; gap: 0.7rem; min-width: 0; flex-shrink: 0; }

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  width: 46px;
  height: 46px;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--legaci-blue);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: background 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
}
.nav-toggle:active { transform: scale(0.94); }
.nav-toggle:hover { background: var(--sand-deep); }

/* Mobile : menu plein écran, ouvert/fermé via classe .open */
.main-nav {
  display: none;
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  background: var(--white);
  flex-direction: column;
  align-items: stretch;
  padding: var(--space-4) var(--gutter) var(--space-5);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 99;
}
.main-nav.open { display: flex; }

.nav-close {
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sand);
  border: 1.5px solid var(--line);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0 0 var(--space-2) 0;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--legaci-blue);
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
}
.nav-close:active { transform: scale(0.94); }
.nav-close:hover { background: var(--sand-deep); }

.main-nav ul { list-style: none; display: flex; flex-direction: column; gap: 0; width: 100%; }
.main-nav > ul > li { width: 100%; border-bottom: 1px solid var(--line); }

.main-nav a.nav-link {
  position: relative;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.9rem 0.1rem;
  color: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.main-nav a.nav-link:hover { color: var(--legaci-red); }

.has-submenu > a.nav-link::after {
  content: '▾';
  font-size: 0.8rem;
  color: var(--ink-soft);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.has-submenu.open > a.nav-link::after { transform: rotate(180deg); }

.has-submenu > .submenu {
  display: none;
  list-style: none;
  padding: 0 0 0.6rem 0.8rem;
  border-left: 2px solid var(--legaci-red);
  margin: 0 0 0.6rem 0.3rem;
}
.has-submenu.open > .submenu { display: block; }
.submenu li a {
  display: block;
  padding: 0.6rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: 4px;
}
.submenu li a:hover { background: var(--sand); color: var(--legaci-red); }

/* Liens de compte compacts, en bas du menu principal (pas de bouton séparé) */
.nav-account-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  width: 100%;
}
.nav-account-links a {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--legaci-blue);
  color: var(--legaci-blue);
}
.nav-account-links a.highlight {
  background: var(--legaci-red);
  border-color: var(--legaci-red);
  color: var(--white);
}

/* Le bouton menu principal (☰) affiche toujours le même icône —
   la fermeture se fait via la croix dans le panneau, pas ici. */
.nav-toggle { font-size: 1.3rem; }

/* Footer */
.site-footer {
  background: var(--legaci-blue);
  color: var(--sand);
  padding-block: var(--space-5) var(--space-3);
  margin-top: var(--space-6);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
  color: var(--clay-light);
}
.footer-grid a { display: block; padding: 0.3rem 0; font-size: 0.92rem; opacity: 0.9; }
.footer-grid a:hover { opacity: 1; text-decoration: underline; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  font-size: 0.78rem;
  opacity: 0.8;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

.whatsapp-float {
  position: fixed;
  bottom: 1.1rem;
  right: 1.1rem;
  background: #25D366;
  color: white;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  z-index: 90;
  font-size: 1.5rem;
}

.back-to-top {
  position: fixed;
  bottom: 1.1rem;
  left: 1.1rem;
  background: var(--legaci-blue);
  color: white;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  z-index: 90;
  font-size: 1.15rem;
  border: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.15s ease;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--legaci-blue-light); }

.build-credit {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  opacity: 0.7;
}
.build-credit a { text-decoration: underline; }
