/** CSS related to shortcode [related_products_grid] used in Elementor Product template page 
* add by btb@didaxo.be on 06/03/2026
* replace inline css in functions.php 
* requested for inheritance CSS issues 
*/
/* --- Main Grid bloc --- */
.rpg-related-products.rpg-fixed {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* --- Item --- */
.rpg-related-products.rpg-fixed .rpg-item {
  overflow: hidden;
  text-align: left;
}
/* --- global --- */
.rpg-related-products.rpg-fixed .rpg-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}
/* --- Product Image V1--- */
/*
.rpg-related-products.rpg-fixed .rpg-thumb {
  width: 100%;
  display: block;
  margin-bottom: 8px;
  line-height: 0;
  text-align: center;
}
.rpg-related-products.rpg-fixed .rpg-thumb img { 
    width: 85%; 
    height: auto; 
    display: block;
*/
/* --- Product Image V2--- */
/* 1. Applique le Flexbox au parent pour centrer le bloc <picture> ou l'image */
.rpg-related-products.rpg-fixed .rpg-thumb {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}
/* 2. Force la balise <picture> à se comporter comme un bloc neutre si elle existe */
.rpg-related-products.rpg-fixed .rpg-thumb picture {
    display: block;
    width: 85%; /* Container size*/
}
/* 3. Adapte l'image à l'intérieur */
.rpg-related-products.rpg-fixed .rpg-thumb img,
.rpg-related-products.rpg-fixed .rpg-thumb picture img {
    width: 100%;  /* Prend 100% du picture (qui fait x% du thumb */
    height: auto;
    display: block;
    object-fit: cover; /* Optionnel : évite la déformation si le srcset change le ratio */
}
/* Ajustement si l'image n'a pas de balise <picture> */
.rpg-related-products.rpg-fixed .rpg-thumb > img {
    width: 85%;
}
/* --- Product Title --- */
.rpg-related-products.rpg-fixed .rpg-title {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  color: #262087;
  min-height: calc(1.2 * 1.2em * 1);
}
/* --- Price --- */
.rpg-related-products.rpg-fixed .rpg-price {
  font-weight: 600;
  margin-top: 4px;
  font-size: 0.75rem;
  text-align: center;
  color: #262087;
}
/* --- Responsive tablet --- */
@media (min-width: 768px) and (max-width: 1024px) {
  .rpg-related-products.rpg-fixed {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* --- Responsive smartphone --- */
@media (max-width: 767px) {
  .rpg-related-products.rpg-fixed {
    grid-template-columns: repeat(2, 1fr);
  }
}
