/* Cornice allineata al sito: solo navbar, menu, footer. Non tocca #root. */
.navbar, .nav-links, .minimal-footer, #contatti {
  font-family: Inter, system-ui, sans-serif;
}
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  box-sizing: border-box;
}
body {
  padding-top: max(68px, calc(55px + env(safe-area-inset-top, 0px) + 12px));
  margin: 0;
}
#applet {
  min-height: 60vh;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: clip;
  position: relative;
}
#root {
  max-width: 1580px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
#contatti { scroll-margin-top: 90px; }

.navbar {
  position: fixed; top: 0; left: 0; width: 100%; max-width: 100vw;
  height: calc(55px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  padding-bottom: 0;
  background: #f9f6e2; box-shadow: 0 2px 10px rgba(0,0,0,.05);
  display: flex; justify-content: space-between; align-items: center;
  z-index: 950; box-sizing: border-box;
}
.brand {
  font-weight: bold; font-size: 0.92rem; letter-spacing: 1px;
  text-decoration: none; color: #050594;
}
.nav-controls { display: flex; flex-direction: row; align-items: center; gap: 18px; }
.search-trigger { display: flex; align-items: center; color: #050594; text-decoration: none; }
.search-icon { width: 22px; height: 22px; }
.hamburger {
  display: flex; flex-direction: column; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 5px;
  -webkit-tap-highlight-color: transparent;
}
.hamburger span.line-1, .hamburger span.line-2, .hamburger span.line-3 {
  display: block; width: 22px; height: 2px; background: #050594;
  transition: transform 0.15s ease, opacity 0.15s ease;
  -webkit-transition: -webkit-transform 0.15s ease, opacity 0.15s ease;
  transform-origin: center;
}
.hamburger.active .line-1 { transform: translateY(6px) rotate(45deg); -webkit-transform: translateY(6px) rotate(45deg); }
.hamburger.active .line-2 { opacity: 0; }
.hamburger.active .line-3 { transform: translateY(-6px) rotate(-45deg); -webkit-transform: translateY(-6px) rotate(-45deg); }

.nav-links {
  display: flex; flex-direction: column; position: absolute;
  top: calc(55px + env(safe-area-inset-top, 0px)); left: 0;
  width: 100%; max-width: 100vw; margin: 0;
  padding-top: 2rem;
  padding-left: max(2rem, env(safe-area-inset-left, 0px));
  padding-right: max(2rem, env(safe-area-inset-right, 0px));
  padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
  list-style: none; text-align: left;
  background: #f9f6e2; gap: 1rem; z-index: 951;
  box-shadow: 0 8px 20px rgba(5, 5, 148, 0.1);
  max-height: calc(100vh - 55px - env(safe-area-inset-top, 0px));
  max-height: calc(100dvh - 55px - env(safe-area-inset-top, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  -webkit-transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  -webkit-transition: opacity 0.18s ease, -webkit-transform 0.18s ease, visibility 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.nav-links.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  -webkit-transform: translateY(0);
}
.nav-links a { color: #050594; text-decoration: none; display: block; width: 100%; -webkit-tap-highlight-color: transparent; }
.nav-links .menu-title { font-size: 1.15rem; font-weight: 600; padding-left: 0.2rem; }
.nav-links .menu-subtitle { font-size: 0.95rem; font-weight: 400; padding-left: 1.5rem; }

.nav-overlay {
  position: fixed;
  top: calc(55px + env(safe-area-inset-top, 0px)); left: 0; width: 100%; max-width: 100vw;
  height: calc(100vh - 55px - env(safe-area-inset-top, 0px));
  height: calc(100dvh - 55px - env(safe-area-inset-top, 0px));
  background: rgba(5, 5, 148, 0.12);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; z-index: 949;
  transition: opacity 0.18s ease;
  -webkit-transition: opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.nav-overlay.active { opacity: 1; pointer-events: auto; }
html.menu-aperto, body.menu-aperto { overflow: hidden; overscroll-behavior: none; }

#contatti {
  margin-top: 40px; padding-top: 25px; border-top: 1px solid #000;
  text-align: center;
  display: flex !important;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  gap: clamp(8px, 3.5vw, 36px);
  padding-left: max(10px, env(safe-area-inset-left, 0px));
  padding-right: max(10px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}
#contatti .footer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0 !important;
}
@media (max-width: 480px) {
  #contatti {
    gap: clamp(8px, 3.5vw, 24px);
  }
}
.minimal-footer {
  text-align: center;
  padding: 3rem 1rem calc(3rem + env(safe-area-inset-bottom, 0px)) 1rem;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  margin-top: 2rem;
  color: #000; background: #fff;
}
.minimal-footer .copyright { font-weight: bold; font-size: 1rem; margin-bottom: 0.8rem; }
.minimal-footer .legal-links { font-size: 0.85rem; }
.minimal-footer .legal-links a { color: #000; text-decoration: underline; font-weight: 400; }
.minimal-footer .legal-links .separator { margin: 0 0.5rem; color: #000; opacity: 0.4; }
