/* ---------------------
   GLOBAL SHARED STYLES 
------------------------ */

/* --- HERO SECTION --- */
.service-hero-section {
  padding: 60px 0;
  background: #ffffff;
}

.service-hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 4rem;
  align-items: center;
}

/* Variante per layout alternato (immagine a sinistra/destra scambiata se necessario o allineamento centrato) */
.service-hero-grid.layout-alternate {
  grid-template-columns: 1.3fr 0.9fr;
  gap: 2rem;
  align-items: center; 
}

.service-hero-grid p {
  margin-bottom: 2rem;
}

.service-hero-content h2 {
  color: #16a34a;
  margin-bottom: 1rem;
  font-size: 2rem;
  line-height: 1.3;
}

.service-hero-content p {
  color: #666;
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.service-hero-content a {
  color: #16a34a;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.service-hero-content a:hover {
  color: #15803d;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Base Image Wrapper */
.service-hero-image {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  background: #f0fdf4;
}

/* Default Image Style */
.service-hero-image img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  display: block;
}

/* --- DESCRIPTION SECTION --- */
.service-description-section {
  padding: 60px 0;
  background-color: #f0fdf4;
}

.service-description-content {
  max-width: 1100px;
  margin: 0 auto;
}

.service-description-content h2 {
  color: #16a34a;
  margin-bottom: 2rem;
  font-size: 2rem;
}

.service-description-content p {
  color: #555;
  font-size: 1rem;
  line-height: 1.86;
  margin-bottom: 1rem;
}

.service-description-content p:last-child {
  margin-bottom: 0;
}

.service-description-content a {
  color: #16a34a;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.service-description-content a:hover {
  color: #15803d;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- BENEFITS SECTION --- */
.service-benefits-section {
  padding: 60px 0;
}

.service-benefits-section h2.text-center {
  margin-bottom: 1rem;
}

.benefits-intro {
  font-size: 1.1rem;
  color: #666;
  max-width: 800px;
  margin: 0 auto 3rem auto;
  line-height: 1.6;
}

/* GRIGLIA BENEFITS AGGIORNATA */
.benefits-grid {
  display: grid;
  grid-template-columns: 1fr; 
  gap: 1.5rem;
}

/* Tablet: 2 colonne */
@media (min-width: 600px) {
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Default 3 colonne */
@media (min-width: 1100px) {
  .benefits-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Variante 4 colonne */
  .benefits-grid-4cols {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  /* Variante 5 colonne */
  .benefits-grid-5cols {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}

.benefit-card {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  text-align: center;
  transition: all 0.3s ease;
  border-left: 4px solid #16a34a;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.benefit-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.benefit-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: inline-block;
}

.benefit-card h3 {
  color: #16a34a;
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
  width: 100%;
}

.benefit-card p {
  color: #666;
  line-height: 1.5;
  margin: 0;
  font-size: 0.95rem;
}

.benefit-card a {
    color: #16a34a;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.benefit-card a:hover {
    color: #15803d;
    text-decoration: underline;
}

/* --- PROCESS TIMELINE --- */
.service-process-section {
  padding: 60px 0;
  background: #ffffff;
}

/* BACKGROUND LIGHT */
.service-process-section.bg-light,
.service-keypoints-section.bg-light,
.related-services-section.bg-light,
.faq-section.bg-light {
    background-color: #f0fdf4; 
    padding-top: 50px; 
    padding-bottom: 50px;
}

.faq-section h2.text-center {
    margin-bottom: 3rem;
}

.process-intro {
  font-size: 1.1rem;
  color: #666;
  max-width: 800px;
  margin: 0 auto 3rem auto;
  line-height: 1.6;
}

.process-timeline {
  max-width: 900px;
  margin: 0 auto;
}

.timeline-item {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

.timeline-item:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 28.5px;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(to bottom, #16a34a, #22c55e);
  z-index: 0;
}

.timeline-item:last-child::before {
  background: linear-gradient(to bottom, #16a34a, rgba(34, 197, 94, 0));
}

.timeline-number {
  width: 60px;
  height: 60px;
  background: #16a34a;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
  position: relative;
  z-index: 2;
}

.timeline-content {
  flex: 1;
  background: #f0fdf4; /* Default: Verdino su sfondo bianco */
  padding: 1.8rem;
  border-radius: 15px;
  border-left: 4px solid #16a34a;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

/* OVERRIDE: Se la sezione è verde (.bg-light), il box diventa BIANCO */
.service-process-section.bg-light .timeline-content {
    background: #ffffff; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

.timeline-content h3 {
  color: #16a34a;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.timeline-content p {
  color: #666;
  line-height: 1.7;
  margin: 0;
}

.timeline-content a {
  color: #16a34a;
  font-weight: 600;
  text-decoration: none;
}

.timeline-content a:hover {
  color: #15803d;
  text-decoration: underline;
}

/* --- PROCESS GRID CARDS --- */
.process-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.process-card-item {
    background: #ffffff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    border: 1px solid #e5e7eb;
}

.process-card-item:hover {
    transform: translateY(-5px);
}

.process-card-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: #d4f0de;
    position: absolute;
    top: -12px;
    right: -8px;
    line-height: 1;
    z-index: 0;
}

.process-card-item h3 {
    position: relative;
    z-index: 1;
    color: #16a34a;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.process-card-item p {
    position: relative;
    z-index: 1;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* --- TARGET/APPLICATIONS --- */
.service-target-section {
  padding: 60px 0;
}

.service-target-section h2.text-center {
  margin-bottom: 3rem;
}

/* Riduce lo spazio inferiore quando la sezione è seguita dalle FAQ */
.service-target-section.compact-bottom {
    padding-bottom: 15px;
}

/* GRIGLIA TARGET */
.target-grid-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin: 2rem 0 2.5rem 0;
}

/* Variante Flessibile */
.target-grid-flexible {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0 2.5rem 0;
}

.target-card {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.target-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.target-card h3 {
  color: #16a34a;
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
}

.target-card p {
  color: #666;
  line-height: 1.6;
  font-size: 0.95rem;
  margin: 0;
  flex-grow: 1;
  text-align: center
}

.target-card a {
    color: #16a34a;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.target-card a:hover {
    color: #15803d;
    text-decoration: underline;
}

.target-note {
  background: #fff7ed;
  padding: 1.5rem;
  border-radius: 15px;
  border-left: 4px solid #d97706;
  max-width: 900px;
  margin: 0 auto;
}

.target-note p {
  color: #666;
  margin: 0;
  line-height: 1.7;
}

/* --- RELATED SERVICES --- */
.related-services-section {
  padding: 60px 0;
}

.related-intro {
  font-size: 1.1rem;
  color: #666;
  max-width: 700px;
  margin: 0 auto 3rem auto;
  line-height: 1.6;
}

.related-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.related-service-card {
  background: #ffffff;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  border-left: 4px solid #16a34a;
  display: block;
}

.related-service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.related-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.related-service-card h3 {
  color: #16a34a;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.related-service-card p {
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.all-services-link {
  text-align: center;
  margin-top: 2rem;
}

/* ===========================================================
   PAGINA: BIOIMPEDENZIOMETRIA (BIA)
   =========================================================== */

.service-hero-image.bia-img img {
  height: 240px;
  object-position: center;
}

/* ===========================================================
   PAGINA: RICOMPOSIZIONE CORPOREA
   =========================================================== */

.service-hero-image.recomp-img img {
  height: 390px;
  object-position: top center;
}

/* --- Keypoints Section --- */
.service-keypoints-section {
  padding-top: 60px;
  padding-bottom: 10px;
  background: #ffffff;
}

.service-keypoints-section h2.text-center {
  margin-bottom: 3rem;
}

.keypoints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 1100px) {
    .keypoints-grid-4cols {
        grid-template-columns: repeat(4, 1fr);
    }
}

.keypoint-item {
  padding: 14px;
  border-radius: 20px;
  transition: all 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.keypoint-item:hover {
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-5px);
}

.keypoint-icon-wrapper {
  background: #f0fdf4;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.keypoint-item:hover .keypoint-icon-wrapper {
  transform: scale(1.08);
}

.keypoint-icon {
  font-size: 1.7rem;
  line-height: 1;
}

.keypoint-content h3 {
  color: #111827;
  margin: 0 0 0.4rem 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.keypoint-content p {
  color: #666;
  line-height: 1.6;
  margin: 0;
  font-size: 0.95rem;
}

.keypoint-content a {
  color: #16a34a;
  font-weight: 600;
  text-decoration: none;
}

.keypoint-content a:hover {
  color: #15803d;
  text-decoration: underline;
}

/* ===========================================================
   PAGINA: DIMAGRIMENTO
   =========================================================== */

.service-hero-image.slimming-img img {
  height: 450px;
  object-position: top center;
}

/* ===========================================================
   PAGINA: EDUCAZIONE ALIMENTARE
   =========================================================== */

.service-hero-image.education-img img {
  height: 350px;
  object-position: top center;
}

.service-hero-image.portion-img img {
  height: 540px;
  object-position: top center;
  object-fit: cover; 
}

.service-hero-image.portion-img {
    max-width: 90%; 
    margin: 0 auto; 
}

/* --- STILI SPECIFICI PER CHECK LIST (Metodo Educativo) --- */
.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.check-list li {
  display: flex;
  align-items: flex-start;
}

.check-icon {
  margin-right: 1rem;
  flex-shrink: 0;
}

.check-list p {
  font-size: 0.95rem;
  color: #666;
  margin-top: 0.25rem;
  line-height: 1.5;
}

.check-list a {
    color: #16a34a;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.check-list a:hover {
    color: #15803d;
    text-decoration: underline;
}

/* ===========================================================
   PAGINA: ALIMENTAZIONE VEGETARIANA E VEGANA
   =========================================================== */

/* --- Hero Image Specifica (Veg) --- */
.service-hero-image.veg-img img {
  height: 250px;
  object-position: center bottom; /* Focus sul cibo in basso/centro */
}

/* --- Nutrient Grid (Focus Nutrienti) --- */
/* Variante della keypoints-grid per i nutrienti specifici */
.nutrient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.nutrient-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    padding: 1.5rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.nutrient-card:hover {
    transform: translateY(-5px);
    border-color: #16a34a;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.nutrient-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.nutrient-icon {
    width: 40px;
    height: 40px;
    background: #f0fdf4;
    color: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.nutrient-card h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1f2937;
}

.nutrient-card p {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

@media (min-width: 992px) {
    .nutrient-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 colonne su desktop */
    }
}

/* ===========================================================
   PAGINA: NUTRIZIONE CLINICA
   =========================================================== */
.service-hero-image.clinical-img img {
  height: 350px;
  object-position: center;
}

@media (max-width: 991px) {
  .service-hero-grid.layout-alternate {
    grid-template-columns: 1fr !important;
  }

}

/* ===========================================================
   PAGINA: NUTRIZIONE SPORTIVA
   =========================================================== */

.service-hero-image.sport-img img {
  height: 260px;
  object-position: top center;
}

/* ===========================================================
   PAGINA: GRAVIDANZA E ALLATTAMENTO
   =========================================================== */

.service-hero-image.pregnancy-img img {
  height: 400px;
  object-position: top center;
}

/* ===========================================================
   PAGINA: NUTRIZIONE PEDIATRICA
   =========================================================== */

.service-hero-image.children-img img {
  height: 310px;
  object-position: top center;
}

/* ===========================================================
   GLOBAL RESPONSIVE ADJUSTMENTS 
   =========================================================== */

/* Tablet & Small Desktop (max-width 1100px) */
@media (max-width: 1100px) {
  /* Gestione Target Grid su Tablet (passa a 2 colonne) */
  .target-grid-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet Portrait (max-width 991px) */
@media (max-width: 991px) {
  .service-hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: left;
  }
  
  /* Ordine alternativo per mobile: testo sopra immagine */
  .service-hero-grid.layout-alternate {
    grid-template-columns: 1fr;
  }

  .service-hero-grid.layout-alternate .service-hero-image {
    order: 1;
  }
  .service-hero-grid.layout-alternate .service-hero-content {
    order: 2;
  }

  /* Force Hero Image Height on Mobile/Tablet */
  .service-hero-image img,
  .service-hero-image.bia-img img,
  .service-hero-image.recomp-img img,
  .service-hero-image.slimming-img img,
  .service-hero-image.education-img img,
  .service-hero-image.portion-img img,
  .service-hero-image.veg-img img {
    height: 350px !important;
  }

  /* Timeline Adjustments */
  .timeline-item::before { left: 24.5px; }
  .timeline-number { width: 52px; height: 52px; font-size: 1.2rem; }
  
  /* Reset Keypoints to 1 col if needed */
  .keypoints-grid, .target-grid-flexible {
    grid-template-columns: 1fr;
  }
}

/* Mobile (max-width 575px) */
@media (max-width: 575px) {
  .service-hero-section,
  .service-benefits-section,
  .service-process-section {
    padding-bottom: 40px;
  }
  .service-target-section,
  .service-keypoints-section {
    padding-bottom: 10px;
  }
  .related-services-section,
  .service-description-section {
    padding: 45px 0;
  }

  .service-hero-content h2 { font-size: 1.6rem; }

  /* Timeline Compact */
  .timeline-number { width: 38px; height: 38px; font-size: 1rem; }
  .timeline-item::before { left: 17.5px; }
  .timeline-item { gap: 0.8rem; }
  .timeline-content { padding: 0.9rem; }

  /* Grids Reset: Tutto a 1 colonna su Mobile */
  .benefits-grid,
  .benefits-grid-4cols,
  .benefits-grid-5cols, /* Nuovo */
  .related-services-grid,
  .target-grid-row,
  .process-grid-cards,
  .keypoints-grid,
  .keypoints-grid-4cols,
  .nutrient-grid {
    grid-template-columns: 1fr !important;
  }

  /* FIX IMMAGINI TAGLIATE SU MOBILE */
  /* Aggiungo un piccolo margine interno al container dell'immagine per staccarlo dai bordi */
  .service-hero-image {
      margin: 0 10px; /* Margine laterale per evitare il taglio */
      width: auto; /* Lascia che il width si adatti al margin */
  }
}