/* Capitalisation automatique des premiers caractères */
.is_capi{
    text-transform: capitalize;
}

/* ====== LAYOUT GLOBAL ====== */
#container_cat{
    width: 100%;
    display: flex;
    margin-top: 14vh; /* espace sous le header */
    position: relative;
    align-items: start;
}

/* ====== PANNEAU LATERAL GAUCHE (filtres / catégories) ====== */
#side_search{
    width: 20%;
    background-color: #e2d8c5;
    padding: 20px;
    padding-top: 50px;
    position: relative;
}

#side_search::-webkit-scrollbar {
  width: 5px;
  background: #c5bfb4; /* style scrollbar */
}

/* ====== GRID DES PRODUITS ====== */
#items_container{
    width: 80%;
    display: grid;
    gap: 30px;
    row-gap: 30px;
    padding: 20px;
    grid-template-columns: repeat(4, 1fr);
}

/* Barre de navigation catégories (desktop) */
#nav_cat{
    width: 100%;
    height:60px;
    grid-column: 1 / -1; /* occupe toute la grille */
    display: flex;
    gap:2%;
    align-items: center;
    background-color: #e2d8c5;
    border-radius: 15px;
    padding: 10px 20px;
}
.neon {
    text-shadow:
        0 0 5px #00ff0057,
        0 0 10px #00ff0057,
        0 0 20px #00ff0057,
        0 0 40px #00ff0057,
        0 0 80px #00ff0057;
}
#nav_cat div{
    cursor: pointer;
}

/* ====== CARDS PRODUITS ====== */
.card {
    padding: 20px;
    height:550px;
    width: 100%;
}

/* Bouton burger responsive */
#opener{
    width: 15px;
    height:15px;
    font-size: 20px;
    position: absolute;
    top:3vh;
    cursor: pointer;
}

/* Catégories (cliquables) */
.cat{
    cursor: pointer;
    width: 100%;
    margin-top: 5px;
    transition: color 0.5s ease;
}
.cat:hover{
    color:rgb(109, 91, 91);
}

/* Icône flèche à droite */
.v_bottom{
    float: right;
    user-select: none;
}

/* Sous-catégories (liste déroulante animée) */
.sous_cat{
    display: grid;
    grid-template-rows: 0fr; /* fermé par défaut */
    overflow: hidden;
    transition: grid-template-rows 0.4s ease;
    margin-top: 5px;
}
.sous_cat.open {
    grid-template-rows: 1fr; /* ouvert */
}

.sous_cat_item{
    padding-left: 30px;
    cursor: pointer;
    transition: color 0.5s ease;
    user-select: none;
}
.sous_cat_item:hover{
    color:rgb(109, 91, 91);
}

.container_sous_cat{
  min-height: 0;
  width: 100%;
}

/* Barre de recherche */
.search{
    background-color: rgba(128, 128, 128, 0.164);
    width: 80%;
    margin-left: 30px;
    padding-left: 5px;
    display: flex;
    align-items: center;
    height:25px;
    margin-top: 5px;
}

#full_loop{
   
}

.loupe{
    height: 15px;
}

#cat{
    margin-top: 10px;
}

/* Bouton responsive (ouvrir menu) */
#btn_resp_open{
    display: none;
    position: fixed;
    font-size: 25px;
}

#close_nav{
    display: none;
}

/* Flèches de sous-catégories */
.arrow_img{
    width: 20px;
    height: 20px;
    user-select: none;
}
.arrow_v_bot{
    transform: rotate(-90deg);
}

/* ====== MEDIA QUERIES ====== */

/* Écrans larges réduits */
@media (max-width: 1366px) {
    .card{
        height: 400px;
        padding: 10px;
    }
    #items_container{
        gap:15px;
    }
    .item_picture{
        height: 55%;
    }
}

/* Laptops moyens */
@media (max-width: 1176px) {
    .card{
        height: 350px;
        padding: 10px;
        box-shadow: 0px 8px 10px rgba(0, 0, 0, 0.582);
    }
}

/* Tablettes */
@media (max-width: 1152px) {
    .new_item_grid{
        width: 100%;
    }
    #items_container{
        grid-template-columns: repeat(3, 1fr);
    }
    #side_search{
        width: 30%;
    }
    #nav_cat{
        flex-wrap: wrap;
    }
    .item_top{
        height:20px;
    }
    .item_picture{
        height:60%;
    }
    .card{
        height: 340px;
        min-height: 340px;
    }
}

/* Adaptation tablette → mobile */
@media (max-width: 800px) {
    #items_container{
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    #container_cat{
        margin-top: 80px; /* header sticky plus bas */
    }
}

/* Mobile */
@media (max-width: 800px) {
    #items_container{
        grid-template-columns: repeat(auto-fit, minmax(2, 1fr));
        width: 100%;
    }

    /* Menu latéral devient panneau coulissant */
    #side_search{
        width: 60%;
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.5s ease;
        z-index: 100000;
        overflow-y: auto;
        overflow-x: hidden;
        height: 100vh;
        padding: 20px;
        padding-top: 50px;
        top:80px;
    }

    #nav_cat{
        display: none;
    }

    /* Boutons d’ouverture */
    #btn_resp_open,
    #close_nav{
        display: block;
    }
}

/* Très petits écrans */
@media (max-width: 400px) {
    #side_search{
        width: 100%;
    }
}

@media (max-width: 350px) {
    .item_picture{
        height: 70%;
    }
}