/* ============================================================
   WC Filter Sidebar — wcfs.css  v2.0 (Smashed It)
   Styled to match the /shop/ page filters: white card, soft
   border, Smashed It blue (#0062d6) and ink (#0b1220).
   ============================================================ */

.wcfs-sidebar {
    --wcfs-ink: #0b1220;
    --wcfs-muted: #4a5568;
    --wcfs-line: #e3e8ef;
    --wcfs-blue: #0062d6;
    --wcfs-soft: #f3f6fb;
    font-size: 15px;
    color: var(--wcfs-ink);
    background: #fff;
    border: 1px solid var(--wcfs-line);
    border-radius: 16px;
    padding: 20px 20px 12px;
    margin-top: 0;
}

.wcfs-sidebar__title {
    margin: 0 0 .5em;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--wcfs-blue);
}

/* ---- Mobile toggle ---- */
.wcfs-mobile-toggle {
    display: none;
    width: 100%;
    min-height: 48px;
    background: #fff;
    color: var(--wcfs-ink);
    border: 1px solid #c9d2de;
    border-radius: 12px;
    padding: .7em 1em;
    font: inherit;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    text-align: left;
    align-items: center;
    justify-content: space-between;
}

.wcfs-mobile-toggle__arrow,
.wcfs-group__arrow {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s;
    flex-shrink: 0;
    margin-left: .5em;
}

.wcfs-mobile-toggle.is-open .wcfs-mobile-toggle__arrow,
.wcfs-group.is-open .wcfs-group__arrow {
    transform: rotate(-135deg) translateY(-2px);
}

/* ---- Filter groups ---- */
.wcfs-group {
    border-bottom: 1px solid var(--wcfs-line);
}

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

.wcfs-group__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 14px 0;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    color: var(--wcfs-ink);
}

.wcfs-group__toggle:focus-visible {
    outline: 2px solid var(--wcfs-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

.wcfs-group__title {
    padding: 4px 0 8px;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--wcfs-ink);
}

.wcfs-group__body {
    overflow: hidden;
    max-height: 0;
    transition: max-height .25s ease;
}

.wcfs-group.is-open .wcfs-group__body {
    max-height: 2000px;
    padding-bottom: 12px;
}

.wcfs-group__body--open,
.wcfs-group--always-open .wcfs-group__body {
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: 14px;
}

/* ---- Checklist ---- */
.wcfs-checklist {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

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

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

.wcfs-checklist__label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.35;
    padding: 6px 0;
    color: var(--wcfs-ink);
}

.wcfs-checklist__label:hover .wcfs-checklist__name {
    color: var(--wcfs-blue);
}

.wcfs-checklist__checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--wcfs-blue);
}

.wcfs-checklist__item.is-checked .wcfs-checklist__name {
    font-weight: 700;
}

.wcfs-checklist__count {
    color: var(--wcfs-muted);
    font-size: 13px;
    margin-left: auto;
    padding-left: .25em;
}

/* ---- Search ---- */
.wcfs-search {
    display: flex;
    gap: 6px;
}

.wcfs-search__input {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    padding: 8px 12px;
    font: inherit;
    font-size: 15px;
    border: 1px solid #c9d2de;
    border-radius: 10px;
    background: #fff;
    color: var(--wcfs-ink);
}

.wcfs-search__input:focus {
    outline: none;
    border-color: var(--wcfs-blue);
    box-shadow: 0 0 0 3px rgba(0, 98, 214, .15);
}

.wcfs-search__btn {
    min-width: 42px;
    min-height: 42px;
    padding: 0 12px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px !important;
    background: var(--wcfs-blue) !important;
    color: #fff !important;
    border: 0 !important;
    line-height: 1;
}

.wcfs-search__btn svg {
    display: block;
}

/* ---- Active filters ---- */
.wcfs-active-filters {
    padding: 14px 0 8px;
    border-top: 1px solid var(--wcfs-line);
}

.wcfs-active-filters__title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--wcfs-muted);
}

.wcfs-active-filters__list {
    list-style: none !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

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

.wcfs-active-filters__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--wcfs-soft);
    color: var(--wcfs-ink);
    border-radius: 999px;
    padding: 6px 8px 6px 12px !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.wcfs-active-filters__remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: var(--wcfs-muted);
    padding: 0 2px;
}

.wcfs-active-filters__remove:hover {
    color: var(--wcfs-ink);
}

.wcfs-active-filters__clear {
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    color: var(--wcfs-blue) !important;
    font-size: 14px !important;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

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

/* ---- Filtered grid ----
 * After a filter runs, the JS removes Themify's masonry layout (it clipped
 * the new results). This plain grid replaces it, keeping the same 4-across
 * layout as the default category grid.
 */
ul.products:not(.masonry) > .gutter-sizer,
ul.products:not(.masonry) > .column-sizer,
ul.products:not(.masonry) > .grid-sizer {
    display: none !important;
}

ul.products:not(.masonry) {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 28px 24px !important;
}

ul.products:not(.masonry) > li.product {
    position: static !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    float: none !important;
}

ul.products:not(.masonry) > li.product img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 6 / 5;
    object-fit: cover;
}

ul.products:not(.masonry) > li.product .woocommerce-info {
    grid-column: 1 / -1;
}

@media (max-width: 1100px) {
    ul.products:not(.masonry) {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* ---- Mobile ---- */
@media (max-width: 760px) {
    /* Show the filter button above the products, not below them */
    body.tax-product_cat #layout,
    body.tax-product_tag #layout,
    body.post-type-archive-product #layout {
        display: flex;
        flex-direction: column;
    }
    body.tax-product_cat #sidebar,
    body.tax-product_tag #sidebar,
    body.post-type-archive-product #sidebar {
        order: -1;
        width: 100%;
        margin: 0 0 16px;
    }

    .wcfs-sidebar {
        border: 0;
        padding: 0;
        background: none;
        border-radius: 0;
    }

    .wcfs-sidebar__title {
        display: none;
    }

    .wcfs-mobile-toggle {
        display: flex;
    }

    .wcfs-filters-collapsible {
        display: none;
        margin-top: 8px;
        padding: 6px 16px 8px;
        border: 1px solid var(--wcfs-line);
        border-radius: 12px;
        background: #fff;
    }

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

    .wcfs-active-filters {
        border-top: 0;
        padding: 10px 0 0;
    }

    ul.products:not(.masonry) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px 12px !important;
    }
}
