/* ============================================================
 * Album BD — Reskin sidebar pm_advancedsearch4
 * CUSTOM ALBUM 2026-02-25
 * ============================================================ */

/* ── En-têtes de groupes ──────────────────────────────────── */
.PM_ASCriterionsGroupTitle {
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 700;
    color: #2a2a2a;
    border-left: 3px solid #ffd101;
    border-bottom: none !important;
    padding: 0 0 6px 8px;
    margin-bottom: 12px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.PM_ASCriterionsGroupTitle .PM_ASCriterionsGroupName {
    vertical-align: middle;
}

/* ── Séparation entre groupes ─────────────────────────────── */
.PM_ASBlockOutputVertical .PM_ASCriterionsGroupList .PM_ASCriterionsGroup {
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
    margin-bottom: 12px;
}
.PM_ASBlockOutputVertical .PM_ASCriterionsGroupList .PM_ASCriterionsGroup:first-child {
    border-top: none;
    padding-top: 0;
}

/* ── Arbre catégories ─────────────────────────────────────── */
/* Tous les niveaux — même taille, hiérarchie via indentation */
.PM_ASLevelDepth li > a {
    display: flex !important;
    align-items: center;
    gap: 4px;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #383838 !important;
    line-height: 1.35 !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

/* Nœud sélectionné / actif — après la règle générale pour prendre le dessus */
.PM_ASLevelDepth .PM_ASCriterionLevelChoosen > a.PM_ASCriterionLevelChoose,
.PM_ASLevelDepth .PM_ASCriterionLevelSelected > a.PM_ASCriterionLevelChoose {
    color: #ffd101 !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    text-decoration: none !important;
}
/* Compteur dans un nœud sélectionné — reste gris, sans effet bold */
.PM_ASLevelDepth .PM_ASCriterionLevelChoosen > a.PM_ASCriterionLevelChoose div.PM_ASCriterionNbProduct,
.PM_ASLevelDepth .PM_ASCriterionLevelSelected > a.PM_ASCriterionLevelChoose div.PM_ASCriterionNbProduct {
    color: #767676 !important;
    text-shadow: none !important;
    font-weight: 400 !important;
}
.PM_ASLevelDepth div.PM_ASCriterionNbProduct {
    flex-shrink: 0;
}

/* Masquer la flèche FontAwesome du module — remplacée par l'indentation */
.PM_ASLevelDepth li:not(.level1) > a:before {
    content: none !important;
}

/* Indentation progressive par niveau */
.PM_ASLevelDepth li.level1 > a { padding-left: 0 !important; }
.PM_ASLevelDepth li.level2 > a { padding-left: 14px !important; }
.PM_ASLevelDepth li.level3 > a { padding-left: 28px !important; }
.PM_ASLevelDepth li.level4 > a { padding-left: 42px !important; }
.PM_ASLevelDepth li.level5 > a { padding-left: 56px !important; }

/* Hover */
.PM_ASLevelDepth li a:hover {
    background: #fafafa;
    color: #2a2a2a !important;
    text-decoration: none;
}
.PM_ASLevelDepth .PM_ASCriterionLevelChoosen > a.PM_ASCriterionLevelChoose:hover {
    color: #2a2a2a !important;
    text-decoration: line-through !important;
}

/* Icônes expand/collapse — Material Icons (chargés par PS) */
.PM_ASLevelDepth li span.grower {
    background: transparent;
}
/* Masquer le texte original des <i> (on remplace par chevrons via ::before) */
.PM_ASLevelDepth li span.grower i {
    font-size: 0 !important;
    display: inline-block;
}
/* Masquer l'icône non pertinente selon l'état */
.PM_ASLevelDepth li span.grower.PM_ASCriterionClose i.remove { display: none; }
.PM_ASLevelDepth li span.grower.PM_ASCriterionOpen i.add    { display: none; }

/* Chevron › (catégorie fermée, a des enfants) */
.PM_ASLevelDepth li span.grower.PM_ASCriterionClose i.add::before,
.PM_ASLevelDepth li span.grower:not(.PM_ASCriterionOpen):not(.PM_ASCriterionClose) i.add::before {
    content: "chevron_right";
    font-family: 'Material Icons';
    font-size: 18px;
    color: #ccc;
    display: block;
    line-height: 30px;
    width: 30px;
    text-align: center;
}
/* Chevron ˅ gold (catégorie ouverte) */
.PM_ASLevelDepth li span.grower.PM_ASCriterionOpen i.remove::before {
    content: "expand_more";
    font-family: 'Material Icons';
    font-size: 18px;
    color: #ffd101;
    display: block;
    line-height: 30px;
    width: 30px;
    text-align: center;
}
/* Hover : chevron gold */
.PM_ASLevelDepth li span.grower:hover i::before {
    color: #ffd101 !important;
}

/* Suppression du soulignement natif pour le nœud actif */
.PM_ASLevelDepth .PM_ASCriterionLevelSelected.PM_ASCriterionLevelChoosen span + .PM_ASCriterionLevelChoose,
.PM_ASLevelDepth .PM_ASCriterionLevelSelected.PM_ASCriterionLevelChoosen a.PM_ASCriterionLevelChoose {
    text-decoration: none;
}

/* Nœud racine sélectionné : indicateur de contexte "‹ COMICS" */
.PM_ASLevelDepth li.PM_ASRootNodeContext > a.PM_ASCriterionLevelChoose {
    color: #aaa !important;
    font-size: 0.78em;
    font-weight: 400;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 6px;
    margin-bottom: 2px;
}
.PM_ASLevelDepth li.PM_ASRootNodeContext > a.PM_ASCriterionLevelChoose:hover {
    color: #383838 !important;
    background: transparent;
    text-decoration: line-through !important;
}

/* ── Radio buttons & checkboxes ───────────────────────────── */
input[type="radio"].PM_ASCriterionCheckbox {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    min-width: 14px;
    border: 2px solid #d0d0d0;
    border-radius: 50%;
    margin: 0 4px 0 0;
    cursor: pointer;
    flex-shrink: 0;
    background: #fff;
    vertical-align: middle;
    transition: border-color 0.15s;
}
input[type="radio"].PM_ASCriterionCheckbox:checked {
    border-color: #ffd101;
    background: #ffd101;
    box-shadow: inset 0 0 0 2.5px #fff;
}
input[type="checkbox"].PM_ASCriterionCheckbox {
    accent-color: #ffd101;
}
.PM_ASLabelCheckboxSelected .PM_ASLabelLink {
    color: #2a2a2a;
    font-weight: 700;
    text-decoration: none !important;
}
.PM_ASCriterionGroupCheckbox ul {
    padding-left: 0;
}
.PM_ASCriterionGroupCheckbox li {
    display: flex;
    align-items: center;
    padding: 2px 0;
    line-height: 1.4;
}
.PM_ASCriterionGroupCheckbox .PM_ASLabelLink {
    color: #383838;
    font-size: 0.88em;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}
.PM_ASCriterionGroupCheckbox .PM_ASLabelLink:hover {
    color: #2a2a2a;
}

/* ── Badges colorés Disponibilité ─────────────────────────── */
/* Ciblage via data-criterion-value ajouté dans le template override */
.PM_ASCriterionGroupCheckbox li[data-criterion-value]::before {
    font-size: 0.7em;
    margin-right: 4px;
    flex-shrink: 0;
    line-height: 1;
}
/* Alignement de "Tous" — même caractère que les dots, mais invisible */
.PM_ASCriterionGroupCheckbox li[data-criterion-value="tous"]::before {
    content: "●";
    color: transparent;
    font-size: 0.7em;
    margin-right: 4px;
    flex-shrink: 0;
    line-height: 1;
}
.PM_ASCriterionGroupCheckbox li[data-criterion-value="Disponible"]::before {
    content: "●";
    color: #71d348;
}
.PM_ASCriterionGroupCheckbox li[data-criterion-value="Précommande"]::before {
    content: "●";
    color: #e3b72e;
}
.PM_ASCriterionGroupCheckbox li[data-criterion-value="Indisponible"]::before {
    content: "●";
    color: #f60034;
}

/* ── Compteurs de produits ────────────────────────────────── */
div.PM_ASCriterionNbProduct {
    color: #767676;
    font-size: 0.75em;
    font-weight: 400;
    opacity: 1;
}

/* ── Bouton réinitialiser groupe ──────────────────────────── */
.PM_ASResetGroup {
    float: right;
    background: #f0f0f0;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.7em;
    color: #767676;
    text-decoration: none;
    margin-top: 4px;
}
.PM_ASResetGroup:hover {
    background: #ffd101;
    color: #2a2a2a;
    text-decoration: none;
}
/* Supprimer l'icône FA par défaut, remplacer par × */
.PM_ASResetGroup:before {
    content: "×";
    font-family: inherit;
    padding-right: 3px;
    font-size: 1.1em;
}

/* ── Bouton réinitialiser tout ────────────────────────────── */
.PM_ASResetSearch {
    font-size: 0.8em;
    color: #767676;
}
.PM_ASResetSearch:hover {
    color: #f60034;
}

/* ── Filtres actifs — chips ───────────────────────────────── */
.PM_ASBlockOutputVertical .PM_ASSelections > ul li {
    display: block !important;
    padding: 2px 0;
}
.PM_ASSelectionsSelectedCriterion {
    display: inline-block;
}
.PM_ASSelectionsSelectedCriterion a.PM_ASSelectionsRemoveLink {
    background: #2a2a2a;
    color: #fff;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.75em;
    text-decoration: none;
    display: inline-block;
}
.PM_ASSelectionsSelectedCriterion a.PM_ASSelectionsRemoveLink:hover {
    background: #ffd101;
    color: #2a2a2a;
    text-decoration: none !important;
}
/* Remplacer le × FA par × natif */
a.PM_ASSelectionsRemoveLink:before {
    content: "× ";
    font-family: inherit;
    padding-right: 2px;
}

/* ── Slider prix ──────────────────────────────────────────── */
.PM_ASCritRangeValue {
    font-size: 0.82em;
    color: #383838;
    font-weight: 600;
}

/* ── Titre h1 listing (label catégorie/recherche) — masqué *─── */
/* Redondant avec le breadcrumb sur toutes les pages listing */
#js-product-list-header {
    display: none !important;
}

/* ── Titre du bloc (compteur produits) ────────────────────── */
.PM_ASBlockOutputVertical .PM_ASBlockNbProductValue {
    color: #767676;
    font-size: 60%;
    font-weight: 400;
}

/* ── Bouton "Voir les résultats" (mobile) ─────────────────── */
/* Bouton flottant injecté par facets-breadcrumb.js quand le panneau est ouvert */
#album-filter-close-btn {
    display: none; /* affiché via JS */
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px 32px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}
#album-filter-close-btn:hover {
    background: #ffd600;
    color: #222;
}
#album-filter-close-btn:active {
    background: #e6bc00;
    color: #222;
}

/* ── Dropdown tri (Trier par) ─────────────────────────────── */
/* Bouton titre du dropdown — couleur et border cohérents avec brand */
.products-sort-order .select-title {
    color: #2a2a2a !important;
    font-size: 0.88rem;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #fff;
    padding: 6px 10px;
}
.products-sort-order .select-title:hover {
    border-color: #ffd101;
}
/* Options du dropdown */
.products-sort-order .select-list:hover,
.products-sort-order .select-list:focus {
    background-color: rgba(255, 209, 1, 0.20) !important;
    color: #2a2a2a !important;
}
.products-sort-order .select-list.current {
    background-color: #ffd101;
    color: #2a2a2a;
    font-weight: 700;
}

/* ── Bouton Filtrer mobile ─────────────────────────────────── */
button#search_filter_toggler {
    display: flex !important;
    align-items: center;
    gap: 5px;
    justify-content: flex-end;
    color: #2a2a2a !important;
    font-size: 0.88rem !important;
    font-weight: 600;
}
button#search_filter_toggler i {
    font-size: 14px;
}

/* ── Fix overflow horizontal + padding dynamique (mobile) ─── */
/* .PM_ASCriterionsGroupList a la classe "row" Bootstrap → marges négatives -15px → overflow */
/* pm_advancedsearch4_dynamic.css injecte padding-top: 45px sur #PM_ASBlockOutput_X → espace vide */
@media (max-width: 991px) {
    .PM_ASBlockOutputVertical .PM_ASCriterionsGroupList {
        margin-left: 0;
        margin-right: 0;
        overflow-x: hidden;
    }
    .PM_ASBlockOutput {
        overflow-x: hidden;
        padding-top: 0 !important;
    }
    /* Espace en bas pour que le bouton flottant "Voir les résultats" ne cache pas les dernières options */
    .PM_ASBlockOutput .card-block {
        padding-bottom: 80px;
    }
}

/* ── Mobile ≤ 767px : boutons sort + Filtrer côte à côte, dark ── */
@media (max-width: 767px) {
    /* Supprimer l'espace vide au-dessus des boutons */
    #js-product-list-top {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Sort button — dark, no text wrap */
    .products-sort-order .select-title {
        background: #222 !important;
        color: #fff !important;
        border: none !important;
        border-radius: 4px !important;
        padding: 8px 10px !important;
        width: 100%;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        white-space: nowrap;
        overflow: hidden;
        font-size: 0.82rem !important;
        font-weight: 600;
    }
    .products-sort-order .select-title:hover {
        background: #444 !important;
        border-color: transparent !important;
    }
    .products-sort-order .select-title i {
        color: #fff;
        flex-shrink: 0;
    }

    /* Filtre — dark, no text wrap */
    button#search_filter_toggler {
        background: #222 !important;
        color: #fff !important;
        border-radius: 4px !important;
        width: 100% !important;
        padding: 8px 10px !important;
        justify-content: center !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        font-size: 0.82rem !important;
        white-space: nowrap;
        overflow: hidden;
    }
    button#search_filter_toggler i {
        color: #fff !important;
        font-size: 13px !important;
        flex-shrink: 0;
    }
    button#search_filter_toggler:hover {
        background: #444 !important;
        color: #fff !important;
    }
}

/* ── Pagination moderne ───────────────────────────────────── */
.album-pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.page-list {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
.page-list li {
    display: flex;
}
.page-list a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.88rem;
    color: #383838;
    text-decoration: none;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}
.page-list a:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #2a2a2a;
    text-decoration: none;
}
/* Page courante — spécificité augmentée pour battre .pagination .current a (0,2,1) de custom.css */
.album-pagination-wrap .page-list li.current a,
.album-pagination-wrap .page-list li.current a:hover {
    background: #ffd101 !important;
    border: 1px solid #ffd101 !important;
    color: #2a2a2a !important;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    opacity: 1 !important;
    text-decoration: none !important;
}
/* Flèches Prev/Next — compactes, sans texte */
.page-list a.previous,
.page-list a.next {
    padding: 0 4px;
    border: none;
    background: transparent;
    color: #2a2a2a;
    min-width: 28px;
}
.page-list a.previous:hover,
.page-list a.next:hover {
    background: transparent;
    border: none;
    color: #ffd101;
    text-decoration: none;
}
.page-list a.previous i,
.page-list a.next i {
    font-size: 20px;
    vertical-align: middle;
    display: block;
}
.page-list .spacer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 32px;
    color: #aaa;
    font-size: 0.88rem;
}
.page-list a.disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* Mobile : centrer + pleine largeur */
@media (max-width: 767px) {
    .album-pagination-wrap {
        justify-content: center;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .page-list {
        justify-content: flex-start;
    }
}

/* Champ saisie directe de page */
.album-page-jump-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #767676;
}
.album-page-jump-wrap span {
    white-space: nowrap;
}
input.album-page-jump {
    width: 48px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
    font-size: 0.88rem;
    color: #2a2a2a;
    padding: 0 4px;
    -moz-appearance: textfield;
}
input.album-page-jump::-webkit-outer-spin-button,
input.album-page-jump::-webkit-inner-spin-button {
    -webkit-appearance: none;
}
input.album-page-jump:focus {
    outline: none;
    border-color: #ffd101;
}

/* ── Loader AJAX liste produits ───────────────────────────── */
#js-product-list {
    position: relative;
    transition: opacity 0.2s ease;
}
#js-product-list.album-loading {
    opacity: 0.35;
    pointer-events: none;
}
#album-list-loader {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 9998;
    width: 44px;
    height: 44px;
    border: 4px solid #f0f0f0;
    border-top-color: #ffd101;
    border-radius: 50%;
    animation: album-spin 0.65s linear infinite;
    margin-left: -22px;
    margin-top: -22px;
}
#album-list-loader.visible { display: block; }

@keyframes album-spin {
    to { transform: rotate(360deg); }
}
