/* Global styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
}

.container {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

/* Categories section (horizontal layout) */
.categories {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background-color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    white-space: nowrap;
}

.category-link {
    display: inline-block;
    text-decoration: none;
    color: #333;
    padding: 10px 15px;
    background-color: #edf2f7;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
    white-space: nowrap;
}

.category-link:hover {
    background-color: #176b61;
    color: white;
}

/* Active category */
.category-link.active {
    background-color: #54c4b7;
    color: white;
}

/* Products section */
.products {
    flex: 1;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Par défaut : 4 colonnes sur grands écrans */
    gap: 20px;
}

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

.product-link {
    text-decoration: none;
    color: inherit;
}

.product-link:hover {
    text-decoration: underline;
}



.product-info {
    padding: 15px;
    text-align: center;
}

.product-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

/* Pagination styles */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination-link {
    padding: 10px 15px;
    background-color: #edf2f7;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.pagination-link:hover {
    background-color: #54c4b7;
    color: white;
}

.pagination-link.active {
    background-color: #54c4b7;
    color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: calc(100% / 4); /* 4 rows */
    }

    .product-img {
        height: 120px;
    }

    .pagination-link {
        padding: 8px 10px;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
  

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: calc(100% / 6); /* 6 rows */
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-info {
        padding: 10px;
    }

    .product-title {
        font-size: 0.875rem;
    }
}

.products-grid {
    display: grid;
    gap: 20px;
}



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

/* Petits écrans : 2 colonnes */
@media (max-width: 768px) {
    .content-container {
        flex-direction: column; /* Empile les filtres et les produits */
        align-items: center;
    }

    .filters {
        width: 100%;
        position: relative; /* Supprime l'effet sticky */
        text-align: center;
    }

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

/* Très petits écrans : 1 colonne */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}


/* Petit écran : 6 lignes de 2 produits */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 colonnes */
        grid-auto-rows: 1fr; /* Lignes ajustées automatiquement */
    }
}

/* Conteneur principal : Formulaire (gauche) + Produits (droite) */
.content-container {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto; /* Centrer sur la page */
}

/* Filtres (à gauche) */
.filters {
    width: 250px;
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    position: sticky;
    top: 20px; /* Reste en haut lorsqu'on scrolle */
    height: fit-content;
}

.products {
    flex: 1;
}
/* Groupe de filtres */
.filter-group {
    margin-bottom: 15px;
}

/* Titre des groupes */
.filter-group strong {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

/* Checkbox stylisée */
.filter-group label {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

.filter-group input[type="checkbox"] {
    margin-right: 8px;
}




/* Carte produit */
.product-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s;
    height: 100%; /* Assure que toutes les cartes occupent la même hauteur */
    padding: 10px;
    text-align: center;
}

.product-card:hover {
    transform: scale(1.05);
}

/* Image produit */
.product-img {
    width: 100%; /* Prend toute la largeur du conteneur */
    max-height: 180px; /* Hauteur maximale au lieu d'une hauteur fixe */
    object-fit: contain; /* Affiche l’image entière sans la couper */
    background-color: #fff; /* Évite le fond transparent */
    padding: 5px; /* Ajoute un peu d’espace autour */
    border-radius: 5px;
}

