/* ============================================
   NAV — DESKTOP + MOBILE
   ============================================ */

#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.2rem 0;
  background: rgba(10, 10, 12, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: padding 0.3s ease, box-shadow 0.3s ease;
}

#nav.scrolled {
  padding: 0.85rem 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  background: rgba(10, 10, 12, 0.99);
}

#nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 2px;
  position: relative;
  z-index: 1001;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.logo:hover { opacity: 0.8; }
.logo-dot { color: #ff5252; }

/* ── Desktop links ── */
.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #a0a0a8;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  padding-bottom: 4px;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: #c62828;
  transition: width 0.2s ease;
}
.nav-links a:hover        { color: #fff; }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active        { color: #fff; }
.nav-links a.active::after { width: 100%; }

.nav-cta {
  background: #c62828;
  color: #fff;
  padding: 0.55rem 1.4rem;
  border-radius: 4px;
  font-weight: 700;
  transition: background 0.2s, transform 0.2s;
}
.nav-cta::after { display: none; }
.nav-cta:hover  { background: #e53935; transform: translateY(-2px); }

/* ── Hamburger ── */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 1101;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: all 0.3s ease;
  transform-origin: center;
}
.menu-toggle.active span { color: #c62828; }

.menu-toggle span:nth-child(1) { top: 14px; }
.menu-toggle span:nth-child(2) { top: 21px; }
.menu-toggle span:nth-child(3) { top: 28px; }

.menu-toggle.active span:nth-child(1) { top: 21px; transform: translateX(-50%) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { top: 21px; transform: translateX(-50%) rotate(-45deg); }

/* ── Mobile overlay ── */
@media (max-width: 900px) {
  .menu-toggle { display: flex; }
  body[style*="overflow: hidden"] .footer-logo {
    display: none !important;
  }
  
  /* ✅ Assicurati che il footer stia sotto */
  .footer {
    position: relative;
    z-index: 100;
  }
  .footer-logo{
    z-index: 100;
  }
  /* Forziamo il contenitore del bottone a diventare il primo elemento */
  .mobile-close-item {
    order: -1; 
    margin-bottom: 2rem; /* Un po' di spazio sotto la X */
    text-align: right;   /* Allineato a destra */
  }

  .nav-links {
    position: fixed;
    top: 70px; left: 0; right: 0; bottom: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: 0;
    gap: 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    min-height: 600px;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s ease;
    z-index: 1100;
    border-bottom: 2px solid #c62828;
  }

  .nav-links.active {
    max-height: none;
    overflow-y: auto;
    opacity: 1;
    padding: 1rem 0;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border-subtle);
    margin: 0 1.5rem;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s ease;
  }
  .nav-links.active li { opacity: 1; transform: translateY(0); }
  .nav-links.active li:nth-child(1) { transition-delay: 0.04s; }
  .nav-links.active li:nth-child(2) { transition-delay: 0.08s; }
  .nav-links.active li:nth-child(3) { transition-delay: 0.12s; }
  .nav-links.active li:nth-child(4) { transition-delay: 0.16s; }
  .nav-links.active li:nth-child(5) { transition-delay: 0.20s; }
  .nav-links.active li:nth-child(6) { transition-delay: 0.24s; border-bottom: none; }

  .nav-links a {
    display: block;
    padding: 1rem 0;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
  }
  .nav-links a::after { display: none; }
  .nav-links a:hover,
  .nav-links a.active { color: #fff; }

  .nav-cta {
    background: #c62828;
    color: #fff !important;
    padding: 0.7rem 1.2rem;
    border-radius: 4px;
    display: inline-block;
    margin: 0.3rem 0 0.8rem;
    font-size: 1rem;
  }
}

@media (max-width: 1100px) {
  .nav-links { gap: 1.8rem; }
  .nav-links a { font-size: 0.9rem; }
}
