/* SECTION PARTENAIRES */
.partners-section {
    padding: 50px 20px;
    background-color: #fff;
    text-align: center;
}

.section-header h2 {
    font-family: 'Raleway', sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1a2a3a;
}
.section-header .line {
    width: 70px;
    height: 4px;
    background-color: #ffaa44;
    margin: 0 auto 35px auto;
}

/* Conteneur principal : grille avec deux lignes fixes */
.partners-slider {
    width: 100%;
    overflow: visible;
}

.partners-track {
    display: grid;
    grid-template-rows: auto auto;       /* deux lignes horizontales */
    grid-auto-flow: column;              /* remplit colonne par colonne */
    gap: 35px 25px;                      /* espacement vertical et horizontal */
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    max-width: 1300px;
}

/* Nombre de colonnes : 5 pour que les 5 premiers aillent sur ligne 1,
   les 4 suivants sur ligne 2 (colonne 1 à 4) */
.partners-track {
    grid-template-columns: repeat(5, minmax(200px, 1fr));
}

/* Chaque carte (div) */
.partner-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    border-radius: 16px;
    padding: 25px 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    width: 100%;
    min-height: 140px;          /* hauteur minimale augmentée */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.partner-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

/* Images à l'intérieur */
.partner-item img {
    max-width: 90%;            /* légèrement plus large */
    max-height: 110px;         /* hauteur max augmentée */
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ========== RESPONSIVE ========== */
/* Tablette : on réduit un peu la largeur mini des colonnes */
@media (max-width: 1100px) {
    .partners-track {
        grid-template-columns: repeat(5, minmax(170px, 1fr));
        gap: 25px 20px;
    }
    .partner-item {
        padding: 20px 12px;
        min-height: 120px;
    }
    .partner-item img {
        max-height: 95px;
    }
}

/* Petit écran / mobile large : on conserve 5 colonnes mais on réduit encore */
@media (max-width: 900px) {
    .partners-track {
        grid-template-columns: repeat(5, minmax(150px, 1fr));
        gap: 20px 15px;
    }
    .partner-item {
        padding: 18px 10px;
        min-height: 110px;
    }
    .partner-item img {
        max-height: 85px;
    }
}

/* Mobile : pour éviter l'écrasement, on permet un léger défilement horizontal
   tout en gardant deux lignes. Les cartes restent lisibles. */
@media (max-width: 750px) {
    .partners-slider {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .partners-track {
        width: max-content;
        min-width: 100%;
        grid-template-columns: repeat(5, minmax(130px, 160px));
        gap: 18px;
    }
    .partner-item {
        padding: 15px 8px;
        min-height: 100px;
    }
    .partner-item img {
        max-height: 75px;
    }
    /* Personnalisation de la scrollbar (optionnel) */
    .partners-slider::-webkit-scrollbar {
        height: 6px;
    }
    .partners-slider::-webkit-scrollbar-track {
        background: #e0e0e0;
        border-radius: 10px;
    }
    .partners-slider::-webkit-scrollbar-thumb {
        background: #aaa;
        border-radius: 10px;
    }
}

/* Très petits écrans (moins de 550px) : pour que les images restent lisibles */
@media (max-width: 550px) {
    .partners-track {
        grid-template-columns: repeat(5, minmax(110px, 140px));
        gap: 14px;
    }
    .partner-item img {
        max-height: 65px;
    }
}