/* =======================================================
   VARIABLES
======================================================= */
:root{
    --primary:#2e7d32;
    --primary-dark:#1b5e20;
    --accent:#ffca28;
    --green-light:#f1f8e9;
    --bg:#f5f7f6;
    --white:#ffffff;
    --text:#333;
    --shadow-sm:0 2px 6px rgba(0,0,0,.1);
    --shadow-md:0 4px 12px rgba(0,0,0,.15);
    --radius:10px;
}

/* =======================================================
   RESET
======================================================= */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}
html{
    scroll-behavior:smooth;
}
button:active{
    transform:scale(0.96);
}

body{
    background:var(--bg);
    color:var(--text);
    font-family:'Segoe UI', sans-serif;
    line-height:1.5;
}

button{
    cursor:pointer;
    border:none;
    transition:.3s ease;
    transition: background .3s ease, transform .15s ease, box-shadow .3s ease;
}

button:focus,
a:focus,
input:focus{
    outline:2px solid var(--accent);
    outline-offset:2px;
}

/* =======================================================
   HEADER
======================================================= */
.header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:15px 30px;
    background:var(--white);
    position:sticky;
    top:0;
    z-index:100;
    box-shadow:var(--shadow-sm);
}

.logo{
    font-size:22px;
    font-weight:bold;
    color:var(--primary);
}

.nav a{
    margin:0 8px;
    text-decoration:none;
    color:var(--primary);
    font-size:14px;
}

.btn-login,
.cart-icon{
    padding:6px 12px;
    background:var(--accent);
    border-radius:5px;
    font-size:14px;
    font-weight:600;
}

/* =======================================================
   HERO
======================================================= */
.hero{
    position:relative;
    overflow:hidden;
}

.carousel{
    display:flex;
    transition:transform .8s cubic-bezier(.77,0,.18,1);
    overflow: hidden;
}
.hero,
.carousel,
.slide-bg{
    height:100vh;
}

.carousel-nav{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    background:#ffffffb3;
    padding:20px;
    border-radius:50%;
}

.carousel-nav.gauche{ left:20px; }
.carousel-nav.droit{ right:20px; }

.slide-bg{
    min-width:100%;
    background-size:cover;
    background-position:center;
    opacity:0;
    position:absolute;
    transition:.6s;
    /* backdrop-filter: blur(5px); */
}
.slide-bg.active{
    opacity:1;
}

.card img{
    transition: transform .4s ease;
}

.card:hover img{
    transform:scale(1.05);
}


.hero-overlay{
    position:absolute;
    inset:0;
    background:#0000003d;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    color:#fff;
    padding:20px;
    /* backdrop-filter: blur(5px); */
    z-index: 1;
}

.hero-content h1{font-size:42px;margin-bottom:10px;}
.hero-content p{font-size:20px;margin-bottom:20px;}

.hero .hero-btn{
    padding:12px 24px;
    border-radius:6px;
    background:var(--accent);
}
.hero-content img{
    z-index: 999;
}
img{
    max-width:100%;
    display:block;
}

#entreRecherche{
    padding: 15px;
    width: 50%;
    border-radius: 30px;
    margin-top: 10px;
    border: 1px solid var(--primary);
    outline: none;

}
#entreRecherche:focus{
    box-shadow:0 0 8px rgba(46,125,50,.4);
}

section {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.5s;
}
section.active {
    opacity: 1;
    transform: translateY(0);
}

.pl{
        background: #fff;
        padding: 10px;
        align-items: center;
        display: flex;
        justify-content: center;
        width: 20%;
        border: none;
        box-shadow: 0 0 10px #ddd;
        margin: 20px;
        border-radius: 30px;
        cursor: pointer;
        animation: pl;
        animation-duration: 3s; /* Durée totale */
        animation-iteration-count: infinite; /* Répétition infinie */
        animation-timing-function: ease-in-out; 
    }    
    .pl:after{
        content: "..."
    }
    .v{
        display: flex;
        align-items: center;
        justify-content: center;
    }
.rc{
    display: flex;
    align-items: center;
    justify-content: center;
}
/* =======================================================
   PRODUCTS GRID
======================================================= */
.grille-produit{
    display:grid;
    grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
    gap:20px;
    padding:20px;
}

.card{
    background:var(--white);
    padding:0;
    border-radius:var(--radius);
    box-shadow:var(--shadow-sm);
    display:flex;
    flex-direction:column;
    transition: transform .3s ease, box-shadow .3s ease;
    position:relative;
    overflow:hidden;
    backface-visibility: hidden;
}

.card:hover{
    transform:translateY(-6px);
    box-shadow:var(--shadow-md);
}

.card img{
    width:100%;
    height:160px;
    object-fit:cover;
    display:block;
}
.card img, .slide-bg {
    backface-visibility: hidden;
    transform: translateZ(0);
}

.card-image-wrapper{
    position:relative;
    overflow:hidden;
    border-radius:var(--radius);
}

.card-badges{
    position:absolute;
    top:10px;
    left:10px;
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    z-index:2;
}

.card-badge{
    padding:3px 8px;
    border-radius:50px;
    font-size:11px;
    font-weight:600;
    color:#fff;
    background:var(--primary);
    box-shadow:0 2px 4px rgba(0,0,0,.15);
}

.card-badge-promo{
    background:#e53935;
}

.card-badge-vedette{
    background:#3949ab;
}

.card-body{
    padding:12px 12px 14px;
    display:flex;
    flex-direction:column;
    gap:6px;
}

.card-title{
    font-size:15px;
    font-weight:600;
    color:var(--text);
    margin:4px 0;
}

.card-rating{
    display:flex;
    align-items:center;
    gap:4px;
    font-size:11px;
    color:#777;
}

.card-rating i{
    color:#ffb300;
}

.card-meta{
    list-style:none;
    font-size:11px;
    color:#666;
    margin:4px 0 0;
    padding:0;
}

.card-meta li{
    display:flex;
    align-items:center;
    gap:4px;
    margin-bottom:2px;
}

.card-footer{
    margin-top:10px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}

.card-price{
    display:flex;
    flex-direction:column;
    font-size:13px;
}

.card-price-value{
    font-weight:700;
    color:var(--primary);
}

.card-price-unit{
    font-size:11px;
    color:#777;
}

.card h3{
    margin:10px 0 5px;
    font-size:16px;
}
.filtresAvance{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.filtresAvance input{
    padding: 15px;
    border-radius: 25px;
    width: 30%;
    outline: none;
    border: 1px solid var(--primary);
}
#filtreMinMax{
    background: var(--primary);
    color: var(--white);
    padding: 15px;
    border-radius: 25px;
}

#filtreMinMax:hover{
    background: var(--primary-dark);
}
.chatVender{
    background: #0f9d6a;
    padding: 5px;
    color: #fff;
    border-radius: 30px;
}
.detailsActions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:10px;
}
.btn-chat-vendeur{
    padding:10px 14px;
    border-radius:5px;
    border:none;
    background:#0f9d6a;
    color:#fff;
    font-size:13px;
    cursor:pointer;
    display:flex;
    align-items:center;
    gap:6px;
    width: 100%;
    font-weight: bold;

}
.btn-chat-vendeur:hover{
    background:#0b7a52;
    
}
#detailsProduitVendeurs{
    color: #fff;
    text-align: center;
    margin-bottom: 0;
}
#quantiteInput{
    padding: 10px;
    border-radius: 25px;
    margin: 10px 0;
    /* width: 50%; */
    text-align: center;
    outline: none;
    border: 1px solid var(--primary);
}
.prix{
    color:var(--primary);
    font-weight:bold;
    background-color: #ffffff;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card button{
    margin-top:0;
    padding:8px 14px;
    background:var(--primary);
    color:#fff;
    border-radius:5px;
    font-size:12px;
    font-weight:600;
    display:inline-flex;
    align-items:center;
    gap:6px;
}

.card button:hover{
    background:var(--primary-dark);
}

.card-actions{
    display:flex;
    gap:8px;
    margin-top:10px;
}

.btn-passer-commande{
    background:var(--accent);
    color:#333;
}

.btn-passer-commande:hover{
    background:#f0b91f;
}

/* =======================================================
   BADGE
======================================================= */
.badge{
    position:absolute;
    top:10px;
    left:10px;
    background:var(--accent);
    padding:5px 10px;
    border-radius:5px;
    font-size:12px;
    font-weight:bold;
}

/* =======================================================
   PANIER
======================================================= */
.panier{
    position:fixed;
    top:80px;
    right:20px;
    width:300px;
    background:var(--white);
    padding:20px;
    border-radius:var(--radius);
    box-shadow:var(--shadow-md);
    display:none;
    flex-direction:column;
    gap:15px;
    z-index:1000;
}

#cartItems{
    display:flex;
    flex-direction:column;
    gap:10px;
    overflow-y:auto;
    max-height:200px;
}

.cart-item{
    display:flex;
    align-items:center;
    gap:10px;
    padding:8px 0;
    border-bottom:1px solid #f0f0f0;
    font-size:13px;
}

.cart-item-image{
    width:40px;
    height:40px;
    object-fit:cover;
    border-radius:6px;
    flex-shrink:0;
}

.cart-item-content{
    display:flex;
    flex-direction:column;
    gap:2px;
    flex:1;
}

.cart-item-title{
    font-weight:600;
}

.cart-item-details{
    color:#666;
}

.cart-item-actions{
    display:flex;
    gap:4px;
    margin-top:4px;
}

.cart-item-actions button{
    padding:2px 6px;
    font-size:11px;
}

.btn-checkout{
    background:var(--primary);
    color:#fff;
    padding:10px;
    border-radius:6px;
}

.btn-checkout:hover{
    background:var(--primary-dark);
}

.profil{
        position: fixed;
        top: 80px;
        right: 20px;
        background-color: #fff;
        padding: 10px;
        border-radius: 5px;
        box-shadow: 0 2px 8px rgba(0,0,0,.1);
        display: none;
        flex-direction: column;
        gap: 10px;
        z-index: 1000;
    }
    .profil img{
        border-radius: 50%;
    }
    .profil a{
        text-decoration: none;
        color: #333;
        font-weight: 600;
        transition: color 0.3s ease;
        cursor: pointer;
    }
    .profil a:hover{
        color: #0f9d6a;
        text-decoration: underline;
    }
     .hct{
        background: #ffffffa6;
        backdrop-filter: blur(5px); 
        padding: 10px;border-radius: 10px; 
        display: flex; 
        align-items: flex-start; 
        flex-direction: column; 
        position: absolute; 
        bottom:15%;
        left:70%;
        color: #333; 
        box-shadow: 0 0 5px rgba(0,0,0,0.5);
    }
    .hpn{
        font-size: 2em; 
        margin: 0; 
        color: #4CAF50;
    }
    .hbtn{
        background-color: #4CAF50; 
        color: white; 
        padding: 15px 30px; 
        border: none; 
        border-radius: 5px; 
        cursor: pointer; 
        position: absolute; 
        top: 90%; 
        left: 20%; 
        transform: translateX(-50%);
    }
    .hvp{
        background-color: #4CAF50; color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; position: absolute; top: 90%; left: 80%; transform: translateX(-50%);
    }
    .himg{
        max-width:100%;  
        max-height: 70%; 
        object-fit: contain;
        position: relative; 
        top: 70px;
    }
    .badge.h{
        position:absolute; top:10px; left:10px; background-color:#ff5722; color:white; padding:10px 20px; border-radius:20px; font-size:14px;
    }
    .hpp{
        font-size:18px; 
        font-weight:bold;
    }
    .hc{
        font-size:14px;
    }
    .parprix{
        margin: 20px;
    }
    .prixvente{
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 20px;
    }
    .prix:hover{
        background-color: #0f9d6a;
        color: white;
        border-color: #0f9d6a;
    }
    .prix.active{
        background-color: #0f9d6a;
        color: white;
        border-color: #0f9d6a;
    }
    .produitparprix{
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
        .vendeur-list {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        padding: 20px 0;
    }
    .vendeur {
        background-color: #ffffff;
        padding: 10px 20px;
        border-radius: 50px;
        cursor: pointer;
        transition: background-color 0.3s ease;
        margin-top: 10px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    .vendeur:hover {
        background-color: #008b2e;
        color: #ffffff;
    }
    .vendeur.active {
        background-color: #008b2e;
        color: #ffffff;
    }
    .detailsProduitss{
        position: fixed;
        top:0;
        left:0;
        width:100%;
        height:100%;
        background:rgba(0,0,0,0.5);
        display:none;
        align-items:center;
        justify-content:center;
        opacity:0;
        visibility:hidden;
        transition:.3s ease;
        z-index:1000;
    }

    .detailsProduitss.active{
        display:flex;
        opacity:1;
        visibility:visible;
    }

    .detailsContents{
        background-color: #ffffff;
        padding: 20px;
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        gap: 20px;
        /* width: 80%;
        max-width: 800px; */
        position: relative;
        max-height: 90vh;
        overflow-y: auto;
    }
    .detailsImage img{
        width: 80px;
        /* height: 300px; */
        object-fit: cover;
        border-radius: 10px;
    }
    .detailsInfo h2{
        margin: 0 0 10px;
        color: #333333;
    }
    .detailsInfo p{
        color: #666666;
    }
    
    .ajoutaupanier{
        position:fixed;
        inset:0;
        background:rgba(0,0,0,0.5);
        display:flex;
        align-items:center;
        justify-content:center;
        opacity:0;
        visibility:hidden;
        transition:.3s ease;
        z-index:1001;
    }

    /* .ajoutaupanier.active{
        display:flex;
        opacity:1;
        visibility:visible;
    } */

    .ajoutaupanierContent{
        background-color: #ffffff;
        padding: 20px;
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        width: 300px;
        position: relative;
        
    }
    .ajoutaupanierContent .qt{
        display:flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin: 20px 0;
    }
    .ajoutaupanierContent .qt button{
        padding: 10px;
        border:none;
        background-color:#0f9d6a ;
        color:#fff;
        font-size: 1em;
        border-radius: 5px;
    }
    .ajoutaupanierContent .qt button:hover{
        background-color:#267558 ;
    }
    .ajoutaupanierContent .p button{
        padding: 10px 20px;
        border:none;
        background-color:#0f9d6a ;
        color:#fff;
        font-size: 1em;
        margin: 0 10px;
        border-radius: 5px;
    }
    .ajoutaupanierContent .p button:hover{
        background-color:#267558 ;
    }
    .btn-ajouter-panier{
        margin-top: auto;
        padding: 10px;
        background-color: #008b2e;
        color: #ffffff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }
    .btn-ajouter-panier:hover{
        background-color: #006622;
    }
    article{
        padding: 10px;
    }
    .panier,
    .profil {
        display: none;
    }
    #cartItemsMain{
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        padding: 10px;
        gap: 10px;
        height: 220px;
    }
    .cart-item{
        display: flex;
        align-items: center;
        gap: 10px;
        border: 1px solid #ddd;
        padding: 5px;
        border-radius: 15px;
        button{
            padding: 5px;
            border: 1px solid;
            font-weight: bold;
            border-radius: 10px;
        }
    }
    .panier.active,
    .profil.active {
        display: flex;
    }

/* =======================================================
   MODALS
======================================================= */
.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.5);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:1001;
}

.modal-content{
    background:var(--white);
    padding:20px;
    border-radius:var(--radius);
    width:90%;
    max-width:600px;
}
.hd{
    display:flex;justify-content:space-between;border-bottom: 1px solid #ddd;padding: 10px;
}
.prx{
    background: #00ff7323;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #51ff8b;
}
.hdp{
    display: flex;
    flex-direction: row;
    padding: 10px;
    gap: 10px;
    .hdr{
        display: flex;
        flex-direction: column;
    }
}
.v{
    display: flex;
    flex-direction: column;
    align-items: start;
    margin-bottom: 10px;
    padding: 10px;
    background: #62ffc519;
    border-radius: 10px;
    p{
        font-size: 0.8em;
        margin-bottom: 10px;
    }
}
.pg{
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: 10px;
}
/* =======================================================
    RESPONSIVE
======================================================= */
@media(max-width:768px){

    #entreRecherche{
        width:90%;
    }

    .filtresAvance input{
        width:45%;
    }

    .detailsContents{
        flex-direction:column;
        /* align-items:center;
        text-align:center; */
        

    }

    .detailsImage img{
        width: 80px;
        height: 80px;
    }

}
/*==========================================================
    ANIMATION
===========================================================*/
@keyframes scrollsection {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pl {
    0% { transform: translateY(0); }
    50% { transform: translateY(8px); }
    100% { transform: translateY(0); }
}

/* Accessibilité : label visible uniquement pour les lecteurs d'écran */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
