body {
    margin: 0;
    /* font-family: 'Poppins', sans-serif; */
    font-size: small;
}

#scrollTopBtn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    /* Spostato a sinistra */
    z-index: 1000;
    border-radius: 50%;
    font-size: 1.5em;
    text-align: center;
    background: linear-gradient(to right, #1E40AF, #1D4ED8);
    color: #fff;
    display: none;
    /* Nascosto inizialmente */
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

#scrollTopBtn:hover {
    background: linear-gradient(to right, #1D4ED8, #1E40AF);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.section {
    display: flex;
    flex-direction: row;
    height: 100vh;
    position: relative;
      height: auto;

}

.section_interventi {
    display: flex;
    flex-direction: row;
    position: relative;
}

.photo {
    flex: 1;
    overflow: hidden;
}

.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    /* text-align: center; */
}

.contentCurriculum {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
    margin-top: 0;
    font-size: medium;
}

.content_interventi {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.map-container {
    width: 90%;
}

#home {
    background: radial-gradient(ellipse at top, #ffffff, transparent),
        radial-gradient(ellipse at bottom, #d2dfff, transparent);
}

#curriculum {
    background: radial-gradient(ellipse at bottom, #ffffff, transparent),
        radial-gradient(ellipse at top, #d2dfff, transparent);
}

#dove {
    background: radial-gradient(ellipse at top, #ffffff, transparent),
        radial-gradient(ellipse at bottom, #d2dfff, transparent);
}

#contatti {
    background: radial-gradient(ellipse at bottom, #ffffff, transparent),
        radial-gradient(ellipse at top, #d2dfff, transparent);
}

.firma {
    width: 50%;
    filter: drop-shadow(60px 60px 6px grey);
}

nav {
    width: 100%;
    text-align: center;
    border-bottom: 2px solid #1E3A8A;
    padding: 1.5%;
    background-color: #fff;
    position: fixed;
    top: 0;
    z-index: 1000;
}

nav a {
    color: #1E3A8A;
    font-weight: 600;
    text-decoration: none;
    margin: 0 20px;
    font-size: 1.1em;
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #1D4ED8;
}

nav a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: #1E3A8A;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::after {
    width: 100%;
}

.btn_centrale {
    font-size: 0.9em;
    padding: 6px 15px;
    border-radius: 20px;
    text-transform: uppercase;
    background: linear-gradient(to right, #3763dd, #1E40AF);
    border: none;
    color: #fff;
    font-weight: bold;
    transition: all 0.3s ease;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.btn_centrale:hover {
    background: linear-gradient(to right, #3763dd, #1E40AF);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

#firmaTop {
    position: fixed;
    top: 1%;
    left: 1%;
    width: 8%;
    height: auto;
    z-index: 1100;
}

#firmaTop:hover {
    transform: scale(0.9);
}

.services-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
}

.service-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s;
}

.service-item:hover {
    transform: scale(1.05);
}

.service-photo img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.service-content {
    padding: 15px;
    text-align: center;
}

.service-content h3 {
    font-size: 18px;
    margin: 10px 0;
}

.service-content p {
    font-size: 14px;
    color: #666;
}

.interventi_container {
    width: 300%;
}

.img_modal{
width: 100% !important;
    height: 35vh;
    object-fit: cover;
}

/* === Mobile-specific overrides to keep desktop unchanged === */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  /* Keep the main menu visible and readable */
  /* nav {
    position: sticky;
    top: 0;
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 2000;
  }
  nav a {
    display: inline-block;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 0.95rem;
  }
  #firmaTop { width: 36px; height: 36px; margin-right: 8px; } */

  nav {
    position: fixed;      /* Fisso in alto */
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 3000;       /* Sopra tutto il resto */
  }

  nav a {
    display: inline-block;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 0.95rem;
  }

  #firmaTop {
    display: none;
    width: 36px;
    height: 36px;
    margin-right: 8px;
  }

  /* Show only the selected section to avoid overlaps */
  .section, .section_interventi {
    display: none;
    padding-top: 70px; /* space below sticky nav */
  }
  .section.active, .section_interventi.active {
    display: block;
  }

  /* Typography and cards scale down a bit */
  h1, h2, h3 { font-size: clamp(1.2rem, 4.5vw, 1.6rem); }
  p, li, .card, .card .card-title, .card .card-text { font-size: clamp(0.9rem, 3.8vw, 1rem); }

  /* Grids and images stack */
  .services-gallery { grid-template-columns: 1fr !important; }
  .row.g-4 > [class*="col-"] { width: 100%; }
  .interventi_container { width: 100% !important; }
  .photo img, .img_modal { width: 100% !important; height: auto; object-fit: cover; }
  .firma { width: 90% !important; filter: none !important; }
}

/* Assicura che i modali stiano sopra la navbar */
.modal {
    z-index: 4000 !important;
  }
  
  .modal-backdrop {
    z-index: 3990 !important;
  }
  
  .modal-header .btn-close {
    position: relative;
    z-index: 4001 !important;
  }

  .ss{
    border-radius: 1%;
    margin: 0.1%; 
    box-shadow: 0 8px 20px rgba(0, 0, 0, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);  
    }

    .ssvasco{
    border-radius: 1%;
    margin: 0.1%; 
    box-shadow: 0 8px 20px rgba(0, 0, 0, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);  
    height: fit-content;
    }


    /* ===== Foto doctor fissa a sinistra (solo desktop) ===== */


  /* quanto “larga” vuoi la colonna foto */
  :root { --left-photo-w: 33.333vw; --nav-h: 72px; }

  /* La foto SOLO nella sezione Home diventa fissa */
  #home .photo {
    position: fixed;
    left: 0;
    top: var(--nav-h);                 /* sotto la navbar */
    width: var(--left-photo-w);
    height: calc(100vh - var(--nav-h));
    z-index: 900;                      /* sotto la navbar (che è 1000) */
    overflow: hidden;
  }

  #home .photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Tutte le sezioni devono lasciare spazio alla colonna fissa */
  .section {
    display: block;                    /* non più layout a 2 colonne flex */
    min-height: 100vh;
    padding-left: var(--left-photo-w);
    padding-top: var(--nav-h);         /* evita sovrapposizione con nav */
    box-sizing: border-box;
  }

  /* Nascondi le foto duplicate delle altre sezioni (desktop) */
  #curriculum .photo,
  #dove .photo,
  #contatti .photo {
    display: none;
  }

  /* I contenuti a destra occupano tutto lo spazio disponibile */
  .content,
  .contentCurriculum {
    width: 100%;
    min-height: calc(100vh - var(--nav-h));
  }
