/**
 * SR Product Filters — sr-filter.css
 *
 * STRUCTURAL STYLES ONLY.
 * This file provides layout and functionality CSS.
 * All colors, fonts, borders, backgrounds, and decorative styles
 * are intentionally omitted and must be customized by your designer.
 *
 * See readme.txt for a full reference of available CSS classes and IDs.
 *
 * @package SR_Product_Filters
 */

/* ==========================================================================
   Horizontal Search Bar — [sr_product_search]
   ========================================================================== */

.sr-search {
    width: 100%;
}

.sr-search__form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    width: 100%;
}

.sr-search__fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    flex: 1 1 auto;
}

.sr-search__field {
    display: flex;
    flex-direction: column;
    flex: 1 1 120px;
    min-width: 100px;
}

.sr-search__label {
    display: block;
    margin-bottom: 0.25rem;
}

.sr-search__select {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.sr-search__actions {
    display: flex;
    align-items: flex-end;
    flex: 0 0 auto;
}

.sr-search__submit {
    display: inline-block;
    cursor: pointer;
    white-space: nowrap;
}

/* ==========================================================================
   Vertical Sidebar Filter — [sr_product_filter]
   ========================================================================== */

.sr-filter {
    width: 100%;
    position: relative;
}

/* Loading state */
.sr-filter--loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Header */
.sr-filter__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.sr-filter__title {
    margin: 0;
}

.sr-filter__reset {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

/* Product count */
.sr-filter__count {
    margin-bottom: 0.75rem;
}

/* Body */
.sr-filter__body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Attribute group */
.sr-filter__group {
    display: flex;
    flex-direction: column;
}

/* Sort and In Stock groups live outside .sr-filter__body, so they don't
   inherit the body's gap spacing — add explicit margin to space them. */
.sr-filter__group--sort,
.sr-filter__group--in-stock {
    margin-bottom: 1.5rem;
}

.sr-filter__group-title {
    margin: 0 0 0.5rem 0;
}

/* Options list */
.sr-filter__options {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sr-filter__option {
    display: flex;
    align-items: center;
}

.sr-filter__option-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    width: 100%;
}

.sr-filter__checkbox {
    flex: 0 0 auto;
    cursor: pointer;
}

.sr-filter__option-name {
    flex: 1 1 auto;
}

.sr-filter__option-count {
    flex: 0 0 auto;
}

/* Disabled option (no results in current filtered state) */
.sr-filter__option--disabled {
    opacity: 0.4;
    pointer-events: none;
}

.sr-filter__option--disabled .sr-filter__option-label {
    cursor: not-allowed;
}

/* Active/checked option — visually distinct from unchecked */
.sr-filter__option:has(.sr-filter__checkbox:checked) {
    font-weight: 600;
}

.sr-filter__option:has(.sr-filter__checkbox:checked) .sr-filter__option-name {
    font-weight: 600;
}

.sr-filter__option:has(.sr-filter__checkbox:checked) .sr-filter__option-count {
    font-weight: 600;
}

/* ==========================================================================
   Price Slider
   ========================================================================== */

.sr-filter__price-slider {
    width: 100%;
}

.sr-filter__price-track {
    position: relative;
    height: 4px;
    margin: 1.5rem 0;
}

.sr-filter__price-range-fill {
    position: absolute;
    top: 0;
    height: 100%;
    pointer-events: none;
}

/* Stack both range inputs on top of each other */
.sr-filter__price-input {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY( -50% );
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.sr-filter__price-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: all;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.sr-filter__price-input::-moz-range-thumb {
    pointer-events: all;
    cursor: pointer;
}

/* Min/max values row */
.sr-filter__price-values {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.sr-filter__price-value {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
}

.sr-filter__price-number {
    width: 100%;
    box-sizing: border-box;
}

.sr-filter__price-separator {
    flex: 0 0 auto;
}

/* No products message */
.sr-no-products {
    width: 100%;
}

/* See More / See Less toggle */
.sr-filter__see-more {
    display: flex;
    align-items: center;
    margin-top: 0.25rem;
}

.sr-filter__see-more-link {
    font-size: 0.875em;
    cursor: pointer;
    text-decoration: none;
}

.sr-filter__see-more-link:hover {
    text-decoration: underline;
}
