/*
 * CSS Final & Définitif pour l'inclusion Amazon List (Flat Design / Sobriété Google)
 * Style : Bleu d'accentuation, fonds clairs, ombres subtiles.
 */

/* ---------------------------------------------------- */
/* 1. Conteneur Général et Titres */
/* ---------------------------------------------------- */
.amazon {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #333;
    line-height: 1.5;
    padding-top: 1rem !important;
    
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 15px !important; 
    padding-right: 15px !important; 
    
    /* Fond très clair pour l'ambiance sobre */
    background-color: #F8F9FA !important; 
    
    overflow-x: hidden; 
}

/* Style des titres de section (ex: ⚡ Plus de vitesse) */
.amazon strong[style*='font-size:1.5em;'] {
    display: block;
    padding-bottom: 5px; 
    margin-bottom: 25px; 
    
    /* Couleur d'accentuation Bleu Matérial Design */
    border-bottom: 3px solid #4285F4; 
    color: #4285F4 !important; 
    font-size: 1.6em !important;
    font-weight: 700;
}

/* ---------------------------------------------------- */
/* 2. Agencement des Produits (La Grille / Grand Écran) */
/* ---------------------------------------------------- */

.amazon > div.text-left.pb-3 { 
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 20px;
    padding-top: 5px;
    
    justify-content: start; 
    
    width: calc(100% - 30px) !important; 
    margin: 0 auto !important; 
    padding: 0; 
    
    overflow-x: hidden !important; 
}

.amazon .text-left.pb-3 > strong:first-child {
    grid-column: 1 / -1; 
    display: block;
    margin-bottom: 20px; 
    text-align: left !important;
}

.amazon .text-left.pb-3 > a {
    text-decoration: none !important;
    display: flex !important; 
    flex-direction: column;
    height: 100%; 
}

.amazon .text-left.pb-3 > div:not(.freebox-item):not(.text-left.pb-3):not([style*="margin-top:5px;"]) {
    display: block; 
    padding-top: 0;
    grid-column: 1 / -1; 
    margin: 0 !important; 
    padding: 0 !important; 
}

/* Style de la boîte d'information (le "En résumé") */
.amazon.geek > div.text-left.pb-3:last-child { 
    background: #E8F0FE; /* Bleu très pâle (comme un champ info Google) */
    border: 1px solid #4285F4;
    border-radius: 8px;
    padding: 20px !important;
    margin-top: 20px;
    grid-column: 1 / -1; 
}


/* ---------------------------------------------------- */
/* 3. Carte Produit (.freebox-item) */
/* ---------------------------------------------------- */

.freebox-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center; 
    text-align: center; 

    background-color: #FFFFFF; /* Blanc pur */
    border: 1px solid #E0E0E0; /* Bordure gris très clair */
    border-radius: 8px; 
    padding: 20px 15px;
    /* Ombre subtile Matérial Design */
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.1); 
    transition: all 0.2s ease-in-out;
    position: relative;
    height: 100%;
}

.amazon a:hover .freebox-item {
    /* Ombre légèrement plus marquée au survol */
    box-shadow: 0 4px 8px rgba(60, 64, 67, 0.15);
    /* Bordure Bleu d'accentuation au survol */
    border: 1px solid #4285F4; 
    transform: translateY(-1px);
}

.freebox-item img {
    float: none !important;
    width: 80px !important;
    height: 80px !important;
    margin: 0 auto 15px auto !important;
    object-fit: contain;
    align-self: center;
}

.freebox-item strong {
    font-size: 1.25em;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 5px;
    color: #333;
    word-break: break-word;
    hyphens: auto;
}

.freebox-item p[style*='line-height:1em;'] {
    font-size: 0.9em;
    color: #6c757d;
    line-height: 1.4;
    margin-top: 5px;
    margin-bottom: 20px;
    flex-grow: 1; 
    min-height: 40px; 
}

.freebox-item div[style*='width:100%;text-align:center;'] {
    display: block;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
    flex-shrink: 0; 
}


/* ---------------------------------------------------- */
/* 4. Le Bouton d'Achat (.voirsuramazon) */
/* ---------------------------------------------------- */

.voirsuramazon {
    display: flex; 
    flex-direction: row; 
    justify-content: center; 
    align-items: center;
    
    width: 100%;
    padding: 14px 10px;
    margin-top: auto !important; 
    
    /* CHANGEMENT CLÉ : Bouton Bleu d'accentuation */
    background-color: #4285F4; 
    color: white !important;
    font-weight: 700;
    border-radius: 6px;
    font-size: 1em;
    transition: background-color 0.2s;
    text-decoration: none;
    flex-shrink: 0; 
    
    text-align: center !important; 
    white-space: nowrap;
    
    background-image: none !important;
}

/* Nettoyage des éléments résiduels (icônes, double texte) */
.voirsuramazon a, .voirsuramazon span[style*='display:none'] {
    display: none !important;
}

/* L'élément qui affiche le texte "Voir l'offre à" doit être net */
.voirsuramazon strong {
    display: inline !important;
    margin-right: 5px;
    font-weight: 700;
    color: white !important;
    font-size: 1em !important;
}

.voirsuramazon:before {
    content: none !important; 
}

/* Hover du bouton */
.voirsuramazon:hover {
    background-color: #3367D6; /* Bleu légèrement plus foncé */
}

/* Prix (mis en évidence) */
.voirsuramazon span.price {
    font-size: 1.8em;
    font-weight: 900;
    line-height: 1;
    margin-left: 5px; 
    padding: 0;
    background: none;
    color: white !important;
}

.voirsuramazon span.price:before {
    content: none; 
}

/* Badge Promo */
.promo {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(15%, -15%);
    font-size: 0.9em;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 10;
    background-color: #D93025; /* Rouge standard pour la promo */
    color: white;
}


/* ---------------------------------------------------- */
/* 5. Média Queries (Mobile & Tablette) */
/* ---------------------------------------------------- */

@media (max-width: 600px) {
    /* Mobile : Force 1 colonne */
    .amazon > div.text-left.pb-3 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .freebox-item {
        padding: 15px 10px;
        margin-bottom: 10px; 
        box-sizing: border-box; 
        width: 100%; 
    }

    /* Le bouton reste en 'row' (horizontal) */
    .voirsuramazon {
        padding: 10px 10px;
        height: auto;
    }
    
    /* Le conteneur du prix est forcé à ne pas sauter à la ligne (FIX) */
    .voirsuramazon span.price {
        display: inline-block !important; 
        font-size: 1.4em;
        margin-left: 0;
        line-height: 1.1;
        
        white-space: nowrap !important; 
        overflow: hidden; 
        
        vertical-align: middle !important; 
    }

    /* Force tous les sous-éléments du prix à s'aligner en ligne dans le white-space: nowrap (FIX) */
    .voirsuramazon span.price > *, .voirsuramazon span.price br {
        display: inline !important; 
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1;
        vertical-align: baseline !important; 
        content: none !important; 
    }
}