/**
 * WC Hash Filter - Frontend CSS v5.1
 * Compatible Astra off-canvas sidebar
 * Pas de système mobile propre - le thème gère l'affichage mobile
 */

/* === VARIABLES === */
#wchf-wrapper {
    --wchf-bg: #ffffff;
    --wchf-text: #333333;
    --wchf-border: #e5e5e5;
    --wchf-accent: #0073aa;
    --wchf-track: #e5e5e5;
    --wchf-handle: #0073aa;
    --wchf-btn-bg: #c0392b;
    --wchf-btn-text: #ffffff;
    --wchf-padding: 20px;
    --wchf-radius: 8px;
    --wchf-font: 14px;
}

/* === WRAPPER === */
#wchf-wrapper {
    background: var(--wchf-bg);
    color: var(--wchf-text);
    padding: var(--wchf-padding);
    border-radius: var(--wchf-radius);
    font-size: var(--wchf-font);
    line-height: 1.5;
    box-sizing: border-box;
}

#wchf-wrapper *, #wchf-wrapper *::before, #wchf-wrapper *::after {
    box-sizing: border-box;
}

/* === SECTIONS === */
#wchf-wrapper .wchf-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--wchf-border);
}

#wchf-wrapper .wchf-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

#wchf-wrapper .wchf-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
    user-select: none;
}

#wchf-wrapper .wchf-section-title {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#wchf-wrapper .wchf-section-arrow {
    font-size: 10px;
    opacity: 0.5;
    transition: transform 0.2s;
}

#wchf-wrapper .wchf-section.collapsed .wchf-section-arrow {
    transform: rotate(180deg);
}

#wchf-wrapper .wchf-section-body {
    padding-top: 12px;
}

/* === FILTER ITEMS === */
#wchf-wrapper .wchf-filter-item {
    margin-bottom: 12px;
}

#wchf-wrapper .wchf-filter-item:last-child {
    margin-bottom: 0;
}

#wchf-wrapper .wchf-filter-label {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--wchf-text);
    opacity: 0.8;
}

/* === SLIDERS (petits handles) === */
#wchf-wrapper .wchf-slider-wrap {
    padding: 8px 6px 0;
}

#wchf-wrapper .wchf-slider {
    height: 4px;
}

/* noUiSlider overrides */
#wchf-wrapper .noUi-target {
    background: var(--wchf-track);
    border: none;
    box-shadow: none;
    border-radius: 2px;
}

#wchf-wrapper .noUi-connect {
    background: var(--wchf-handle);
}

#wchf-wrapper .noUi-handle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--wchf-handle);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    cursor: pointer;
    top: -5px;
    right: -7px;
}

#wchf-wrapper .noUi-handle::before,
#wchf-wrapper .noUi-handle::after {
    display: none;
}

#wchf-wrapper .noUi-handle:focus {
    outline: none;
}

#wchf-wrapper .wchf-slider-values {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 500;
}

/* === CHECKLISTS === */
#wchf-wrapper .wchf-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 180px;
    overflow-y: auto;
}

#wchf-wrapper .wchf-checklist li {
    margin-bottom: 6px;
}

#wchf-wrapper .wchf-checklist li::before {
    display: none;
}

#wchf-wrapper .wchf-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

#wchf-wrapper .wchf-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

#wchf-wrapper .wchf-checkmark {
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 2px solid var(--wchf-border);
    border-radius: 3px;
    position: relative;
    transition: all 0.15s;
}

#wchf-wrapper .wchf-checkmark::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s;
}

#wchf-wrapper .wchf-check input:checked + .wchf-checkmark {
    background: var(--wchf-accent);
    border-color: var(--wchf-accent);
}

#wchf-wrapper .wchf-check input:checked + .wchf-checkmark::after {
    transform: rotate(45deg) scale(1);
}

#wchf-wrapper .wchf-check-text {
    flex: 1;
    font-size: 13px;
}

#wchf-wrapper .wchf-check-count {
    opacity: 0.5;
    font-size: 12px;
}

#wchf-wrapper .wchf-single-check {
    padding: 8px 0;
}

/* === SELECT === */
#wchf-wrapper .wchf-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--wchf-border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--wchf-text);
    background: #fff;
    cursor: pointer;
}

#wchf-wrapper .wchf-select:focus {
    outline: none;
    border-color: var(--wchf-accent);
}

/* === ACTIONS === */
#wchf-wrapper .wchf-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--wchf-border);
}

#wchf-wrapper .wchf-reset-btn {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    background: var(--wchf-btn-bg);
    color: var(--wchf-btn-text);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.2s;
}

#wchf-wrapper .wchf-reset-btn:hover {
    opacity: 0.9;
}

/* === COUNT === */
#wchf-wrapper .wchf-count-wrap {
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    opacity: 0.7;
}

#wchf-wrapper .wchf-count-num {
    font-weight: 600;
}

/* === LOADING === */
#wchf-wrapper.wchf-loading {
    position: relative;
    pointer-events: none;
}

#wchf-wrapper.wchf-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    z-index: 10;
}

/* CSS spécial dans page : uniquement pour la page ID 2563 */
.page-id-2563 #wchf-wrapper .wchf-section-body {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.page-id-2563 #wchf-wrapper .wchf-section-body .wchf-filter-item {
    flex: 1 1 100%;
    box-sizing: border-box;
}

/* Desktop : 2 colonnes */
@media (min-width: 768px) {
    .page-id-2563 #wchf-wrapper .wchf-section-body .wchf-filter-item {
        flex: 1 1 calc(50% - 20px);
    }
}

.page-id-2563 #wchf-wrapper .wchf-filter-label {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--wchf-accent);
    text-align: center;
}