/*
 * Fichier CSS : produits-pedagogiques-page.css - Optimisation 2025
 * Objectif : Styliser la page de la boutique avec une mise en page claire, responsive,
 * et intégrer les menus déroulants (dropdowns) pour les filtres.
 */

/* ========================================================================= */
/* --- 1. VARIABLES & BASE --- */
/* ========================================================================= */
:root {
    --primary-color: #18faaf; /* Vert vif/Aqua fluo */
    --secondary-color: #e03e6c; /* Rose/Magenta */
    --text-color-dark: #333;
    --text-color-light: #fff;
    --link-color: #34495e; 
    --light-bg: #f7f7f7;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    
    --handwritten-font: 'Caveat', cursive; /* Changement de police manuscrite pour plus de lisibilité */
    --main-font: 'Open Sans', sans-serif;
    --heading-font: 'Montserrat', sans-serif;
}

body {
    font-family: var(--main-font);
    margin: 0;
    padding: 0;
    background-color: var(--light-bg);
    color: var(--text-color-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================================================= */
/* --- 2. HERO ET TITRE DE LA BOUTIQUE --- */
/* ========================================================================= */

.hero-shop-rainbow {
    background-color: var(--primary-color);
    padding: 60px 20px 30px 20px;
    text-align: center;
    box-sizing: border-box;
}

.shop-rainbow-title {
    font-family: var(--heading-font);
    font-size: clamp(2.5em, 5vw, 3.5em); /* Responsive font size */
    font-weight: 800;
    color: var(--text-color-dark); /* Texte foncé sur fond fluo */
    margin: 0 auto 15px auto;
}

.hero-shop-subtitle {
    font-size: 1.2em;
    color: var(--link-color);
    max-width: 800px;
    margin: 0 auto;
}

/* ========================================================================= */
/* --- 3. BARRE DE FILTRES ET NAVIGATION CATÉGORIES --- */
/* ========================================================================= */

.shop-filters-bar-final {
    background-color: var(--text-color-light);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.shop-nav-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Bloc Catégories (Ligne du haut) --- */
.categories-nav-wrapper {
    padding: 15px 0 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.categories-menu-compact-div {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px 30px;
}

.category-item-link {
    text-decoration: none;
    color: var(--link-color);
    font-weight: 600;
    font-size: 1.2em;
    padding: 5px 0;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    font-family: var(--handwritten-font); 
    transition: color 0.2s;
}

.category-item-link:hover {
    color: var(--secondary-color);
}

.utility-icons-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ribbon-nouveautes-iconic {
    background-color: var(--secondary-color);
    color: var(--text-color-light);
    font-weight: 700;
    font-size: 1em;
    padding: 8px 20px;
    border-radius: 5px;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
    text-decoration: none;
    font-family: var(--heading-font);
    transition: transform 0.2s;
}

.ribbon-nouveautes-iconic:hover {
    transform: translateY(-2px);
    box-shadow: 5px 5px 0 rgba(0,0,0,0.2);
}

.cart-icon-compact {
    font-size: 1.8em;
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

.cart-icon-compact:hover {
    color: var(--secondary-color);
}


/* --- Barre de Recherche & Filtres (Ligne du bas - Vert Fluo) --- */
.filter-controls-compact-bottom-row {
    background-color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
}

/* Search Box Styling */
.search-box-compact {
    background-color: var(--text-color-light);
    border: 1px solid var(--text-color-dark);
    border-radius: 20px; /* Plus arrondi */
    padding: 8px 15px;
    flex-basis: 45%; 
    max-width: 450px;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
}

.search-box-compact input {
    border: none;
    outline: none;
    padding: 0 10px;
    font-size: 1em;
    flex-grow: 1;
}

.search-box-compact .search-icon, .search-box-compact .clear-search {
    color: var(--text-color-dark);
    cursor: pointer;
}

/* ========================================================================= */
/* --- 4. DROPDOWN MENUS (PAR PROFIL / PAR ÂGE) --- */
/* ========================================================================= */

.secondary-filters-group { 
    display: flex;
    gap: 30px; 
    align-items: center;
    flex-shrink: 0;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color-dark); 
    font-weight: 700; 
    font-size: 1.3em; 
    padding: 5px 10px;
    font-family: var(--heading-font); 
    line-height: 1.2;
    outline: none;
    transition: opacity 0.2s;
    border-radius: 5px;
}

.dropdown-btn:hover {
    opacity: 0.8;
    background-color: rgba(0,0,0,0.05);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0; /* Aligné à droite pour ne pas déborder */
    top: 100%; 
    z-index: 100;
    
    background-color: var(--text-color-light);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    padding: 5px 0;
    border-radius: 8px;
    border: 2px solid var(--secondary-color); /* Bordure Rose */
    overflow: hidden;
}

.dropdown-content a {
    color: var(--text-color-dark);
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--secondary-color);
    color: var(--text-color-light);
}

/* Affichage au survol */
.dropdown:hover .dropdown-content {
    display: block;
}


/* ========================================================================= */
/* --- 5. LISTE DE PRODUITS ET CARTES --- */
/* ========================================================================= */

.products-by-category {
    padding: 40px 0;
}

.category-section {
    margin-bottom: 50px;
}

.category-section h2 {
    font-family: var(--heading-font);
    font-size: 2.2em;
    font-weight: 700;
    color: var(--link-color);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 5px;
    margin-bottom: 30px;
    display: inline-block;
}

/* Règle de base (Fallback/Mobile First) */
.product-list {
    display: grid;
    /* Règle par défaut : essaye d'ajuster des cartes de min 280px */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px; 
}

.product-card {
    background-color: var(--text-color-light);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    padding-bottom: 20px;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.product-card img {
    width: 100%;
    /* Utilisation de l'aspect ratio pour la cohérence des images (carré) */
    aspect-ratio: 1 / 1; 
    object-fit: cover;
    display: block;
    height: auto; 
}

.product-card h3 {
    font-family: var(--heading-font);
    font-size: 1.4em;
    color: var(--secondary-color);
    margin: 15px 10px 5px 10px;
}

.product-description {
    font-size: 0.95em;
    color: #666;
    padding: 0 15px;
    margin-bottom: 15px;
    min-height: 40px; 
}

.product-price {
    font-family: var(--heading-font);
    font-size: 1.6em;
    font-weight: 800;
    color: var(--text-color-dark);
    margin-bottom: 15px;
}

.btn-shop {
    background-color: var(--primary-color);
    color: var(--text-color-dark);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    transition: background-color 0.2s, box-shadow 0.2s;
    border: 2px solid var(--text-color-dark);
}

.btn-shop:hover {
    background-color: #00e590; /* Un vert un peu plus sombre */
    box-shadow: 0 0 10px rgba(24, 250, 175, 0.5);
}


/* ========================================================================= */
/* --- 6. CTA ET FOOTER (Styles génériques conservés) --- */
/* ========================================================================= */

.cta-contact {
    background-color: var(--link-color);
    color: var(--text-color-light);
    text-align: center;
    padding: 40px 20px;
    margin-top: 20px;
}

.cta-contact h2 {
    color: var(--primary-color);
    font-family: var(--heading-font);
    margin-top: 0;
}

.cta-contact p {
    font-size: 1.1em;
    margin-bottom: 20px;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--text-color-light);
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: background-color 0.2s;
    display: inline-block;
    box-shadow: 0 4px 0 #a91f4b;
}

.btn-primary:hover {
    background-color: #a91f4b;
    box-shadow: 0 2px 0 #a91f4b;
    transform: translateY(2px);
}

footer {
    background-color: var(--text-color-dark);
    color: var(--text-color-light);
    padding: 20px 0;
    text-align: center;
    font-size: 0.9em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-color-light);
}

/* ========================================================================= */
/* 7. RESPONSIVE DESIGN - VERSION CORRIGÉE (COMPATIBLE FILTRES JS) */
/* ========================================================================= */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Mobile → 1 ou 2 colonnes selon l'espace */
@media (min-width: 600px) {
    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .product-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .product-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* CLASSE POUR CACHER LES PRODUITS (utilisée par le JS) */
.product-card.hidden {
    display: none !important;
    
}