html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Mulish', sans-serif;
  color: #002147;
  background: #f5f5f5;
  overflow-x: hidden;
}

/* ===== PROGRESS BAR ===== */
.scroll-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 7px;
  background: #C3A600; 
  width: 0;
  z-index: 1500;
  transition: width 0.1s ease-out;
}

/* ===== HEADER ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 2rem;
  background: rgba(0, 33, 71, 0.95);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-top: 3px solid #C3A600;
  border-bottom: 3px solid #C3A600;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

header.scrolled {
  width: 95%;
  left: 2.5%;
  border-radius: 12px;
  padding: 0.7rem 1.8rem;
  background: rgba(0, 33, 71, 0.85);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ===== LOGO TEXT ===== */
.logo a {
  font-weight: 700;
  color: #fff;
  font-size: 1.6rem;
  text-shadow: 2px 2px 4px #C3A600;
  text-decoration: none;
  transition: font-size 0.3s ease;
}

header.scrolled .logo a {
  font-size: 1.3rem;
}

/* ===== NAV MENU ===== */
nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow: hidden;
}

nav a {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: transparent;
  color: #C3A600;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid #C3A600;
  border-radius: 6px;
  position: relative;
  transition: all 0.3s ease;
}

nav a::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 0.5px solid #C3A600;
  border-radius: 8px;
  pointer-events: none;
}

nav a::after {
  content: "";
  display: block;
  height: 2px;
  background: #002147; /* Highlight navy */
  width: 0;
  transition: width 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

nav a:hover,
nav a.active {
  background: #C3A600;
  color: #002147;
}

nav a:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(195, 166, 0, 0.5);
}

header.scrolled nav a {
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
}

/* ===== HERO ===== */
main {
  padding-top: 80px;
}

.hero {
  position: relative;
  text-align: center;
  padding: 6rem 2rem;
  color: #002147;
  overflow: hidden; /* per sicurezza */
  border-bottom: 3px solid #C3A600;
  border-top: 2px solid #C3A600;
}

/* L’immagine sotto */
.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('../img/sfondoProva.jpg') center/cover no-repeat;
  z-index: -2;
}

/* Il livello vetro */
.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: -1;
}


.hero-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.hero-logo {
  height: 280px;
  width: auto;
}

.hero h1 {
  font-weight: 700;
  font-size: 2.8rem;
  margin: 0;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 2rem auto;
}

.hero-btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  background: #002147; /* blu navy di base */
  color: #C3A600;      /* testo oro su blu */
  text-decoration: none;
  font-weight: 600;
  border: 2px solid #C3A600;
  border-radius: 6px;
  position: relative;
  transition: all 0.3s ease;
  font-size: 1.1rem; 
}

.hero-btn::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 0.5px solid #fff;
  border-radius: 8px;
  pointer-events: none;
}

.hero-btn:hover {
  background: #C3A600; /* al passaggio diventa oro pieno */
  color: #002147;      /* testo blu navy */
}

/* ===== SECTIONS ===== */


.content-section {
  padding: 5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  border-top: 2px solid #C3A600;
  border-bottom: 2px solid #C3A600;
}

.content-section h2 {
  font-size: 2rem;
  color: #002147;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.content-section > p {
  font-size: 1.1rem;
  color: #002147;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.service-item {
  margin-bottom: 2rem;
}

.service-item h3 {
  font-size: 1.3rem;
  color: #002147;
  margin-bottom: 0.5rem;
}

.service-item p {
  font-size: 1.1rem;
  color: #002147;
  line-height: 1.6;
}

.content-section::before {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: #C3A600;
  margin: 0 auto 1rem;
}


/*
.content-section:nth-of-type(odd) {
  background: #f9f9f9;
}

.content-section:nth-of-type(even) {
  background: #fff;
}
*/

/* ===== Contact ===== */

.contact-info p {
  font-size: 1.1rem;
  color: #002147;
  margin-bottom: 0.5rem;
}

.contact-info a {
  color: #C3A600;
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.contact-map {
  margin-top: 2rem;
  border: 2px solid #C3A600;
  border-radius: 8px;
  overflow: hidden;
}

/* ===== FOOTER ===== */
footer {
  background: #002147;
  color: #fff;
  padding: 2rem 1rem;
  border-top: 3px solid #C3A600;
  border-bottom: 3px solid #C3A600;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-col {
  text-align: center;
}

.footer-logo {
  max-width: 150px;
  height: auto;
}

.footer-col p,
.footer-col small {
  margin: 0.5rem 0;
}

.footer-col a {
  color: #C3A600;
  text-decoration: none;
}

.footer-col a:hover {
  text-decoration: underline;
}

/* ===== FLOATING BUTTON ===== */

.floating-buttons {
  position: fixed;
  bottom: 3rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  z-index: 2000;
}

.float-btn {
  background: #002147;
  border: 2px solid #C3A600;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  padding: 0;
}

.float-btn:hover {
  background: #C3A600;
  color: #002147;
  transform: scale(1.1);
}

.flag-icon {
  width: 60%;
  height: auto;
  border-radius: 50%;
}

/* Bottone torna su */
#top-btn {
  font-size: 1.5rem;
  color: #C3A600;
  background: #002147;
  border: 2px solid #C3A600;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: none; /* inizialmente nascosto */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  padding: 0;
}

@keyframes fadeZoomIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#top-btn.show {
  display: flex;
  animation: fadeZoomIn 0.3s ease;
}

/*===== COOKIE =====*/
.modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #002147;
  color: #fff;
  border: 2px solid #C3A600;
  border-radius: 8px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  text-align: left;
}

.modal-content h2 {
  color: #C3A600;
  margin-top: 0;
  text-align: center;
}

.modal-body p {
  line-height: 1.6;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.modal-body ul {
  margin: 0;
  padding-left: 1.2rem;
}

.modal-body li {
  margin-bottom: 0.5rem;
}

.modal-close {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #C3A600;
  color: #002147;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.modal-close:hover {
  background: #fff;
  color: #002147;
}

.modal-content a {
  color: #C3A600; /* oro */
  text-decoration: none;
}

.modal-content a:hover {
  text-decoration: underline;
}

/* Hamburger base: nascosto su desktop */
.hamburger {
  display: none;
  font-size: 2rem;
  background: none;
  border: none;
  color: #C3A600;
  cursor: pointer;
}

/* Menu mobile */
@media (max-width: 768px) {
  header {
    display: flex;
    flex-direction: row !important; /* forza riga anche se altro CSS interviene */
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* evita che vada a capo */
  }

  .logo {
    flex: 1 1 auto;
  }

  .hamburger {
    display: block;
    font-size: 2rem;
    background: none;
    border: none;
    color: #C3A600;
    cursor: pointer;
    margin-left: 1rem; /* aggiusta spazio se serve */
  }

  nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 33, 71, 0.95);
    display: none;
    flex-direction: column;
    align-items: flex-start;
  }

  nav.show {
    display: flex;
  }

  nav ul {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  nav li {
    width: 100%;
  }

  nav a {
    display: block;
    width: 100%;
    padding: 1rem;
    border: none;
    border-bottom: 1px solid #C3A600;
    text-align: left;
  }

  nav a::before,
  nav a::after {
    display: none;
  }
}




/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 992px) {
  header {
    padding: 0.7rem 1rem;
  }

  .logo a {
    font-size: 1.3rem;
  }

  nav ul {
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero {
    padding: 4rem 1rem;
  }

  .hero-logo {
    height: 180px;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-btn {
    font-size: 1rem;
    padding: 0.6rem 1.4rem;
  }

  .content-section {
    padding: 3rem 1rem;
  }

  .footer-grid {
    gap: 1rem;
  }
}

/* Mobile */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .hero-logo {
    height: 140px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .hero-btn {
    width: 100%;
    text-align: center;
  }

  .content-section h2 {
    font-size: 1.5rem;
  }

  .service-item h3 {
    font-size: 1.1rem;
  }

  .contact-map iframe {
    height: 200px;
  }

  .floating-buttons {
    bottom: 1rem;
    right: 0.5rem;
  }

  .float-btn,
  #top-btn {
    width: 50px;
    height: 50px;
  }

  .flag-icon {
    width: 50%;
  }
}
