/* ================== SEZIONE PRODOTTI DIATEST ================== */
#prodotti-diatest-section {
    margin: 40px auto 20px auto;
    font-family: 'Poppins', sans-serif !important;
    max-width: 1000px;
}

/* ================== LOGO + QR (TUA STRUTTURA ORIGINALE) ================== */
#prodotti-diatest-section .header-logo {
    position: relative;      /* serve per posizionare il QR a destra */
    text-align: center;      /* logo centrato */
    padding: 20px 0;
    background-color: #fff;
    max-width: 1000px;
    margin: 0 auto;
}

#prodotti-diatest-section .header-logo .logo-diatest {
    height: 50px;
    width: auto;
}

#prodotti-diatest-section .header-logo .qr-diatest {
    position: absolute;
    top: 50%;
    right: 10px;            /* margine dal bordo destro del container */
    transform: translateY(-50%);
    height: 70px;
    width: 70px;
}

/* ================== UNICA MODIFICA PER MOBILE ================== */
@media (max-width: 768px) {
    #prodotti-diatest-section {
        /* Aumentiamo il margine solo qui per spingere tutto il blocco pił in basso */
        /* in modo che non finisca sotto il breadcrumb */
        margin-top: 85px !important; 
    }
}

/* ================== SEZIONE ICONE E ELENCO ATTACCATE ================== */
#diatest-icone-section,
#elenco-prodotti-section {
    text-align: center;
    margin-top: 0;
    margin-bottom: 0;
}

.collapsible-wrapper {
    max-width: 1000px;
    margin: 0 auto; /* rimosso spazio sotto */
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: #fff;
    overflow: visible;
}

.collapsible {
    background-color: #f1f1f1;
    color: #003366;
    cursor: pointer;
    padding: 10px 15px;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    font-size: 16px;
    border-radius: 8px 8px 0 0;
}

.collapsible:after {
    content: "\25BC";
    font-size: 12px;
    float: right;
    margin-left: 5px;
}

.collapsible.active:after {
    content: "\25B2";
}

.content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
    padding: 0 15px;
}

/* ================== ICONE ================== */
.diatest-icone-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 15px 0;
    overflow: visible;
}

.diatest-icona-item {
    width: 50px;
    height: 50px;
    position: relative;
}

.diatest-icona-item img {
    width: 100%;
    height: 100%;
}

/* ================== TOOLTIP SU HOVER ================== */
.diatest-icona-item::after {
    content: attr(title);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 11px;
    padding: 4px 6px;
    border-radius: 4px;
    text-align: center;
    width: 140px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    z-index: 10;
}

.diatest-icona-item:hover::after {
    opacity: 1;
}

/* ================== ELENCO PRODOTTI COLLASSABILE ================== */
#elenco-prodotti-section .elenco-prodotti li {
    display: block;
    text-align: left;
    padding: 2px 8px;
    line-height: 1.2;
    border-radius: 3px;
    margin-bottom: 1px;
}

#elenco-prodotti-section .elenco-prodotti li a {
    display: contents;
    color: black !important;
    text-decoration: none !important;
}

#elenco-prodotti-section .elenco-prodotti li a strong {
    text-align: left;
}

#elenco-prodotti-section .elenco-prodotti li a span {
    text-align: left;
}

/* ================== ELENCO PRODUTTI TESTUALE ================== */
#elenco-prodotti-section .elenco-prodotti li:nth-child(odd) {
    background-color: rgba(245, 211, 211, 0.4);
}

#elenco-prodotti-section .elenco-prodotti li:nth-child(even) {
    background-color: #ffffff;
}

#elenco-prodotti-section .elenco-prodotti li {
    padding: 3px 5px;
    border-radius: 4px;
}

#elenco-prodotti-section .descrizione-prodotto {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* ================== GRIGLIA PRODOTTI ================== */
#prodotti-diatest-section .prodotti-diatest-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    justify-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

/* ================== CARD PRODOTTO ================== */
#prodotti-diatest-section .prodotto-item {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    text-align: center;
    width: 100%;
    max-width: 220px;
    transition: transform 0.2s;
    position: relative; /* necessario per badge assoluto */
}

#prodotti-diatest-section .prodotto-item:hover {
    transform: scale(1.05);
}

/* ================== IMMAGINI PRODOTTO ================== */
#prodotti-diatest-section .prodotto-img {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    position: relative;
    background-color: #fff;
}

#prodotti-diatest-section .prodotto-img img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ================== TESTO E LOGO SOTTO IMMAGINE ================== */
#prodotti-diatest-section .testo-prodotto {
    padding: 5px 10px;
    text-align: center;
}

#prodotti-diatest-section .prodotto-item a,
#prodotti-diatest-section .prodotto-item a * {
    color: black !important;
    text-decoration: none !important;
}

#prodotti-diatest-section .logo-prodotto {
    height: 16px;
    width: auto;
    vertical-align: middle;
    margin-bottom: 4px;
}

/* ================== Icona diramazione ================== */
#prodotti-diatest-section .prodotto-item .prodotto-img::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background-image: url('/img/icona-diramazione.png');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 5;
}

#prodotti-diatest-section .prodotto-item.no-diramazione .prodotto-img::after {
    content: none;
}

/* ================== BADGE CONTEGGIO ================== */
.badge-count-custom {
    position: absolute;
    top: 8px;
    right: 0px;
    background-color: #1a7f00;
    color: #ffffff !important;
    padding: 5px 10px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* FIX DEFINITIVO COLORE TESTO BADGE */
#prodotti-diatest-section .prodotto-item a span.badge-count-custom {
    color: #ffffff !important;
}

/* ================== Responsive ================== */
@media (max-width: 1024px) {
    #prodotti-diatest-section .prodotti-diatest-container {
        max-width: 100%;
    }

    #prodotti-diatest-section .prodotto-item {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    #prodotti-diatest-section .prodotto-item {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    #prodotti-diatest-section .prodotto-item {
        max-width: 100%;
    }
}

/* ================== ICONA NELLA LISTA TESTUALE ================== */
#elenco-prodotti-section .elenco-prodotti li a {
    display:flex;
    align-items:center;
}

#elenco-prodotti-section .icon-products {
    width:16px;
    height:16px;
    margin-right:6px;
    flex-shrink:0;
    background-image:url('/img/icona-diramazione.png');
    background-size:contain;
    background-repeat:no-repeat;
}

#elenco-prodotti-section .icon-products.no-icon {
    background-image:none;
}

/* ================== COLLAPSIBILE STICKY ================== */
#prodotti-diatest-sticky-wrapper {
    position: static;
    top: auto;
    margin: 0;
    padding: 0;
}

#prodotti-diatest-sticky-wrapper .collapsible-wrapper {
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: visible;
}

#diatest-icone-section .content,
#elenco-prodotti-section .content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
    padding: 0 15px;
}

/* ================== MEDIA QUERIES DESKTOP ================== */
@media (min-width: 1024px) {
    #prodotti-diatest-section {
        max-width: 1300px;
    }

    #prodotti-diatest-section .header-logo {
        max-width: 1300px;
    }

    .collapsible-wrapper {
        max-width: 1300px;
    }

    #prodotti-diatest-section .prodotti-diatest-container {
        max-width: 1300px;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    #prodotti-diatest-section .prodotto-item {
        max-width: 260px;
    }
}

#prodotti-diatest-section h3 {
    text-align: center;
    margin: 20px 0;
}

.comparatori-intro {
    width: 100%;          /* occupa tutta la larghezza disponibile */
    margin: 20px 0;       /* margini verticali */
    font-family: Arial, sans-serif;
    font-size: 16px;      /* font pił grande e leggibile */
    line-height: 1.8;     /* pił spazio tra le righe */
    color: #333;
    padding: 0 20px;      /* margine interno laterale */
    box-sizing: border-box; /* evita che padding riduca la larghezza */
}

.comparatori-container {
    display: flex;
    flex-direction: column;
    width: 100%;           /* prende tutta la larghezza */
    margin: 20px 0;
    font-family: Arial, sans-serif;
    font-size: 14px;       /* dimensione standard per le righe */
    color: #333;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    box-sizing: border-box;
}

/* ================== CONTAINER WRAPPER ================== */
#dettagli-comparatore-kaefer-section .container-wrapper {
    display: flex;
    gap: 20px;                 /* spazio tra i container */
    flex-wrap: wrap;           /* permette al mobile di fare stack */
    padding: 20px;
}

/* ================== IMAGE, LEGEND, TEXT ================== */
#dettagli-comparatore-kaefer-section .image-container,
#dettagli-comparatore-kaefer-section .legend-container,
#dettagli-comparatore-kaefer-section .text-container {
    flex: 1;                   /* tutte e 3 prendono lo stesso spazio su desktop */
    min-width: 250px;          /* evita che siano troppo strette */
    padding: 20px;             /* padding interno maggiore */
    border-radius: 8px;
    box-sizing: border-box;
    transition: transform 0.2s;
}

/* ================== STILE GENERALE PER LA SEZIONE ================== */
#dettagli-comparatore-kafer {
  font-family: 'Poppins', sans-serif;
  color: #333;
  margin: 20px 0;
}

#dettagli-comparatore-kafer .collapsible-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ================== CONTENITORE COLLASSABILE ================== */
#dettagli-comparatore-kafer .collapsible {
  background-color: #f1f1f1;
  color: #003366;
  cursor: pointer;
  padding: 10px 15px;
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  font-size: 16px;
  border-radius: 8px 8px 0 0;
}

#dettagli-comparatore-kafer .collapsible:after {
  content: "\25BC";
  font-size: 12px;
  float: right;
  margin-left: 5px;
}

#dettagli-comparatore-kafer .collapsible.active:after {
  content: "\25B2";
}

#dettagli-comparatore-kafer .content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 15px;
}

/* ================== STILE PER I CONTENITORI ================== */
#dettagli-comparatore-kafer .container {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  background: #f9f9f9;
  box-sizing: border-box;
}

#dettagli-comparatore-kafer .image-container {
  flex: 1 1 300px;
  text-align: center;
  background-color: rgba(200, 230, 255, 0.3); /* Azzurro chiaro */
  border: 1px solid #99c2ff;
}

#dettagli-comparatore-kafer .legenda-container {
  flex: 1 1 300px;
  max-height: 600px;
  overflow-y: auto;
  background-color: rgba(200, 255, 200, 0.3); /* Verde chiaro */
  border: 1px solid #99ff99;
}

#dettagli-comparatore-kafer .testo-container {
  flex: 1 1 300px;
  background-color: rgba(255, 230, 200, 0.3); /* Arancione chiaro */
  border: 1px solid #ffcc99;
}

/* ================== STILE PER LE VOCI DELLA LEGENDA ================== */
#dettagli-comparatore-kafer .legenda-item {
  margin-bottom: 15px;
  font-size: 14px;
}



/* ================== STILE PER I CONTENITORI ================== */
#dettagli-comparatore-kafer .content {
  display: flex;
  gap: 20px;
  padding: 15px;
  flex-wrap: wrap;
}

#dettagli-comparatore-kafer .container {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  background: #f9f9f9;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%; /* Impostiamo altezza uguale per tutti i container */
}



/* ================== CONTENITORE COLLASSABILE ================== */
/* ================== STILE GENERALE PER LA SEZIONE ================== */
#dettagli-comparatore-kafer {
  font-family: 'Poppins', sans-serif;
  color: #333;
  margin: 20px 0;
}

#dettagli-comparatore-kafer .collapsible-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ================== CONTENITORE COLLASSABILE ================== */
#dettagli-comparatore-kafer .collapsible {
  background-color: #f1f1f1;
  color: #003366;
  cursor: pointer;
  padding: 10px 15px;
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  font-size: 16px;
  border-radius: 8px 8px 0 0;
}

#dettagli-comparatore-kafer .collapsible:after {
  content: "\25BC";
  font-size: 12px;
  float: right;
  margin-left: 5px;
}

#dettagli-comparatore-kafer .collapsible.active:after {
  content: "\25B2";
}

#dettagli-comparatore-kafer .content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 15px;
}


/* ================== FIX 3 BOX IN LINEA / MOBILE STACK ================== */

/* ============================================================
   FIX DEFINITIVO 3 BOX IN LINEA (KAEFER)
   ============================================================ */

/* 1. Assicuriamoci che il contenitore sia pronto a espandersi */
.collapsible-wrapper .content {
    display: block; /* Il padre deve essere block per il JS */
    padding: 0 15px;
    transition: max-height 0.3s ease-out;
}

/* 2. Il wrapper dei box DEVE essere Flexbox su desktop */
.collapsible-wrapper .content .info-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; /* Forza la riga su desktop */
    gap: 15px;
    padding: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

/* 3. Stile dei Box */
.info-box {
    flex: 1 1 0; /* Forza i box a dividersi lo spazio in parti uguali */
    padding: 15px;
    border-radius: 8px;
    box-sizing: border-box;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
}

/* 4. Colori di sfondo specifici */
.info-box-1 { background-color: #ffffff !important; border-color: #2196f3 !important; }
.info-box-2 { background-color: #f5f5f5 !important; border-color: #9e9e9e !important; }
.info-box-3 { background-color: #fffde7 !important; border-color: #fbc02d !important; }

/* 5. Allineamento testi */
.info-box h3 {
    margin-top: 0;
    font-size: 1.1em;
    color: #003366;
    text-align: left;
}
.info-box p {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 0;
    text-align: left;
}

/* 6. REGOLE PER MOBILE (Stack verticale) */
@media screen and (max-width: 768px) {
    .collapsible-wrapper .content .info-container {
        flex-direction: column !important; /* Uno sotto l'altro */
        flex-wrap: wrap !important;
    }
    
    .info-box {
        width: 100% !important;
        flex: none !important;
    }
}


/* ============================================================
   SEZIONE DOWLOAD
   ============================================================ */
/* ================== DOWNLOAD WRAPPER ================== */
.catalog-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

/* ================== CARD ================== */
.catalog-item {
  width: 150px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ================== COPERTINA ================== */
.catalog-cover {
  width: 140px;
  height: auto;
  border: 1px solid #ccc;
  display: block;
}

/* ================== INFO ================== */
.catalog-info {
  margin-top: 4px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ================== ICONE ================== */
.catalog-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  width: 100%;
  font-size: 11px;
  color: #555;
}

.catalog-icons img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}

/* ================== TITOLO ================== */
.catalog-title {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #000;
  text-decoration: none;
  line-height: 1.2;
}

.catalog-item:hover .catalog-title {
  text-decoration: underline;
}

/* ================== MOBILE ================== */
@media (max-width: 768px) {

  .catalog-wrapper {
    gap: 10px;
    justify-content: space-between;
  }

  .catalog-item {
    width: calc(50% - 5px);
  }

  .catalog-cover {
    width: 100%;
  }

  .catalog-title {
    font-size: 11px;
  }
}

/* LISTA PRODOTTI (tuo codice invariato) */
#elenco-prodotti-section .elenco-prodotti li:nth-child(odd) {
  background-color: rgba(245, 211, 211, 0.4);
}