.especes-list {
    display: flex;
    justify-content: space-evenly;
    list-style-type: none;
}

.item-animal .conteneur-animal {
    position: relative;
    height: 250px; /* Définir une hauteur fixe ou adaptative selon vos besoins */
    width: 100%;
    overflow: hidden; /* Pour s'assurer que tout contenu débordant est caché */
}

.item-animal .conteneur-animal .image-animal {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease, opacity 0.5s ease; /* Ajout de transform à la transition */
    display: block;
    transform: scale(1); /* Échelle initiale */
}

.item-animal .conteneur-animal .overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0; /* Le texte est initialement transparent */
    background-color: #484848; /* Fond blanc pour le texte */
    color: #fff; /* Couleur du texte */
    transition: opacity 0.5s ease; /* Transition douce pour l'opacité */
    pointer-events: none; /* Permet les interactions avec l'élément en dessous */
    flex-direction: column;
}

.item-animal:hover .conteneur-animal .image-animal {
    opacity: 0; /* L'image devient transparente au survol */
    transform: scale(0.9);
}

.item-animal:hover .conteneur-animal .overlay {
    opacity: 1; /* Le texte devient opaque au survol */
}

h3.animal-name{
    color: white;
    margin-bottom: 0;
    text-transform: uppercase;
}


.especes-select {
    display: none;
    position: sticky;
    position: -webkit-sticky;
    top: 50px;
    z-index: 1000;
    background-color: #fff;
}

/* Pour les petits écrans */
@media (max-width: 768px) {
    .especes-list {
        display: none;
        /* Cache la liste sur petits écrans */
    }

    .especes-select {
        display: block;
        /* Affiche le select sur petits écrans */
        margin-left: auto;
        margin-right: auto;
    }
}

/* Styles par défaut pour grands écrans : 3 colonnes */
.animaux {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Pour les écrans moyens : 2 colonnes */
@media (max-width: 768px) {
    .animaux {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Pour les petits écrans : 1 colonne */
@media (max-width: 480px) {
    .animaux {
        grid-template-columns: 1fr;
        margin: 0px !important;
    }
}

.item-animal {
    list-style-type: none;
}

.conteneur-animal {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 10px;
    border-radius: 5px;
    background-color: #fff;
    transition: box-shadow 0.3s ease;
}

.conteneur-animal:hover {
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.image-animal img {
    max-width: 100%;
    display: block;
    margin-bottom: 10px;
    border-radius: 5px;
}

.item-animal img {
    height: 250px !important;
    width: auto !important;
    margin-left: auto;
    margin-right: auto;
}

.conteneur-animal h3 a {
    margin: 0 0 10px;
    font-size: 2.2rem;
    color: #1B1D26;
}

.button-animal {
    display: inline-block;
    background-color: #54ACF0;
    color: #ffffff;
    padding: 5px 10px;
    text-decoration: none;
    border-radius: 3px;
    font-size: 1rem;
    transition: all .2s ease-in-out;
}

.button-animal:hover {
    background-color: #005a8c;
    color: white;
    transform: scale(1.05);
}

.especes-list a {
    font-weight: 600;
    color: #1B1D26;
}

.especes-list a.active {
    color: #54ACF0;
    font-weight: bold;
}

.especes-list a:hover {
    color: #54ACF0;
    font-weight: bold;
}

.especes-list a:hover:after {
    content: "";
    display: block;
    margin: auto;
    height: 2px;
    width: 50%;
    background-color: #54ACF0;
}

.especes-list a.active:after {
    content: "";
    display: block;
    margin: auto;
    height: 2px;
    width: 50%;
    background-color: #54ACF0;
}

h3.animal-name-mobile {
    text-align: center;
    color: #1B1D26;
    font-size: 20px !important;
    padding: 10px 0;
    text-transform: uppercase;
}

.item-animal .conteneur-animal{
    height: 320px;
}

@media (max-width: 768px) {
    .item-animal .overlay {
        display: none !important;
    }

    .item-animal .conteneur-animal .image-animal{
        height: auto !important;
    }

    .animal-name-mobile {
        display: block !important; 
    }

    .item-animal:hover .conteneur-animal .image-animal {
        opacity: 1;
        transform: scale(1);
    }
}
