.asso, .asso *, .asso *::before, .asso *::after {
    box-sizing: border-box;
}

.asso {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 60px 24px;
}

/* ======================
   BARRE DE FILTRES
   ====================== */

.asso-filters {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.asso-search {
    width: 100%;
    max-width: 320px;
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 15px !important;
}

.alphabet-filter,
.categorie-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.categorie-filter {
    margin-bottom: 4px;
}

.filter-item {
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
}

.filter-item:hover {
    background-color: var(--Fond);
    transition: background 0.3s;
}

.filter-item.active {
    background: var(--Principal);
    color: #fff !important;
}

/* ======================
   GRILLE DES CARTES
   ====================== */

.associations {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    gap: 20px;
    justify-content: center;
	justify-items:center;
}

.card-container {
    perspective: 1000px;
    width: 350px;
    height: 600px;
    margin: 0 auto;
}

.card {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.card-container:hover .card {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.card-container.flipped .card {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 20px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    overflow-y: auto;
    overflow-x: hidden;
    border: 2px solid var(--Principal);
}

.card-back {
    transform: rotateY(180deg);
    justify-content: space-between;
    padding-top: 30px;
}

.card-back .liens,
.card-back .link {
    text-align: left;
}

.card-back .keywords {
    justify-content: flex-start;
}

.card-front img {
    width: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.card h2 {
    font-size: 1.1rem;
    text-align: center;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.card-back .description,
.card-front .description {
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.card .liens,
.card .link {
    font-size: 0.9rem;
    text-decoration: none;
    display: block;
    width: 100%;
    max-width: 100%;
    text-align: start;
    color: var(--Principal);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.card .liens:hover,
.card .link:hover {
    text-decoration: underline;
}

.flip-btn {
    padding: 10px 20px;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 0.9rem;
}

.infos {
    display: flex;
    flex-direction: column;
    justify-content: start;
    width: 100%;
    height: 100%;
    gap: 10px;
}

.infos p {
    text-align: start !important;
    margin: 0 !important;
}

/* ======================
   BADGE CATÉGORIE
   ====================== */

.categorie-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--Principal);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 1;
}

/* ======================
   TABLETTE (≤ 1024px)
   ====================== */

@media (max-width: 1024px) {
    .associations {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .card-container {
        width: 300px;
        height: 500px;
    }
}

/* ======================
   TÉLÉPHONE (≤ 768px)
   ====================== */

@media (max-width: 768px) {
    .associations {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-container {
        width: calc(100vw - 40px);
        max-width: 400px;
        height: 550px;
    }

    .card h2 {
        font-size: 1.05rem;
    }

    .card-back .description {
        font-size: 0.9rem;
    }

    .flip-btn {
        font-size: 0.9rem;
        padding: 10px 18px;
    }
}

/* ======================
   PETIT TÉLÉPHONE (≤ 480px)
   ====================== */

@media (max-width: 480px) {
    .asso {
        padding: 0 12px;
    }

    .card-container {
        width: calc(100vw - 60px);
        max-width: 100%;
        height: 550px;
    }
}

.reseaux-sociaux {
    display: flex;
    align-items: center;
    justify-content: start;
}

.reseaux-sociaux a i {
    font-size: 200% !important;
    transition-duration: .3s;
}

.reseaux-sociaux a i:hover {
    transform: scale(130%);
}

.bold {
    font-weight: 700;
}

.moyen-paiement {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.paiement-item {
    color: var(--Principal) !important;
    transition-duration: .3s;
    font-size: 150%;
}

.paiement-item:hover {
    transform: scale(150%);
    color: var(--Secondaire) !important;
}

.paiement-item img {
    width: var(--fa-width, 1.1em);
    height: auto;
}

.infos-front {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.keywords {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 100%;
}

.keyword-tag {
    background: var(--Fond);
    color: var(--Principal);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

/* ======================
   TITRES DE GROUPE (catégories)
   ====================== */

.asso-group {
    margin-bottom: 48px;
}

.asso-group-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--Principal);
    text-align: center;
    margin: 0 0 28px;
    position: relative;
    padding-bottom: 14px;
}

.asso-group-title::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    border-radius: 4px;
    background: var(--Secondaire);
    margin: 12px auto 0;
}

.asso-group:first-child .asso-group-title {
    margin-top: 0;
}
