.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 20px auto;
}

.filtres {
    display: block;
}

.card {
    border-radius: 18px;
    padding: 0;
    min-height: 350px;
    text-align: center;
    color: white;
    cursor: pointer;
    perspective: 1000px;
    width: 100%;
    height: 100%;
    position: relative;
}

.card-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
    border-radius: 18px;
}

.card-inner h2 {
    font-family: 'Kelson Sans', sans-serif;
    font-weight: bold;
}

/* Rotation au survol */
.card:hover .card-inner {
    transform: rotateY(180deg);
}

/* Faces */
.card-front,
.card-back {
    position: absolute;
    inset: 0;
    padding: 20px;
    border-radius: 18px;
    backface-visibility: hidden;
}

.card-front {
    background: var(--rouge);
}

.card-back {
    background: #8f0000;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.card-back p {
    font-size: 1rem;
    line-height: 1.5;
    overflow-y: auto;
    max-height: 100%;
}

.badge {
    position: absolute;
    top: 0px;
    left: -30px;
    width: 140px;
    height: 33px;
    padding: 8px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    transform: rotate(-25deg);
}

.icon {
    width: 25px;
    height: 25px;
    background: #b1160f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.badge-text {
    padding-left: 13px;
    padding-top: 3px;
    color: black;
}

.badge-chat {
    background-color: #f5c24c;
}

.badge-chien {
    background-color: #F791C3;
}

.illus {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: #FFD4A3;
    margin: 30px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.illus img {
    width: 130px;
    height: 130px;
    object-fit: contain;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 13px;
}

.card-front p {
    font-size: 1rem;
}

.btn-filtres {
    margin-bottom: 30px;
}

/* responsive */
@media(max-width:600px) {
    .search input {
        width: 180px;
    }
}

@media (min-width:1200px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        margin: 20px;
    }

    .filtres {
        display: flex;
        gap: 30px;
        top: 20px;
        left: 0px;
    }

    .recettes-container {
        display: flex;
        align-items: flex-start;
        justify-content: start;
        gap: 60px;
    }
}

@media (min-width:1600px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        margin: 20px auto;
        max-width: 1400px;
    }

    .filtres {
        top: 20px;
        left: 40px;
    }
}