/* Nouvelle structure des cartes produits avec division claire */

/* Structure de base de la carte produit */
.product-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px !important;
    overflow: hidden !important;
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* Zone d'image qui prend tout l'espace disponible */
.product-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    background-color: white;
    flex-grow: 1;
    width: 100%;
}

/* Image qui remplit correctement son conteneur */
.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Zone de texte regroupée en bas */
.product-info {
    padding: 12px 16px !important;
    background-color: white !important;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #e2e8f0 !important;
    flex-shrink: 0;
    flex: 0;
}

/* Styles pour les éléments de texte */
.product-name {
    font-size: 1rem !important;
    font-weight: bold !important;
    color: #333 !important;
    text-transform: uppercase !important;
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
}

.product-ref {
    font-size: 0.7rem !important;
    color: #666 !important;
    margin: 0 0 4px 0 !important;
    font-weight: 500 !important;
}

.product-description {
    font-size: 0.75rem !important;
    color: #444 !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Effet de survol subtil */
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Style spécifique pour les produits uniques (image au-dessus, texte en-dessous) */
.products-grid.single-product {
    display: flex !important;
    justify-content: center !important;
    align-items: stretch !important;
    padding: 1.5rem 2rem !important;
    height: calc(100% - 2rem) !important;
}

.single-product .product-card.full-width {
    flex-direction: column !important;
    margin: 0 auto !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    height: 100% !important;
    width: 100% !important;
}

.single-product .product-image-container {
    width: 100% !important;
    height: 60% !important;
    position: relative !important;
    flex: 1 1 auto !important;
}

.single-product .product-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.products-grid.single-product .product-card.full-width .product-info {
    width: 100% !important;
    border-top: none !important;
    border-left: none !important;
    padding: 2rem 1rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}

.single-product .product-card.full-width .product-description {
    -webkit-line-clamp: 10;
    line-clamp: 10;
    max-height: none;
}

/* Style spécifique pour le dernier produit d'un groupe de 3 (image à gauche, texte à droite) */
.product-card.last-odd-product {
    flex-direction: row !important;
    grid-column: span 2 !important;
    display: flex !important;
    overflow: hidden !important;
}

.product-card.last-odd-product .product-image-container {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
    height: 100% !important;
    overflow: hidden !important;
    position: relative !important;
}

.product-card.last-odd-product .product-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

.product-card.last-odd-product .product-info {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
    height: 100% !important;
    border-top: none !important;
    border-left: 1px solid #e2e8f0 !important;
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}

.product-card.last-odd-product .product-description {
    -webkit-line-clamp: 6;
    line-clamp: 6;
}

/* Style spécifique pour les grilles contenant exactement 2 produits */
.catalogue-container .products-grid.two-products-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
}

/* Style pour les cartes produits dans une grille de 2 produits (image à gauche, texte à droite) */
.product-card.two-product-card {
    flex-direction: row !important;
    display: flex !important;
    overflow: hidden !important;
}

.product-card.two-product-card .product-image-container {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
    height: 100% !important;
    overflow: hidden !important;
    position: relative !important;
}

.product-card.two-product-card .product-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

.product-card.two-product-card .product-info {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
    height: 100% !important;
    border-top: none !important;
    border-left: 1px solid #e2e8f0 !important;
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}

.product-card.two-product-card .product-description {
    -webkit-line-clamp: 6;
    line-clamp: 6;
}
