/* ══════════════════════════════════════════════
   HEADER + NAV + BURGER + MOBILE MENU
   UNICO FILE, IDENTICO SU TUTTE LE PAGINE
   Caricato DOPO il CSS di pagina per override
   ══════════════════════════════════════════════ */

/* ── HEADER ── */
header {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: 100 !important;
  background: rgba(40, 56, 93, 0.97) !important;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(189, 44, 51, 0.2) !important;
  transition: all 0.3s ease;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.header-left { display: flex; align-items: center; gap: 0; }

.logo-mark, .logo-full {
  width: auto;
  display: block;
  transition: opacity 0.35s ease;
}
.logo-mark { height: 56px; }
.logo-full { height: 44px; display: none; }
header.scrolled .logo-mark { display: none; }
header.scrolled .logo-full { display: block; }

.header-name {
  font-family: 'EB Garamond', serif;
  color: var(--white, #fff);
  font-size: 12px;
  letter-spacing: 0.22em;
  line-height: 1.35;
  text-transform: uppercase;
  padding-left: 20px;
  margin-left: 20px;
  border-left: 1px solid rgba(255,255,255,0.18);
  transition: opacity 0.3s ease, max-width 0.35s ease, padding 0.35s ease, margin 0.35s ease, border-color 0.35s ease;
  max-width: 280px;
  overflow: hidden;
  white-space: nowrap;
}
.header-name span:first-child {
  font-style: italic;
  color: var(--red-light, #d4464d);
  letter-spacing: 0.18em;
}
header.scrolled .header-name {
  opacity: 0;
  max-width: 0;
  padding-left: 0;
  margin-left: 0;
  border-left-color: transparent;
}

/* ── NAV ── */
header nav {
  display: flex !important;
  align-items: center !important;
  gap: 36px !important;
}

header nav a {
  text-decoration: none !important;
  color: rgba(255,255,255,0.75) !important;
  font-size: 10px !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase !important;
  font-weight: 500 !important;
  transition: color 0.2s;
  position: relative;
}

header nav a.active { color: var(--white, #fff) !important; }

header nav a .num {
  display: block !important;
  font-size: 8px !important;
  color: var(--red, #bd2c33) !important;
  margin-bottom: 1px !important;
  font-family: 'EB Garamond', serif !important;
  font-style: italic !important;
  letter-spacing: 0.1em !important;
}

header nav a:hover { color: var(--red, #bd2c33) !important; }

header nav a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 1px;
  background: var(--red, #bd2c33);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

header nav a:hover::after,
header nav a.active::after { transform: scaleX(1); }

/* ── BURGER ── */
.burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 200;
  position: relative;
  width: 38px;
  height: 38px;
}

.burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--white, #fff);
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.burger span + span { margin-top: 6px; }

.burger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ── MOBILE MENU ── */
.mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 150;
  background: var(--navy, #28385d);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 80px 48px 60px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  overflow-y: auto;
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(189,44,51,0.05) 60%,
    rgba(189,44,51,0.08) 100%
  );
  pointer-events: none;
}

.mobile-menu-logo {
  position: absolute;
  top: 22px; left: 24px;
  height: 40px;
  width: auto;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.mobile-menu.open .mobile-menu-logo {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 320px;
  position: relative;
  z-index: 2;
}

.mobile-nav a {
  text-decoration: none;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 400;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: baseline;
  gap: 12px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.2s;
}

.mobile-nav a .num {
  font-size: 10px;
  color: var(--red, #bd2c33);
  font-family: 'EB Garamond', serif;
  font-style: italic;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.mobile-nav a:hover,
.mobile-nav a.active { color: var(--red, #bd2c33); }

.mobile-menu.open .mobile-nav a:nth-child(1) { transition-delay: 0.18s; }
.mobile-menu.open .mobile-nav a:nth-child(2) { transition-delay: 0.25s; }
.mobile-menu.open .mobile-nav a:nth-child(3) { transition-delay: 0.32s; }
.mobile-menu.open .mobile-nav a:nth-child(4) { transition-delay: 0.39s; }
.mobile-menu.open .mobile-nav a:nth-child(5) { transition-delay: 0.46s; }

.mobile-menu.open .mobile-nav a {
  opacity: 1;
  transform: translateX(0);
}

.mobile-contact {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease 0.55s, transform 0.3s ease 0.55s;
}

.mobile-menu.open .mobile-contact {
  opacity: 1;
  transform: translateY(0);
}

.mobile-contact a {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  letter-spacing: 0.08em;
  font-weight: 300;
  transition: color 0.2s;
}

.mobile-contact a:hover { color: var(--red, #bd2c33); }

/* ── HEADER RESPONSIVE ── */
@media (max-width: 768px) {
  header nav { display: none !important; }
  .burger { display: block !important; }

  .header-inner {
    padding: 0 24px !important;
    height: 70px !important;
  }
  .logo-mark { height: 42px !important; }
  .logo-full { height: 34px !important; }
  .header-name {
    font-size: 9px !important;
    letter-spacing: 0.18em !important;
    padding-left: 12px !important;
    margin-left: 12px !important;
  }
}

@media (max-width: 480px) {
  .header-inner { padding: 0 18px !important; height: 64px !important; }
  .logo-mark { height: 38px !important; }
  .logo-full { height: 30px !important; }
  .header-name { display: none !important; }
}
