/* default: mostra solo i primi 2 indicatori */
#reviewsIndicators .indicator:nth-child(n + 3) {
  display: none;
}

/* ---------------------------------------------------
   RESPONSIVE BREAKPOINT: 375px - 380px (Smartphone)
------------------------------------------------------ */
@media (max-width: 400px) {
  /* 1. LAYOUT WRAPPER: Frecce sotto il contenuto */
  .intervention-carousel-wrapper,
  .reviews-carousel-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    /* Cambiato da center a flex-start per spostare le frecce a sinistra */
    justify-content: center;
    align-items: center;
    padding: 0 15px; /* Leggermente aumentato per non far toccare il bordo alle frecce */
    gap: 0;
    position: relative;
  }

  .intervention-display-container,
  .reviews-display-container {
    flex: 0 0 100%;
    width: 100%;
    margin-bottom: 10px;
    order: 1; /* Assicura che la card sia il primo elemento */
  }

  /* 2. FRECCE: Affiancate a sinistra sotto la card */
  .carousel-arrow {
    position: static !important;
    display: inline-flex !important;
    width: 50px;
    height: 50px;
    /* Margin-right crea lo spazio tra le due frecce, margin-bottom dà aria ai pallini */
    margin: 10px 10px !important;
    transform: none;
    order: 2;
  }

  /* 3. INTERVENTI: Immagine quadrata a tutta larghezza */
  .intervention-container {
    flex: 0 0 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 1 / 1 !important; /* Forza il contenitore quadrato */
    position: relative !important;
    overflow: hidden !important;
    margin: 0 !important;
  }

  .intervention-image {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: cover !important; /* Impedisce il taglio casuale e la deformazione */
    object-position: center !important;
    position: absolute !important; /* Assicura che riempia il contenitore */
    top: 0;
    left: 0;
  }

  .intervention-text-content h3 {
    font-size: 19px !important;
  }

  /* 4. RECENSIONI: Altezza fissa e scroll interno */
  .review-card {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    height: 300px !important;
    padding: 20px !important;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-sizing: border-box;
    overflow: hidden;
  }

  .review-text {
    font-size: 0.95rem !important;
    line-height: 1.5;
    margin: 10px 0;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px;
  }

  /* 5. INDICATORI: Spostati più in basso e centrati per chiarezza */
  .carousel-indicators {
    order: 3;
    width: 100%; /* Occupa tutta la riga per potersi centrare sotto le frecce */
    display: flex;
    justify-content: center;
    margin-top: 15px; /* Spazio aggiuntivo sopra i pallini */
    padding-bottom: 10px;
    gap: 6px;
  }

  .indicator {
    width: 10px;
    height: 10px;
  }

  /* 6. RIDUZIONE SPAZI VUOTI SEZIONI */
  .intervention-section,
  .story-section,
  .estimate-quote-section,
  .reviews-section {
    padding: 25px 10px !important;
  }

  .hero-banner {
    height: 28vh;
  }

  .hero-content h1,
  .hero-content2 h1,
  .hero-content3 h1 {
    font-size: 20px !important;
  }

  .hero-content p,
  .hero-content2 p,
  .hero-content3 p {
    font-size: 16px !important;
  }

  .intervention-text p {
    font-size: 21px;
  }

  .story-subtitle,
  .reviews-title,
  .estimate-quote-subtitle {
    font-size: 21px !important;
    text-align: center;
  }

  .hero-banner {
    height: 26vh !important;
  }

  .hero-content,
  .hero-content2,
  .hero-content3 {
    margin-top: 10px;
    padding: 6px;
    text-align: center;
  }

  .hero-content h1,
  .hero-content2 h1,
  .hero-content3 h1 {
    font-size: 18px !important;
    line-height: 1.2;
    padding: 2px;
  }

  .hero-content p,
  .hero-content2 p,
  .hero-content3 p {
    font-size: 11px;
    line-height: 1.4;
    margin-top: 6px;
    padding: 0 8px;
  }

  /* ===== INTERVENTION TITLE (se presente) ===== */
  .intervention-text p {
    font-size: 16px;
    padding: 0 8px;
    text-align: center;
  }

  .intervention-underline {
    width: 95%;
    margin: 6px auto 10px;
  }

  /* ===== STORY SECTION ===== */
  .story-section {
    margin-top: 16px;
    padding: 0 10px;
    text-align: center;
  }

  .story-subtitle {
    font-size: 18px;
    margin-bottom: 2px;
  }

  .subtitle-underline {
    width: 100%;
    margin: 4px auto 14px;
  }

  .story-display {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px;
  }

  .story-text-section {
    width: 100%;
    align-items: center;
  }

  .story-text-section p {
    font-size: 13px;
    line-height: 1.6;
    margin: 10px auto;
    max-width: 320px;
  }

  .story-image-section img {
    width: 100%;
    border-radius: var(--radius-medium);
  }

  .estimate-quote-underline {
    width: 90vw;
  }

  .reviews-underline {
    width: 80%;
  }
}

/* ------------------------------------------
   RESPONSIVE BREAKPOINTS: MAX-WIDTH 480px
------------------------------------------- */
@media (min-width: 401px) and (max-width: 480px) {
  /* ===== HERO BANNER ===== */
  .hero-banner {
    height: 28vh !important;
  }

  .hero-content,
  .hero-content2,
  .hero-content3 {
    padding: 8px;
  }

  .hero-content h1,
  .hero-content2 h1,
  .hero-content3 h1 {
    font-size: 20px !important;
    line-height: 1.2;
    padding: 4px;
  }

  .hero-content p,
  .hero-content2 p,
  .hero-content3 p {
    font-size: 14px;
    line-height: 1.4;
    margin-top: 8px;
  }

  .intervention-carousel-wrapper {
    padding: 0 !important;
  }

  /* ===== INTERVENTI (CAROUSEL, UNA CARD ALLA VOLTA) ===== */
  .intervention-section {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .intervention-display-container {
    overflow: hidden;
    width: 100%;
  }

  .intervention-display {
    display: flex;
    gap: 16px;
    transition: transform 0.5s ease;
  }

  /* Una card alla volta → larghezza 100% */
  .intervention-container {
    min-width: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-large);
  }

  .intervention-text-content {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    position: absolute;
  }

  .intervention-text-content.visible {
    visibility: visible;
    opacity: 1;
  }

  .intervention-text-content h3 {
    font-size: 16px;
  }

  .intervention-text-content p {
    font-size: 13px;
  }

  .intervention-text p {
    font-size: 18px;
    padding: 0 10px;
  }

  .intervention-underline {
    width: 90%;
    margin: 8px auto 12px auto;
  }

  /* FRECCE INTERVENTI */
  .carousel-arrow {
    width: 50px;
    height: 50px;
    font-size: 14px;
    margin-left: 20px;
    margin-right: 20px;
  }

  /* INDICATORI CAROUSEL */
  .carousel-indicators {
    gap: 6px;
  }

  .indicator {
    width: 8px;
    height: 8px;
  }

  #reviewsIndicators .indicator {
    display: inline-block;
  }

  #reviewsIndicators {
    gap: 4px; /* riduci lo spazio se necessario */
  }

  /* ===== LA NOSTRA STORIA ===== */
  .story-section {
    margin-top: 20px;
  }

  .story-subtitle {
    font-size: 20px;
    margin-bottom: 2px;
  }

  .subtitle-underline {
    width: 60vw;
    margin: 4px auto 16px auto;
  }

  .story-display {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 10px;
  }

  .story-text-section p {
    font-size: 14px;
    line-height: 1.6;
    margin-top: 16px;
    margin: 10px auto;
  }

  .story-text-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra titolo e paragrafo */
  }

  .story-image-section img {
    width: 100%;
    border-radius: var(--radius-medium);
  }

  /* ===== SLOGAN ===== */
  .slogan {
    font-size: 14px;
    line-height: 1.4;
    padding-left: 10px;
    max-width: 90%;
    margin: 20px auto;
  }

  /* ===== PREVENTIVO ===== */
  .estimate-quote-subtitle {
    font-size: 20px;
  }

  .estimate-quote-underline {
    width: 90vw;
    margin: 4px auto 16px;
  }

  .estimate-quote-subcontainer {
    padding: 20px;
    width: 100%;
    max-width: 100%;
  }

  .estimate-quote-text p {
    font-size: 14px;
    line-height: 1.6;
  }

  .estimate-quote-button {
    width: 160px;
    height: 44px;
    font-size: 14px;
  }

  /* ===== RECENSIONI (CAROUSEL, UNA CARD ALLA VOLTA) ===== */
  .reviews-title {
    font-size: 20px;
  }

  .reviews-section {
    padding: 30px 0 !important;
  }

  .reviews-underline {
    width: 70%;
  }

  .reviews-carousel-wrapper {
    gap: 10px;
  }

  .reviews-display {
    display: flex;
    gap: 10px;
    margin-top: -15px;
    transition: transform 0.5s ease;
  }

  /* Una card per pagina → 100% */
  .review-card {
    flex: 0 0 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    padding: 18px;
  }

  .review-name {
    font-size: 1.5rem;
  }

  .review-stars {
    font-size: 1.5rem;
  }

  .review-text {
    font-size: 1.1rem;
  }

  .review-date {
    font-size: 1rem;
  }

  .reviews-button {
    width: 160px;
    height: 45px;
    font-size: 14px;
  }

  /* FRECCE RECENSIONI */
  .carousel-arrow.reviews {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
}

/* ------------------------------------------
   RESPONSIVE BREAKPOINTS: 768px - 780px
------------------------------------------- */
@media (min-width: 481px) and (max-width: 768px) {
  /* ===== HERO BANNER ===== */
  .hero-banner {
    height: 40vh; /* Leggermente più alto del mobile per dare respiro */
  }

  .hero-content h1,
  .hero-content2 h1,
  .hero-content3 h1 {
    font-size: 28px;
  }

  .hero-content p,
  .hero-content2 p,
  .hero-content3 p {
    font-size: 16px;
  }

  /* ===== INTERVENTI (1 CARD QUADRATA) ===== */
  .intervention-section {
    padding: 40px 40px;
  }

  .intervention-underline {
    width: 95%;
  }

  .intervention-text p {
    font-size: 20px;
    margin-bottom: 10px;
  }

  /* Distanziamo le frecce dai bordi */
  .intervention-carousel-wrapper {
    padding: 0 50px;
    gap: 15px;
  }

  .intervention-container {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    aspect-ratio: 16 / 9; /* Immagine quadrata */
  }

  .intervention-text-content h3 {
    font-size: 22px;
  }

  .intervention-text-content p {
    font-size: 16px;
  }

  /* ===== LA NOSTRA STORIA ===== */
  .story-section {
    padding: 40px 20px;
  }

  .story-display {
    display: flex !important;
    flex-direction: column !important; /* Forza la colonna */
    align-items: center !important;
    text-align: center !important;
    gap: 0 !important; /* Aumenta lo spazio tra testo e immagine */
  }

  .story-text-section {
    width: 100% !important;
    order: 1; /* Testo sopra */
  }

  .story-image-section {
    width: 100% !important;
    max-width: 500px; /* Evita che l'immagine diventi gigantesca su tablet */
    margin: 0 auto;
    order: 2; /* Immagine sotto */
  }

  .story-subtitle {
    font-size: 26px;
  }

  .subtitle-underline {
    width: 90%;
  }

  .story-text-section p {
    font-size: 17px;
    line-height: 1.6;
    margin-top: 20px;
  }

  .slogan {
    font-size: 18px;
    max-width: 85%;
    padding: 15px;
    border-left: 4px solid var(--accent-color); /* Un tocco di stile */
  }

  .story-image-section {
    width: 90%; /* Più larga su tablet */
    margin-top: 20px;
  }

  /* ===== PREVENTIVO ===== */
  .estimate-quote-section {
    padding: 50px 20px;
  }

  .estimate-quote-subtitle {
    font-size: 24px;
    text-align: center;
  }

  .estimate-quote-underline {
    width: 95%;
  }

  .estimate-quote-text p {
    font-size: 17px;
    margin-bottom: 20px;
  }

  .estimate-quote-button {
    width: 200px;
    height: 50px;
    font-size: 16px;
  }

  /* ===== RECENSIONI (2 CARD) ===== */
  .reviews-title {
    font-size: 26px;
  }

  .reviews-underline {
    width: 50%;
  }

  .reviews-carousel-wrapper {
    padding: 0 40px;
  }

  .review-card {
    flex: 0 0 calc((100% - 24px) / 2) !important;
    max-width: calc((100% - 24px) / 2) !important;
    min-width: calc((100% - 24px) / 2) !important;
    padding: 25px;
  }

  .review-name {
    font-size: 1.2rem;
  }

  .review-text {
    font-size: 1rem;
    height: auto; /* Permette al testo di respirare */
  }
}

/* ---------------------------------------------------
   RESPONSIVE BREAKPOINT: 1024px (Tablet Landscape / Laptop)
------------------------------------------------------ */
@media (min-width: 769px) and (max-width: 1024px) {
  /* ===== HERO BANNER ===== */
  .hero-banner {
    height: 45vh; /* Altezza intermedia per schermi desktop piccoli */
  }

  .hero-content h1,
  .hero-content2 h1,
  .hero-content3 h1 {
    font-size: 32px;
  }

  /* ===== SEZIONE INTERVENTI (2 CARD -> 3 INDICATORI) ===== */
  .intervention-section {
    padding: 50px 0;
  }

  /* Spazio per le frecce laterali */
  .intervention-carousel-wrapper {
    padding: 0 60px;
    gap: 20px;
  }

  .intervention-display {
    gap: 24px; /* Spazio tra le due card */
  }

  .intervention-underline {
    width: 95%;
  }

  .intervention-container {
    /* Calcolo per 2 card: (100% - gap) / 2 */
    flex: 0 0 calc((100% - 24px) / 2) !important;
    max-width: calc((100% - 24px) / 2) !important;
    aspect-ratio: 1 / 1; /* Forza la forma quadrata grande */
  }

  .intervention-text p {
    font-size: 24px;
  }

  .intervention-text-content h3 {
    font-size: 20px;
  }

  .intervention-text-content p {
    font-size: 16px;
  }

  /* ===== LA NOSTRA STORIA ===== */
  .story-display {
    flex-direction: row; /* Su 1024px torniamo al layout affiancato */
    align-items: center;
    gap: 40px;
    padding: 0 30px;
  }

  .story-text-section {
    flex: 1;
    text-align: left;
  }

  .story-image-section {
    flex: 1;
    max-width: 450px;
  }

  .story-subtitle {
    font-size: 28px;
  }

  .subtitle-underline {
    width: 95%;
    margin: 4px 0 16px 0; /* Allinea a sinistra */
  }

  /* ===== PREVENTIVO ===== */
  .estimate-quote-container {
    padding: 40px;
  }

  .estimate-quote-subtitle {
    font-size: 26px;
  }

  .estimate-quote-underline {
    width: 90%;
  }

  /* ===== RECENSIONI (4 CARD -> 2 INDICATORI) ===== */
  .reviews-title {
    font-size: 28px;
  }

  .reviews-display-container {
    width: 100%;
    overflow: hidden;
  }

  .reviews-carousel-wrapper {
    padding: 0 40px;
  }

  .reviews-display {
    gap: 16px; /* Ridotto per far stare 4 card comodamente */
  }

  .review-card {
    flex: 0 0 calc((100% - (16px * 3)) / 4) !important;
    max-width: calc((100% - (16px * 3)) / 4) !important;
    min-width: calc((100% - (16px * 3)) / 4) !important;
    box-sizing: border-box;
    padding: 15px;
    min-height: 220px;
  }

  .review-name {
    font-size: 1.1rem;
  }

  .review-stars {
    font-size: 1.2rem;
  }

  .review-text {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .review-date {
    font-size: 0.85rem;
  }
}

@media (min-width: 1025px) and (max-width: 1390px) {
  /* ===== SEZIONE INTERVENTI (2 CARD -> 3 INDICATORI) ===== */
  /* Spazio per le frecce laterali */
  .intervention-carousel-wrapper {
    padding: 0 60px;
    gap: 20px;
  }

  .intervention-display {
    gap: 24px; /* Spazio tra le due card */
  }

  .intervention-container {
    /* Calcolo per 2 card: (100% - gap) / 2 */
    flex: 0 0 calc((100% - 24px) / 2) !important;
    max-width: calc((100% - 24px) / 2) !important;
    aspect-ratio: 1 / 1; /* Forza la forma quadrata grande */
  }

  .intervention-underline {
    width: 80%;
  }

  .estimate-quote-underline {
    width: 65%;
  }
}
