/* ============================================================
   WC Filter Sidebar — wcfs.css  v1.1
   Inherits theme colours/fonts.
   ============================================================ */

/* ---- Sidebar container ---- */
.wcfs-sidebar {
    font-size: inherit;
    margin-top: 150px;
    background: #f7f7f7;
    padding: 20px;
}

/* ---- Mobile: collapsible sidebar toggle button ---- */
.wcfs-mobile-toggle {
    display: none;
    width: 100%;
    background: #333;
    color: #fff;
    border: none;
    padding: .75em 1em;
    font: inherit;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    text-align: left;
    border-radius: 3px;
    margin-bottom: 0;
    align-items: center;
    justify-content: space-between;
}

.wcfs-mobile-toggle__arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #fff;
    transition: transform .2s;
    flex-shrink: 0;
    margin-left: .5em;
}

.wcfs-mobile-toggle.is-open .wcfs-mobile-toggle__arrow {
    transform: rotate(180deg);
}

.wcfs-filters-collapsible {
    /* On desktop: always visible — no changes */
}

@media (max-width: 760px) {
    .wcfs-sidebar {
        margin-top: 0;
        padding: 0;
        background: #f7f7f7;
        border-radius: 3px;
        overflow: hidden;
        margin-bottom: 1.5em;
    }

    .wcfs-mobile-toggle {
        display: flex;
        border-radius: 3px;
    }

    /* Title hidden on mobile (toggle button replaces it) */
    .wcfs-sidebar__title {
        display: none;
    }

    /* Filters panel slides open/closed on mobile */
    .wcfs-filters-collapsible {
        display: none;
        padding: 15px;
    }

    .wcfs-filters-collapsible.is-open {
        display: block;
    }

    /* Active filters always visible below toggle */
    .wcfs-active-filters {
        padding: .75em 15px !important;
    }
}

.wcfs-sidebar__title {
    margin-top: 0;
    margin-bottom: 1em;
    font-size: 1.1em;
}

/* ---- Filter group ---- */
.wcfs-group {
    border-bottom: 1px solid rgba(0,0,0,.1);
    margin-bottom: 0;
}

.wcfs-group:last-child {
    border-bottom: none;
}

/* Toggle button (collapsible filter groups) */
.wcfs-group__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: .75em 5px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    color: inherit;
}

.wcfs-group__toggle:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Larger tap targets on mobile */
@media (max-width: 760px) {
    .wcfs-group__toggle {
        padding: .9em 5px;
    }
}

/* Static title (non-collapsible, e.g. search) */
.wcfs-group__title {
    padding: .75em 0 .25em;
    margin: 0;
    font-size: 1em;
    font-weight: 600;
}

/* Arrow indicator */
.wcfs-group__arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    transition: transform .2s;
    flex-shrink: 0;
    margin-left: .5em;
}

.wcfs-group.is-open .wcfs-group__arrow {
    transform: rotate(180deg);
}

/* Collapsible body — closed by default */
.wcfs-group__body {
    overflow: hidden;
    max-height: 0;
    transition: max-height .25s ease;
}

/* Open state for collapsible groups */
.wcfs-group.is-open .wcfs-group__body {
    max-height: 2000px;
    padding-bottom: .75em;
}

/* Always-open body (used by search group) */
.wcfs-group__body--open,
.wcfs-group--always-open .wcfs-group__body {
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: .75em;
}

/* ---- Checklist — NO bullets ---- */
.wcfs-checklist {
    list-style: none !important;
    margin: 0 !important;
    padding: 5px !important;
}

.wcfs-checklist__item {
    margin: .3em 0;
    padding: 0;
    list-style: none !important;
    background-image: none !important;
    padding-left: 0 !important;
}

/* Larger tap spacing on mobile */
@media (max-width: 760px) {
    .wcfs-checklist__item {
        margin: .45em 0;
    }
}

.wcfs-checklist__item::before,
.wcfs-checklist__item::marker {
    display: none !important;
    content: '' !important;
}

.wcfs-checklist__label {
    display: flex;
    align-items: center;
    gap: .5em;
    cursor: pointer;
    font-size: .9em;
    line-height: 1.4;
}

/* Bigger touch targets on mobile */
@media (max-width: 760px) {
    .wcfs-checklist__label {
        padding: .35em 0;
        font-size: 1em;
    }
}

.wcfs-checklist__label:hover .wcfs-checklist__name {
    text-decoration: underline;
}

.wcfs-checklist__checkbox {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    cursor: pointer;
    margin: 0;
}

/* Larger checkbox on mobile */
@media (max-width: 760px) {
    .wcfs-checklist__checkbox {
        width: 18px;
        height: 18px;
    }
}

.wcfs-checklist__count {
    color: #888;
    font-size: .85em;
    margin-left: auto;
    padding-left: .25em;
}

/* ---- Search group ---- */
.wcfs-search {
    display: flex;
    gap: .25em;
}

.wcfs-search__input {
    flex: 1;
    min-width: 0;
    padding: .4em .6em;
    font: inherit;
    font-size: .9em;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 3px;
    background: transparent;
    color: inherit;
}

/* Comfortable search on mobile */
@media (max-width: 760px) {
    .wcfs-search__input {
        font-size: 1em;
        padding: .55em .7em;
    }
}

.wcfs-search__btn {
    padding: .4em .6em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Bigger search button on mobile */
@media (max-width: 760px) {
    .wcfs-search__btn {
        padding: .55em .8em;
    }

    .wcfs-search__btn svg {
        width: 20px;
        height: 20px;
    }
}

.wcfs-search__btn svg {
    display: block;
}

/* ---- Active filters ---- */
.wcfs-active-filters {
    padding: .75em 0;
    border-top: 1px solid rgba(0,0,0,.1);
    margin-top: .5em;
}

.wcfs-active-filters__title {
    margin: 0 0 .5em;
    font-size: .9em;
    font-weight: 600;
}

.wcfs-active-filters__list {
    list-style: none !important;
    margin: 0 0 .5em !important;
    padding: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: .35em;
}

.wcfs-active-filters__list li {
    list-style: none !important;
    background-image: none !important;
    padding: 7px !important;
    margin: 0 !important;
}

.wcfs-active-filters__chip {
    display: inline-flex;
    align-items: center;
    gap: .3em;
    background: rgba(0,0,0,.07);
    border-radius: 2em;
    padding: .2em .6em;
    font-size: .8em;
    line-height: 1.4;
}

/* Larger chips on mobile */
@media (max-width: 760px) {
    .wcfs-active-filters__chip {
        font-size: .9em;
        padding: .3em .75em;
    }
}

.wcfs-active-filters__remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    line-height: 1;
    color: inherit;
    padding: 0 0 0 .1em;
    opacity: .7;
}

.wcfs-active-filters__remove:hover {
    opacity: 1;
}

/* Easier tap on mobile */
@media (max-width: 760px) {
    .wcfs-active-filters__remove {
        font-size: 1.3em;
        padding: 0 0 0 .3em;
    }
}

.wcfs-active-filters__clear {
    font-size: .85em;
}

@media (max-width: 760px) {
    .wcfs-active-filters__clear {
        font-size: .95em;
        padding: .5em 1em;
    }
}

/* ---- Loading overlay on product grid ---- */
.wcfs-loading {
    opacity: .45;
    pointer-events: none;
    position: relative;
    transition: opacity .15s;
}
