/* --- DESIGN GLOBAL --- */
:root {
    --bg-color: #fffcf4;
    --card-bg: #ffffff;
    --accent-color: #ffb414; /* Le Jaune/Doré du logo */
    --accent-hover: #e09b00;
    --text-color: #ffffff;
    --text-dark: #333333;
}

body {
    font-family: 'Open Sans', sans-serif;
    /* Dégradé de fond fixe */
    background: linear-gradient(to bottom, #f7e8d0, #fffcf4);
    background-attachment: fixed; 
    min-height: 100vh;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

/* --- ANIMATION D'APPARITION (Keyframes) --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- HEADER HERO --- */
.hero-header {
    position: relative;
    background-image: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.5)), url('image_059983.jpg'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 30px 20px;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 10; 
}

.hero-content { max-width: 800px; width: 100%; }

.top-location {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

h1 { 
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem; 
    margin: 0; 
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.brand-name {
    display: block;
    font-family: 'Great Vibes', cursive;
    color: var(--accent-color);
    font-size: 4rem; 
    margin-top: 0px;
    font-weight: normal;
    padding-bottom: 10px;
}

.hero-tagline {
    font-size: 1.1rem;
    margin-top: 10px;
    margin-bottom: 30px;
    font-weight: 300;
    opacity: 0.9;
}

/* Boite noire infos (PC) */
.hero-info-box {
    background: rgba(79, 89, 102, .08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 15px 25px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.hero-info-box p { margin: 0; font-size: 0.95rem; line-height: 1.4; color: #eee; }
.hero-info-box strong { color: var(--accent-color); }
.time-icon { font-size: 1.5rem; color: var(--accent-color); }

/* --- CONTENEUR PRINCIPAL --- */
.container { max-width: 1200px; margin: 30px auto; padding: 0 15px; }

/* --- FILTRES CATEGORIES (STYLE + ANIMATION) --- */
.category-filters { margin-bottom: 0; }

/* --- NOUVEAU STYLE BOUTONS (Avec effets visibles) --- */

.cat-btn {
    /* STYLE DE BASE */
    background: #fff; 
    border: 1px solid #a36924; /* Bordure un peu plus visible */
    color: #a36924; /* Texte Marron/Orange */
    padding: 10px 15px; /* Un peu plus d'espace */
    margin: 5px;
    border-radius: 10px; /* Forme "Pilule" plus moderne */
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
	    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.2);
    
    /* Important pour l'animation fluide */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Animation d'arrivée en cascade */
    animation: fadeInUp 0.5s ease-out backwards;
}

/* GESTION DES DÉLAIS D'ARRIVÉE */
.cat-btn:nth-child(1) { animation-delay: 0.1s; }
.cat-btn:nth-child(2) { animation-delay: 0.2s; }
.cat-btn:nth-child(3) { animation-delay: 0.3s; }
.cat-btn:nth-child(4) { animation-delay: 0.4s; }


/* --- 1. ETAT SURVOL (Uniquement à la souris) --- */
.cat-btn:hover {
    background-color: #ffb414; /* Jaune Doré */
    color: white;
    border-color: #ffb414;
    
    /* L'effet "Pop" vers le haut */
    transform: translateY(-5px); 
    box-shadow: 0 5px 15px rgba(141, 75, 9, 0.9); /* Ombre lumineuse */
	 box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.2);
}

/* --- 2. ETAT ACTIF (Le bouton sélectionné 'TOUT' ou 'PAIN') --- */
.cat-btn.active {
    background-color: #e09b00 !important; /* Orange plus foncé/sérieux */
    color: white !important;
    border-color: #e09b00;
    
    /* Pas de mouvement, il est "posé" */
    transform: translateY(0);
    box-shadow: inset 0 3px 4px rgba(0,0,0,0.5); /* Effet "Enfoncé" */
}

/* --- 3. ETAT CLIC (Au moment où on appuie dessus) --- */
.cat-btn:active {
    transform: scale(0.90) !important; /* Rétrécissement bien visible */
    transition: transform 0.1s; /* Très rapide */
}

/* Effet Clic Mobile */
.cat-btn:active { transform: scale(0.95); }

/* --- PRODUITS --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}
.product-card {
    background-color: var(--card-bg);
    color: var(--text-dark);
    border-radius: 15px; 
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    border: 1px solid rgba(0,0,0,0.05);
}
.product-card:hover { transform: translateY(-5px); }

.product-img-container {
    width: 100%;
    height: 200px;
    background: #fff;
    padding: 0px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-img { max-width: 100%; max-height: 100%; object-fit: contain; }

.product-info { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; }
.product-title { font-weight: bold; font-size: 0.95rem; margin-bottom: 5px; text-transform: uppercase; color: #333; }
.product-desc { font-size: 0.85rem; color: #666; margin-bottom: 10px; flex-grow: 1; }
.product-price { font-weight: 800; font-size: 1.3rem; margin-bottom: 10px; color: #333; }

/* Boutons Carte Produit */
.product-actions {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-top: auto; width: 100%;
}

.qty-selector {
    flex: 1; display: flex; align-items: center; justify-content: space-between;
    border: 2px solid var(--accent-color); border-radius: 10px;
    padding: 0 5px; background-color: #fff; height: 40px;
}
.qty-btn-card {
    background: none; border: none; color: #333; font-weight: bold; font-size: 1.2rem;
    cursor: pointer; width: 30px; height: 100%; display: flex; align-items: center; justify-content: center;
}
.qty-display-card { font-weight: 800; color: #333; font-size: 1rem; }

.add-cart-btn {
    flex: 1; background-color: var(--accent-color); color: white; border: none;
    border-radius: 10px; height: 40px; cursor: pointer; font-size: 1rem; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s, background 0.3s; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.add-cart-btn:hover { background-color: var(--accent-hover); transform: scale(1.02); }

/* ELEMENTS UI GENERAUX */
.btn {
    background-color: var(--accent-color); color: white; border: none;
    padding: 12px; width: 100%; cursor: pointer; font-weight: bold; text-transform: uppercase;
    border-radius: 4px; transition: background 0.3s;
}
.btn:hover { background-color: var(--accent-hover); }

#cart-trigger {
    position: fixed; bottom: 20px; right: 20px;
    background-color: #333; color: var(--accent-color);
    padding: 15px 25px; border-radius: 50px; cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4); font-weight: bold; z-index: 100;
    border: 2px solid var(--accent-color);
}

/* MODALES */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.85); z-index: 1000; justify-content: center; align-items: center;
    backdrop-filter: blur(3px);
}
.modal-content {
    background-color: white; color: #333; 
    width: 90%; max-width: 500px; padding: 25px; border-radius: 15px;
    max-height: 90vh; overflow-y: auto; position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 28px; cursor: pointer; color: #999; }
.close-btn:hover { color: #333; }

/* PANIER & FORM */
.cart-item { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding: 10px 0; }
.cart-controls button { background: #eee; color: #333; border: none; width: 25px; height: 25px; cursor: pointer; border-radius: 50%; }
.total-section { font-size: 1.3rem; font-weight: bold; margin: 20px 0; text-align: right; color: #333; }
.link-continue { color:#999; text-align:center; display:block; text-decoration:none; margin-top: 15px; font-size: 0.9rem;}

.form-group { margin-bottom: 10px; }
.form-group label { display: block; margin-bottom: 1px; font-size: 0.8rem; color: #666; font-weight: bold; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 8px; box-sizing: border-box;
    background: #f9f9f9; border: 1px solid #ddd; color: #333; border-radius: 8px; font-size: 0.75rem;
}
.form-group input:focus { border-color: var(--accent-color); outline: none; background: #fff; }
.success-icon { font-size: 50px; color: #4CAF50; display: block; margin-bottom: 10px; }

/* SPINNER */
.loading {
    grid-column: 1 / -1; display: flex; justify-content: center; align-items: center;
    min-height: 300px; width: 100%; color: #aaa;
}
.loading::after {
    content: ""; width: 50px; height: 50px; border: 5px solid #eee;
    border-top: 5px solid var(--accent-color); border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* STRUCTURE FILTRES + CAMION (Desktop) */
.filters-wrapper {
    display: flex; align-items: center; justify-content: center;
    gap: 30px; margin-bottom: 30px;
}
.filter-mascot {
    width: 200px; height: auto; object-fit: contain; flex-shrink: 0;
}

/* ANIMATIONS CAMION / MAISON (Desktop) */
@keyframes driveIn {
    0% { opacity: 0; transform: translateX(-100vw); }
    60% { opacity: 1; }
    80% { transform: translateX(15px); }
    100% { transform: translateX(0); }
}
.mascot-left { animation: driveIn 1.5s ease-out forwards; will-change: transform; }

@keyframes bounceIn {
    0% { opacity: 0; transform: translateY(-100px); animation-timing-function: ease-in; }
    60% { opacity: 1; transform: translateY(15px); animation-timing-function: ease-out; }
    80% { transform: translateY(-15px); }
    100% { transform: translateY(0); opacity: 1; }
}
.mascot-right { animation: bounceIn 0.6s forwards; animation-delay: 0.2s; opacity: 0; }


/* --- FOOTER --- */
footer {
    background-color: #3b362a; color: #fdf7e6; margin-top: 50px; font-size: 0.95rem;
}
.footer-cta {
    background-color: #ffe4bd; color: #3b362a; text-align: center;
    padding: 15px 20px; font-weight: bold; font-size: 1.1rem;
}
.footer-cta a { color: #3b362a; text-decoration: underline; }

.footer-container {
    max-width: 1200px; margin: 0 auto; padding: 40px 20px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px;
}
.footer-col h3 {
    color: #f0ad4e; font-family: 'Merriweather', serif; margin-top: 0;
    margin-bottom: 20px; font-size: 1.3rem; border-bottom: 1px solid rgba(240, 173, 78, 0.3); padding-bottom: 10px;
}
.footer-col h4 { color: #f0ad4e; margin-bottom: 10px; font-size: 1.1rem; }
.footer-col p { line-height: 1.6; margin-bottom: 15px; color: #ccc; }
.footer-col strong { color: white; }
.villages-list-footer { font-style: italic; font-size: 0.9rem; color: #aaa !important; }
.footer-divider { height: 1px; background-color: rgba(255,255,255,0.1); margin: 20px 0; }

address { font-style: normal; line-height: 1.6; margin-bottom: 15px; color: #ccc; }
.phone-link, .map-link {
    display: block; color: white; text-decoration: none; margin-bottom: 10px; font-weight: bold; transition: color 0.3s;
}
.phone-link:hover, .map-link:hover { color: #f0ad4e; }
.footer-bottom {
    background-color: #2c2720; text-align: center; padding: 15px;
    font-size: 0.8rem; color: #777; border-top: 1px solid #444;
}

/* --- BANDEAU INFO LIVRAISON (mobile uniquement) --- */
.mobile-livraison-banner {
    display: none; /* Caché par défaut sur desktop */
}

/* ========================================= */
/* --- MEDIA QUERIES MOBILE (MAX 768px) --- */
/* ========================================= */

@media (max-width: 768px) {

    /* 1. HEADER COMPACT (1/4 ECRAN) */
    .hero-header {
        padding: 30px 15px; 
        min-height: auto;
    }
    .hero-info-box, .hero-tagline { display: none !important; }

    .top-location { font-size: 0.7rem; margin-bottom: 3px; }
    h1 { font-size: 1.4rem; line-height: 1.2; margin-bottom: 0; }
    .brand-name {
        font-size: 2.6rem; padding-bottom: 5px; margin-top: -5px; 
    }

    /* 2. GRID PRODUITS MOBILE */
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-img-container { height: 140px; padding: 5px; }
    .product-info { padding: 5px; }
    .product-title { font-size: 0.85rem; height: 2.4em; overflow: hidden; }
    .product-desc { display: block !important; font-size: 0.7rem; margin-bottom: 5px; min-height: 1.2em; }
    .qty-selector, .add-cart-btn { height: 35px; }

    /* 3. BANDEAU LIVRAISON MOBILE */
    .mobile-livraison-banner {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        background: linear-gradient(135deg, #fff8ec, #fff3d6);
        border: 1px solid #ffb414;
        border-left: 4px solid #ffb414;
        border-radius: 10px;
        padding: 12px 14px;
        margin: 0 0 12px 0;
        animation: fadeInUp 0.5s ease-out backwards;
        animation-delay: 0.05s;
    }

    .mobile-livraison-icon {
        font-size: 1.4rem;
        flex-shrink: 0;
        margin-top: 1px;
    }

    .mobile-livraison-banner p {
        margin: 0;
        font-size: 0.82rem;
        color: #5a3e00;
        line-height: 1.5;
    }

    .mobile-livraison-banner strong {
        color: #a36924;
        font-weight: 800;
    }

    .mobile-livraison-banner em {
        font-style: normal;
        color: #888;
        font-size: 0.78rem;
    }

    /* 4. FILTRES SANS MASCOTTES (Boutons centrés) */
    .filter-mascot { display: none !important; }
    
    .filters-wrapper {
        display: flex; justify-content: center; margin-bottom: 15px; gap: 0;
    }
    .category-filters { 
        width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 5px;
    }
    .cat-btn {
        margin: 2px; padding: 6px 10px; font-size: 0.85rem; flex: 0 0 auto;
    }

    /* 4. FOOTER */
    .footer-container { grid-template-columns: 1fr; text-align: center; }
    .footer-col h3 { border-bottom: none; }
}
/* --- OPTION PAIN TRANCHÉ (Switch) --- */
.slice-option {
    display: flex;
    align-items: center;
    margin-top: 8px;
    margin-bottom: 5px;
}

.slice-label {
    font-size: 0.8rem;
    color: #666;
    margin-left: 10px;
    font-weight: 600;
}

/* Le conteneur du switch */
.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

/* Cache la checkbox par défaut HTML */
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

/* Le fond du slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

/* Le rond qui bouge */
.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* Quand c'est activé (Checked) */
input:checked + .slider {
    background-color: var(--accent-color); /* Ton orange doré */
}

input:checked + .slider:before {
    transform: translateX(14px);
}
/* --- TEXTE COLLECTIVITÉS (BANDEAU) --- */
.collectivites-hero {
    font-size: 1.1rem;
    color: #fff; /* Texte blanc pour ressortir sur la photo */
    margin-top: 5px;
    margin-bottom: 25px;
    font-weight: 500;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8); /* Ombre pour lisibilité sur photo */
    max-width: 800px;
    line-height: 1.4;
}

/* --- MISE A JOUR MOBILE (Pour garder le bandeau compact) --- */
@media (max-width: 768px) {
    /* On cache cette phrase sur mobile car elle prendrait trop de place */
    .collectivites-hero {
        display: none;
    }
}