/* Griglia di tutti i blocchi consigli del modulo (carrello e pagina prodotto).
   Non dipende dal CSS di ets_crosssell, che questo modulo sostituisce.
   Colonne da ~160px che riempiono lo spazio disponibile: 6 sotto il prodotto,
   4 nel carrello; con pochi prodotti le schede restano della loro misura. */
.mangayo-recsys-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mangayo-recsys-block {
  margin-top: 30px;
}

.mangayo-recsys-block .ets_crosssell_title {
  margin-bottom: 15px;
}

.mangayo-recsys-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin: 0 !important;
}

.mangayo-recsys-grid::before,
.mangayo-recsys-grid::after {
  content: none !important;
}

/* Il tema assegna larghezze/float da colonna (col-lg-*) alle miniature. */
.mangayo-recsys-grid .product-miniature {
  float: none;
  width: auto !important;
  max-width: none !important;
  flex: none;
  padding: 0 !important;
  margin: 0 !important;
}

/* Immagine, descrizione e bottone del tema hanno larghezze/altezze fisse
   pensate per altre griglie: li adattiamo alla colonna. */
.mangayo-recsys-grid .thumbnail-container,
.mangayo-recsys-grid .thumbnail-container-image,
.mangayo-recsys-grid .product-thumbnail,
.mangayo-recsys-grid .product-description {
  width: 100% !important;
  max-width: 100%;
}

.mangayo-recsys-grid .thumbnail-container-image,
.mangayo-recsys-grid .product-thumbnail {
  min-height: 0 !important;
  height: auto !important;
}

.mangayo-recsys-grid .product-thumbnail img {
  width: 100%;
  height: auto;
}

.mangayo-recsys-grid .an_productattributes-add {
  padding-left: 0;
  padding-right: 0;
}

.mangayo-recsys-grid .product-miniature .btn {
  width: 100%;
  max-width: 100%;
  font-size: 13px;
  white-space: nowrap;
  padding-left: 4px;
  padding-right: 4px;
  justify-content: center;
}

.mangayo-recsys-grid .product-miniature .product-title,
.mangayo-recsys-grid .product-miniature .product-title a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 575px) {
  .mangayo-recsys-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
