/* ===== RESET & VARIABLES ===== */
:root {
    --bleu: #007bff;
    --bleu-fonce: #0056b3;
    --orange: #ff6b00;
    --gris-fonce: #222;
    --gris-clair: #f5f5f5;
    --max-width: 1100px;
    --padding: 1.2rem;
    --radius: 8px;
    --transition: .3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--gris-fonce);
    background: #fff;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--bleu);
    text-decoration: none;
    transition: var(--transition);
}

/* ===== HEADER ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--padding);
    background: var(--gris-fonce);
    color: #fff;
}

.logo {
    height: 60px;
}

nav {
    display: none; /* mobile first */
    gap: 1rem;
}

nav a {
    color: #fff;
    font-weight: 600;
}

.btn-don {
    background: var(--orange);
    padding: .5rem 1rem;
    border-radius: var(--radius);
    color: #fff;
}

.btn-admin {
    background: transparent;
    border: 1px solid #fff;
    padding: .5rem 1rem;
    border-radius: var(--radius);
}

/* Bouton burger */
#burger {
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#burger span {
    display: block;
    height: 3px;
    width: 100%;
    background: #fff;
}

/* ===== HERO & CARROUSEL ===== */
#hero {
    position: relative;
    height: 80vh;
    overflow: hidden;
}

.hero-text {
    position: absolute;
    top: 50%;
    left: var(--padding);
    transform: translateY(-50%);
    max-width: 450px;
    color: #fff;
    background: rgba(0,0,0,.5);
    padding: var(--padding);
    border-radius: var(--radius);
    z-index: 2;
}

.hero-text h1 {
    font-size: 2rem;
    margin-bottom: .5rem;
}

.cta-primary {
    display: inline-block;
    margin-top: 1rem;
    padding: .8rem 1.6rem;
    background: var(--orange);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
}

/* Carrousel */
.carousel {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s;
}

.slide.active {
    opacity: 1;
}

/* ==== CARROUSEL : images bien cadrées ==== */
.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;        /* remplit sans déformation */
    object-position: center;  /* centre l’image (peut être ajusté) */
}

.slide figcaption {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.6);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    text-align: center;
}

/* ===== SECTIONS COMMUNES ===== */
.container {
    max-width: var(--max-width);
    margin: 3rem auto;
    padding: 0 var(--padding);
}

h2 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
    color: var(--bleu-fonce);
}

/* Grille animaux */
.grid-animaux {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.card {
    border: 1px solid #ddd;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition);
    position: relative;   /* référence pour le coin absolu */
}

.fav-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.9);
    font-size: 1.4rem;    /* cœur plus gros */
    cursor: pointer;
    z-index: 10;          /* au-dessus de l’image */
    transition: transform .2s, background .2s;
}
.fav-btn:hover {
    transform: scale(1.15);
    background: #fff;
}

.card:hover {
    transform: translateY(-5px);
}

.card img {
    height: 200px;
    object-fit: cover;
}

.card h3, .card p {
    padding: 0 1rem;
}

.cta-secondary {
    display: block;
    margin: 1rem;
    padding: .6rem 1.2rem;
    background: var(--bleu);
    color: #fff;
    border-radius: var(--radius);
    text-align: center;
}

/* ===== FORMULAIRE DON ===== */
form {
    display: flex;
    flex-direction: column;
    max-width: 300px;
    gap: 1rem;
}

input[type=number] {
    padding: .6rem;
    border: 1px solid #ccc;
    border-radius: var(--radius);
}

button[type=submit] {
    cursor: pointer;
}

/* ===== FOOTER ===== */
footer {
    background: var(--gris-fonce);
    color: #fff;
    text-align: center;
    padding: var(--padding);
    font-size: .9rem;
}

/* BARRE CONTACT RÉPARTIE */
.contact-bar {
  display: flex;
  justify-content: space-evenly;   /* répartition égale */
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
}

.contact-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--bleu-fonce);
  text-decoration: none;
  transition: transform .3s ease;
}

.contact-bar svg {
  width: 44px;
  height: 44px;
  fill: currentColor;
}

.contact-bar span {
  margin-top: .4rem;
  font-size: .9rem;
  font-weight: 600;
}

/* Animation au survol */
.contact-bar a:hover {
  transform: translateY(-6px) scale(1.1) rotate(-3deg);
}

@media (max-width: 480px) {
  .contact-bar {
    flex-direction: row;
    gap: .5rem;
  }
  .contact-bar svg {
    width: 36px;
    height: 36px;
  }
}

/* ===== RESPONSIVE TABLET & DESKTOP ===== */
@media (min-width: 768px) {
    nav {
        display: flex;
    }
    #burger {
        display: none;
    }
    .hero-text h1 {
        font-size: 3rem;
    }
}
@media (max-width: 600px) {
    .hero-text {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        margin: 1rem;
        max-width: none;
        z-index: 2;
        background: rgba(0,0,0,.7);
    }

    /* Empêche le texte de chevaucher le carrousel */
    #hero {
        display: flex;
        flex-direction: column;
        height: auto;
    }
    .carousel {
        position: relative;
        height: 60vh;   /* hauteur réduite */
    }
}
/* Mobile nav */
@media (max-width: 768px) {
    header {
        position: relative;
    }
    nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        right: 1rem;
        background: var(--gris-fonce);
        padding: 1rem;
        border-radius: 8px;
        z-index: 999;
    }
    nav.show {
        display: flex;
    }
}
#modal-fiche {
    border: none;
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
}
#modal-fiche::backdrop {
    background: rgba(0,0,0,.6);
}
#close-modal {
    float: right;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
}
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.filters label {
    font-weight: 600;
}
.filters select,
.filters input {
    margin-top: .25rem;
    padding: .4rem;
}

/* ===== MODALE CONTACT ===== */
#modal-contact {
    border: none;
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
}
#modal-contact::backdrop {
    background: rgba(0,0,0,.6);
}
#close-modal-contact {
    float: right;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
}