/*
 * Hydroplante Filters 2.0
 * Sidebar, picker, chips, range sliders, mobile drawer.
 */

:root {
    --hpf-blue:        #2787C9;
    --hpf-blue-dark:   #1a6ba8;
    --hpf-blue-light:  #e8f3fb;
    --hpf-accent:      #0E9EDE;
    --hpf-text:        #1F2626;
    --hpf-text-muted:  #767676;
    --hpf-border:      #e0e6e0;
    --hpf-bg:          #F4F7F4;
    --hpf-white:       #FFFFFF;
    --hpf-radius:      6px;
    --hpf-transition:  0.2s ease;
    --hpf-shadow:      0 1px 4px rgba(0,0,0,.08);
    --hpf-font:        "Raleway", sans-serif;
}

/* ---------------------------------------------------------------
   Sidebar
--------------------------------------------------------------- */
.hpf-sidebar {
    width: 100%;
    font-family: var(--hpf-font);
    font-size: 14px;
    color: var(--hpf-text);
}

.hpf-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 4px;
    border-bottom: 2px solid var(--hpf-border);
}

.hpf-sidebar__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font: 700 15px/1.4 var(--hpf-font);
    color: var(--hpf-text);
}

.hpf-sidebar__title svg {
    color: var(--hpf-blue);
    flex-shrink: 0;
}

.hpf-clear-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--hpf-blue);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 5px 13px;
    font: 700 12px/1.4 var(--hpf-font);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--hpf-transition);
}

.hpf-clear-all:hover {
    background: var(--hpf-blue-dark);
}

.hpf-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #fff;
    color: var(--hpf-blue);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.hpf-hidden {
    display: none !important;
}

/* ---------------------------------------------------------------
   Active filter chips
--------------------------------------------------------------- */
.hpf-active-filters {
    margin: 12px 0 16px;
}

.hpf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hpf-chips .hpf-chip,
button.hpf-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--hpf-blue-light);
    color: var(--hpf-text);
    border: 1px solid transparent;
    border-radius: 20px;
    font: 500 12px/1.3 var(--hpf-font);
    cursor: pointer;
    transition: background var(--hpf-transition), border-color var(--hpf-transition);
}

.hpf-chips .hpf-chip:hover,
.hpf-chips .hpf-chip:focus {
    background: var(--hpf-white);
    border-color: var(--hpf-blue);
    outline: none;
}

.hpf-chip__remove {
    color: var(--hpf-blue);
    font-size: 11px;
    line-height: 1;
    transition: color var(--hpf-transition);
}

.hpf-chips .hpf-chip:hover .hpf-chip__remove {
    color: var(--hpf-blue-dark);
}

/* ---------------------------------------------------------------
   Range sliders (numeric & price)
--------------------------------------------------------------- */
.hpf-range-group {
    padding: 12px 0;
    border-bottom: 1px solid var(--hpf-border);
}

.hpf-range-label {
    display: block;
    font: 700 14px/1.3 var(--hpf-font);
    color: var(--hpf-text);
    margin-bottom: 10px;
}

.hpf-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.hpf-range-input {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--hpf-border);
    border-radius: var(--hpf-radius);
    font: 500 13px/1.2 var(--hpf-font);
    color: var(--hpf-text);
    text-align: center;
    background: var(--hpf-white);
    appearance: textfield;
    -moz-appearance: textfield;
}

.hpf-range-input::-webkit-outer-spin-button,
.hpf-range-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.hpf-range-input:focus {
    border-color: var(--hpf-blue);
    outline: none;
}

.hpf-range-sep,
.hpf-range-unit {
    font-size: 13px;
    color: var(--hpf-text-muted);
    flex-shrink: 0;
}

.hpf-range-slider {
    position: relative;
    height: 24px;
    margin: 4px 0 8px;
}

.hpf-range-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--hpf-border);
    border-radius: 2px;
    transform: translateY(-50%);
    pointer-events: none;
}

.hpf-range-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    background: var(--hpf-blue);
    border-radius: 2px;
}

.hpf-range-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 24px;
    margin: 0;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.hpf-range-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--hpf-blue);
    border: 2px solid var(--hpf-white);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    cursor: pointer;
    pointer-events: auto;
    transition: transform var(--hpf-transition);
}

.hpf-range-thumb::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--hpf-blue);
    border: 2px solid var(--hpf-white);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    cursor: pointer;
    pointer-events: auto;
}

.hpf-range-thumb::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* ---------------------------------------------------------------
   Accordions
--------------------------------------------------------------- */
.hpf-accordeon {
    border-bottom: 1px solid var(--hpf-border);
}

.hpf-accordeon__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    cursor: pointer;
    user-select: none;
}

.hpf-accordeon__header:hover .hpf-accordeon__title {
    color: var(--hpf-blue);
}

.hpf-accordeon__title {
    font: 700 14px/1.3 var(--hpf-font);
    color: var(--hpf-text);
    transition: color var(--hpf-transition);
}

.hpf-accordeon__icon {
    position: relative;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.hpf-accordeon__icon::before,
.hpf-accordeon__icon::after {
    content: "";
    position: absolute;
    background: var(--hpf-text);
    transition: transform var(--hpf-transition), background var(--hpf-transition);
}

.hpf-accordeon__icon::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
}

.hpf-accordeon__icon::after {
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    transform: translateX(-50%) rotate(0);
}

.hpf-accordeon--open .hpf-accordeon__icon::after {
    transform: translateX(-50%) rotate(90deg);
}

.hpf-accordeon--open .hpf-accordeon__icon::before,
.hpf-accordeon--open .hpf-accordeon__icon::after {
    background: var(--hpf-blue);
}

.hpf-accordeon__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.hpf-accordeon--open .hpf-accordeon__body {
    max-height: 800px;
    padding-bottom: 14px;
}

/* ---------------------------------------------------------------
   Checkbox lists
--------------------------------------------------------------- */
.hpf-checkboxes {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hpf-checkbox-item {
    margin: 0 0 6px;
}

.hpf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 0;
    font: 400 13px/1.4 var(--hpf-font);
    color: var(--hpf-text);
    transition: color var(--hpf-transition);
}

.hpf-checkbox-label:hover {
    color: var(--hpf-blue);
}

.hpf-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.hpf-checkbox-custom {
    position: relative;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border: 1.5px solid var(--hpf-border);
    border-radius: 3px;
    background: var(--hpf-white);
    transition: background var(--hpf-transition), border-color var(--hpf-transition);
}

.hpf-checkbox:checked + .hpf-checkbox-custom {
    background: var(--hpf-blue);
    border-color: var(--hpf-blue);
}

.hpf-checkbox:checked + .hpf-checkbox-custom::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.hpf-checkbox-text {
    flex: 1;
}

.hpf-checkbox-count {
    color: var(--hpf-text-muted);
    font-size: 12px;
}

.hpf-checkbox:checked ~ .hpf-checkbox-text {
    color: var(--hpf-blue);
    font-weight: 600;
}

/* ---------------------------------------------------------------
   Icon options (sun/shade etc.)
--------------------------------------------------------------- */
.hpf-icon-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.hpf-icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border: 1.5px solid var(--hpf-border);
    border-radius: var(--hpf-radius);
    background: var(--hpf-white);
    cursor: pointer;
    text-align: center;
    transition: border-color var(--hpf-transition), background var(--hpf-transition);
}

.hpf-icon-option:hover {
    border-color: var(--hpf-blue);
}

.hpf-icon-option--active {
    border-color: var(--hpf-blue);
    background: var(--hpf-blue-light);
}

.hpf-icon-svg {
    color: var(--hpf-text-muted);
    transition: color var(--hpf-transition);
}

.hpf-icon-option:hover .hpf-icon-svg,
.hpf-icon-option--active .hpf-icon-svg {
    color: var(--hpf-blue);
}

.hpf-icon-svg svg {
    width: 28px;
    height: 28px;
}

.hpf-icon-label {
    font: 600 12px/1.2 var(--hpf-font);
    color: var(--hpf-text);
}

/* ---------------------------------------------------------------
   Color swatches
--------------------------------------------------------------- */
.hpf-color-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hpf-color-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    cursor: pointer;
    border-radius: var(--hpf-radius);
    transition: background var(--hpf-transition);
}

.hpf-color-option:hover {
    background: var(--hpf-blue-light);
}

.hpf-color-option--active .hpf-color-name {
    color: var(--hpf-blue);
    font-weight: 600;
}

.hpf-color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--hpf-border);
    flex-shrink: 0;
}

.hpf-color-name {
    flex: 1;
    font: 400 13px/1.4 var(--hpf-font);
    color: var(--hpf-text);
}

/* ---------------------------------------------------------------
   No-results / reset button
--------------------------------------------------------------- */
.hpf-no-results {
    text-align: center;
    padding: 40px 16px;
    color: var(--hpf-text-muted);
    font-family: var(--hpf-font);
}

.hpf-no-results p {
    margin: 0 0 16px;
    font-size: 15px;
}

.hpf-reset-btn {
    background: var(--hpf-blue);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font: 700 13px/1.4 var(--hpf-font);
    cursor: pointer;
    transition: background var(--hpf-transition);
}

.hpf-reset-btn:hover {
    background: var(--hpf-blue-dark);
}

/* ---------------------------------------------------------------
   Loading overlay on grid
--------------------------------------------------------------- */
#hpf-product-grid.hpf-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* ---------------------------------------------------------------
   Pagination (legacy)
--------------------------------------------------------------- */
.hpf-pagination {
    display: flex;
    justify-content: center;
    margin: 24px 0;
    list-style: none;
    padding: 0;
    gap: 4px;
}

.hpf-pagination li {
    display: inline-flex;
}

.hpf-pagination li a,
.hpf-pagination li .current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--hpf-border);
    border-radius: var(--hpf-radius);
    font: 500 13px/1 var(--hpf-font);
    color: var(--hpf-text);
    text-decoration: none;
    transition: all var(--hpf-transition);
}

.hpf-pagination li a:hover {
    border-color: var(--hpf-blue);
    color: var(--hpf-blue);
}

.hpf-pagination li .current {
    background: var(--hpf-blue);
    border-color: var(--hpf-blue);
    color: #fff;
}

/* ---------------------------------------------------------------
   Mobile drawer
--------------------------------------------------------------- */
.hpf-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 600;
}

.hpf-drawer {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(340px, 90vw);
    background: #fff;
    z-index: 700;
    overflow-y: auto;
    padding: 20px 20px 80px;
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.hpf-drawer--open {
    transform: translateX(0);
}

.hpf-drawer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--hpf-text-muted);
    font-size: 22px;
    line-height: 1;
    padding: 4px;
    cursor: pointer;
}

.hpf-drawer .hpf-drawer-close,
.hpf-drawer .hpf-drawer-close:hover,
.hpf-drawer .hpf-drawer-close:focus {
    /* Le kit Elementor (`.elementor-kit-9 button`, specificite 0,1,1, et ses
       etats :hover/:focus en 0,2,1) habillait la croix en carre bleu plein
       avec padding de bouton. On retablit la petite croix grise prevue
       ci-dessus, avec une specificite superieure (v2.2.2). */
    width: auto;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 4px;
    color: var(--hpf-text-muted);
    font-size: 22px;
    line-height: 1;
}

.hpf-drawer .hpf-drawer-close:hover,
.hpf-drawer .hpf-drawer-close:focus {
    color: var(--hpf-text);
}

.hpf-drawer-apply {
    display: none;
}

/* Le reset du theme Hello (button, [type="button"] { display: inline-block })
   est charge APRES cette feuille, a specificite egale : il reaffichait le
   bouton, ajoute en fin de <body>, tout en bas a gauche des pages categorie
   (corrige en v2.2.2). Le :not() porte la specificite a (0,2,0), au-dessus du
   reset (0,1,0) et du kit Elementor `.elementor-kit-9 button` (0,1,1). */
.hpf-drawer-apply:not(.hpf-drawer-apply--visible) {
    display: none;
}

.hpf-drawer-apply.hpf-drawer-apply--visible {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    width: min(340px, 90vw);
    background: var(--hpf-blue);
    color: #fff;
    border: none;
    padding: 16px;
    font: 700 15px/1.2 var(--hpf-font);
    text-align: center;
    cursor: pointer;
    z-index: 710;
    transition: background var(--hpf-transition);
}

.hpf-drawer-apply.hpf-drawer-apply--visible:hover {
    background: var(--hpf-blue-dark);
}

@media (max-width: 1024px) {
    .hpf-sidebar {
        display: none;
    }
}

/* ---------------------------------------------------------------
   Category picker
--------------------------------------------------------------- */
.hpf-picker {
    width: 100%;
    margin: 0 0 32px;
    font-family: var(--hpf-font);
}

.hpf-picker__title {
    font: 800 1.6rem/1.2 var(--hpf-font);
    color: var(--hpf-text);
    margin: 0 0 24px;
}

.hpf-picker__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.hpf-picker .hpf-picker__item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 60px;
    padding: 14px 16px 14px 60px;
    background: var(--hpf-blue-light);
    border: 1px solid var(--hpf-blue-light);
    border-radius: 100px;
    color: var(--hpf-text);
    cursor: pointer;
    text-align: center;
    font-family: var(--hpf-font);
    transition: background var(--hpf-transition), border-color var(--hpf-transition);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.hpf-picker .hpf-picker__item:hover {
    border-color: var(--hpf-blue);
    background: var(--hpf-white);
}

.hpf-picker .hpf-picker__item--active,
.hpf-picker .hpf-picker__item.hpf-picker__item--active {
    background: var(--hpf-white);
    border-color: var(--hpf-blue);
}

.hpf-picker .hpf-picker__item--active:hover {
    border-color: var(--hpf-blue-dark);
}

.hpf-picker__visual {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    min-width: 50px;
    background: var(--hpf-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    z-index: 2;
}

.hpf-picker--icon .hpf-picker__visual {
    color: var(--hpf-blue);
}

.hpf-picker__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.hpf-picker__initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hpf-blue-light);
    border-radius: 50%;
    color: var(--hpf-blue);
    font-size: 18px;
    font-weight: 800;
}

.hpf-picker__icon {
    width: 32px;
    height: 32px;
    color: var(--hpf-blue);
    transition: color var(--hpf-transition);
}

.hpf-picker__label {
    font: 600 14px/1.2 var(--hpf-font);
    color: var(--hpf-text);
    transition: color var(--hpf-transition);
}

/* ---------------------------------------------------------------
   Ordering dropdown
--------------------------------------------------------------- */
.hpf-orderby {
    position: relative;
    display: inline-block;
    font-family: var(--hpf-font);
    user-select: none;
}

.hpf-orderby__trigger {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    font: 700 15px/1.2 var(--hpf-font);
    color: var(--hpf-text);
    transition: color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.hpf-orderby__trigger:hover,
.hpf-orderby__trigger:focus,
.hpf-orderby[aria-expanded="true"] .hpf-orderby__trigger {
    color: var(--hpf-blue);
    outline: none;
}

.hpf-orderby__caret {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--hpf-blue);
    transition: transform 0.2s ease;
}

.hpf-orderby[aria-expanded="true"] .hpf-orderby__caret {
    transform: rotate(180deg);
}

.hpf-orderby__current {
    white-space: nowrap;
}

.hpf-orderby__panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 100;
    min-width: 220px;
    margin: 0;
    padding: 12px 0;
    list-style: none;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

.hpf-orderby[aria-expanded="true"] .hpf-orderby__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.hpf-orderby__option {
    padding: 10px 24px;
    font: 500 15px/1.4 var(--hpf-font);
    color: var(--hpf-text);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease;
}

.hpf-orderby__option:hover {
    background: var(--hpf-blue-light);
}

.hpf-orderby__option--active {
    color: var(--hpf-blue);
    font-weight: 700;
}

.woocommerce-ordering > select.orderby {
    display: none;
}

/* ---------------------------------------------------------------
   Responsive
--------------------------------------------------------------- */
@media (max-width: 1024px) {
    .hpf-picker__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .hpf-picker__title {
        font-size: 1.3rem;
        margin-bottom: 18px;
    }

    .hpf-picker__grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 10px;
        padding: 4px 16px 10px;
        margin: 0 -16px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--hpf-blue) transparent;
    }

    .hpf-picker__grid::-webkit-scrollbar {
        height: 4px;
    }

    .hpf-picker__grid::-webkit-scrollbar-thumb {
        background: var(--hpf-blue);
        border-radius: 2px;
    }

    .hpf-picker .hpf-picker__item {
        flex: 0 0 auto;
        min-width: auto;
        padding: 10px 18px;
        min-height: 44px;
        scroll-snap-align: start;
    }

    /* Hide visual on mobile to keep pills compact */
    .hpf-picker .hpf-picker__visual {
        min-width: 40px;
        width: 40px;
        left:0px;
        height: 40px;
        
    }

    .hpf-picker .hpf-picker__label {
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hpf-picker .hpf-picker__item {
        padding: 9px 16px;
        min-height: 40px;
        width: 60%;
    }

    .hpf-picker .hpf-picker__label {
        font-size: 13px;
    }
}

/* ----- Lisibilite des chiffres : police Quicksand (contenu du filtre) ----- */
.hpf-sidebar,
.hpf-result-count,
.hpf-checkbox-label,
.hpf-checkbox-text,
.hpf-checkbox-count,
.hpf-range-input {
    font-family: "Quicksand", sans-serif;
}

/* Les titres des groupes de filtres (accordeon a derouler) restent en Raleway. */
.hpf-sidebar .hpf-accordeon__header,
.hpf-sidebar .hpf-accordeon__title {
    font-family: "Raleway", sans-serif;
}
