/* Here, the content of the common custom CSS defined into Home - Setup - Display - CSS*/
/* --- Correction GRILLE MOBILE TAKEPOS pour le clic et image --- */

@media screen and (max-width: 900px) {

/* 1. Configuration de la grille pour le conteneur des produits */
.div5 {
display: grid !important; /* Transformer le conteneur en grille */
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important; /* Colonnes flexibles */
gap: 8px !important; /* Espacement entre cartes */
padding: 5px !important; /* Padding interne */
overflow-y: scroll !important; /* Défilement vertical si nécessaire */
overflow-x: hidden !important; /* Pas de défilement horizontal */
}

/* 2. Style des boutons produits (.wrapper2) */
.div5 .wrapper2 {
position: relative !important; /* Clic possible sur toute la carte */
width: auto !important;
height: 150px !important; /* Hauteur de la carte ajustée pour image + texte */
float: none !important;
display: flex !important;
flex-direction: column; /* Empilement vertical image + nom + prix */
align-items: center; /* Centrer horizontalement */
justify-content: center; /* Centrer verticalement */
border-radius: 5px; /* Coins légèrement arrondis */
border: 1px solid #AAA; /* Bordure visible pour mieux délimiter la carte */
overflow: hidden; /* Évite que l’image dépasse de la carte */
}

/* 3. Image du produit - responsive */
.div5 .wrapper2 img.imgwrapper {
width: 75%; /* Largeur de base */
max-width: 100%; /* Ne jamais dépasser la largeur de la carte */
height: auto; /* Hauteur automatique pour garder les proportions */
object-fit: cover;
object-position: center center;
border-radius: 5px;
margin-bottom: 6px;
transition: transform 0.3s ease;
}

/* Ajustement pour petits écrans */
@media screen and (max-width: 768px) {
.div5 .wrapper2 img.imgwrapper {
width: 80%; /* Image un peu plus large sur mobile */
margin-bottom: 1px;
}
}



.div5 .wrapper2 .product-price {
font-size: 3.4em; /* Taille adaptée au mobile */
font-weight: 600;
color: #007bff;
margin-top: 4px; /* Petit espace avec le nom du produit */
text-align: center;
}

/* 5. Nom du produit */
.div5 .wrapper2 .product-name {
font-size: 50px;
font-weight: bold;
color: #333;
text-align: center;
white-space: normal !important;
word-wrap: break-word;
overflow: hidden;
text-overflow: ellipsis;
width: 90%; /* Légèrement moins que 100% pour laisser respirer le texte */
line-height: 1.2em;
margin-top: 2px;
max-height: 2.5em; /* Limite le texte à environ 2 lignes */
background-color: rgba(255, 255, 255, 0.85); /* Fond blanc semi-transparent */
padding: 4px 6px; /* Padding pour espacer le texte du bord */
border-radius: 4px; /* Coins légèrement arrondis */
box-sizing: border-box;

/* 6. Description du produit (pour ne pas bloquer le clic) */
.div5 .description {
position: absolute !important;
bottom: 0px !important;
width: 100% !important;
background: transparent !important;
padding-top: 0px !important;
z-index: 1; /* Ne bloque pas la zone de clic */
}
}