/* ==========================================================================
   FacetWP Custom Styles — GraffitiStreet
   ========================================================================== */
.shop-sorting-wrapper .orderby {
    font-size: 1.6rem !important;
    box-shadow: none;
    border: none !important;
    outline: none;
}

.woocommerce-shop .facetwp-facet-store_results_counter,
.tax-artists .facetwp-facet-store_results_counter {
    margin: 0px 0 3rem 0 !important;
}

#shop-main-content {
    width: 100%;
}

.gspf-shop-header {
    margin-top: 4rem;
}


/* --- Filter Toggle Button --- */
.gspf-filter-toggle-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #333;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.2s, color 0.2s;
}

.gspf-filter-toggle-inline:hover,
.gspf-filter-toggle-inline.active {
    background: #333;
    color: #fff;
}

.gspf-filter-toggle-inline .ss-icon {
    display: flex;
    align-items: center;
    transition: transform 0.6s ease;

}

.gspf-filter-toggle-inline.active .ss-icon {
    transform: rotate(180deg);
}

/* --- Shop Controls Bar --- */
.woocommerce-before-shop-loop-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.shop-sorting-wrapper {
    display: flex;
    align-items: center;
}

.shop-sorting-wrapper .orderby {
    border: 1px solid #ddd;
    padding: 6px 12px;
    font-size: 13px;
}

/* --- Filter Sidebar Wrapper (hidden by default) --- */
.gspf-sidebar-column {
    position: relative;
}

.gspf-filter-sidebar-wrapper {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.gspf-sidebar-content {
    width: 244px;
}

.gspf-filter-sidebar {
    background: #fff;
    overflow-y: auto;
    padding: 0 15px 20px 15px;
    box-sizing: border-box;
    width: 244px;

}

/* --- Filter Sections --- */
.gspf-filter-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.gspf-filter-section .facetwp-facet {
    margin-bottom: 1rem;
}

.gspf-filter-section:last-child {
    border-bottom: none;
}

.gspf-filter-section label {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    color: #333;
}

/* --- FacetWP Checkbox Facets --- */
.gspf-filter-section .facetwp-checkbox {
    display: block;
    padding: 5px 0;
    font-size: 1.6rem;
    color: #555;
    cursor: pointer;
    background-size: 1.6rem;
    padding-left: 2.2rem;
}

.gspf-filter-section .facetwp-checkbox:hover {
    color: #000;
}

.gspf-filter-section .facetwp-checkbox .facetwp-counter {
    color: #999;
    font-size: 12px;
}

/* --- FacetWP Slider (Price) --- */
.facetwp-slider-wrap {
    padding: 10px 5px 0;
}

.facetwp-slider-label {
    font-size: 13px;
    color: #555;
    margin-top: 10px;
}

/* --- FacetWP filter Button --- */
.gspf-filter-section .facetwp-type-number_range .facetwp-submit {
    display: block;
    width: calc(100% - 1.5rem);
    transition: background-color 0.2s;
}

/* --- FacetWP Reset Button --- */
.facetwp-facet-reset .facetwp-reset-btn,
.facetwp-type-reset button {
    display: block;
    width: 100%;
    padding: 10px;
    background: #333;
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.facetwp-facet-reset .facetwp-reset-btn:hover,
.facetwp-type-reset button:hover {
    background: #e91e63;
}

/* --- Results Counter --- */
.facetwp-result-count-container {
    font-size: 13px;
    color: #777;
    margin-bottom: 10px;
}

/* --- Desktop: sidebar in-flow, pushes products --- */
@media (min-width: 992px) {
    #shop-main-content {
        display: flex;
        padding-top: 2rem;
    }

    .gspf-filter-sidebar-wrapper {
        position: relative;
        height: auto;
        flex-shrink: 0;
        order: -1;
    }

    .gspf-filter-sidebar-wrapper.is-open {
        width: 280px;
    }

    .gspf-filter-sidebar {
        position: sticky;
        top: 20px;
        width: 100%;
        height: auto;
        min-height: 100%;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        box-sizing: border-box;
        border-right: 1px solid #eee;
        padding-right: 20px;
        margin-right: 20px;
    }

    .gspf-products-column {
        flex: 1;
        min-width: 0;
        width: auto !important;
    }
}

/* --- Mobile: fixed overlay with backdrop --- */
@media (max-width: 991px) {

    body.woocommerce-shop,
    body.tax-artists {
        padding-top: 8rem;
    }

    body.woocommerce-shop .page-content,
    body.tax-artists .page-content {
        padding-bottom: 4rem;
    }

    body.woocommerce-shop .page-content h2.main-title,
    body.tax-artists .page-content h2.main-title {
        font-size: 3.5rem;
    }

    body.woocommerce-shop .page-content h2.main-title {
        margin-bottom: 1rem;
    }

    .gspf-shop-header {
        margin-top: 0
    }



    .gspf-filter-sidebar-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1050;
        background: rgba(0, 0, 0, 0);
        pointer-events: none;
        overflow: visible;
        transition: background 0.3s ease;
    }

    .gspf-filter-sidebar-wrapper.is-open {
        width: 100%;
        background: rgba(0, 0, 0, 0.4);
        pointer-events: auto;
    }

    .gspf-filter-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        height: 100%;
        z-index: 1051;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
        transform: translateX(-100%);
        transition: transform 0.6s ease;
        padding: 3rem;
        overflow: hidden;
        /* Crucial: hides the content as width shrinks */
        white-space: nowrap;
        /* Prevents text and inline elements from wrapping */

    }

    .gspf-filter-sidebar-wrapper.is-open .gspf-filter-sidebar {
        transform: translateX(0);
    }

    body.gspf-filters-open {
        overflow: hidden;
    }
}

@media (max-width: 767px) {
    .woocommerce-before-shop-loop-wrapper {
        flex-wrap: wrap;
        gap: 10px;
    }

    .gspf-filter-toggle-inline {
        width: 100%;
        justify-content: center;
        margin-bottom: 1rem;
    }

    .shop-sorting-wrapper {
        width: 100%;
    }

    .shop-sorting-wrapper .orderby {
        width: 100%;
    }

    .gspf-filter-sidebar {
        width: 85%;
        max-width: 320px;
    }
}

/* --- Artist facet: scrollable list --- */
.gspf-filter-section.artist .facetwp-facet {
    max-height: 250px;
    overflow-y: auto;
}

.gspf-filter-section.artist .facetwp-facet::-webkit-scrollbar {
    width: 4px;
}

.gspf-filter-section.artist .facetwp-facet::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.gspf-filter-section.artist .facetwp-facet::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* --- Facet search input + clear button --- */
.facetwp-facet-search-wrap {
    position: relative;
    margin: 0 1rem 1rem;
    margin-left: 0;
}

.facetwp-facet-search {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    background: #fff;
    color: #101010;
}

.facetwp-facet-search:focus {
    outline: none;
    border-color: #101010;
}

.facetwp-facet-search::placeholder {
    color: #999;
}

.facetwp-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-size: 18px;
    line-height: 1;
    display: none;
    padding: 2px 4px;
}

.facetwp-search-clear:hover {
    color: #333;
}

.facetwp-search-clear.is-visible {
    display: block;
}