/* =================================================================== */
/* ==  MODIFICATIONS POUR LE LISTING PRODUIT (STYLE INVERSÉ)        == */
/* =================================================================== */

body { background-color: #ffffff; }
.contentContainer { background-color: transparent; }

/* Grille produits */
#product-listing>ul.inline-span.four-across {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 0;
}

#product-listing>ul>li.listingContainer {
    width: auto !important;
    margin: 0;
    list-style: none;
    background-color: #f7f7f7;
    padding: 15px;
}

#product-listing>ul>li.listingContainer img {
    mix-blend-mode: multiply;
    filter: brightness(1) contrast(1);
}

/* Responsive grille */
@media (max-width: 992px) {
    #product-listing>ul.inline-span.four-across {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    #product-listing>ul.inline-span.four-across {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Filter header */
.filter-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}
.filter-header .reset-filter { font-size: 11px; color: #999; }

/* Filter toggle bar - equal width, centered */
#filter-toggle-container {
    margin-bottom: 20px;
}
.filter-toggle-inner {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}
.filter-toggle-col {
    flex: 1 1 0;
    min-width: 0;
}
.filter-toggle-col .btn-block,
.filter-toggle-col .form-control {
    width: 100%;
}

@media (max-width: 480px) {
    .filter-toggle-inner {
        gap: 8px;
    }
    /* Le bouton noir arrondi garde sa ligne unique dans sa demi-colonne
       (!important : ses styles sont inline dans product_listing.php) */
    #main-filter-toggle {
        padding-left: 12px !important;
        padding-right: 12px !important;
        font-size: 12px !important;
        letter-spacing: 0.04em !important;
    }
}

/* Remonter le filtre (réduire l'espace avec le titre) */
#filter-container {
    margin-top: 0;
}

/* Layout lignes filtres */
.filter-row {
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}
.filter-row:last-child { border-bottom: none; }

.filter-row-label {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 13px;
    color: #333;
    padding-top: 4px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.filter-row-values {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-row .reset-filter {
    font-size: 11px;
    color: #999;
    margin-left: 0;
    margin-top: 5px;
    text-decoration: underline;
}
.filter-row .reset-filter:hover { color: #666; }

@media (max-width: 767px) {
    .filter-row { flex-direction: column; gap: 4px; }
    .filter-row-label { width: auto; min-width: auto; max-width: none; margin-bottom: 4px; padding-top: 0; flex-direction: row; align-items: baseline; gap: 10px; }
    .filter-row .reset-filter { margin-top: 0; }
}

/* Filter labels */
.filter-labels-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 2px 0;
}

.filter-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border: 1px solid #c9c9c9;
    border-radius: 20px;
    background-color: #fff;
    color: #1a1a1a;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    user-select: none;
    line-height: 1.2;
}

.filter-label:hover { border-color: #111; background-color: #f5f5f5; }
.filter-label.active { background-color: #111; color: #fff; border-color: #111; }
.filter-label.active:hover { background-color: #333; }
.filter-label.disabled {
    /* Trois signaux cumules plutot qu'un opacity qui delave tout ensemble :
       un fond gris, un texte nettement grise mais encore lisible (rapport de
       contraste 3,0:1 contre 2,0:1 auparavant), et le texte barre — la
       convention des tailles epuisees. La pastille disponible, elle, reste a
       17:1 sur fond blanc : l'ecart entre les deux etats saute aux yeux. */
    background-color: #f2f2f2;
    border-color: #e8e8e8;
    color: #8c8c8c;
    text-decoration: line-through;
    opacity: 1;
    cursor: not-allowed;
    pointer-events: none;
}
.filter-label.disabled:hover { border-color: #e8e8e8; background-color: #f2f2f2; }
.filter-label .count { font-size: 10px; opacity: 0.7; }
.filter-label input[type="checkbox"] { display: none; }

/* Active filters chips */
.active-filters-container {
    padding: 8px 0;
    margin-bottom: 10px;
    background: #fff;
}
.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 15px;
    background-color: #f9f9f9;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 5px;
}
.active-filter-chip .remove-icon { font-weight: bold; font-size: 14px; }
.reset-all-filters { background-color: #333; color: #fff; border-color: #333; }

/* Pagination */
.pagination-small { margin-top: 20px; }
.pager-wrap { display: flex; align-items: center; justify-content: center; gap: 4px; }
.pager-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    font-size: 12px;
    color: #333;
    line-height: 1;
    vertical-align: middle;
}
.pager-btn.pager-disabled { opacity: 0.4; cursor: default; pointer-events: none; }
.pager-btn:hover { background-color: #f5f5f5; }
.pager-arrow { font-size: 14px; line-height: 1; display: inline-block; vertical-align: middle; }
.pager-text { line-height: 1; display: inline-block; vertical-align: middle; }
.pager-pages { display: flex; align-items: center; gap: 2px; }
.pager-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    font-size: 12px;
    color: #333;
    background: #fff;
    line-height: 1;
    box-sizing: border-box;
}
.pager-num:hover { background-color: #f5f5f5; }
.pager-active {
    background-color: #333;
    color: #fff;
    border-color: #333;
}
.pager-dots {
    display: inline-block;
    padding: 0 4px;
    color: #999;
    font-size: 12px;
    line-height: 30px;
}

/* ========================================= */
/* ==  FILTER MODAL OVERLAY               == */
/* ========================================= */

/* Prevent body scroll when modal open */
body.nf-modal-open {
    overflow: hidden;
}

/* Modal container - hidden by default */
.nf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh; /* viewport dynamique : la barre d'URL mobile ne cache plus le bas de la modal */
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.nf-modal.nf-modal--active {
    opacity: 1;
    pointer-events: all;
}

/* Semi-transparent backdrop */
.nf-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
}

/* Content panel */
.nf-modal__content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    width: 95%;
    max-width: 800px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border: 1px solid #000;
    box-sizing: border-box;
}

/* Header */
.nf-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #000;
    flex-shrink: 0;
}
.nf-modal__title {
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.nf-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    color: #333;
}
.nf-modal__close:hover {
    color: #000;
}

/* Scrollable body */
.nf-modal__body {
    overflow-y: auto;
    padding: 15px 20px;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Footer with buttons */
.nf-modal__footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #000;
    flex-shrink: 0;
}
.nf-modal__footer .btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 0;
    white-space: nowrap;
}

/* Laptop breakpoint */
@media (min-width: 768px) and (max-width: 1199px) {
    .nf-modal__content {
        width: 90%;
        max-width: 700px;
    }
}

/* Mobile: full screen modal */
@media (max-width: 767px) {
    .nf-modal__content {
        width: 100%;
        max-width: none;
        top: 0;
        bottom: 0;
        left: 0;
        height: 100%;
        height: 100dvh; /* le footer Tout effacer / Appliquer reste dans la zone visible */
        transform: none;
        border-radius: 0;
    }
    .nf-modal__footer {
        flex-direction: column;
        gap: 10px;
        padding: 16px 20px;
    }
    .nf-modal__footer .btn {
        width: 100%;
        padding: 14px 24px;
        font-size: 15px;
        text-align: center;
    }
}

/* Desktop breakpoint */
@media (min-width: 1200px) {
    .nf-modal__content {
        max-width: 800px;
    }
}
