/**
 * Bibliothèque de Solutions - CSS
 * Layout selon maquette: filtres en haut, 2 colonnes en bas
 */

/* =============================================
   RESET & BASE
   ============================================= */
.sp-bibliotheque-wrapper {
    font-family: 'Quicksand', sans-serif;
    background-color: #EBECE6;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.sp-bibliotheque-wrapper *,
.sp-bibliotheque-wrapper *::before,
.sp-bibliotheque-wrapper *::after {
    box-sizing: border-box;
}

/* =============================================
   BARRE THÉMATIQUES EN HAUT
   ============================================= */
.sp-thematiques-bar {
    background-color: #EBECE6;
    padding: 30px 10% 25px;
    display: flex;
    justify-content: center;
}

/* Toggle mobile — caché sur desktop */
.sp-thematiques-toggle {
    display: none;
}

.sp-thematiques-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
}

/* Boutons thématiques */
.sp-thematique-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    background: transparent;
    border: 2px solid #576557;
    border-radius: 0;
    font-family: 'Quicksand', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #576557;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sp-thematique-btn:hover {
    background: rgba(87, 101, 87, 0.08);
    border-color: #576557;
}

.sp-thematique-btn.active {
    background: #576557;
    color: white;
    border-color: #576557;
}

.sp-thematique-btn.active .sp-thematique-icon svg {
    stroke: white;
}

/* Icône SVG dans le bouton */
.sp-thematique-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.sp-thematique-icon svg {
    width: 100%;
    height: 100%;
    stroke: #576557;
    transition: stroke 0.3s ease;
}

.sp-thematique-label {
    line-height: 1;
}

/* Labels des filtres sidebar */
.sp-filter-label {
    display: block;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

/* Input générique pour la sidebar */
.sp-input {
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 14px 18px;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.sp-input:focus {
    border-color: #576557;
}

.sp-input::placeholder {
    color: #999;
}

/* Champ de recherche avec bouton loupe */
.sp-search-wrapper {
    display: flex;
    gap: 0;
    width: 100%;
}

.sp-search-wrapper .sp-input {
    flex: 1;
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.sp-search-loupe {
    width: 48px;
    height: auto;
    align-self: stretch;
    background: #576557;
    border: none;
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}

.sp-search-loupe:hover {
    background: #465246;
}

.sp-search-loupe svg {
    width: 20px;
    height: 20px;
    stroke: white;
    fill: none;
}

/* =============================================
   DROPDOWN THÉMATIQUE
   ============================================= */
.sp-dropdown {
    position: relative;
    width: 100%;
}

.sp-dropdown-btn {
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 14px 18px;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s;
}

.sp-dropdown-btn:hover {
    border-color: #576557;
}

.sp-dropdown-arrow {
    font-size: 10px;
    color: #666;
    transition: transform 0.3s;
}

.sp-dropdown.is-open .sp-dropdown-arrow {
    transform: rotate(180deg);
}

.sp-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 350px;
    overflow-y: auto;
    display: none;
}

.sp-dropdown.is-open .sp-dropdown-menu {
    display: block;
}

/* Options Monnaie Locale */
.sp-monnaie-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s, color 0.2s;
}
.sp-monnaie-option img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}
#sp-monnaie-label {
    display: flex;
    align-items: center;
    gap: 8px;
}
#sp-monnaie-label img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}

.sp-monnaie-option:last-child {
    border-bottom: none;
}

.sp-monnaie-option:hover {
    background-color: #f8f8f8;
}

.sp-monnaie-option.sp-monnaie-active {
    background-color: #576557;
    color: white;
    font-weight: 600;
}

.sp-monnaie-option.sp-monnaie-active:hover {
    background-color: #465246;
}

.sp-dropdown-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    font-size: 14px;
    color: #333;
}

.sp-dropdown-option:hover {
    background-color: #f8f8f8;
}

.sp-dropdown-option:last-child {
    border-bottom: none;
}

.sp-dropdown-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #576557;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: white;
    border: 2px solid #576557;
    border-radius: 0;
    flex-shrink: 0;
}

.sp-dropdown-option input[type="checkbox"]:checked {
    background: #576557;
    border-color: #576557;
}

.sp-dropdown-option input[type="checkbox"]:checked::after {
    content: '✓';
    color: white;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

/* =============================================
   RECHERCHE PAR MOTS-CLÉS
   ============================================= */
.sp-search-form {
    display: flex;
    gap: 0;
    width: 100%;
}

.sp-search-input {
    flex: 1;
    background: white;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 6px 0 0 6px;
    padding: 14px 18px;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    outline: none;
}

.sp-search-input:focus {
    border-color: #576557;
}

.sp-search-btn {
    background-color: #576557;
    color: white;
    border: none;
    padding: 14px 25px;
    font-family: 'Quicksand', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
    white-space: nowrap;
    transition: background 0.3s;
}

.sp-search-btn:hover {
    background-color: #465246;
}

/* =============================================
   BOUTON CLEAR (X ROUGE) DANS LES CHAMPS
   ============================================= */
.sp-clear-btn {
    position: absolute !important;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    background: #d9534f !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0 !important;
    margin: 0 !important;
    font-family: Arial, sans-serif;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, background 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.sp-clear-btn:hover {
    background: #c9302c !important;
}

.sp-clear-btn.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Ajuster le wrapper recherche pour positionner le X */
.sp-search-wrapper {
    position: relative;
}

.sp-search-wrapper .sp-clear-btn {
    right: 56px; /* à gauche du bouton loupe */
}

.sp-search-wrapper .sp-input {
    padding-right: 45px;
}

.sp-search-wrapper .sp-input.has-value {
    padding-right: 45px;
}

/* Wrapper secteur pour positionner le X */
.sp-secteur-input-wrapper {
    position: relative;
    width: 100%;
}

.sp-secteur-input-wrapper .sp-clear-btn {
    right: 12px;
}

.sp-secteur-input-wrapper .sp-input {
    padding-right: 45px;
}

/* =============================================
   RECHERCHE PAR SECTEUR
   ============================================= */
.sp-secteur-input {
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 14px 18px;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    outline: none;
}

.sp-secteur-input:focus {
    border-color: #576557;
}

/* Liste autocomplete avec transitions fluides */
.sp-autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 5px;
    display: none;
    /* Transition pour apparition/disparition fluide */
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* État visible avec animation */
.sp-autocomplete-list.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.sp-autocomplete-list a,
.sp-autocomplete-list .div_patch_tri {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    cursor: pointer;
}

.sp-autocomplete-list a:hover,
.sp-autocomplete-list .div_patch_tri:hover {
    background-color: #f8f8f8;
}

/* Label cliquable pour secteur */
.sp-secteur-label {
    cursor: pointer;
}

.sp-secteur-label .ecologie2 {
    flex: 1;
}

/* Checkboxes dans autocomplete list (recherche secteur) */
.sp-autocomplete-list .contour_bouton input[type="checkbox"],
.sp-autocomplete-list input[type="checkbox"] {
    width: 24px !important;
    height: 24px !important;
    appearance: none;
    -webkit-appearance: none;
    background: white;
    border: 2px solid #999 !important;
    border-radius: 8px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sp-autocomplete-list .contour_bouton input[type="checkbox"]:checked,
.sp-autocomplete-list input[type="checkbox"]:checked {
    background: #6B6B6B;
    border: 2px solid #999 !important;
    box-shadow: inset 0 0 0 3px white;
}

.sp-autocomplete-list .contour_bouton input[type="checkbox"]:checked::after,
.sp-autocomplete-list input[type="checkbox"]:checked::after {
    content: '';
}

/* =============================================
   BOUTON VIDER FILTRE (POUBELLE)
   ============================================= */
.sp-filtre-trash {
    width: 52px;
    height: 52px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.sp-filtre-trash:hover {
    border-color: #576557;
    background: #f8f8f8;
}

.sp-filtre-trash img {
    width: 22px;
    height: 22px;
    opacity: 0.6;
}

.sp-filtre-trash:hover img {
    opacity: 1;
}

/* =============================================
   SECTION PRINCIPALE - 2 COLONNES
   ============================================= */
.sp-main-section {
    max-width: none;
    margin: 0;
    padding: 30px 10%;
    display: flex;
    gap: 40px;
    align-items: flex-start;
    justify-content: flex-start;
}

/* =============================================
   COLONNE GAUCHE - SIDEBAR FILTRES
   ============================================= */
.sp-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

.sp-filter-group {
    margin-bottom: 30px;
    position: relative;
}

.sp-filter-group.sp-filter-search,
.sp-filter-group.sp-filter-secteur {
    margin-bottom: 25px;
}

.sp-filter-title {
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #576557;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 10px;
    border-bottom: 2px dashed #ccc;
}

/* =============================================
   COLONNE DROITE - CONTENU PRINCIPAL
   ============================================= */
.sp-main-content {
    flex: 1;
    min-width: 0;
}

/* Header avec compteur et tri */
.sp-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 5px;
}

.sp-results-count {
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    color: #666;
}

.sp-sort-dropdown {
    position: relative;
}

.sp-select {
    appearance: none;
    -webkit-appearance: none;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23576557' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 15px center;
    border: 1px solid #576557;
    border-radius: 6px;
    padding: 12px 40px 12px 18px;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #576557;
    cursor: pointer;
    min-width: 180px;
    transition: all 0.3s;
}

.sp-select:hover {
    background-color: #f8f8f8;
}

.sp-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(87, 101, 87, 0.2);
}

.sp-filter-options {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Scrollbar discrète pour les options */
.sp-filter-options::-webkit-scrollbar {
    width: 4px;
}

.sp-filter-options::-webkit-scrollbar-track {
    background: transparent;
}

.sp-filter-options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.sp-filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    cursor: pointer;
    border-bottom: 1px dashed #ddd;
    font-size: 14px;
    color: #333;
}

.sp-filter-option input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    background: white;
    border: 2px solid #999;
    border-radius: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.sp-filter-option input[type="checkbox"]:hover {
    border-color: #777;
}

.sp-filter-option input[type="checkbox"]:checked {
    background: #6B6B6B;
    border: 2px solid #999;
    border-radius: 8px;
    box-shadow: inset 0 0 0 3px white;
}

.sp-filter-option input[type="checkbox"]:checked::after {
    content: '';
}

/* Sous-familles chargées via AJAX - utilise .sp-filter-option */
#sp-show {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* =============================================
   FILTRES CARACTÉRISTIQUES - BADGES COLORÉS
   ============================================= */
.sp-caracteristiques-options {
    gap: 10px !important;
}

.sp-carac-option {
    border-bottom: none !important;
    padding: 5px 0 !important;
}

.sp-carac-option input[type="checkbox"] {
    width: 24px;
    height: 24px;
    border: 2px solid #999;
    border-radius: 8px;
    background: white;
}

.sp-carac-option input[type="checkbox"]:checked {
    background: #6B6B6B;
    border: 2px solid #999;
    box-shadow: inset 0 0 0 3px white;
}

.sp-carac-badge {
    padding: 8px 18px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    font-family: 'Quicksand', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Badge ECOLOGIQUE - vert */
.sp-carac-ecologique {
    background-color: #829B82;
    color: white;
}

/* Badge SOLIDAIRE - rose */
.sp-carac-solidaire {
    background-color: #B5879E;
    color: white;
}

/* Badge SECONDE VIE - beige */
.sp-carac-secondevie {
    background-color: #B59A87;
    color: white;
}

/* Badge ZERO DECHET - gris */
.sp-carac-zerodechet {
    background-color: #8F9BA3;
    color: white;
}

/* =============================================
   COLONNE DROITE - GRILLE DES FICHES
   ============================================= */
.sp-content {
    flex: 1;
    min-width: 0;
}

/* =============================================
   BANNIÈRE FILTRE SECTEUR
   ============================================= */
.sp-sector-banner {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 25px;
    margin-bottom: 20px;
}

.sp-sector-banner-text {
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    color: #333;
}

.sp-sector-banner-text strong {
    color: #576557;
}

.sp-btn-all-sectors {
    background: white;
    border: 1px solid #576557;
    color: #576557;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Quicksand', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.sp-btn-all-sectors:hover {
    background: #576557;
    color: white;
}

/* Compteur de résultats */
.sp-results-count {
    grid-column: 1 / -1;
    text-align: center;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    color: #666;
    padding: 5px 0 10px;
    margin: 0;
}

.sp-fec-grid,
#sp-show2 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 30px;
    min-height: 400px;
}

/* État de chargement initial */
#sp-show2:empty::before {
    content: 'Chargement...';
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    font-family: 'Quicksand', sans-serif;
    color: #666;
}

/* =============================================
   NOUVELLE CARTE FEC (sp-card)
   ============================================= */
.sp-card {
    background: white;
    border-radius: 15px !important;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.sp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* Image de la carte */
.sp-card-image {
    position: relative;
    width: 100%;
    height: 280px;
    border-radius: 15px 15px 0 0;
    overflow: hidden;
}

.sp-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 15px 15px 0 0;
}

/* Badge TYPE - Simple avec margin négatif */
.sp-card-type {
    display: flex;
    justify-content: center;
    margin-top: -45px;
    position: relative;
    z-index: 5;
}

.sp-card-type span {
    background: white;
    color: #333;
    padding: 10px 35px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 25px;
    border: 1px solid #eee;
    font-family: 'Quicksand', sans-serif;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Boutons d'action sur l'image */
.sp-card-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 20;
}

.sp-action-btn {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.3s;
    border: none;
    text-decoration: none;
}

.sp-action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.sp-action-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Bouton + avec fond vert */
.sp-action-add-green {
    background: #576557 !important;
}

.sp-action-add-green:hover {
    background: #465246 !important;
}

.sp-action-add-green img {
    filter: brightness(0) invert(1);
}

/* Contenu de la carte */
.sp-card-content {
    padding: 25px 20px 20px;
    flex: 1;
    background: white;
    border-radius: 0 0 15px 15px;
}

/* Breadcrumb */
.sp-card-breadcrumb {
    font-family: 'Quicksand', sans-serif;
    font-size: 11px;
    color: #888;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Titre */
.sp-card-title {
    margin: 0 0 10px 0;
}

.sp-card-title a {
    font-family: 'Quicksand', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    text-decoration: none !important;
    line-height: 1.4;
    display: block;
    text-transform: uppercase;
}

.sp-card-title a:hover {
    color: #576557;
}

/* Secteur */
.sp-card-sector {
    font-family: 'Quicksand', sans-serif;
    font-size: 13px;
    color: #666;
    margin: 0 0 15px 0;
}

.sp-card-sector span {
    color: #333;
}

/* Tags / Badges */
.sp-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* =============================================
   BADGES CARACTÉRISTIQUES (sur les cartes)
   ============================================= */
.sp-card-tags .position_text,
.position_text {
    padding: 10px 22px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 25px;
    font-family: 'Quicksand', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Badge ECOLOGIQUE - vert */
.ecologie.position_text {
    background-color: #829B82;
    color: white;
}

/* Badge SECONDE VIE - beige */
.seconde_vie.position_text {
    background-color: #B59A87;
    color: white;
}

/* Badge SOLIDAIRE - rose */
.solidaire.position_text {
    background-color: #B5879E;
    color: white;
}

/* Badge ZERO DECHET - gris */
.zero_dechet.position_text {
    background-color: #8F9BA3;
    color: white;
}

/* Ancien conteneur de tags */
.pacth {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Badges dans la sidebar */
.sp-badge {
    padding: 8px 18px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.sp-badge-ecologique {
    background-color: #829B82;
    color: white;
}

.sp-badge-secondevie {
    background-color: #B59A87;
    color: white;
}

.sp-badge-solidaire {
    background-color: #B5879E;
    color: white;
}

.sp-badge-zerodechet {
    background-color: #8F9BA3;
    color: white;
}

/* =============================================
   PAGINATION - Design Moderne et Stable
   ============================================= */

/* Container pagination */
.sp-pagination,
#pagination {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 15px 0;
    flex-wrap: wrap;
}

/* Pointillés de pagination */
.sp-pagination-dots {
    font-family: 'Quicksand', sans-serif;
    font-size: 16px;
    color: #666;
    padding: 0 5px;
    user-select: none;
}

/* Liens de pagination - base */
.sp-pagination-link,
.liens_pagination_filtre {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    background: #fff;
    color: #444;
    text-decoration: none;
    border-radius: 50%;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    line-height: 1;
    text-align: center;
    box-sizing: border-box;
}

/* Hover - changement de couleur sans déplacement */
.sp-pagination-link:hover,
.liens_pagination_filtre:hover {
    background: #576557;
    color: #fff;
    border-color: #576557;
    box-shadow: 0 4px 12px rgba(87, 101, 87, 0.25);
}

/* Page active */
.sp-pagination-active,
.liens_pagination_filtre[style*="lightgray"] {
    background: #576557 !important;
    color: #fff !important;
    border-color: #576557 !important;
    box-shadow: 0 3px 10px rgba(87, 101, 87, 0.3);
    cursor: default;
}

/* Flèches précédent/suivant */
.sp-pagination-prev,
.sp-pagination-next {
    font-size: 20px;
    font-weight: 400;
}

/* Responsive mobile */
@media screen and (max-width: 768px) {
    .sp-pagination,
    #pagination {
        gap: 8px;
        padding: 35px 15px 25px;
    }

    .sp-pagination-link,
    .liens_pagination_filtre {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .sp-pagination-prev,
    .sp-pagination-next {
        font-size: 18px;
    }
}

/* =============================================
   MESSAGE AUCUN RÉSULTAT
   ============================================= */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    font-family: 'Quicksand', sans-serif;
    font-size: 16px;
    color: #666;
}

/* =============================================
   POPUP INTÉGRÉ DANS CHAQUE CARTE
   Animation moderne avec effet slide-up + fade
   ============================================= */

/* Carte doit être positionnée relative pour le popup */
.sp-card {
    position: relative;
    overflow: visible;
}

/* Popup overlay - couvre toute la carte */
.sp-card-popup {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    z-index: 50;

    /* Animation - caché par défaut */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Popup ouvert */
.sp-card-popup.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header du popup */
.sp-card-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.sp-card-popup-title {
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #576557;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sp-card-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.sp-card-popup-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Body avec scroll */
.sp-card-popup-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 15px;
    padding-right: 8px;
    margin-right: -8px;
}

/* Scrollbar très discrète */
.sp-card-popup-body::-webkit-scrollbar {
    width: 3px;
}

.sp-card-popup-body::-webkit-scrollbar-track {
    background: transparent;
}

.sp-card-popup-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.sp-card-popup-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Option de liste */
.sp-card-popup-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 2px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.sp-card-popup-option:hover {
    background: rgba(87, 101, 87, 0.08);
}

.sp-card-popup-option span {
    font-family: 'Quicksand', sans-serif;
    font-size: 13px;
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Checkbox moderne */
.sp-popup-checkbox {
    width: 20px;
    height: 20px;
    appearance: none;
    -webkit-appearance: none;
    background: white;
    border: 2px solid #576557;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sp-popup-checkbox:hover {
    background: rgba(87, 101, 87, 0.05);
    border-color: #576557;
}

.sp-popup-checkbox:checked {
    background: #576557;
    border-color: #576557;
}

.sp-popup-checkbox:checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Message si non connecté */
.sp-card-popup-login {
    font-family: 'Quicksand', sans-serif;
    color: #888;
    font-size: 13px;
    text-align: center;
    padding: 30px 10px;
    margin: 0;
}

/* Bouton Enregistrer */
.sp-card-popup-save {
    width: 100%;
    background: linear-gradient(135deg, #829B82 0%, #6b866b 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(130, 155, 130, 0.3);
}

.sp-card-popup-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(130, 155, 130, 0.4);
}

.sp-card-popup-save:active {
    transform: translateY(0);
}

/* Animation d'entrée pour les options */
.sp-card-popup.is-open .sp-card-popup-option {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

.sp-card-popup.is-open .sp-card-popup-option:nth-child(1) { animation-delay: 0.05s; }
.sp-card-popup.is-open .sp-card-popup-option:nth-child(2) { animation-delay: 0.1s; }
.sp-card-popup.is-open .sp-card-popup-option:nth-child(3) { animation-delay: 0.15s; }
.sp-card-popup.is-open .sp-card-popup-option:nth-child(4) { animation-delay: 0.2s; }
.sp-card-popup.is-open .sp-card-popup-option:nth-child(5) { animation-delay: 0.25s; }
.sp-card-popup.is-open .sp-card-popup-option:nth-child(6) { animation-delay: 0.3s; }
.sp-card-popup.is-open .sp-card-popup-option:nth-child(7) { animation-delay: 0.35s; }
.sp-card-popup.is-open .sp-card-popup-option:nth-child(8) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .sp-card-popup {
        padding: 15px;
    }

    .sp-card-popup-title {
        font-size: 13px;
    }

    .sp-card-popup-option span {
        font-size: 12px;
    }

    .sp-card-popup-save {
        padding: 10px 15px;
        font-size: 12px;
    }
}

/* =============================================
   POPUP OVERLAY (visualisation fiche)
   ============================================= */
#popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: white;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    z-index: 1000000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#fec-object {
    width: 90%;
    max-width: 1100px;
    height: 90%;
    background: white;
    border-radius: 12px;
}

/* =============================================
   RESPONSIVE - TABLET (< 1200px)
   ============================================= */
@media screen and (max-width: 1200px) {
    .sp-main-section {
        flex-direction: column;
    }

    .sp-sidebar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 30px;
    }

    .sp-filter-group {
        flex: 1;
        min-width: 200px;
        margin-bottom: 0;
    }

    .sp-fec-grid,
    #sp-show2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* =============================================
   RESPONSIVE - TABLET SMALL (< 992px)
   ============================================= */
@media screen and (max-width: 992px) {
    .sp-filtres-container {
        flex-wrap: wrap;
    }

    .sp-filtre-item {
        flex: 1 1 calc(50% - 15px);
        min-width: 250px;
        max-width: none;
    }

    .sp-filtre-trash {
        margin-left: auto;
    }
}

/* =============================================
   RESPONSIVE - MOBILE (< 768px)
   ============================================= */
@media screen and (max-width: 768px) {
    /* Barre thématiques mobile — bouton extensible */
    .sp-thematiques-bar {
        padding: 15px;
        flex-direction: column;
    }

    .sp-thematiques-toggle {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 18px;
        background: #576557;
        color: #fff;
        border: none;
        border-radius: 6px;
        font-family: 'Quicksand', sans-serif;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        text-transform: uppercase;
        transition: border-radius 0.3s ease;
    }
    .sp-thematiques-bar.is-open .sp-thematiques-toggle {
        border-radius: 6px 6px 0 0;
    }
    .sp-thematiques-toggle-arrow {
        font-size: 16px;
        transition: transform 0.3s ease;
    }
    .sp-thematiques-bar.is-open .sp-thematiques-toggle-arrow {
        transform: rotate(180deg);
    }

    .sp-thematiques-container {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0;
        padding: 0;
        overflow: hidden;
        max-height: 0;
        background: #576557;
        border-radius: 0 0 6px 6px;
        transition: max-height 0.4s ease, padding 0.3s ease;
    }
    .sp-thematiques-bar.is-open .sp-thematiques-container {
        display: flex !important;
        max-height: 600px;
        padding: 6px 0 10px;
    }

    .sp-thematique-btn {
        padding: 12px 20px;
        font-size: 13px;
        flex-shrink: 0;
        justify-content: flex-start !important;
        text-align: left !important;
        border: none !important;
        border-radius: 0 !important;
        color: #fff;
        background: transparent;
        border-bottom: 1px solid rgba(255,255,255,0.12) !important;
        outline: none !important;
        box-shadow: none !important;
    }
    .sp-thematique-btn:focus,
    .sp-thematique-btn:focus-visible {
        outline: none !important;
        box-shadow: none !important;
        border: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.12) !important;
    }
    .sp-thematiques-toggle:focus,
    .sp-thematiques-toggle:focus-visible {
        outline: none !important;
        box-shadow: none !important;
    }
    .sp-thematique-btn:hover {
        background: rgba(255,255,255,0.1) !important;
        border-color: transparent !important;
    }
    .sp-thematique-btn.active {
        background: rgba(255,255,255,0.18) !important;
        color: #fff !important;
        border-color: rgba(255,255,255,0.12) !important;
    }
    .sp-thematique-btn .sp-thematique-icon svg {
        stroke: #fff;
    }

    .sp-thematique-icon {
        width: 18px;
        height: 18px;
    }

    /* Section principale mobile */
    .sp-main-section {
        flex-direction: column;
        padding: 20px 4%;
        gap: 25px;
    }

    .sp-sidebar {
        width: 100%;
        position: static;
    }

    .sp-filter-group.sp-filter-categories {
        display: none; /* Cacher les catégories sur mobile par défaut */
    }

    .sp-filter-group {
        width: 100%;
    }

    /* Header contenu mobile */
    .sp-content-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .sp-select {
        width: 100%;
    }

    .sp-fec-grid,
    #sp-show2 {
        grid-template-columns: 1fr !important;
        gap: 25px;
    }

    /* Cartes mobile */
    .sp-card-image {
        height: 220px;
    }

    .sp-card-actions {
        right: 10px;
        top: 10px;
        gap: 8px;
    }

    .sp-action-btn {
        width: 38px;
        height: 38px;
    }

    .sp-action-btn img {
        width: 16px;
        height: 16px;
    }

    .sp-card-content {
        padding: 22px 15px 15px;
    }

    .sp-card-title a {
        font-size: 14px;
    }

    .sp-card-type {
        margin-top: -38px;
    }

    .sp-card-type span {
        padding: 8px 20px;
        font-size: 10px;
    }

    .position_text {
        padding: 8px 16px;
        font-size: 10px;
    }

    /* Skeleton mobile */
    .skeleton-image {
        height: 220px;
    }

    /* Pagination mobile */
    .liens_pagination_filtre {
        width: 35px;
        height: 35px;
        font-size: 12px;
        margin: 0 3px;
    }
}

/* =============================================
   RESPONSIVE - MOBILE SMALL (< 480px)
   ============================================= */
@media screen and (max-width: 480px) {
    .sp-search-form {
        flex-direction: column;
    }

    .sp-search-input {
        border-radius: 6px;
        border-right: 1px solid #ddd;
    }

    .sp-search-btn {
        border-radius: 6px;
        margin-top: 10px;
    }

    .pacth {
        gap: 8px;
    }

    .position_text {
        padding: 5px 12px;
        font-size: 9px;
    }
}

/* =============================================
   UTILITAIRES
   ============================================= */
.ecriture {
    font-family: 'Quicksand', sans-serif !important;
}

.titre_spe {
    font-family: 'LEMONMILKB', sans-serif !important;
    color: #576557;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    font-family: 'Quicksand', sans-serif;
    color: #666;
    grid-column: 1 / -1;
}

/* =============================================
   SKELETON LOADING
   ============================================= */
.sp-card-skeleton {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.skeleton-image {
    width: 100%;
    height: 280px;
    flex-shrink: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-badge {
    width: 100px;
    height: 36px;
    background: #e8e8e8;
    border-radius: 25px;
    margin: -18px auto 0;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}

.skeleton-content {
    padding: 25px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-line.short {
    width: 40%;
}

.skeleton-line.medium {
    width: 60%;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }

}

/* Responsive skeleton */
@media screen and (max-width: 768px) {
    .sp-card-skeleton {
        min-height: 420px;
    }

    .skeleton-image {
        height: 220px;
    }
}

/* === LIKE HEART BUTTON === */
/* TODO: retirer display:none pour activer le bouton like */
.sa-like-btn {
    display: none;
    padding: 0;
}

.sa-heart-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #999;
    stroke-width: 2;
    transition: fill 0.3s, stroke 0.3s, transform 0.3s;
}

.sa-like-btn:hover .sa-heart-icon {
    stroke: #e74c3c;
    transform: scale(1.15);
}

.sa-like-btn.sa-liked .sa-heart-icon {
    fill: #e74c3c;
    stroke: #e74c3c;
}

.sa-like-btn.sa-liked:hover .sa-heart-icon {
    transform: scale(1.15);
}

@keyframes sa-heart-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.sa-like-btn.sa-heart-anim .sa-heart-icon {
    animation: sa-heart-pop 0.4s ease;
}
