/* Définition des couleurs à la racine */
:root {
    --couleur-principale: #28a745;
    --couleur-secondaire: #030847;
    --texte-fonce: #2C3E50;
    --texte: #000;
    --fond: #ffffff;
    --fond-menu: #f5f5f5;
    --ombre: rgba(0, 0, 0, 0.1);
    --btn-fond: #fff;
    --btn-texte: #000;
}

@media (prefers-color-scheme: dark) {
    :root {
        --fond: #121212;
        --texte: #ffffff;
        --btn-fond: #000;
        --fond-menu: rgba(0, 0, 0, 0.8);
        --btn-texte: #fff;
    }
    
    .btn-principal {
        border: 1px solid !important;
    }

    .popup-profil {
        background-color: #1a1a1a;
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
        color: #111;
    }

        .popup-profil h4,
        .etat-compte {
            color: #DDD;
        }

    .champ-recherche {
        background-color: aliceblue !important;
        color: black !important;
    }
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
  
/* Base */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--fond);
    color: var(--texte);
    position: relative;
}

#form1 {
    display: flex;
    flex-direction: column;
    height: 100dvh;
}

.CphMain {
    flex: 1;
}

/* En-tête */
.en-tete {
    display: grid;
    background-color: var(--couleur-secondaire);
    padding: 1rem 2rem;
    grid-template-columns: 1fr 600px 1fr;
    grid-template-areas: "bloc-logo barre-recherche actions-utilisateur";
    position: sticky;
    top: 0;
    z-index: 10;
}

.bloc-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    grid-area: bloc-logo;
}

.logo {
    width: 2rem;
    height: auto;
    border-radius: 50%;
    border: 2px solid green;
}

.nom-site {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--couleur-principale);
}

#cBlanc {
    color: #fff;
}

.barre-recherche {
    display: flex;
    flex: 1;
    justify-content: center;
    margin: 1rem 0;
    grid-area: barre-recherche;
}

.champ-recherche {
    flex: 1;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px 0 0 5px;
}

.bouton-recherche {
    padding: 0.5rem 1rem;
    background-color: var(--couleur-principale);
    color: #fff;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
}

.actions-utilisateur {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 1rem;
    grid-area: actions-utilisateur;
}

.icone-action {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.menu {
    display: none;
}

.panier {
    position: relative;
}

#nombre, #LblNombreNotification {
    position: absolute;
    top: -10px;
    right: -7px;
    color: red;
    font-weight: 600;
}

#notification {
    position: relative;
}

#notification-disponible {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 200px;
    position: absolute;
    top: 40px;
    right: 0;
    background-color: white;
    color: black;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

    #notification-disponible h5::before, #notification-disponible h5::after {
        content: "";
        display: block;
        width: 100%;
        height: 2px;
        background-color: black;
    }

.notification {
    padding: 3px;
    border-radius: 5px;
    background-color: #e8f5e9;
    cursor: pointer;
    margin: 2px 0;
    overflow: hidden;
    height: 70px;
}

    .notification:hover {
        background-color: #d8eedb;
    }

    .notification p {
        font-size: 14px;
    }

#BtnVoirPlusDeNotification {
    padding: 5px;
    text-transform: uppercase;
    color: white;
    background-color: green;
    cursor: pointer;
    border: 1px solid;
    font-weight: 600;
    margin-top: 10px;
}

    #BtnVoirPlusDeNotification:hover {
        background-color: darkgreen;
    }


/* =============================== NAVIGATION HORIZONTALE DES CATÉGORIES =============================== */
.menu-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    background-color: var(--fond-menu);
    padding: 1rem;
    margin: 0;
}

.menu-categories li {
    position: relative;
    list-style: none;
}

.btn-principal {
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    color: var(--btn-texte);
    background-color: var(--btn-fond);
    border-radius: 5px;
    transition: background-color 0.3s;
}

    .btn-principal:hover {
        background-color: var(--couleur-principale);
    }

    .liste-secondaire {
        position: absolute;
        top: 100%;
        left: 0;
        background-color: white;
        border-radius: 5px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        display: none;
        flex-direction: column;
        min-width: 150px;
        z-index: 999;
        padding: 0;
    }

        .liste-secondaire li .liste-secondaire-bouton {
            padding: 0.5rem 1rem;
            background: none;
            border: none;
            width: 100%;
            text-align: left;
            cursor: pointer;
            font-size: 0.9rem;
            color: #333;
            transition: background-color 0.3s;
        }

            .liste-secondaire .liste-secondaire-bouton:hover {
                background-color: var(--couleur-principale);
                color: white;
                border-radius: 3px;
            }

.menu-categories li.ouvert .liste-secondaire {
    display: flex;
}

/* Bouton Connexion/Inscription dynamique */
#BtnConnexionAlternatif {
    background-color: var(--couleur-principale);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    width: 135px;
    transition: background-color 0.3s;
}

#BtnConnexionAlternatif:hover {
    background-color: #1e7e34;
}

/* Section Accueil (conserve l'image) */
.accueil {
    background-image: url('../images/Background/bg-1.jpg');
    background-size: cover;
    background-position: center;
    padding: 4rem;
    text-align: center;
    color: #fff;
    height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.slogan {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-shadow: 0 1px 2px black;
}

.description {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 10px;
}

/* Boutons flottants */
.bouton-whatsapp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    text-decoration: none;
}

.bouton-haut {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: var(--couleur-principale);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Carrousel */
.carrousel {
    display: flex;
    overflow-x: hidden;
    scroll-snap-type: x mandatory;
    padding: 2rem;
    background-color: #f3f3f3;
    gap: 1rem;
}

.image-produit {
    width: 200px;
    height: 200px;
    border-radius: 10px;
    scroll-snap-align: start;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-produit:hover {
    transform: scale(1.05);
}


/* =============================== GRILLE DES PRODUITS =============================== */
.grille-produits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 2rem;
}

.carte-produit {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;

    cursor: pointer;
    text-decoration: none;
}

.carte-produit:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.carte-produit img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
}

.titre-produit {
    font-size: 1rem;
    margin: 0.5rem 0 0.25rem;
    color: #222;
    text-align: center;
}

.prix-produit {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--couleur-principale);
    margin-bottom: 0.5rem;
}

.zone-boutons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-acheter, .btn-panier {
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease;
}

.btn-acheter {
    background-color: var(--couleur-principale);
    color: white;
    text-decoration: none;
}

.btn-acheter:hover {
    background-color: #1e7e34;
}

.btn-panier {
    background-color: var(--couleur-secondaire);
    color: white;
    border: none;
}

.btn-panier:hover {
    background-color: #021f65;
}

/* POP-UP */
.bloc-profil {
    position: relative;
}
  
.popup-profil {
    position: absolute;
    top: 120%;
    right: 0;
    width: 200px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    padding: 1rem;
    transition: all 0.3s ease;
    display: none;
}
  
.popup-profil h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #222;
}

#profilNonConnecte {
    text-align: center;
}

#profilConnecte {
    word-wrap: break-word;
}
  
.etat-compte {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    color: #444;
}
  
.boutons-pop {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
  
.btn-pop {
    background-color: var(--couleur-principale);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    border: none;
    cursor: pointer;
    text-align: center;
}
  
.btn-pop:hover {
    background-color: #1e7e34;
}

/* Pied de page */
.pied-page {
    background-color: var(--couleur-secondaire);
    color: #fff;
    text-align: center;
    padding: 1rem;
    font-size: 1rem;
    font-weight: bold;
}

.pied-page #BtnFAQ, .pied-page #BtnContact {
    background-color: transparent;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    color: white;
    font-size: 1rem;
}

@media (max-width: 1100px) {
    .en-tete {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        grid-template-areas: "bloc-logo actions-utilisateur"
                             "barre-recherche barre-recherche";
        gap: 2px;
    }

    .barre-recherche {
        margin: 0.3rem 0;
    }

    .actions-utilisateur {
        justify-content: end;
    }

    .bloc-logo {
        gap: 10px;
    }
}

@media (max-width: 1095px) {
    .nom-site {
        font-size: 1.3rem;
    }
}

@media (max-width: 450px) {
    .en-tete {
        padding: 10px;
    }

    .nom-site {
        font-size: 1.1rem;
    }

    .bloc-logo {
        gap: 5px;
    }
}

@media (max-width: 365px) {
    .nom-site {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .actions-utilisateur {
        row-gap: 10px;
    }

    .grille-produits {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.8rem;
        padding: 1rem;
    }
}