html {
  scroll-behavior: smooth;
}

/* Reset base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  color: #4d4c4c;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

#about,
#services,
#gallery,
#contact {
  scroll-margin-top: 96px;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(27, 69, 115, 0.06);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  max-width: 1000px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.2rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1b4573;
  text-decoration: none !important;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(27, 69, 115, 0.08);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.96);
  color: #16395f;
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(27, 69, 115, 0.12), 0 6px 14px rgba(27, 69, 115, 0.08);
}

/* Hero */
#hero {
  text-align: center;
  padding: 0.1rem 0.1rem;
}
#hero .hero-content {
  width: 100%;
  max-width: 100%;
}
#hero .hero-content picture {
  display: block;
}
#hero .hero-content img {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 0 auto 0.1rem;
}
#hero h1 {
  font-size: 2rem;
  margin-top: 0.2rem;
  margin-bottom: 1rem;
  color: #4d4c4c;
}

@media (min-width: 601px) {
  #hero .hero-content img {
    margin-bottom: 0;
  }

  #hero h1 {
    margin-top: 0;
  }
}

/* About */
#about {
  background: #1b4573;
  color: #ffffff;
  padding: 3rem 1rem;
}
.about-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
  margin: 0 auto;
  gap: 2rem;
}
.about-image,
.about-text {
  flex: 1 1 300px;
}
.about-text {
  text-align: left;
}
.about-image img {
  width: 100%;
  max-width: 400px;
  max-height: 600px;
  aspect-ratio: 9/16;
  object-fit: cover;
  border-radius: 10px;
}

/* Services */
#services {
  padding: 3rem 1rem;
  text-align: center;
}
#services h2 {
  margin-bottom: 4rem;
}
#services i {
  display: block;
  margin-bottom: 2rem;
  color: #ddb966;
  font-size: 0.95rem;
}
.service-list {
  display: grid;
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto 4rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.service-item {
  text-align: center;
}
.service-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 1rem;
  cursor: pointer;
  border-radius: 13px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.service-item img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.service-item p {
  font-size: 1rem;
  line-height: 1.4;
}

/* Service Modal (riverniciatura example) */
.custom-dialog {
  max-width: 70vw;
  margin: 1.5rem auto;
}
.custom-modal {
  border-radius: 12px;
  overflow: hidden;
}
.custom-body {
  display: flex;
  height: 60vh;
  padding: 0;
}
.custom-image {
  flex: 0 0 48%;
}
.custom-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
}
.custom-info {
  flex: 0 0 48%;
  background: #d1603d;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}
.custom-info h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}
.custom-info h5 {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}
.custom-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.custom-info ul li {
  margin-bottom: 0.75rem;
}
.custom-accent {
  flex: 0 0 4%;
  background: #d1603d;
  position: relative;
  border-top-right-radius: 20px;
  border-bottom-right-radius: 20px;
}
.custom-accent .btn-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  filter: invert(0.5);
}

/* Contact */
.contact-title {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2rem;
}
.contact-hours {
  font-size: 1rem;
  margin-bottom: 2rem;
}
.contact-buttons {
  display: grid;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.btn-contact {
  background: #d1603d !important;
  color: #fff !important;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-contact:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}


/* Fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  #about,
  #services,
  #gallery,
  #contact {
    scroll-margin-top: 128px;
  }

  .site-nav {
    padding: 0.75rem 0.85rem;
  }

  .site-nav-inner {
    gap: 0.55rem;
  }

  .site-nav a {
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
  }

  #hero .hero-content img {
    width: min(280px, calc(100vw - 3rem));
  }
  .about-container,
  .custom-body {
    flex-direction: column;
  }
  #about {
    padding: 2.25rem 1rem;
  }
  .about-container {
    gap: 1.35rem;
  }
  .about-image,
  .about-text {
    flex-basis: auto;
    width: 100%;
  }
  .about-image img {
    max-width: 100%;
    max-height: none;
    height: clamp(220px, 48vw, 320px);
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center 36%;
  }
  .custom-body {
    height: auto;
  }
}

/* 1) Rimuovo sfondo e box-shadow del modal-content di servizio */
.custom-modal {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

/* Elimino anche il bordo bianco predefinito */
.custom-modal .modal-content {
  border: none !important;
  background: none !important;
  border-radius: 20px;
}

/* 2) Allargo il dialogo fino al 90% della viewport */
.custom-dialog {
  max-width: 70vw !important;
}

/* Di conseguenza il contenuto occupa più spazio */
.custom-modal {
  width: 90vw;
}


/* Close button personalizzato con PNG bianco */
.btn-close {
  /* rimuove l’icona SVG di Bootstrap */
  background-image: none !important;
}

/* Applica la tua immagine */
.btn-close::before {
  content: "";
  display: block;
  width: 1.85rem;   /* regola a piacere */
  height: 1.85rem;  /* regola a piacere */
  background: url('../images/btn_close_white.png') no-repeat center center !important;
  background-size: contain !important;
}

/* Assicura che il bottone non abbia bordo e padding extra */
.btn-close {
  border: none !important;
  padding: 0 !important;
}

/* Banner cookie */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  display: none;               /* nascosto di default */
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  z-index: 10000;
  font-size: 0.9rem;
}
#cookie-banner a {
  color: #ddb966;
  text-decoration: underline;
}
#cookie-banner.show {
  display: flex;
}
#cookie-banner p {
  margin: 0;
  flex: 1;
}
#cookie-banner button {
  margin-left: 1rem;
}

/* MEDIA-QUERY per schermi molto stretti */
@media (max-width: 480px) {
  .slideshow {
    aspect-ratio: auto;     /* disabilita il rapporto fisso */
    height: 250px;          /* imposta un’altezza fissa più bassa */
  }
}

/* base modal override */
.service-modal {
  border-radius: 18px;
  overflow: hidden;
  background: #d1603d !important;
  position: relative;
  box-shadow: 0 24px 55px rgba(20, 18, 17, 0.22);
}

/* close button */
.service-modal-close {
  position: absolute;
  top: 0.8rem;
  right: 1.4rem;
  filter: invert(1);
  z-index: 10;
  opacity: 0.9;
}

/* body wrapper: desktop = row, mobile = column */
.service-modal-body {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-height: clamp(420px, 58vh, 560px);
}

/* testo */
.service-modal-text {
  flex: 0 0 60%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
  padding: 2.1rem 2.25rem;
  color: #fff;
  text-align: left;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.04));
}
.service-modal-kicker {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff3e6;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.service-modal-text h2 {
  margin: 0;
  font-size: clamp(1.65rem, 2.2vw, 2.2rem);
  line-height: 1.08;
}
.service-modal-lead {
  margin: 0;
  max-width: 34ch;
  font-size: 1.02rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.92);
}
.service-modal-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  width: 100%;
  margin-top: 0.25rem;
}
.service-modal-feature {
  min-height: 100%;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.95rem;
  line-height: 1.45;
  color: #ffffff;
}

/* immagine */
.service-modal-image {
  flex: 0 0 40%;
  overflow: hidden;
  align-self: stretch;
}
.service-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* mobile breakpoint */
@media (max-width: 600px) {
  .service-modal-body {
    flex-direction: column;
    min-height: auto;
  }
  .service-modal-image,
  .service-modal-text {
    width: 100%;
  }
  .service-modal-image {
    flex: 0 0 250px;
  }
  .service-modal-text {
    flex: 0 0 auto;
    padding: 1.5rem;
  }
  .service-modal-features {
    grid-template-columns: 1fr;
  }
}

/* Contenitore immagine con dimensione massima e overflow nascosto */
.service-modal-image {
  min-height: inherit;
}

/* Immagine sempre in cover, riempiendo il contenitore */
.service-modal-image img {
  width: 100%;           /* occupa tutta la larghezza del container */
  height: 100%;          /* occupa tutta l’altezza del container */
  object-fit: cover;     /* ritaglia/scala per riempire senza distorsione */
  object-position: center; /* centra il ritaglio */

}

/* Stato espanso: l'immagine occupa la larghezza intera superiormente */
.service-modal-body.expanded {
  flex-direction: column;
  height: auto;         /* permette al modal di adattarsi al contenuto */
}

.service-modal-body.expanded .service-modal-image {
  flex: 0 0 auto;
  width: 100%;
  height: 300px;        /* altezza fissa per l'immagine espansa */
  margin: 0;            /* rimuove margini */
  padding: 0;           /* rimuove padding */
}

.service-modal-body.expanded .service-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-modal-body.expanded .service-modal-text {
  flex: 0 0 auto;       /* non cresce oltre il contenuto */
  width: 100%;
  padding: 2rem;        /* mantiene il padding interno */
}

@media (max-width: 600px) {
  .slideshow {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Close button nel lightbox */
#lightboxModal .modal-body {
  position: relative; /* necessario per il positioning assoluto */
}

#lightboxModal .btn-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  filter: invert(1);      /* mantiene l’icona bianca */
  z-index: 10;
}

/* La sezione Gallery eredita lo sfondo di #gallery */
#gallery {
  background: #1b4573;
  color: #ffffff;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.gallery-header h2 {
  margin: 0;
  text-align: left;
}

.gallery-cta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-left: auto;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.86);
}

.gallery-cta-button {
  min-width: 0;
  border-radius: 999px;
  border: 1px solid #ffffff;
  background: #ffffff !important;
  color: #1b4573 !important;
  padding: 0.55rem 1rem;
  font-size: 0.92rem;
}

.gallery-cta-button:hover {
  background: #f2f5f8 !important;
  color: #16395f !important;
}

/* Scroll‑gallery dentro la section, senza sfondo proprio */
.scroll-container {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 10px;
  background: transparent;
}

/* Box fisso + cover mode */
.scroll-container img {
  flex: 0 0 300px;
  height: 300px;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  display: block;
}

/* Scorri‑container: scrollbar track completamente trasparente */
.scroll-container::-webkit-scrollbar {
  height: 8px;
  background: transparent;        /* nasconde lo sfondo */
}

.scroll-container::-webkit-scrollbar-track {
  background: transparent;        /* nasconde la rotaia */
  border: none;                   /* rimuove eventuali bordi */
}

.scroll-container::-webkit-scrollbar-track-piece {
  background: transparent;        /* copre ogni pezzo di rotaia */
}

.scroll-container::-webkit-scrollbar-corner {
  background: transparent;        /* nasconde l’angolo quando presente */
}

.scroll-container::-webkit-scrollbar-thumb {
  background: #4d4c4c;            /* colore del thumb */
  border-radius: 4px;
  border: none;                   /* nessun bordo */
}

.scroll-container::-webkit-scrollbar-thumb:hover {
  background: #4d4c4c;
}

/* Firefox: thumb color e track trasparente */
.scroll-container {
  scrollbar-width: thin;
  scrollbar-color: #ffffff transparent;
}

@media (max-width: 600px) {
  .gallery-header {
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.25rem;
  }

  .gallery-header h2 {
    text-align: center;
  }

  .gallery-cta {
    justify-content: center;
    margin-left: 0;
    text-align: center;
    font-size: 0.9rem;
  }

  .gallery-cta-button {
    width: 100%;
    max-width: 220px;
  }
}
