/*
Theme Name: Mon Thème Enfant
Template: astra
*/

/* --- Conteneur principal des filtres --- */
.filtres-haut {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px 20px;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
/* --- Mise en page avec sidebar --- */
.catalogue-wrapper {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}
.catalogue-sidebar {
    flex: 0 0 220px;
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    align-self: flex-start;
    position: sticky;
    top: 20px;
}

.catalogue-content {
    flex: 1;
    min-width: 0;
}

/* --- Arborescence des familles --- */
.arborescence-familles h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.famille-parent {
    margin-bottom: 12px;
    padding-left: 8px;
    border-left: 2px solid #007cba;
}

.famille-label {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 0.95rem;
}

.famille-enfants {
    padding-left: 20px;
    margin-top: 2px;
}

.famille-enfant {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 3px;
    cursor: pointer;
    color: #444;
}

.famille-enfant:hover,
.famille-label:hover {
    color: #007cba;
}

.famille-enfant input,
.famille-label input {
    margin-right: 6px;
    cursor: pointer;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .catalogue-wrapper {
        flex-direction: column;
    }
    .catalogue-sidebar {
        flex: 1;
        position: static;
    }
}

/* --- Groupe des filtres (Modèle + Liquide) --- */
.filtres-groupes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 30px;
    flex: 0 1 auto;
}

/* --- Chaque filtre (label + select) --- */
.filtre-groupe {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}

.filtre-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 15px;
    margin-left: auto; /* Pousse les boutons à droite */
}

.filtre-groupe label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
}

.filtre-groupe select {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    background: white;
    font-size: 0.95rem;
    min-width: 180px;
    transition: border-color 0.15s ease;
}

.filtre-groupe select:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,124,186,0.25);
}



.filtre-actions button {
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
}

#btn-rechercher {
    background: #007cba;
    color: white;
}

#btn-rechercher:hover {
    background: #005a87;
}

#btn-reinitialiser {
    background: #e9ecef;
    color: #333;
}

#btn-reinitialiser:hover {
    background: #dde0e3;
}

.filtre-actions label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #555;
}

.filtre-actions input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* --- Cartes des pièces --- */
.carte-piece {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
}

.carte-piece:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.carte-piece h3 {
    font-size: 1rem;
    margin: 0 0 8px 0;
    color: #1a1a1a;
}

.carte-piece p {
    font-size: 0.85rem;
    color: #666;
    margin: 4px 0;
}

/* --- Compteur --- */
.compteur {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 15px;
    font-weight: bold;
}
.carte-piece-link {
    display: block;
    text-decoration: none;
    color: inherit; /* hérite la couleur du texte parent */
}

.carte-piece-link:hover .carte-piece {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

/* --- Options désactivées (liquides non compatibles) --- */
select option:disabled {
    color: #aaa;
    background-color: #f5f5f5;
    font-style: italic;
}
/* --- Lien cliquable sur toute la carte (optionnel) --- */
.carte-piece {
    cursor: pointer; /* Indique que la carte est cliquable */
    transition: transform 0.2s, box-shadow 0.2s;
}

.carte-piece:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

/* Le lien autour du titre */
.carte-piece-link {
    text-decoration: none;
    color: inherit;
    display: block; /* Pour que le lien prenne toute la largeur */
}

.carte-piece-link h3 {
    transition: color 0.2s;
}

.carte-piece-link:hover h3 {
    color: #007cba; /* Couleur au survol, comme Mercedes */
}

/* --- Bouton de vote --- */
.vote-piece {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* --- Boutons de vote --- */
.btn-voter {
    border: none;
    padding: 6px 14px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s;
    background: #007cba;
    color: white;
}

.btn-voter:hover {
    filter: brightness(0.9);
}

.btn-voter:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* État "annuler" (rouge) */
.vote-piece[data-a-vote="1"] .btn-voter {
    background: #dc3545;
    color: white;
}

/* État "voter" (bleu) par défaut */
.vote-piece[data-a-vote="0"] .btn-voter {
    background: #007cba;
    color: white;
}
/* --- Formulaire de contribution --- */
.formulaire-contribution {
    max-width: 700px;
    margin: 30px auto;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 1px solid #ddd;
}

.formulaire-contribution h2 {
    margin-top: 0;
    font-size: 1.5rem;
    color: #333;
}

.formulaire-contribution p {
    margin-bottom: 15px;
}

.formulaire-contribution label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: #333;
}

.formulaire-contribution input[type="text"],
.formulaire-contribution textarea,
.formulaire-contribution select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.formulaire-contribution select[multiple] {
    height: auto;
    min-height: 60px;
}

.formulaire-contribution input[type="file"] {
    padding: 6px 0;
}

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

.formulaire-contribution input[type="submit"] {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.formulaire-contribution input[type="submit"]:hover {
    background: #005a87;
}

.formulaire-contribution .erreur {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
}

.formulaire-contribution .succes {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
}


.compteur-votes {
    font-weight: bold;
    font-size: 1rem;
    color: #007cba;
}

/* --- Lien de retour au catalogue --- */
.retour-catalogue {
    margin-bottom: 20px;
}

.retour-catalogue a {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 30px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.retour-catalogue a:hover {
    background: #e0e0e0;
    color: #007cba;
}

/* --- Le sélecteur de tri poussé à droite --- */
.filtre-tri {
    margin-left: auto; /* Pousse le tri vers la droite */
    min-width: 150px;
}

/* --- Actions (boutons + checkbox) --- */
.filtre-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 15px;
    flex: 0 1 auto;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .filtres-haut {
        flex-direction: column;
        align-items: stretch;
    }
    .filtres-groupes,
    .filtre-actions,
    .filtre-tri {
        flex: 1 1 100%;
        margin-left: 0;
    }
    .filtre-actions {
        justify-content: flex-start;
    }
}