/* --- VARIABLES & BASE --- */
:root {
    --primary-color: #000;       /* Noir */
    --accent-beige: #B49282;     /* Beige principal */
    --light-bg: #f9f9f9;         /* Fond gris clair */
    --text-color: #333;          /* Texte standard */
    --border-color: #eee;        /* Bordures */
    --sale-pink: black;        
}

/* --- SECTION GLOBALE --- */
.produits-similaires {
    max-width: 1200px;
    /* Marges auto à gauche/droite pour centrer le bloc */
    margin: 60px auto 40px; 
    padding: 0 20px;
    text-align: center;
}

.produits-similaires h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--text-color);
    position: relative;
    padding-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
}

/* Petite ligne décorative sous le titre */
.produits-similaires h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-beige);
}

/* --- CONTENEUR GRILLE --- */
.similaires-container {
    display: grid;
    /* Crée des colonnes flexibles (min 220px) */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    /* Centre le contenu si les colonnes ne remplissent pas toute la largeur */
    justify-content: center; 
}

/* --- CARTE PRODUIT --- */
.produit-similaire {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative; /* Pour positionner le badge */
    display: flex;
    flex-direction: column;
}

.produit-similaire:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: var(--accent-beige);
}

.produit-similaire a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* --- BADGE SALE --- */
.similaire-badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--sale-pink);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 2px;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* --- IMAGE --- */
.produit-similaire img {
    width: 100%;
    height: 220px; /* Hauteur fixe */
    object-fit: contain; /* L'image ne sera pas coupée */
    background-color: var(--light-bg);
    padding: 15px;
    transition: transform 0.3s ease;
}

.produit-similaire:hover img {
    transform: scale(1.05);
}

/* --- INFO PRODUIT --- */
.produit-similaire .nom {
    font-size: 1rem;
    font-weight: 600;
    margin: 15px 10px 5px;
    color: var(--text-color);
    /* Coupe le texte proprement s'il est trop long */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- BLOC PRIX --- */
.prix-block {
    margin: 0 0 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.prix-actuel {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Couleur Rose si promo active */
.prix-actuel.promo {
    color: var(--sale-pink);
}

/* Prix barré en gris */
.prix-barre {
    font-size: 0.9rem;
    text-decoration: line-through;
    color: #999;
    font-weight: normal;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 600px) {
    .produits-similaires {
        margin-top: 40px;
        padding: 0 10px;
    }

    .similaires-container {
        /* Force 2 colonnes sur mobile */
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px;
    }

    .produits-similaires h2 {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }

    .produit-similaire img {
        height: 160px; /* Image plus petite sur mobile */
        padding: 10px;
    }

    .produit-similaire .nom {
        font-size: 0.9rem;
        margin: 10px 5px 5px;
    }
    
    .prix-block {
        flex-direction: column; /* Prix l'un sous l'autre sur petit écran */
        gap: 2px;
        margin-bottom: 10px;
    }

    .prix-actuel { font-size: 1rem; }
    .prix-barre { font-size: 0.85rem; }
}