/* --- 1. CONFIGURATION GÉNÉRALE --- */
/* 1. POLICE ET VARIABLES (Toujours en premier) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary: #ffcc00;    /* Jaune SafeRun */
    --secondary: #1a1a1a;  /* Noir profond */
    --accent: #ff9900;     /* Orange action */
    --bg-color: #f4f7f6;   /* Fond gris clair */
    --white: #ffffff;
    --text-muted: #7f8c8d;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
/* --- GESTION DES THÈMES (DYNAMIQUE) --- */

/* 1. Configuration pour le MODE SOMBRE */
[data-theme="sombre"] {
    --bg-color: #121212 !important;   /* Fond noir profond */
    --secondary: #ffffff !important;  /* Le texte et la Top Bar deviennent blancs */
    --white: #1e1e1e !important;      /* Les cartes deviennent gris foncé */
    --text-muted: #aaaaaa !important; /* Texte secondaire plus clair */
}

/* 2. Configuration pour le MODE MODERNE */
[data-theme="moderne"] {
    --bg-color: #eef2f7 !important;   /* Gris bleuté moderne */
    --secondary: #2c3e50 !important;  /* Bleu nuit élégant */
    --white: #ffffff !important;      /* Reste blanc pur */
}

/* 3. Transition douce pour ne pas agresser les yeux */
body {
    transition: background-color 0.4s ease, color 0.4s ease !important;
}

/* 2. SÉCURITÉ MOBILE (Empêche le site de glisser à gauche/droite) */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    font-family: 'Poppins', sans-serif;
    color: var(--secondary);
}

/* --- ICI CONTINUE TON RESTE DE CODE CSS (Header, Boutons, etc.) --- */

/* --- 2. TEXTE DÉFILANT (TOP BAR) --- */
.top-announcement {
    background: var(--secondary);
    color: var(--primary);
    overflow: hidden;
    white-space: nowrap;
    padding: 10px 0;
    font-weight: bold;
    font-size: 0.9rem;
}

.scrolling-text {
    display: inline-block;
    padding-left: 100%;
    animation: scroll 25s linear infinite;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* --- 3. HEADER ORCHESTRÉ --- */
header {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: rgba(255, 255, 255, 0.85); /* Transparent */
    backdrop-filter: blur(10px); /* Flou derrière (Effet iPhone) */
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
header.scrolled {
    padding: 5px 5% !important; /* On réduit l'espace interne */
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important;
}

header.scrolled .logo-img {
    height: 40px !important; /* Le logo devient un peu plus petit */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 50px;
    border-radius: 10px;
}

.logo-text {
    font-weight: 700;
    font-size: 1.3rem;
}

.logo-text span { color: var(--primary); }

.nav-elements {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-wrapper {
    position: relative;
    /* On dit à la barre : prend toute la largeur MOINS 110 pixels (la place des icônes) */
    width: calc(100% - 110px); 
    max-width: 200px; /* Elle ne deviendra jamais trop géante sur tablette */
    min-width: 120px; /* Elle ne deviendra jamais trop petite pour écrire */
    transition: all 0.3s ease;
}

/* --- RECHERCHE ANIMÉE --- */
#search {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 50px;
    border: 1px solid #eee;
    background: #f9f9f9;
    outline: none;
    transition: all 0.3s ease; /* L'animation est ici */
}

/* Quand on clique dans le champ de recherche */
#search:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.15);
    transform: scale(1.02); /* Petit effet de zoom */
}

.search-icon-inside {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.header-icons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
    position: relative; 
    z-index: 10; /* Force les icônes à passer devant le "rideau" */
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    cursor: pointer;
}

.cart-badge {
    background: var(--primary);
    color: var(--secondary);
    padding: 2px 6px;
    border-radius: 50px;
    font-weight: bold;
}

/* --- 4. SLIDER PUBLICITAIRE --- */
.promo-slider {
    margin: 20px;
    min-height: 300px; /* On utilise min-height au lieu de height */
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 20px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.slide {
    display: none;
    padding: 20px;
    animation: fadeIn 0.8s ease;
}

.slide.active { display: block; }

.btn-promo {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    margin-top: 15px;
    cursor: pointer;
    font-weight: bold;
}

/* Effet de halo lumineux derrière le livreur */
.slide-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide-image::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.4);
    filter: blur(60px);
    border-radius: 50%;
    z-index: 0;
}

.slide-image img {
    position: relative;
    z-index: 1; /* L'image passe devant le halo */
}

/* --- 5. BADGES DE CONFIANCE --- */
.trust-badges {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: white;
    margin: 0 20px 20px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.badge-item { text-align: center; font-weight: bold; font-size: 0.8rem; }
.badge-item i { display: block; color: #27ae60; font-size: 1.5rem; margin-bottom: 5px; }

/* --- 6. GRILLE DE PRODUITS --- */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.carte-produit {
    background: var(--white);
    border-radius: 25px;
    overflow: hidden;
    padding: 10px;
    position: relative;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(0,0,0,0.03);
}

.carte-produit:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid var(--primary); /* Une petite bordure jaune apparaît */
}

.carte-produit img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 20px;
    background: #f9f9f9;
    transition: transform 0.5s ease;
}

.prix-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 204, 0, 0.9); /* Jaune SafeRun semi-transparent */
    backdrop-filter: blur(5px); /* Flou derrière le prix */
    padding: 6px 12px;
    border-radius: 50px;
    font-weight: 800;
    color: #1a1a1a;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 5;
    border: 1px solid rgba(255,255,255,0.3);
}

/* --- AJOUT POUR LA BOUTIQUE ET LE CHARGEMENT --- */
#boutique {
    display: none; /* Caché au début pour laisser place au skeleton */
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

#loading-placeholder {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- 7. BOUTONS --- */
/* --- 7. BOUTONS (NETTOYAGE ET CORRECTION) --- */
/* On ne cible que les gros boutons d'action */
.btn-commander, .btn-inscription, .btn-promo, .btn-inscription-popup {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--secondary);
    border: none;
    padding: 15px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 700;
    width: 100%; /* Ils prennent toute la largeur de leur parent */
    margin-top: 15px;
    display: block;
    transition: transform 0.2s ease;
}

/* On répare les petits boutons (Like, Fermer, Filtres) pour qu'ils ne soient pas géants */
.btn-interaction, .close-popup, .close-sidebar, .cat-btn {
    width: auto !important; 
    margin-top: 0 !important;
    display: inline-flex !important;
}
/* --- ANIMATIONS ET RESPONSIVE --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 768px) {
    .logo-text, .icon-label, .search-wrapper { display: none; }
    .container { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .promo-slider { height: 180px; }
}
/* --- FOOTER PREMIUM --- */
.footer-premium {
    background: #1a1a1a;
    color: white;
    padding: 60px 0 20px 0;
    margin-top: 50px;
    position: relative;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 0 20px;
}

.footer-logo { height: 60px; border-radius: 10px; margin-bottom: 15px; }
.footer-brand h3 { color: white; margin-bottom: 10px; }
.footer-brand h3 span { color: var(--primary); }
.footer-brand p { color: #aaa; font-size: 0.9rem; line-height: 1.6; }

.footer-links h4, .footer-contact h4 {
    color: var(--primary);
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-links ul { list-style: none; padding: 0; }
.footer-links ul li { margin-bottom: 10px; }
.footer-links ul li a { color: #aaa; text-decoration: none; transition: 0.3s; }
.footer-links ul li a:hover { color: var(--primary); padding-left: 5px; }

.footer-contact p { color: #aaa; margin-bottom: 15px; font-size: 0.9rem; }
.footer-contact i { color: var(--primary); margin-right: 10px; }

.social-icons { display: flex; gap: 15px; margin-top: 20px; }
.social-icons a { 
    color: white; background: #333; width: 40px; height: 40px; 
    display: flex; align-items: center; justify-content: center; 
    border-radius: 50%; transition: 0.3s; 
}
.social-icons a:hover { background: var(--primary); color: #1a1a1a; transform: translateY(-5px); }

.footer-copyright {
    text-align: center;
    border-top: 1px solid #333;
    margin-top: 40px;
    padding-top: 20px;
    color: #666;
    font-size: 0.8rem;
}
/* --- BARRE DE FILTRES PAR CATÉGORIES --- */
.category-filter-container {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    padding: 20px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.category-filter-container::-webkit-scrollbar {
    display: none;
}

/* LE CORRECTIF EST ICI : */
.category-filter-container .cat-btn {
    width: auto !important; /* Force la largeur automatique pour les filtres */
    margin-top: 0 !important; /* Annule la marge du haut des boutons normaux */
    padding: 10px 22px;
    border-radius: 30px;
    border: 2px solid var(--primary);
    background: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-btn:hover {
    background: #fff9e6;
    transform: translateY(-2px);
}

.cat-btn.active {
    background: var(--primary);
    color: var(--secondary);
    box-shadow: 0 5px 15px rgba(255, 204, 0, 0.3);
    border-color: var(--primary);
}

/* Badge de catégorie sur chaque carte produit */
.cat-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 50px;
    color: #666;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
/* POPUP DE BIENVENUE */
.welcome-popup {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%); /* Caché au début */
    background: var(--white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-radius: 20px;
    padding: 20px;
    z-index: 2000;
    width: 90%;
    max-width: 350px;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-top: 5px solid var(--primary);
}

.welcome-popup.show {
    transform: translateX(-50%) translateY(0); /* Apparaît */
}

.popup-content h4 { margin: 10px 0 5px; font-weight: 700; }
.popup-content p { font-size: 0.85rem; color: #666; margin-bottom: 15px; }

.btn-inscription {
    background: var(--secondary);
    color: var(--primary);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    width: auto; /* Important pour ne pas subir le width 100% */
    margin: 0;
    padding: 0;
}

.popup-icon { font-size: 30px; }

/* --- STYLE DU VOLET LATÉRAL (SIDEBAR) --- */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px; /* Caché par défaut */
    width: 280px;
    height: 100vh; /* Utilise toute la hauteur de l'écran */
    background: #1a1a1a;
    color: white;
    z-index: 9999;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    
    /* --- LES LIGNES QUI RÉPARENT TON PROBLÈME --- */
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Permet de défiler vers le bas si ça dépasse */
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

/* --- LE MOTEUR DE L'EFFET PUSH --- */

/* 1. On prépare le contenu du site pour qu'il puisse bouger */
#main-content {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

/* 2. QUAND LE MENU EST OUVERT (La magie opère ici) */

/* On pousse tout le contenu du site de 280px vers la droite */
body.sidebar-open #main-content {
    transform: translateX(280px);
}

/* On fait sortir la sidebar de la gauche */
body.sidebar-open .sidebar {
    left: 0 !important;
}

/* 3. On cache l'ancien bouton X (car le bouton fixe s'en occupe) */
.close-sidebar {
    display: none !important;
}

/* 4. Sécurité pour éviter que le site ne "dépasse" à droite pendant le mouvement */
body {
    overflow-x: hidden;
    width: 100%;
}

.user-profile { text-align: center; padding: 30px 0; border-bottom: 1px solid #333; margin-bottom: 20px; }
.user-avatar { font-size: 60px; color: #ffcc00; margin-bottom: 10px; }
.user-profile h3 { color: white; margin: 5px 0; font-size: 1.2rem; }
.user-profile p { color: #888; font-size: 0.85rem; }

.sidebar-nav { display: flex; flex-direction: column; gap: 8px; }
.nav-item {
    color: #eee;
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.3s;
}

.nav-item i { width: 20px; text-align: center; color: #ffcc00; }
.nav-item:hover, .nav-item.active { background: #ffcc00; color: #1a1a1a; font-weight: bold; }
.nav-item:hover i { color: #1a1a1a; }
.nav-item small { display: block; font-size: 0.7rem; opacity: 0.7; font-weight: normal; }

.notif-badge { background: #ff3b30; color: white; font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; margin-left: auto; }
.close-sidebar { background: none; border: none; color: white; font-size: 30px; cursor: pointer; position: absolute; right: 15px; top: 10px; width: auto; }

#modal-planification {
    display: none; /* caché par défaut */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* fond semi-transparent */
    justify-content: center; /* centrage horizontal */
    align-items: center;     /* centrage vertical */
    z-index: 2000;           /* au-dessus de tout */
}

#modal-planification .modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

#modal-planification.show {
    display: flex !important;
}

/* Correction affichage des modals RDV et Planification */
#modal-rdv,
#modal-planification {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    transform: none !important;   /* Annule le déplacement de welcome-popup */
    justify-content: center;
    align-items: center;
    z-index: 3000; /* au-dessus de la sidebar */
}

#modal-rdv.show,
#modal-planification.show {
    display: flex !important;
}
/* Le badge rond et rouge */
/* Remplace ton bloc .badge-notif et @keyframes par celui-ci */
/* Le badge dans la sidebar */
/* --- 8. BADGES ET NOTIFICATIONS --- */
#badge-livraison {
    background-color: #ff3b30;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: auto;
    font-weight: bold;
    display: none;
    transition: background 0.3s ease;
}

.pulse-alerte {
    animation: pulse-red 1.5s infinite linear;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* --- 9. SYSTÈME DE MODALS UNIFIÉ (LE CŒUR DU CENTRAGE) --- */
/* --- 9. SYSTÈME DE MODALS UNIFIÉ (PRIORITÉ MAXIMALE) --- */
#modal-rdv,
#modal-planification,
#modal-livraisons,
#modal-panier,
.modal-system {
    display: none; 
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.8) !important;
    
    /* SOLUTION : On passe au dessus de la sidebar (9999) et du bouton menu (10001) */
    z-index: 20000 !important; 
    
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* On force l'affichage flexible quand la classe .show est là */
#modal-rdv.show,
#modal-planification.show,
#modal-livraisons.show,
#modal-panier.show,
.modal-system.show {
    display: flex !important;
}

/* La boîte blanche (Le contenu) */
.modal-content, .popup-content, .modal-box {
    background: white !important;
    padding: 25px !important;
    border-radius: 25px !important; /* Plus arrondi pour 2026 */
    width: 90% !important;
    max-width: 400px !important;
    position: relative !important;
    margin: auto !important; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Corrections boutons spécifiques */
.close-popup {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* Gestion du slider responsive */
@media (max-width: 768px) {
    .slide-container {
        flex-direction: column; /* Empile le texte et l'image */
        text-align: center !important;
        padding: 20px !important;
    }
    .slide-content {
        text-align: center !important;
    }
    .slide-image {
        display: none; /* Cache l'image sur mobile pour gagner de la place */
    }
}

/* Animation du loader MVola */
.loader {
    display: inline-block;
    animation: rotate 2s linear infinite;
    font-size: 2rem;
}
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

.floating-cart:active {
    transform: scale(0.9);
}

/* On le cache sur grand écran si tu préfères, mais sur mobile c'est indispensable */
@media (max-width: 768px) {
    .logo-text, .icon-label, .search-wrapper { display: none; }
    /* On applique les 2 colonnes à la fois à la boutique et au skeleton */
    .container, #boutique, #loading-placeholder { 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 15px; 
    }
    .promo-slider { height: 180px; }
}

/* Animation de chargement fantôme */
.skeleton {
    background: #eee;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    border-radius: 15px;
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
}

@keyframes shine {
    to { background-position-right: -200%; }
}

.skeleton-card {
    height: 250px;
    width: 100%;
    margin-bottom: 20px;
}
/* Barre d'interaction sous le produit */
.interaction-bar {
    display: flex;
    gap: 15px;
    padding: 10px 5px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.btn-interaction {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    color: #666;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
}

/* État quand on clique sur J'aime */
.btn-interaction.active-like i {
    color: #ff3b30; /* Coeur Rouge */
    font-weight: 900; /* Coeur Plein */
}

.btn-interaction.active-like span {
    color: #1a1a1a;
    font-weight: 700; /* Texte Gras */
}

/* Animation de pop */
@keyframes heartPop {
    50% { transform: scale(1.3); }
}
.btn-interaction.active-like i { animation: heartPop 0.3s ease; }

/* --- AMÉLIORATIONS MODERNES 2026 --- */

/* 1. Barre de navigation mobile style iPhone */
/* --- 10. RESPONSIVE MOBILE (STABILISÉ) --- */
@media (max-width: 768px) {
    /* On cache les éléments inutiles sur mobile */
    .logo-text, .icon-label, .search-wrapper, .floating-cart { 
        display: none !important; 
    }
    
    /* Espace de sécurité en bas pour ne pas cacher le contenu */
    body { padding-bottom: 90px !important; }

    .mobile-bottom-nav {
        display: flex !important; /* Force l'apparition */
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        justify-content: space-around;
        padding: 12px 0 25px 0;
        border-top: 1px solid rgba(0,0,0,0.05);
        z-index: 5000;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    }
}

/* On cache la barre mobile sur ordinateur pour éviter les doublons */
@media (min-width: 769px) {
    .mobile-bottom-nav { display: none !important; }
}

/* 2. Micro-interactions sur les boutons */
.btn-commander {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.btn-commander:active {
    transform: scale(0.95);
}

/* 3. Effet de survol d'image (CORRIGÉ POUR TON JS) */
.carte-produit {
    background: #ffffff;
    border-radius: 24px; /* Plus arrondi pour un look "App" */
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.carte-produit:hover {
    transform: translateY(-5px); /* La carte se lève au survol */
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.carte-produit img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f8f8f8; /* Fond gris clair si l'image charge mal */
}
/* --- ANIMATION DE CHARGEMENT INITIALE --- */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 9999;
    width: 0;
    animation: loadProgress 1.5s cubic-bezier(0.1, 0.7, 1.0, 0.1) forwards;
}

@keyframes loadProgress {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; opacity: 0; }
}
/* --- NOUVEAU STYLE HERO GIZ --- */
.hero-giz {
    position: relative;
    height: 450px; /* Hauteur généreuse */
    margin: 15px;
    border-radius: 25px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
    border: none;
}

/* L'image de fond qui zoom */
.hero-giz::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: var(--bg-image, url('https://images.unsplash.com/photo-1542838132-92c53300491e?q=80&w=2000'));
    background-size: cover;
    background-position: center;
    transition: background-image 1s ease-in-out;
    animation: slowZoom 20s infinite alternate;
    z-index: 1;
}

/* Le voile sombre pour la lisibilité */
.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.2));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: white;
    padding: 0 20px;
    max-width: 800px;
}

.hero-badge {
    background: var(--primary);
    color: var(--secondary);
    padding: 5px 15px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 15px;
}

.hero-content h1 {
    font-size: clamp(1.8rem, 5vw, 3rem); /* Taille adaptative */
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

@keyframes slowZoom {
    from { transform: scale(1); }
    to { transform: scale(1.15); }
}

@media (max-width: 768px) {
    .hero-giz { height: 350px; margin: 10px; }
}
/* ==========================================================
   DERNIÈRES CORRECTIONS : SPÉCIAL ANDROID & PETITS ÉCRANS
   ========================================================== */
@media (max-width: 768px) {

    /* 1. On ajuste le Hero Dynamique pour qu'il soit moins haut */
    .hero-giz {
        height: 280px !important;
        margin: 10px !important;
        border-radius: 15px !important;
    }

    .hero-content h1 {
        font-size: 1.4rem !important;
        margin-bottom: 5px !important;
    }

    .hero-content p {
        font-size: 0.8rem !important;
        line-height: 1.3;
    }

    /* 2. BOUTIQUE : On force 2 colonnes pour éviter les cartes trop larges */
    #boutique {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 10px !important;
    }

    /* 3. CARTES PRODUITS : On réduit la taille pour mobile */
    .carte-produit img {
        height: 120px !important; /* Image moins haute */
    }

    .carte-produit h3 {
        font-size: 0.8rem !important;
        margin: 5px 0 !important;
    }

    .prix-badge {
        font-size: 0.7rem !important;
        padding: 4px 8px !important;
    }

    .btn-commander {
        font-size: 0.7rem !important;
        padding: 10px 5px !important;
    }

    /* 4. SÉCURITÉ BAS D'ÉCRAN : On ajoute de l'espace pour ne pas cacher 
       les produits derrière la barre de navigation mobile */
    body {
        padding-bottom: 80px !important;
    }

    /* 5. HEADER MOBILE : On cache les textes pour gagner de la place */
    .icon-label {
        display: none !important;
    }
}
/* Correction pour le débordement de la Sidebar */
.user-sidebar .sidebar-content {
    flex: 1; /* Prend l'espace disponible */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* On s'assure que le bouton en bas a de l'espace */
.user-sidebar .btn-livraison, 
.user-sidebar .btn-inscription {
    margin-top: auto; /* Pousse les boutons vers le bas si l'écran est grand */
    margin-bottom: 10px;
    min-height: 45px; /* Taille minimale pour être cliquable */
}

/* Pour les très petits écrans (Android type Galaxy A10/A12) */
@media (max-height: 600px) {
    #qrcode-container {
        width: 80px !important; /* On réduit le QR code si l'écran est trop court */
        height: 80px !important;
    }
    #qrcode canvas, #qrcode img {
        width: 80px !important;
        height: 80px !important;
    }
}
/* À ajouter dans style.css si ce n'est pas déjà fait */
.skeleton-card {
    height: 200px; /* Ou 250px selon la taille de tes produits */
    width: 100%;
    border-radius: 15px;
}

.skeleton {
    background: linear-gradient(90deg, #eff1f3 25%, #e2e2e2 50%, #eff1f3 75%);
    background-size: 200% 100%;
    animation: loading-shine 1.5s infinite linear;
}

@keyframes loading-shine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
/* Style pour la roue dentée */
.settings-btn {
    background: #ffcc00;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Fond noir transparent derrière le menu */
.settings-popup {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: flex; /* Utilisé avec style.display='none'/'flex' en JS */
    align-items: center;
    justify-content: center;
}

/* La boîte blanche au centre */
.settings-content {
    background: white;
    padding: 25px;
    border-radius: 25px;
    width: 85%;
    max-width: 320px;
    text-align: center;
    color: #333;
}

/* Points de couleur pour les thèmes */
.theme-options { display: flex; justify-content: center; gap: 20px; margin: 15px 0; }
.dot { width: 35px; height: 35px; border-radius: 50%; border: 3px solid #eee; cursor: pointer; }
.dot-white { background: #ffffff; }
.dot-gray { background: #f4f7f6; }
.dot-black { background: #1a1a1a; }

/* Bouton QR */
.qr-trigger-btn {
    background: #000; color: #fff; border: none;
    padding: 12px; border-radius: 12px; width: 100%; cursor: pointer;
}

#qrcode-area img { margin: 20px auto; display: block; }
.close-settings { margin-top: 20px; background: none; border: none; color: red; cursor: pointer; font-weight: bold; }

.menu-toggle-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
    background-color: #ffcc00;
    color: #1a1a1a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    
    /* --- LA SOLUTION EST ICI --- */
    z-index: 10001; /* Plus haut que la sidebar (9999) */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* Animation fluide */
}

/* --- DÉCALER LE BOUTON QUAND LE MENU EST OUVERT --- */
body.sidebar-open .menu-toggle-btn {
    /* On le déplace de 230px pour qu'il reste visible au bord du menu */
    transform: translateX(230px); 
    background-color: #1a1a1a; /* Optionnel : il devient noir */
    color: #ffcc00;            /* Optionnel : l'icône devient jaune */
}
/* Le voile corrigé */
.sidebar-overlay {
    position: fixed;   /* CHANGEMENT : 'fixed' pour qu'il suive le scroll */
    top: 0;
    left: 0;
    width: 100vw;      /* Utilise toute la largeur de la vue */
    height: 100vh;     /* Utilise toute la hauteur de la vue */
    background: rgba(0,0,0,0.5); /* Un peu plus sombre pour bien voir */
    
    /* Z-INDEX : Doit être entre le contenu (bas) et la sidebar (haut) */
    z-index: 9500;     
    
    display: none;     /* Caché par défaut */
    cursor: pointer;
}

/* On l'affiche quand le body a la classe sidebar-open */
body.sidebar-open .sidebar-overlay {
    display: block;
}
/* Le couloir de défilement horizontal */
/* --- LE CONTENEUR DE DÉFILEMENT (APPARENCE PLUS PRO) --- */
.ppn-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 12px; /* Un peu plus serré pour voir la carte suivante */
    padding: 20px 15px; /* Plus d'air en haut et en bas */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa); /* Dégradé subtil */
    border-bottom: 1px solid #f0f0f0;
}

.ppn-scroll-container::-webkit-scrollbar {
    display: none;
}

/* --- LE STYLE DES CARTES (MODERNE & ÉPURÉ) --- */
.ppn-scroll-container .carte-produit {
    min-width: 165px; /* On réduit pour laisser "dépasser" la 2ème carte (effet d'appel) */
    max-width: 165px;
    scroll-snap-align: start;
    background: white;
    border-radius: 20px; /* Angles beaucoup plus ronds = plus moderne */
    border: 1px solid rgba(0,0,0,0.03); /* Bordure presque invisible */
    box-shadow: 0 8px 20px rgba(0,0,0,0.06); /* Ombre plus diffuse et douce */
    transition: transform 0.2s ease;
    overflow: hidden; /* Pour que l'image ne dépasse pas des arrondis */
}

/* Effet de pression au clic sur mobile */
.ppn-scroll-container .carte-produit:active {
    transform: scale(0.96);
}

/* Ajustement des images dans le scroll */
.ppn-scroll-container .carte-produit img {
    height: 130px; /* Un peu plus court pour garder de la place pour le texte */
    object-fit: cover;
    border-bottom: 1px solid #f9f9f9;
}

/* Ajustement des titres dans le scroll */
/* Ajustement des titres dans le scroll */
.ppn-scroll-container .carte-produit h3 {
    font-size: 0.85rem;
    line-height: 1.2;
    margin: 8px 0;
    color: #333;
    
    /* --- LA CORRECTION EST ICI --- */
    display: -webkit-box;
    -webkit-line-clamp: 2;    /* Pour Chrome et Safari */
    line-clamp: 2;            /* LA PROPRIÉTÉ STANDARD (pour la compatibilité) */
    -webkit-box-orient: vertical;
    
    overflow: hidden;         /* Coupe le texte qui dépasse */
    height: 2.4em;            /* Fixe la hauteur pour que toutes les cartes soient alignées */
}
.img-container {
    width: 100%;
    height: 130px; /* Hauteur fixe pour le scroll */
    overflow: hidden;
    border-radius: 20px 20px 0 0; /* Arrondi uniquement en haut */
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* L'image remplit la case sans se déformer */
    transition: transform 0.5s ease;
}

.carte-produit:hover img {
    transform: scale(1.1); /* Petit zoom élégant au survol */
}
/* --- CORRECTIF DESIGN : ALIGNEMENT ET IMAGES --- */

/* On cadre l'image pour éviter les déformations */
.carte-produit img {
    height: 140px !important; /* Hauteur fixe pour l'harmonie */
    object-fit: cover !important; /* L'image remplit sans s'écraser */
    width: 100% !important;
}

/* On force le titre sur 2 lignes maximum pour aligner les boutons */
.carte-produit h3 {
    font-size: 0.9rem !important;
    height: 2.4em !important; /* Réserve la place pour exactement 2 lignes */
    line-height: 1.2 !important;
    margin: 10px 0 !important;

    /* --- COMPATIBILITÉ TOTALE --- */
    display: -webkit-box;
    -webkit-line-clamp: 2;         /* Pour Chrome, Safari, Edge */
    line-clamp: 2;                 /* Propriété STANDARD (Future-proof) */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Espacement propre pour le bouton commander */
.btn-commander {
    margin-top: 10px !important;
}
.pulse-alerte {
    animation: pulse-green 2s infinite;
    box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7);
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(39, 174, 96, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}
/* Design des cartes de reçus */
.recu-card {
    background: white;
    border: 1px solid #f0f0f0;
    padding: 18px;
    border-radius: 18px;
    margin-bottom: 15px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    border-left: 6px solid #27ae60;
}

.recu-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.recu-status {
    background: #27ae60;
    color: white;
    font-size: 0.6rem;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.recu-details-btn {
    background: #333;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.recu-details-btn:active {
    transform: scale(0.95);
}
#badge-achats-valides {
    display: inline-flex !important; /* Empêche de prendre toute la ligne */
    align-items: center;
    justify-content: center;
    width: 20px !important;  /* Largeur fixe */
    height: 20px !important; /* Hauteur fixe */
    border-radius: 50% !important; /* Cercle parfait */
    padding: 0 !important;   /* On enlève les paddings qui déforment */
    margin-left: 10px;
    font-weight: bold;
    font-size: 11px;
    flex-shrink: 0; /* Empêche l'écrasement */
}
#sidebar a:hover span {
    color: #27ae60 !important;
    transition: 0.3s;
}
/* --- STYLE DU CHAT WHATSAPP / META AI --- */

/* La zone qui contient tous les messages */
#chat-messages {
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); /* Fond discret style WhatsApp */
    background-color: #e5ddd5;
    background-blend-mode: overlay;
    display: flex;
    flex-direction: column;
    padding: 15px;
}

/* Style général des bulles */
.message {
    position: relative;
    margin-bottom: 10px;
    padding: 8px 12px;
    font-size: 0.92rem;
    line-height: 1.4;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    word-wrap: break-word;
    animation: fadeInMsg 0.3s ease;
}

/* Bulle du Client (Droite) */
.msg-client {
    background: #dcf8c6 !important;
    align-self: flex-end;
    border-radius: 15px 15px 0 15px;
    border: none;
}

/* Bulle de l'Admin (Gauche) */
.msg-admin {
    background: #ffffff !important;
    align-self: flex-start;
    border-radius: 15px 15px 15px 0;
    border: none;
}

/* Animation d'apparition des messages */
@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Personnalisation de la barre de défilement (Scrollbar) */
#chat-messages::-webkit-scrollbar {
    width: 5px;
}
#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}

/* Style de l'input au focus */
#chat-input:focus {
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}

/* Effet de pulsation sur le badge de notification */
#chat-notif {
    animation: pulseRed 2s infinite;
}

@keyframes pulseRed {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 0, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

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

.chat-bubble-active {
    animation: slideUp 0.5s ease-out forwards;
}

#chat-promo-text {
    pointer-events: none; /* Le client peut cliquer "à travers" le message */
    white-space: nowrap; /* Évite que le texte se coupe en deux lignes */
}