:root {
  --color-bg: #f5f5f5;
  --color-bg-alt: #ffffff;
  
  /* NUOVI COLORI BLU */
  --color-primary: #004e92;      /* Blu principale del logo */
  --color-primary-dark: #003366; /* Blu più scuro per l'hover */
  
  --color-text: #222222;
  --color-muted: #666666;
  --color-border: #dddddd;
  --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.08);
  --radius-lg: 18px;
  --radius-xl: 28px;
  --max-width: 1100px;
  --header-height: 70px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Layout di base */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 4.5rem 0;
}

section:nth-of-type(even) {
  background-color: var(--color-bg-alt);
}

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.section-intro {
  max-width: 650px;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.98rem;
}

/* Header & nav */

header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 1rem;
  text-transform: uppercase;
}

.logo span {
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  font-size: 0.95rem;
}

.nav-links a {
  position: relative;
  padding-bottom: 0.2rem;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width 0.2s ease-out;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.nav-phone {
  font-weight: 600;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0.3rem;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #333;
  margin: 4px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Hero */

#home {
  padding-top: calc(var(--header-height) + 3rem);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  /* MODIFICATO: Sfondo blu molto chiaro */
  background: rgba(0, 78, 146, 0.08); 
  color: var(--color-primary-dark);
  margin-bottom: 0.8rem;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-primary);
}

.hero-title {
  font-size: clamp(2.1rem, 3vw, 2.7rem);
  margin-bottom: 0.8rem;
}

.hero-title span {
  color: var(--color-primary);
}

.hero-subtitle {
  color: var(--color-muted);
  max-width: 550px;
  margin-bottom: 1.5rem;
  font-size: 0.98rem;
}

.hero-list {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1.8rem;
  font-size: 0.95rem;
}

.hero-list li::before {
  content: "✔";
  margin-right: 0.4rem;
  color: var(--color-primary);
  font-size: 0.85rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

.hero-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.hero-media {
  position: relative;
}

.hero-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  /* MODIFICATO: Gradiente blu */
  background: radial-gradient(
    circle at top right,
    rgba(0, 78, 146, 0.2), /* Blu al 20% di opacità */
    transparent 60%
  );
  opacity: 0.9;
  pointer-events: none;
}

.hero-stats {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
}

.stat {
  flex: 1;
}

.stat-strong {
  font-size: 1.1rem;
  font-weight: 700;
  display: block;
}

.stat-label {
  color: var(--color-muted);
}

/* Pulsanti */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
  /* MODIFICATO: Ombra blu */
  box-shadow: 0 8px 18px rgba(0, 78, 146, 0.35);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-1px);
  /* MODIFICATO: Ombra blu più intensa */
  box-shadow: 0 10px 22px rgba(0, 78, 146, 0.4);
}

.btn-outline {
  border: 1px solid var(--color-border);
  background-color: #fff;
  color: var(--color-text);
}

.btn-outline:hover {
  background-color: #f0f0f0;
  transform: translateY(-1px);
}

.btn-whatsapp {
  background-color: #25d366;
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:hover {
  background-color: #1ebe5d;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp svg {
  margin-right: 8px;
}

/* Servizi */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.card p {
  font-size: 0.95rem;
  color: var(--color-muted);
}

.chip {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.04);
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* Chi siamo */

.two-cols {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: start;
}

.muted {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.highlight-box {
  background-color: var(--color-bg-alt);
  padding: 1.3rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  font-size: 0.9rem;
}

/* Galleria Slider */

.photo-slider {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 1.5rem;
  cursor: grab;
  /* Nasconde scrollbar su IE, Edge e Firefox */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.photo-slider::-webkit-scrollbar {
  display: none; /* Nasconde scrollbar su Chrome, Safari e Opera */
}

.slider-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
}

.slider-item {
  /* Assicurati che questa regola esista per mantenere gli angoli tondi */
  border-radius: var(--radius-lg); 
  overflow: hidden; /* Taglia l'immagine che esce dai bordi tondi */
  /* ... le altre regole come width e shadow lasciale uguali ... */
}

.slider-item img {
  width: 100%;
  height: 300px;       /* AUMENTA questo valore (prima era 200px). Ora che non c'è testo, falle più alte! */
  object-fit: cover;   /* FONDAMENTALE: Riempie il riquadro senza deformare la foto (la taglia se necessario) */
  object-position: center; /* Centra l'immagine. Puoi mettere anche 'top' se i cancelli vengono tagliati in alto */
  display: block;      /* Toglie eventuali spazietti bianchi fastidiosi sotto l'immagine */
}

.slider-item:hover {
  transform: translateY(-5px);
}



.slider-caption {
  padding: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

/* FAQ */

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  gap: 0.8rem;
}

details {
  background-color: var(--color-bg-alt);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow-soft);
  font-size: 0.95rem;
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  float: right;
  font-weight: 700;
}

details[open] summary::after {
  content: "−";
}

details p {
  margin-top: 0.5rem;
  color: var(--color-muted);
}

/* --- SEZIONE PREVENTIVO E CONTATTI (NUOVA) --- */

/* Form Generico */
form {
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  font-size: 0.95rem;
}

.form-row {
  margin-bottom: 0.9rem;
}

label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-size: 0.9rem;
}

input,
textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  padding: 0.55rem 0.7rem;
  font: inherit;
  resize: vertical;
  min-height: 40px;
}

input:focus,
textarea:focus {
  /* MODIFICATO: Bordo blu */
  outline: 2px solid rgba(0, 78, 146, 0.35);
  border-color: var(--color-primary);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.form-message {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  display: none;
}

.form-message.success {
  color: #1e8449;
}

.form-message.error {
  color: #c0392b;
}

/* Stili specifici per la sezione Preventivo centrata */
.form-container-centered {
  max-width: 600px;
  margin: 0 auto;
}

/* Stili per la sezione Dove Siamo / Contatti */
.contact-info-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.5fr; /* Info strette, mappa larga */
  gap: 3rem;
  align-items: center;
}

.contact-details {
  font-size: 1.05rem;
  line-height: 2; /* Più leggibile */
  color: var(--color-muted);
}

.contact-details strong {
  color: var(--color-text);
}

/* Stili per la Mappa */
.map-container .google-map {
  width: 100%;
  height: 350px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 0;
  margin: 0;
}

/* Mappa Responsive (utile anche se usata altrove) */
.google-map {
  width: 100%;
  height: 300px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* Footer */

footer {
  padding: 1.5rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.8rem;
  color: var(--color-muted);
  background-color: #ffffff;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

/* Responsività Globale */

@media (max-width: 900px) {
  .hero-inner,
  .two-cols {
    grid-template-columns: 1fr;
  }

  .hero-media {
    order: -1;
  }

  /* Ora i servizi sono uno sotto l'altro già da 900px in giù */
  .cards {
    grid-template-columns: 1fr; 
  }

  /* Opzionale: se vuoi anche le recensioni una sotto l'altra, cambia anche qui in 1fr */
  .reviews-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
  }

  /* ... il resto rimane uguale ... */
  .contact-info-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .contact-buttons {
    display: flex;
    justify-content: center;
  }
}

/* --- STILE RESPONSIVE ELEGANTE (A TENDINA) --- */

/* Regola base per il wrapper su Desktop: li allinea a destra */
.nav-wrapper {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

@media (max-width: 720px) {
  header {
    height: auto;
    /* Importante per far scivolare il menu "sopra" il contenuto */
    overflow: visible; 
  }

  .nav {
    padding-top: 1rem;
    padding-bottom: 1rem;
    position: relative; /* Serve da riferimento per il menu assoluto */
  }

  /* Nascondiamo il menu desktop standard */
  .nav-desktop, 
  .nav-links,
  .nav-cta {
    display: block; /* Reset del display per gestirli dentro il wrapper */
    width: 100%;
  }

  /* Configurazione del MENU A TENDINA */
  .nav-wrapper {
    position: absolute;
    top: 100%; /* Si attacca esattamente sotto l'header */
    left: 0;
    width: 100%;
    background-color: #ffffff;
    
    /* Layout interno verticale */
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem;
    gap: 1.5rem;
    
    /* Ombra elegante per staccarlo dalla pagina */
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);

    /* --- ANIMAZIONE --- */
    /* Stato iniziale: invisibile e spostato in su */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    
    /* Transizione fluida */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: -1; /* Sta sotto l'header finché non scende */
  }

  /* QUANDO IL MENU È APERTO (.nav-open aggiunto da JS) */
  .nav-open .nav-wrapper {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* Scivola nella posizione naturale */
    z-index: 999;
  }

  /* Stile dei link nel menu mobile */
  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    text-align: center;
  }

  .nav-links a {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text);
    display: block;
    padding: 5px;
  }

  /* Stile CTA nel menu mobile */
  /* Stile CTA nel menu mobile - AFFIANCATI */
  .nav-cta {
    display: flex;
    flex-direction: row; /* Ora sono in riga! */
    align-items: center;
    gap: 0.8rem; /* Spazio un po' più piccolo per farli entrare */
    width: 100%;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
  }

  /* Riguardo i pulsanti dentro il menu mobile */
  .nav-cta .btn {
    flex: 1;      /* "Flex 1" significa: dividetevi lo spazio 50% e 50% */
    width: auto;  /* Togliamo la larghezza fissa */
    padding: 0.7rem 0.5rem; /* Riduciamo un pelo il padding laterale se il testo è lungo */
    justify-content: center;
    font-size: 0.9rem; /* Testo leggermente più piccolo per sicurezza */
  }

  /* Mostra il bottone hamburger */
  .menu-toggle {
    display: block;
  }
  
  /* Animazione hamburger (Opzionale: lo trasforma in X) */
  .nav-open .menu-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }
  .nav-open .menu-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}

@media (max-width: 480px) {
  h2 {
    font-size: 1.6rem;
  }

  .hero-title {
    font-size: 1.8rem;
  }
}

/* --- NUOVO STILE RECENSIONI --- */

.reviews-grid {
  display: grid;
  /* Crea colonne automatiche: se c'è spazio ne mette 3, altrimenti 2 o 1 */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
  gap: 2rem;
}

.review {
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.03);
  
  /* Flexbox verticale per allineare tutto alla stessa altezza */
  display: flex;
  flex-direction: column;
  height: 100%; 
  position: relative;
  overflow: hidden;
}

/* Aggiunge il virgolettone gigante sullo sfondo */
.review::before {
  content: "“";
  position: absolute;
  top: -15px;
  right: 20px;
  font-size: 6rem;
  color: var(--color-primary);
  opacity: 0.1; /* Molto trasparente */
  font-family: serif;
  line-height: 1;
  pointer-events: none;
}

.stars {
  color: #f1c40f;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

.review p {
  font-size: 0.95rem;
  color: var(--color-text);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  flex-grow: 1; /* Spinge l'autore sempre in basso */
}

.review-author {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Trattino colorato prima del nome */
.review-author::before {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--color-primary);
}

/* --- LIGHTBOX (ZOOM IMMAGINI) --- */

/* 1. Cambiamo il cursore sulle immagini della galleria per far capire che sono cliccabili */
.slider-item img {
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.slider-item img:hover {
  transform: scale(1.03); /* Leggero zoom all'hover */
}

/* 2. Il contenitore scuro a tutto schermo (inizialmente nascosto) */
.lightbox {
  display: none; /* Nascosto di default */
  position: fixed;
  z-index: 2000; /* Sopra a tutto, anche all'header */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9); /* Sfondo nero quasi opaco */
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Quando aggiungiamo questa classe via JS, il lightbox diventa visibile */
.lightbox.show {
  display: flex;
  opacity: 1;
}

/* 3. L'immagine ingrandita */
.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90vh;
  border-radius: 5px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  animation-name: zoom;
  animation-duration: 0.3s;
}

/* Animazione di apertura */
@keyframes zoom {
  from {transform:scale(0.8); opacity: 0} 
  to {transform:scale(1); opacity: 1}
}

/* 4. Il pulsante di chiusura (X) */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 2001;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: var(--color-primary); /* Usa il tuo nuovo blu */
  text-decoration: none;
  cursor: pointer;
}

/* Adattamento per mobile */
@media only screen and (max-width: 700px){
  .lightbox-content {
    width: 95%;
  }
  .lightbox-close {
    top: 10px;
    right: 20px;
  }
}