/* ==========================================================================
   1. VARIABLES & LAYOUT GLOBAL
   ========================================================================== */
:root {
    --primary-green: #2ecc71;
    --primary-light: #3498db; /* À ajuster selon votre charte */
    --text-gray: #7f8c8d;
    --bg-light: #fdf2f2;
}

.shop-container {
    display: flex;
    gap: 40px;
    padding: 140px 40px 12px 40px; /* Top 140px pour le header */
    max-width: 1400px;
    margin: 0 auto;
}

/* ==========================================================================
   2. SIDEBAR (CATÉGORIES)
   ========================================================================== */
.sidebar { 
    width: 250px; 
}

.sidebar h3 { 
    font-size: 1.5rem; 
    margin-bottom: 20px; 
}

.category-list { 
    list-style: none; 
    padding: 0; 
    display: flex; 
    flex-direction: column; 
    gap: 5px;
}

.category-list li {
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.3s;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.category-list li.active {
    background-color: var(--primary-green); /* Accordé à la capture mobile */
    color: white;
}

.category-list li:hover:not(.active) {
    background-color: #eee;
}

/* ==========================================================================
   3. BARRE DE RECHERCHE
   ========================================================================== */
.products-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.search-bar-wrapper {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

.search-bar-wrapper input {
    width: 100%; /* Utilise 100% du conteneur parent */
    padding: 15px 15px 15px 45px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    box-sizing: border-box;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    right: 50;
    transform: translateY(-50%);
    color: var(--text-gray);
}

.results-count { 
    color: var(--text-gray);
    margin-bottom: 30px; 
    font-size: 0.9rem;
}

/* ==========================================================================
   4. GRILLE DE PRODUITS & CARTES
   ========================================================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 colonnes sur PC */
    gap: 20px;
}

.product-card {
    /* background: white; */
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.211);
    transition: transform 0.3s;
}

.product-card:hover { 
    transform: translateY(-5px); 
}

.image-container {
    position: relative;
    /* background: var(--bg-light); */
    width: 100%; /* S'adapte à la carte */
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.badge-vedette {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary-green);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    z-index: 1;
}

.product-info { 
    padding: 15px; 
}

.product-info h4 { 
    font-size: 0.85rem; 
    margin: 0 0 10px 0; 
    color: #444; 
}

.price { 
    color: var(--primary-green); 
    font-weight: bold; 
    font-size: 1.1rem; 
}

/* ==========================================================================
   5. RESPONSIVE DESIGN (MOBILE & TABLETTE)
   ========================================================================== */

/* Tablettes */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobiles (Selon Capture) */
@media (max-width: 768px) {

    .shop-container {
        flex-direction: column;
        padding: 100px 15px 12px 15px;
        gap: 20px;
    }

    /* SIDEBAR STICKY MOBILE */
    .sidebar {
        width: 100%;
        position: sticky;
        top: 80px; /* Hauteur header mobile */
        background: white;
        z-index: 100;
        padding-top: 10px;
    }

    /* SEARCH STICKY MOBILE */
    .search-bar-wrapper {
        position: sticky;
        top: 140px; /* header + categories */
        background: white;
        z-index: 99;
        padding: 10px 0;
    }

    .sidebar h3 {
        display: none;
    }

    .category-list {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
        gap: 10px;
        scrollbar-width: none;
    }

    .category-list::-webkit-scrollbar {
        display: none;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .image-container {
        height: 150px;
    }
}
