:root {
    /* VOS COULEURS EXACTES */
    --primary-color: #398f14;
    --secondary-color: #95b482;
    --background-color: #f6edd9;
    --font-color: #333333;
    
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 12px;
}

/* --- RESET & BASES --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--font-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden; /* Sécurité anti-scroll horizontal */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 16px; /* Base pour rem */
}

/* --- RÈGLE CLÉ : Images Responsives --- */
img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover; /* Empêche la déformation par défaut */
}

/* --- Header & Banner --- */
.banner {
    width: 100%;
    background-color: var(--primary-color);
    display: block; /* Change de flex à block pour le positionnement */
    position: relative; /* Indispensable pour positionner le logo en absolu */
    overflow: hidden;
    /* Suppression du max-height pour laisser l'image définir la hauteur (ratio conservé) */
    line-height: 0; /* Supprime l'espace fantôme sous l'image */
}

.banner-img {
    width: 100%;
    height: auto; /* Conserve les proportions exactes de l'image envoyée */
    object-fit: contain; /* S'assure que l'image n'est pas coupée */
    display: block;
}

.banner-logo {
    position: absolute;
    bottom: 20px; /* Marge du bas */
    left: 20px;   /* MODIFIÉ : Marge de GAUCHE au lieu de droite */
    width: 150px; /* Taille du logo (ajustable) */
    height: auto;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); /* Légère ombre pour détacher le logo du fond */
    object-fit: contain;
}

/* --- Menu de navigation --- */
.menu {
    display: flex;
    align-items: center;
    justify-content: center; /* Centré par défaut */
    background-color: var(--secondary-color);
    padding: 0 20px; /* Padding latéral */
    min-height: 60px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Permet aux liens de passer à la ligne sur petit écran tablette */
    gap: 15px 25px; /* Espacement vertical et horizontal */
    width: 100%;
    max-width: 1200px;
    padding: 10px 0;
}

.menu a {
    color: var(--font-color);
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, color 0.2s;
    font-size: 0.95rem;
    white-space: nowrap; /* Empêche le texte du lien de se casser bizarrement */
}

.menu a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.hamburger {
    display: none; /* Caché par défaut */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--font-color);
    cursor: pointer;
    padding: 5px;
}

/* --- Conteneur principal --- */
.container {
    width: 100%;
    max-width: 1100px; /* Largeur max confortable pour la lecture */
    margin: 40px auto;
    padding: 0 20px; /* Marges de sécurité sur les côtés */
    flex: 1; /* Pousse le footer vers le bas */
}

h1, h3 {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    margin-top: 0;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

h1::after, h3::after {
    content: '';
    display: block;
    width: 60px; /* Largeur fixe plus élégante */
    height: 4px;
    background: var(--secondary-color);
    margin-top: 8px;
    border-radius: 2px;
}

/* --- Sections --- */
.section {
    background: rgba(255, 255, 255, 0.8); /* Légèrement plus opaque pour la lisibilité */
    margin-bottom: 50px;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    
    /* Animation */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section.appear {
    opacity: 1;
    transform: translateY(0);
}

/* --- Layouts Flexibles (Split) --- */
/* Utilise flex-wrap pour s'adapter automatiquement sans media queries complexes */
.split-section {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap; /* MAGIQUE : Passe à la ligne si pas assez de place */
}

.split-section.reverse {
    flex-direction: row-reverse;
}

/* Quand ça passe à la ligne, on veut que l'ordre visuel reste logique */
/* Sur mobile, l'image passe souvent au-dessus ou en dessous selon le design */

.split-text {
    flex: 1 1 400px; /* S'agrandit, se rétrécit, base de 400px */
    min-width: 280px; /* Ne devient jamais illisiblement petit */
}

.split-image, .split-image-vertical {
    flex: 1 1 350px; /* S'agrandit, se rétrécit, base de 350px */
    display: flex;
    justify-content: center;
    width: 100%;
}

.split-image img, 
.split-image-vertical img {
    width: 100%;
    height: 100%;
    max-height: 400px; /* Hauteur max pour éviter les images géantes */
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.split-image img:hover,
.split-image-vertical img:hover {
    transform: scale(1.02);
}

.split-text-conserves {
    flex: 1 1 400px;
}

/* --- Galerie Images (Index) --- */
.image-row {
    display: flex;
    flex-wrap: wrap; /* Essentiel pour le responsive */
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    width: 100%;
}

.image-row img {
    flex: 1 1 300px; /* Chaque image prend au moins 300px ou partage l'espace */
    height: 250px; /* Hauteur fixe pour l'alignement */
    width: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.image-row img:hover {
    transform: scale(1.02);
}

/* --- Grille Produits --- */
.gallery-grid {
    display: grid;
    /* Grid responsive automatique : autant de colonnes que possible avec min 250px */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
    width: 100%;
}

.gallery-grid img {
    width: 100%;
    height: 250px; /* Uniformisation */
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.gallery-grid img:hover {
    transform: scale(1.03);
}

/* --- Boutons & Formulaires --- */
.commande-container {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    max-width: 800px;
    margin: 40px auto;
    box-shadow: var(--shadow);
    width: 100%;
}

.buttons-wrapper {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.commande-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 160px; /* Taille minimum pour l'uniformité */
}

.commande-button:hover {
    background-color: #2a6b0f;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--primary-color);
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc; /* Bordure plus douce */
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background-color: #fff;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(57, 143, 20, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 16px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: var(--radius);
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s, transform 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.submit-btn:hover {
    background-color: #2a6b0f;
    transform: translateY(-1px);
}

/* Maps */
.map-responsive {
    overflow: hidden;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    position: relative;
    height: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    background: #e0e0e0; /* Couleur de fond pendant le chargement */
}

.map-responsive iframe {
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    position: absolute;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 40px 20px;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.footer-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Liens Sociaux et Texte */
.section a {
    word-break: break-word; /* Empêche les liens longs de casser la page */
}

.section a:not(.social-button):not(.commande-button):not(.submit-btn) {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    position: relative;
    transition: color 0.3s ease;
    border-bottom: 1px solid transparent;
}

.section a:not(.social-button):not(.commande-button):not(.submit-btn):hover {
    color: #d35400;
    border-bottom-color: #d35400;
}

.social-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    width: 100%;
}

.social-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px 30px;
    width: 100%;
    max-width: 350px;
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.social-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.btn-facebook { background-color: #1877F2; }
.btn-instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.btn-tiktok { background-color: #000000; border: 1px solid #333; }

#mention-legale-link {
    display: inline-block;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
    font-size: 0.9rem;
}

/* --- MOBILE & TABLETTE (Media Queries) --- */
/* Point de rupture unique et propre pour simplifier */
@media (max-width: 850px) {
    
    /* 1. Ajustement global des espacements */
    .container {
        margin: 20px auto;
        padding: 0 15px;
    }

    .section {
        padding: 25px 20px;
        margin-bottom: 30px;
    }

    h1, h3 {
        font-size: 1.75rem; /* Titres un peu plus petits */
    }

    /* 2. Menu Mobile : Transformation totale */
    .hamburger {
        display: flex; /* Apparaît */
    }

    .menu {
        justify-content: flex-start; /* Logo/Burger à gauche */
        padding: 15px 20px;
        position: sticky;
        top: 0;
    }

    .nav-links {
        display: none; /* Caché par défaut */
        position: absolute;
        top: 100%; /* Juste en dessous de la barre */
        left: 0;
        width: 100%;
        flex-direction: column;
        background-color: var(--white);
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
        align-items: stretch; /* Les liens prennent toute la largeur */
        gap: 0;
    }

    .nav-links.open {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .menu a {
        color: var(--font-color);
        padding: 15px 10px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 1rem;
    }

    .menu a:last-child {
        border-bottom: none;
    }
    
    .menu a:hover {
        background-color: #f9f9f9;
        color: var(--primary-color);
        transform: none; /* Pas de déplacement sur mobile */
    }

    /* 3. Sections Split (Force la colonne si pas déjà fait par le wrap) */
    .split-section, 
    .split-section.reverse {
        flex-direction: column;
        gap: 25px;
    }

    /* L'ordre visuel : Texte d'abord, image ensuite (souvent mieux sur mobile) */
    /* On peut inverser l'ordre avec 'order' si on veut l'image au dessus */
    .split-image {
        order: -1; /* L'image apparaît au-dessus du texte pour donner du visuel */
        width: 100%;
    }
    
    .split-section.reverse .split-image {
        order: -1; /* Pareil pour le reverse */
    }

    /* 4. Images */
    .image-row {
        flex-direction: column;
    }
    
    .image-row img {
        height: auto; /* Laisse la hauteur s'adapter à la largeur */
        max-height: 300px; /* Limite quand même */
        width: 100%;
        flex: none;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Colonnes plus petites sur mobile */
        gap: 15px;
    }
    
    .gallery-grid img {
        height: 150px; /* Vignettes plus petites */
    }

    /* 5. Boutons */
    .buttons-wrapper {
        flex-direction: column;
        align-items: stretch; /* Boutons pleine largeur sur mobile */
    }

    .commande-button {
        width: 100%;
    }
    
    /* Logo de la bannière sur mobile */
    .banner-logo {
        width: 80px; /* Plus petit sur mobile */
        bottom: 10px;
        left: 10px; /* Ajusté à gauche sur mobile aussi */
    }
    #ancienne_vaches{
        max-height: 200px;
    }
}