/* Styles pour les cartes produits avec couleurs de catégorie */

/* Contour de la carte avec la couleur de la catégorie */
.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;
}

/* Style de la zone d'information */
.product-info {
    padding: 12px 16px !important;
    background-color: white !important;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #e2e8f0 !important;
    flex-shrink: 0;
}

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

/* Styles pour les différentes catégories */
/* Styles pour les éléments de texte des cartes produits */
.product-name {
    font-size: 1rem !important;
    font-weight: bold !important;
    color: #333 !important;
    text-transform: uppercase !important;
    line-height: 1.3 !important;
}

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

/* Styles pour un produit unique qui prend toute la largeur et la hauteur disponible sous l'en-tête */
.products-grid.single-product {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    width: 100%;
    height: calc(100% - 8rem - 3rem); /* Hauteur totale moins l'en-tête (8rem) et le pied de page (3rem) */
    padding: 0;
    margin: 0;
    margin-bottom: 3rem; /* Espace pour le pied de page */
}

.product-card.full-width {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    /* Suppression de la bordure fixe pour permettre la couleur de catégorie */
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden;
}

.product-card.full-width .product-image-container {
    flex: 1;
    width: 100%;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #fff;
}

.product-card.full-width .product-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.product-card.full-width .product-info {
    width: 100%;
    padding: 2rem 1rem !important;
    border-top: 1px solid #e2e8f0 !important;
    background-color: #f8f7fc !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Styles pour le nom du produit en pleine largeur */
.product-card.full-width .product-name {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Styles pour la référence du produit en pleine largeur */
.product-card.full-width .product-ref {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.product-card.full-width .product-subcategory {
    font-size: 1.1rem !important;
    text-align: center;
}

.product-subcategory {
    font-size: 0.8rem !important;
    color: #777 !important;
    margin: 2px 0 8px 0 !important;
    font-style: italic !important;
    font-weight: normal !important;
}

.product-details {
    margin-bottom: 4px !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;
}

/* Style de l'image du produit */
.product-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    background-color: white;
    overflow: hidden;
    flex-grow: 1;
    width: 100%;
}

.product-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* Jeux éducatifs - rose */
.product-card[data-category-color="#F06292"] {
    border-color: #F06292;
    /* La bordure est définie dynamiquement par JavaScript */
}

/* Matériel pédagogique - vert */
.product-card[data-category-color="#37A069"] {
    border-color: #37A069;
    /* La bordure est définie dynamiquement par JavaScript */
}

/* Fournitures scolaires - violet */
.product-card[data-category-color="#6B59A1"] {
    border-color: #6B59A1;
    /* La bordure est définie dynamiquement par JavaScript */
}

/* Bricolage et Loisirs créatifs - rouge */
.product-card[data-category-color="#E53D3E"] {
    border-color: #E53D3E;
    /* La bordure est définie dynamiquement par JavaScript */
}

/* Psychomotricité et sport - bleu */
.product-card[data-category-color="#4299E1"] {
    border-color: #4299E1;
    /* La bordure est définie dynamiquement par JavaScript */
}

/* Equipement et mobilier scolaire - marron/orange */
.product-card[data-category-color="#C05621"] {
    border-color: #C05621;
    /* La bordure est définie dynamiquement par JavaScript */
}
/* Suppression des couleurs de catégorie dans les bordures */

/* Couleur par défaut - gris */
.product-card[data-category-color="#888888"] {
    border-color: #888888;
    --category-color-rgb: 136, 136, 136;
}
.product-card[data-category-color="#888888"] .product-info {
    background-color: rgba(136, 136, 136, 0.08);
    border-top: none;
}
