/* --- RESET E BASE --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  margin: 0;
  padding: 0;
  line-height: 1.5;
  padding-top: 200px;
}

/* Rimuovi padding-top per dispositivi touch/mobile */
@media (hover: none) and (pointer: coarse),
       (max-width: 1024px) {
  body {
    padding-top: 0;
  }
}

.about-services-titles {
  background: #efeeea;
  padding: 0.5rem 0 0.5rem 0;
  border-radius: 8px;
}

.about-services-titles h2 {
  color: #820000;
  font-weight: bold;
  font-size: 2rem;
  text-align: center;
  margin-bottom: 0.5rem;
  display: none;
}
.about-services-titles h2.active {
  display: block;
}

/* Linea orizzontale tra titolo servizi e card */
.services-separator {
  border: none;
  border-top: 3px solid #820000;
  margin: 0.5rem auto 1.5rem auto;
  width: 60%;
  opacity: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === PROJECT COUNTERS === */
.counters-section {
  background: #ffffff;
  padding: 1.5rem 1rem 2rem 1rem;
}

.counters-title h2 {
  color: #820000;
  font-weight: 700;
  font-size: 2rem;
  text-align: center;
}

.counters-row {
  max-width: 1200px;
  margin: 0.5rem auto 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  align-items: stretch;
}


.counter {
  background: #efeeea;
  border-radius: 10px;
  padding: 1rem 0.5rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.counter .value {
  font-size: 2.4rem;
  font-weight: 800;
  color: #820000;
  line-height: 1.1;
}

.counter .label {
  margin-top: 0.2rem;
  font-size: 1.05rem;
  color: #111;
  font-weight: 500;
}

a {
  color: #820000;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: #820000;
}

/* === HEADER === */
header {
  background: #efeeea;
  color: #000;
  padding: 1.5rem 0;
  width: 100%;
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Header non fisso per dispositivi touch/mobile */
@media (hover: none) and (pointer: coarse),
       (max-width: 1024px) {
  header {
    position: static;
    box-shadow: none;
  }
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  padding: 0 1rem;
  box-sizing: border-box;
  width: 100%;
  gap: 0.5rem;
}

.logo-img {
  height: 100px;
  width: auto;
  object-fit: contain;
  display: block;
}

.header-title {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  margin-left: 0.2rem;
  text-align: left;
  gap: 0;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.bold-text {
  font-weight: bold;
  font-size: 2.7rem;
  color: #820000;
  text-align: left;
  margin-bottom: 0;
  line-height: 1;
  display: block;
}

.light-text {
  font-weight: 300;
  font-size: 2.1rem;
  color: #555;
  text-align: left;
  margin-bottom: 0;
}

.subtitle,
p.subtitle {
  display: none;
  text-align: left;
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-size: 1.7rem;
  color: #555;
  font-weight: normal;
}

.subtitle.active,
p.subtitle.active {
  display: block;
}

.about-services-container {
  /* Variabili per controllare gap e percentuali colonne (desktop) */
  --about-gap: 3rem;
  --about-text-col: 60%;
  --about-image-col: 40%;
  --about-image-desktop-height: 280px;
  /* Split layout: testo a sinistra | immagine a destra */
  display: flex;
  flex-direction: row;
  align-items: stretch; 
  justify-content: space-between;
  width: 100%;
  max-width: none; 
  min-height: 360px;
  margin: 0; 
  padding: 0 2rem 0 2rem; 
  box-sizing: border-box;
  background: #fff;
  gap: var(--about-gap);
  overflow: hidden;
}

.about-services-text {
  /* colonna testo (50% meno metà gap) */
  flex: 0 0 calc(var(--about-text-col, 50%) - (var(--about-gap, 3rem) / 2));
  max-width: calc(var(--about-text-col, 50%) - (var(--about-gap, 3rem) / 2));
  text-align: left;
  padding: 0;
  font-size: 1rem;
  line-height: 1.5;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 260px;
}

.about-services-text h2 {
  text-align: left;
  font-size: 1.3rem;
  font-weight: 700;
  color: #820000;
  margin-bottom: 0.5rem;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.about-services-text p {
  text-align: left;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #000000;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.about-services-text section#about {
  margin-bottom: 2.7rem;
}

.about-services-image {
  /* colonna immagine laterale (50% meno metà gap) */
  flex: 0 0 calc(var(--about-image-col, 50%) - (var(--about-gap, 3rem) / 2));
  max-width: calc(var(--about-image-col, 50%) - (var(--about-gap, 3rem) / 2));
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  align-self: stretch;
}

.about-services-image img {
  width: 100%;
  height: 100%; 
  object-fit: cover;
  object-position: center; 
  border-radius: 8px;
  box-shadow: none;
  background: transparent;
  display: block;
}

#about-services {
  margin-bottom: 48px;
}

/* --- BLOCCO CONTATTO --- */
.contact-block {
  min-width: 300px;
  display: none;
}

.contact-block.english,
.contact-block.italian,
.contact-block.spanish {
  display: none;
}

.contact-block.english.active,
.contact-block.italian.active,
.contact-block.spanish.active {
  display: block;
}

/* --- BLOCCO TESTO MULTILINGUA --- */
.about-services-text {
  display: none;
}

.about-services-text.english,
.about-services-text.italian,
.about-services-text.spanish {
  display: none;
}

.about-services-text.english.active,
.about-services-text.italian.active,
.about-services-text.spanish.active {
  display: flex;
}

.featured-sections {
  display: none;
}

.featured-sections.english,
.featured-sections.italian,
.featured-sections.spanish {
  display: none;
}

.featured-sections.english.active,
.featured-sections.italian.active,
.featured-sections.spanish.active {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 6rem;
  padding: 2rem;
  background-color: #efeeea;
}

/* --- CARD SERVIZI --- */
.featured-section {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  height: 400px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  background: #efeeea; 
}

/* Immagine */
.featured-section img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay contenente titolo e descrizione */
.overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  padding: 1rem;
  transition: all 0.4s ease;
  height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

/* Titolo */
.overlay h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #820000;
  text-align: left;
  width: fit-content;
}

/* Paragrafo descrizione */
.card-description {
  margin-top: 0.1rem;
  font-size: 1rem;
  line-height: 1.6;
  color: #000000;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-align: justify;
  max-height: 600px;
}

/* === GESTIONE SPECIFICA PER TIPO DI DISPOSITIVO === */

/* Per dispositivi puramente touch (smartphone, tablet touch) */
body.touch-device .featured-section,
body.mixed-device .featured-section {
  display: flex !important;
  flex-direction: column-reverse !important;
  height: auto !important;
  cursor: default !important;
  padding: 1rem !important;
  background: #ffffff !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

body.touch-device .featured-section .overlay,
body.mixed-device .featured-section .overlay {
  position: static !important;
  background: transparent !important;
  height: auto !important;
  padding: 0 !important;
  display: block !important;
  overflow: visible !important;
}

body.touch-device .featured-section .card-description,
body.mixed-device .featured-section .card-description {
  opacity: 1 !important;
  transition: none !important;
}

/* Disabilita completamente gli effetti hover per dispositivi touch */
body.touch-device .featured-section:hover .overlay,
body.touch-device .featured-section:active .overlay,
body.touch-device .featured-section:focus .overlay,
body.mixed-device .featured-section:hover .overlay,
body.mixed-device .featured-section:active .overlay,
body.mixed-device .featured-section:focus .overlay {
  height: auto !important;
  justify-content: flex-start !important;
  text-align: left !important;
  background: transparent !important;
}

/* Per dispositivi desktop con mouse preciso */
body.hover-device .featured-section:hover .overlay {
  height: 100% !important;
  justify-content: center !important;
  text-align: center !important;
}

body.hover-device .featured-section:hover .card-description {
  opacity: 1 !important;
}

body.hover-device .featured-section:hover h3 {
  text-align: left !important;
  margin-bottom: 0.2rem !important;
}

/* Effetto hover SOLO per dispositivi desktop con mouse preciso */
/* Escludiamo esplicitamente i dispositivi touch */
@media (hover: hover) and (pointer: fine) and (any-hover: hover) and (any-pointer: fine) {
  /* Assicuriamoci che non sia un dispositivo touch */
  @supports not ((-webkit-touch-callout: none)) {
    .featured-section:hover .overlay {
      height: 100%;
      justify-content: center;
      text-align: center;
    }

    .featured-section:hover .card-description {
      opacity: 1;
    }

    .featured-section:hover h3 {
      text-align: left;
      margin-bottom: 0.2rem;
    }
  }
}

/* Regola specifica per forzare layout fisso su tutti i dispositivi touch */
@media (hover: none) and (pointer: coarse),
       (any-hover: none) and (any-pointer: coarse),
       (max-width: 1024px) {
  .featured-section {
    display: flex !important;
    flex-direction: column-reverse !important;
    height: auto !important;
    cursor: default !important;
    padding: 1rem !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  }
  
  .featured-section .overlay {
    position: static !important;
    background: transparent !important;
    height: auto !important;
    padding: 0 !important;
    display: block !important;
    overflow: visible !important;
  }
  
  .featured-section .card-description {
    opacity: 1 !important;
    transition: none !important;
  }
  
  .featured-section:hover .overlay,
  .featured-section:active .overlay,
  .featured-section:focus .overlay {
    height: auto !important;
    justify-content: flex-start !important;
    text-align: left !important;
  }
}

/* --- SWITCHER LINGUA --- */
.language-switcher {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  z-index: 100;
}
.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.3rem 1rem;
  font-size: 1rem;
  font-family: 'Roboto', Arial, sans-serif;
  border: 1px solid #820000;
  border-radius: 4px;
  background: #fff;
  color: #820000;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.lang-btn img {
  width: 30px;
  height: 26px;
  object-fit: contain;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: none;
  border: none;
  display: inline-block;
}
.lang-btn.active,
.lang-btn:hover {
  background: #820000;
  color: #fff;
  outline: none;
  text-decoration: none;
  box-shadow: none;
}

/* === Container generale === */
.contact-container {
  width: 100%;
  background-color: #f9f9f9;
  padding: 2rem 0;
}

/* === Layout a due colonne === */
.contact-wrapper-2cols {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 4rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  box-sizing: border-box;
}

.contact-content-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 4rem;
  width: 100%;
  max-width: 1200px;
}

/* === Colonna 1: Info contatti === */
.contact-block {
  flex: 1;
  min-width: 300px;
  max-width: 500px;
  display: none;
  flex-direction: column;
  gap: 1rem;
  font-family: 'Roboto', Arial, sans-serif;
  border-radius: 12px;
  padding: 1.2rem 0.8rem;
  font-size: 0.98rem;
  margin: 0;
}
.contact-block.english.active,
.contact-block.italian.active,
.contact-block.spanish.active {
  display: flex;
}

.contact-block h2 {
  color: #820000;
  font-size: 1.7rem;
  margin-bottom: 0.1rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.contact-block p {
  display: flex;
  align-items: center;
  margin: 0.2rem 0;
  font-size: 1.18rem;
  line-height: 1.2;  
  word-break: break-word;
  gap: 5px; 
}

.contact-block img,
.contact-block .linkedin-icon {
  width: 32px;
  height: 32px;
  margin-right: 12px;
  flex-shrink: 0;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  box-shadow: none;
  border: none;
}

.contact-block a {
  color: #005fa3;
  font-weight: 500;
  transition: color 0.2s;
}
.contact-block a:hover {
  color: #820000;
}

.contact-form.english,
.contact-form.italian,
.contact-form.spanish {
  display: none;
}

.contact-form.english.active,
.contact-form.italian.active,
.contact-form.spanish.active {
  display: flex;
}

/* === Colonna 2: Form === */
.contact-form {
  flex: 1;
  min-width: 300px;
  max-width: 500px;
  width: 90%;
  display: none;
  flex-direction: column;
  gap: 0.8rem;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 0.98rem;
  border-radius: 12px;
  padding: 1.2rem 0.8rem;
  margin: 0;
}
.contact-form.english.active,
.contact-form.italian.active,
.contact-form.spanish.active {
  display: flex;
}

.contact-form form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form .form-group {
  display: flex;
  flex-direction: column;
}

.contact-form label {
  margin-bottom: 0.25rem;
  font-weight: 600;
  color: #333;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  padding: 0.4rem;
  font-size: 0.98rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
  color: #222;
  margin-bottom: 0.5rem;
}

.contact-form textarea {
  min-height: 100px;
  max-height: 300px;
}

/* === Messaggi del form === */
.form-message {
  font-weight: bold;
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 4px;
}

.form-message.success {
  color: #155724;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
}

.form-message.error {
  color: #721c24;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
}


/* === Bottone === */
.contact-form button[type="submit"] {
  width: 100%;
  margin-left: auto;
  font-size: 0.98rem;
  padding: 0.4rem 1rem;
  background-color: #820000;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.contact-form button[type="submit"]:hover {
  background-color: #6e1f1f;
  border-color: #6e1f1f;
}

.privacy-group label {
  font-weight: 400;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  max-width: 100vw;
  border-radius: 0;
  margin: 0;
  z-index: 9999;
  background: #222;
  color: #fff;
  padding: 1.5rem 1rem;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
  text-align: center;
}

.cookie-banner a {
  color: #ffffff;
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.cookie-buttons button {
  background: #fff;
  color: #222;
  border: none;
  border-radius: 4px;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  min-width: 120px;
  font-family: 'Roboto', Arial, sans-serif;
  font-weight: 500;
}

.cookie-buttons button:hover {
  background: #820000;
  color: #fff;
}

footer {
  padding: 0;
  margin: 0;
  width: 100%;
  border: none;
}

.footer-top {
  background: #efeeea;
  color: #111;
  text-align: center;
  padding: 0.7rem 0.5rem 0.5rem 0.5rem;
  font-size: 1.2rem;
  font-family: 'Roboto', Arial, sans-serif;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.footer-bottom {
  background: #820000;
  color: #fff;
  text-align: center;
  padding: 0.7rem 0.5rem 0.7rem 0.5rem;
  font-size: 1.08rem;
  font-family: 'Roboto', Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.footer-bottom a {
  color: #fff;
  text-decoration: underline;
  margin-left: 0.5rem;
}

.footer-bottom a:hover {
  color: #f5f5f5;
}

/* === TABLET (768px - 1024px) === */
/* Tablet Portrait: 768×1024px | Tablet Landscape: 1024×768px */
@media (min-width: 768px) and (max-width: 1024px) {
/* Stack layout: testo e immagine su due righe, testo a tutta larghezza */
  .about-services-container {
    flex-direction: column;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* === HEADER CENTRATO === */
  .header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    width: 100%;
    gap: 1rem;
    text-align: center;
  }
  
  .logo-img {
    height: 165px;
    width: auto;
    object-fit: contain;
    margin: 0 auto;
    display: block;
  }
  
  .header-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 0 auto;
    width: 100%;
    gap: 0.2rem;
  }
  
  .bold-text {
    font-size: 3rem;
    color: #820000;
    text-align: center;
    margin: 0 auto;
    width: 100%;
    line-height: 1.1;
  }
  
  .light-text {
    font-size: 2.3rem;
    color: #555;
    text-align: center;
    margin: 0 auto;
    width: 100%;
    line-height: 1.1;
  }
  
  .subtitle,
  p.subtitle {
    font-size: 1.6rem;
    text-align: center;
    margin: 0.5rem auto;
    padding: 0 1rem;
    width: 100%;
  }
  
  .language-switcher {
    position: static;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem auto 0 auto;
    width: 100%;
    gap: 1rem;
  }
  
  .lang-btn {
    padding: 0.4rem 1.2rem;
    font-size: 1rem;
    min-width: 100px;
  }
  
  /* === FEATURED SECTIONS - 2 COLONNE === */
  .featured-sections.english.active,
  .featured-sections.italian.active,
  .featured-sections.spanish.active {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem;
    background-color: #efeeea;
    justify-items: center;
    align-items: start;
  }
  
  .featured-section {
    display: flex;
    flex-direction: column-reverse;
    height: auto;
    cursor: default;
    padding: 1rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    width: 100%;
    margin-bottom: 1rem;
  }
  
  .featured-section img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-top: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
  }
  
  .overlay {
    position: static;
    background: transparent;
    height: auto;
    padding: 0;
    display: block;
    overflow: visible;
  }
  
  .overlay h3 {
    font-size: 1.3rem;
    text-align: center;
    color: #820000;
    margin-bottom: 0.5rem;
    padding: 0;
  }
  
  .card-description {
    opacity: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #000;
    text-align: justify;
    margin: 0 0 1rem 0;
  }
  
  /* === ABOUT SERVICES - FIANCO A FIANCO === */
   
  .about-services-text {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    padding: 0;
  }
  
  .about-services-image {
    flex: 0 0 100%;
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }
  
  .about-services-image img {
    width: 100%;
    height: 250px !important;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }
  
  /* === CONTACT SECTION CENTRATA === */
  .contact-wrapper-2cols {
    display: flex;
    flex-direction: column;
    align-items: left;
    gap: 2rem;
    padding: 2rem 1rem;
    text-align: left;
  }
  
  .contact-block,
  .contact-form {
    width: 100%;
    max-width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: left;
    justify-content: left;
  }
  
  .contact-block {
    font-size: 1.1rem;
    text-align: left;
  }
  
  .contact-block h2 {
    text-align: left;
    margin-bottom: 1rem;
  }
  
  .contact-block p {
    justify-content: left;
    text-align: left;
  }
  
  .contact-form {
    max-width: 100%;
    width: 100%;
    text-align: left;
  }

  .contact-form input[type="text"],
  .contact-form input[type="email"],
  .contact-form textarea,
  .contact-form button[type="submit"] {
    width: 100%;
    box-sizing: border-box;
  }
  
  /* === PROJECT COUNTERS (Tablet) === */
  .counters-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
  }
  
}

/* === IPAD 810x1080 e risoluzioni simili === */
@media (min-width: 800px) and (max-width: 820px) and (min-height: 1000px) {
  /* Stack anche su iPad: testo a tutta larghezza, immagine sotto a tutta larghezza */
  .about-services-container {
    flex-direction: column;		
    padding-left: 12px;
    padding-right: 12px;				   
  }
  
.featured-sections.english.active,
.featured-sections.italian.active,
.featured-sections.spanish.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  background-color: #efeeea;
  justify-items: center;
  align-items: start;
}
  
  .featured-section {
    display: flex;
    flex-direction: column-reverse;
    height: 500px;
    cursor: default;
    padding: 0.8rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    width: 100%;
    margin-bottom: 0.8rem;
    overflow: hidden;
  }
  
  .featured-section img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    margin-bottom: 1rem;
    margin-top: 1rem;
    border-radius: 6px;
    flex-shrink: 0;
  }
  
  .overlay {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 0.5rem;
  }
  
  .overlay h3 {
    font-size: 1.2rem;
    text-align: center;
    color: #820000;
    margin-bottom: 0.6rem;
    padding: 0;
  }

   .featured-sections h3 {
    text-align: center !important;
    justify-content: center;
    width: 100%;
    display: block;
    margin-bottom: 0.8rem;
  }
  
  .card-description {
    opacity: 1;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #000;
    text-align: justify;
    margin: 0 0 1rem 0;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
  }
  
  /* === ABOUT SERVICES - OTTIMIZZATO PER IPAD === */
  
  .about-services-text {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    padding: 0;
  }
  
  .about-services-image {
    flex: 0 0 100%;
    max-width: 100%;
    min-width: 0;
    width: 100%;
    margin: 0.8rem 0 0 0;
    padding: 0;
    display: block;
  }
  
  .about-services-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: none;
    margin: 0;
    padding: 0;
    display: block;
  }
}

@media (max-width: 1024px) {
  .language-switcher {
    position: static;
    margin-top: 1rem;
    justify-content: center;
    width: 100%;
    gap: 1rem;
  }
  .header-title {
    margin-bottom: 2rem;
  }
}

/* Desktop con mouse preciso (901–1024px): mostra l'immagine senza ritagliarla e scala proporzionalmente */
@media (hover: hover) and (pointer: fine) and (min-width: 901px) and (max-width: 1024px) {
  .about-services-image {
    height: auto;            /* niente altezza fissa: la colonna si adatta all'immagine */
    align-self: stretch;     /* si allinea all'altezza del contenitore */
  }
  .about-services-image img {
    width: 100%;
    height: auto !important; /* scala mantenendo il rapporto, nessun taglio alto/basso */
    object-fit: contain;     /* non ritaglia: tutto contenuto, eventualmente con bande */
    object-position: center;
  }
}

/* Per tablet medi (verticali) */
@media (max-width: 900px) {
  .about-services-container {
    flex-direction: column;
    padding-top: 2rem;
  }
  .about-services-image {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    margin-left: 0;
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .about-services-image img {
    align-self: center;
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
  }
  .contact-wrapper-2cols {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
  .contact-block,
  .contact-form {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }
  .privacy-group {
    flex-direction: column;
    align-items: flex-start;
  }
  .contact-form button[type="submit"] {
    margin-left: 0;
    margin-top: 1rem;
    width: 100%;
  }
  .contact-container {
    flex-direction: column;
    align-items: stretch;
    gap: 2rem;
    padding: 1rem 0.5rem;
  }
  .contact-block,
  .contact-form {
    margin-bottom: 0.5rem;
    width: 100%;
    display: flex;
    justify-content: left;
    align-items: left;
  }
}

/* Tablet verticali ipad mini/air/pro */
@media 
  (max-width: 768px),
  (min-width: 1024px) and (max-width: 1026px) and (min-height: 1366px) and (max-height: 1368px) and (orientation: portrait),
  (min-width: 820px) and (max-width: 822px) and (min-height: 1180px) and (max-height: 1182px) and (orientation: portrait),
  (min-width: 1024px) and (max-width: 1026px) and (min-height: 1257px) and (max-height: 1261px) and (orientation: portrait)
{
  .featured-sections.english.active,
  .featured-sections.italian.active,
  .featured-sections.spanish.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 1rem 0;
    gap: 1rem;
  }
  .featured-section {
    display: flex;
    flex-direction: column-reverse;
    height: auto;
    cursor: default;
    padding-left: 12px;
    padding-right: 12px;
    background: #ffffff;
  }
  .featured-section img {
    margin-bottom: 1.5rem;
    padding-left: 12px;
    padding-right: 12px;
    margin-top: 1rem;
  }
  .overlay {
    position: static;
    background: transparent;
    height: auto;
    padding-left: 12px;
    padding-right: 12px;
    display: block;
    overflow: visible;
  }
  .overlay h3 {
    font-size: 1.5rem;
    text-align: center;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.8rem;
    width: 100%;
    display: block;
    box-sizing: border-box;
    word-break: break-word;
  }
  .card-description {
    opacity: 1 !important;
    font-size: 1rem;
    line-height: 1.6;
    color: rgb(0, 0, 0);
    margin-top: 0.2rem;
    text-align: justify;
    background: #ffffff;
    margin: 0 0 1rem 0;
  }
  .language-switcher {
    position: static;
    justify-content: center;
    margin-top: 1rem;
    width: 100%;
    gap: 0.5rem;
  }
  .lang-btn {
    font-size: 0.95rem;
    padding: 0.2rem 0.7rem;
  }
  header .header-title {
    margin-bottom: 2rem;
  }
  .contact-block {
    width: 100%;
    padding: 1rem;
  }
  .contact-block p {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .about-services-container,
  .about-services-text,
  .about-services-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0;
    object-fit: cover;
    border-radius: 14px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .about-services-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    padding-left: 8px;
    padding-right: 8px;
  }
  .about-services-text h2 {
    padding-left: 8px;
    text-align: left;
  }
  .about-services-text p {
    text-align: justify;
    margin-left: 8px;
    margin-right: 8px;
  }

  .cookie-banner {
    display: flex;
    flex-direction: column;
    padding: 1rem;
  }
  .cookie-banner p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }
  .contact-block {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
    font-size: 1.15rem;
  }
  .contact-block p {
    font-size: 1.08rem;
    line-height: 1.5;
  }
  .cookie-buttons {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 0.5rem;
  }
  .cookie-buttons button {
    flex: 1 1 0;
    width: auto;
    font-size: 1rem;
  }
  .contact-block h2 {
    text-align: left;
    margin-left: 0;
  }
  .footer-top,
  .footer-bottom {
    font-size: 0.98rem;
    padding: 0.7rem 0.2rem;
  }
  .featured-section {
    gap: 1rem;
  }
  .featured-section h3 {
    margin-bottom: 0.1px;
  }
  .language-switcher {
    gap: 0.2rem;
    padding: 0.2rem 0;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
  }
  .lang-btn {
    display: flex;
    width: auto;
    min-width: unset;
    max-width: 120px;
    height: 34px;
    font-size: 1.08rem;
    padding: 0.3rem 1rem;
    border-radius: 3px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .lang-btn img {
    width: 32px;
    height: 26px;
    margin-right: 8px;
    vertical-align: middle;
  }
  .header-container {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
  }
  .logo-img {
    margin: 0 auto 0.5rem auto;
    display: block;
    height: 160px;
    width: auto;
  }
  .header-title {
    align-items: center;
    text-align: center;
    margin-left: 0;
    margin-bottom: 0.5rem;
  }
  .bold-text,
  .light-text,
  .subtitle,
  p.subtitle {
    text-align: center;
    margin-top: 0.5rem;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }
}

@media 
  (min-width: 1180px) and (max-width: 1200px) and (min-height: 800px) and (max-height: 850px) and (orientation: landscape),
  (min-width: 1360px) and (max-width: 1370px) and (min-height: 1020px) and (max-height: 1030px) and (orientation: landscape),
  (min-width: 1020px) and (max-width: 1030px) and (min-height: 760px) and (max-height: 770px) and (orientation: landscape),
  (min-width: 1366px) and (max-width: 1368px) and (min-height: 915px) and (max-height: 920px) and (orientation: landscape)
  
{
  .featured-sections.english.active,
  .featured-sections.italian.active,
  .featured-sections.spanish.active {
    align-items: stretch;
  }
  .featured-section {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center; 
    cursor: default;
    padding-left: 24px;
    padding-right: 24px;
    background: #ffffff;
    height: 600px;
  }
  .featured-section img {
    margin-bottom: 2rem;
    margin-top: 1rem;    
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    display: block;
  }
  .overlay {
    position: static;
    background: transparent;
    height: auto;
    padding: 0;
    display: block;
    overflow: visible;
    width: 100%;
  }
  .overlay h3 {
    font-size: 1rem;
    text-align: left;
    padding: 0.3rem 0 !important;
    margin-bottom: 0.3rem !important;
    width: 100%;
    display: block;
    box-sizing: border-box;
    word-break: break-word;
  }
  .card-description {
    opacity: 1 !important;
    font-size: 0.8rem;
    line-height: 1.7;
    color: rgb(0, 0, 0);
    margin-top: 0.5rem;
    text-align: justify;
    background: #ffffff;
    margin-bottom: 1rem;
  }
}


@media (max-width: 768px) {
  .about-services-image,
  .featured-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .about-services-image img,
  .featured-section img {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 140px !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    padding: 0 !important;
  }

  .subtitle {
    line-height: 1.3;
}

  /* Desktop con mouse preciso (>=1025px): niente altezza fissa, l'immagine cresce con la finestra e non viene ritagliata */
  @media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
    .about-services-image {
      height: auto; 
      align-self: stretch; 
    }
    .about-services-image img {
      width: 100%;
      height: auto; 
      object-fit: contain; 
      object-position: center;
    }
  }

/* Estendi il comportamento tablet landscape oltre 1024px fino a 1200px */
@media (min-width: 1025px) and (max-width: 1200px) and (orientation: landscape) {
  .featured-sections.english.active,
  .featured-sections.italian.active,
  .featured-sections.spanish.active {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem;
    background-color: #efeeea;
    justify-items: center;
    align-items: start;
  }

  /* Nascondi l'immagine laterale e rendi il testo About full-width */
  .about-services-image,
  .about-services-image .foto-laterale {
    display: none !important;
  }

  .about-services-container {
    flex-direction: column;
    padding: 0.5rem 1rem;
    gap: 1.5rem;
    align-items: stretch;
  }

  .about-services-text {
    width: 100%;
    max-width: 100%;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
    box-sizing: border-box;
  }
}

  /* === PROJECT COUNTERS (Mobile) === */
  .counters-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }
  .counter .value { font-size: 2rem; }
  .counter .label { font-size: 1rem; }
}

/* ABOUT: in landscape tablet/low-desktop nascondi l'intera colonna immagine
   e fai espandere il testo a tutta larghezza */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape),
       (min-width: 1025px) and (max-width: 1200px) and (orientation: landscape) {
  /* Nascondi tutta la colonna immagine, non solo l'elemento <img> */
  .about-services-image {
    display: none !important;
  }

  /* Contenitore a colonna per evitare spazi vuoti e mantenere ordine */
  .about-services-container {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    padding: 0.5rem 1rem;
  }

  /* Testo a tutta larghezza quando la foto è nascosta */
  .about-services-text {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
    box-sizing: border-box;
  }
}
/* Desktop ampio (>=1201px): centra verticalmente immagine e testo affiancati
   in modo che la foto non parta dall'alto ma sia sempre centrata rispetto al blocco testo */
@media (min-width: 1201px) {
  .about-services-container {
    align-items: center; /* centra i due blocchi lungo l'asse verticale */
  }
  .about-services-image {
    align-self: center;  /* evita lo stretch della colonna immagine */
    height: auto;        /* lascia che l'altezza sia determinata dal contenuto */
  }
  .about-services-image img {
    height: auto;        /* evita di riempire tutta l'altezza del contenitore */
    width: 100%;
    object-fit: cover;   /* mantiene un aspetto elegante senza deformazioni */
    object-position: center;
  }
}


/* --- PROJECT COUNTERS (centered row) --- */
.counters-section {
  width: 100%;
  background: transparent;
  padding: 1.5rem 0 2rem 0;
}

.counters-row {
  display: flex;
  justify-content: center; /* center the whole row horizontally */
  align-items: center;
  gap: 2.5rem; /* spacing between counters */
  max-width: 1200px; /* keep a comfortable maximum width */
  margin: 0 auto; /* center within page */
  padding: 0 1rem; /* small horizontal padding for narrow viewports */
  flex-wrap: wrap; /* allow wrapping on small screens */
}

.counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 160px; /* preserve visual size */
  padding: 0.4rem 0.6rem;
}

.counter .value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #820000;
  line-height: 1;
}

.counter .label {
  margin-top: 0.4rem;
  font-size: 1.05rem;
  color: #333;
  text-align: center;
}

@media (max-width: 600px) {
  .counters-row {
    gap: 1.25rem;
  }
  .counter {
    min-width: 140px;
    padding: 0.3rem 0.4rem;
  }
  .counter .value {
    font-size: 2rem;
  }
}