/**
 * Shop Filters Styling
 * Professional filter sidebar design for Filter Everything plugin
 */

/* ============================================
   Shop Layout with Sidebar Filter
   ============================================ */

/* Wrapper for filter + products */
.rf-shop-content-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
}

/* Ensure only sidebar and products section are grid items */
.rf-shop-content-wrapper > .rf-filter-toggle,
.rf-shop-content-wrapper > .rf-filter-overlay {
    display: none; /* Hidden on desktop, shown on mobile with specific styles */
}

/* Expand container width for desktop */
@media (min-width: 1200px) {
    .rf-shop-wrapper .container {
        max-width: 1600px;
    }
}

/* Full-width header without border radius */
.rf-shop-header--has-bg {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    border-radius: 0 !important;
    width: 100vw;
    position: relative;
    left: 0;
    right: 0;
}

/* ============================================
   Filter Sidebar - Desktop
   ============================================ */
.rf-filter-sidebar {
    position: sticky;
    top: 130px; /* Stick below the fixed header */
    height: fit-content;
    max-height: calc(100vh - 150px); /* Leave room for header and spacing */
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 187px; /* Align with products section */
}

.rf-filter-sidebar-inner {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

/* Filter Header */
.rf-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #28333A;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem; /* Extend to edges of sidebar */
    padding: 1.25rem 1.5rem;
    border-radius: 12px 12px 0 0; /* Match sidebar border radius */
    position: relative;
}

.rf-filter-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
}

.rf-filter-title {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rf-filter-icon {
    width: 20px;
    height: 20px;
    color: #ffffff;
    opacity: 0.9;
}

.rf-filter-reset {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

.rf-filter-reset:hover {
    color: #ffffff;
    text-decoration-thickness: 2px;
}

/* Mobile Toggle Button - Hidden on Desktop */
.rf-filter-toggle {
    display: none; /* Hidden by default on desktop */
}

/* Desktop: Ensure grid layout works properly */
@media (min-width: 1025px) {
    .rf-shop-content-wrapper {
        display: grid;
        grid-template-columns: 280px 1fr;
        grid-template-areas: "sidebar products";
    }
    
    .rf-filter-sidebar {
        grid-area: sidebar;
        /* Sticky positioning and padding defined in base styles */
    }
    
    .rf-products-section {
        grid-area: products;
    }
    
    .rf-filter-toggle,
    .rf-filter-overlay,
    .rf-filter-close {
        display: none !important;
    }
}

/* ============================================
   Custom Riverside Filters Styling
   ============================================ */

/* Filter Sections */
.rf-filter-section {
    margin-bottom: 0;
    border-bottom: 1px solid #f0f0f0;
}

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

/* Section Toggle Button */
.rf-filter-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    padding: 0.875rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.rf-filter-section-toggle:hover {
    background: rgba(34, 136, 201, 0.05);
}

.rf-filter-section-title {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text-heading, #28333A);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
}

/* Toggle Icon */
.rf-toggle-icon {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--color-text-light, #7a7a73);
}

.rf-filter-section-toggle[aria-expanded="true"] .rf-toggle-icon {
    transform: rotate(180deg);
    color: var(--color-primary, #2288c9);
}

/* Filter Options */
.rf-filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0 0.5rem 1rem 0.5rem;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.rf-filter-options--collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.rf-filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
    color: var(--color-text-body, #595954);
    position: relative;
    margin: 0;
}

.rf-filter-option:hover {
    background-color: rgba(34, 136, 201, 0.05);
}

.rf-filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-primary, #2288c9);
    flex-shrink: 0;
}

.rf-filter-label-text {
    flex: 1;
    font-weight: 500;
}

.rf-filter-option input[type="checkbox"]:checked ~ .rf-filter-label-text {
    font-weight: 600;
    color: var(--color-primary, #2288c9);
}

.rf-filter-count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-light, #7a7a73);
    background: #f0f0f0;
    padding: 0px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    min-width: 24px;
    text-align: center;
}

/* Child/Nested Filters */
.rf-filter-children {
    padding-left: .6rem;
    margin-top: 0.25rem;
    border-left: 2px solid #f0f0f0;
}

.rf-filter-option--child {
    font-size: 0.8125rem;
}

/* Active Filters Display */
.rf-active-filters {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.rf-active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rf-active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    padding: 0.375rem 0.5rem 0.375rem 0.75rem;
    background: var(--color-primary, #2288c9);
    color: #ffffff;
    border-radius: 20px;
    font-weight: 500;
}

.rf-remove-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    margin: 0;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.rf-remove-filter:hover {
    opacity: 1;
}

.rf-remove-filter svg {
    width: 14px;
    height: 14px;
}

/* Loading State */
.rf-products-section.is-loading {
    position: relative;
    pointer-events: none;
}

/* Dark overlay behind spinner */
.rf-products-section.is-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(3px);
    z-index: 99;
}

/* Spinner */
.rf-products-section.is-loading::after {
    content: '';
    position: absolute;
    top: calc(50% - 25px); /* Center without transform */
    left: calc(50% - 25px); /* Center without transform */
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--color-primary, #2288c9);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 100;
}

/* ============================================
   Filter Everything Plugin Styling (Legacy - Keep for compatibility)
   ============================================ */

/* Widget container */
.wpc-filters-widget,
.widget_wpc_filters_widget,
.wpc-filters-widget-wrapper,
.wpc-filters-main-container {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

/* Hide widget title if it exists */
.rf-filter-sidebar-inner .widget-title,
.rf-filter-sidebar-inner h3.widget-title {
    display: none;
}

/* Filter sections */
.wpc-filters-section,
.wpc-filter-post-search,
.wpc-filter {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.wpc-filters-section:last-child,
.wpc-filter:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Filter titles/labels */
.wpc-filters-section-title,
.wpc-filter-title,
.wpc-filter-label {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text-heading, #28333A);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Checkboxes and Radio Buttons */
.wpc-filter-content ul,
.wpc-filters-ul-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wpc-filter-content li,
.wpc-filters-ul-list li {
    margin: 0 0 0.5rem 0;
}

.wpc-filter-content label,
.wpc-filters-ul-list label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
    color: var(--color-text-body, #595954);
}

.wpc-filter-content label:hover,
.wpc-filters-ul-list label:hover {
    background-color: rgba(34, 136, 201, 0.05);
}

.wpc-filter-content input[type="checkbox"],
.wpc-filter-content input[type="radio"],
.wpc-filters-ul-list input[type="checkbox"],
.wpc-filters-ul-list input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-primary, #2288c9);
}

.wpc-filter-content input[type="checkbox"]:checked + span,
.wpc-filter-content input[type="radio"]:checked + span,
.wpc-filters-ul-list input[type="checkbox"]:checked + span,
.wpc-filters-ul-list input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--color-primary, #2288c9);
}

/* Count badges */
.wpc-term-count,
.wpc-filter-count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-light, #7a7a73);
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Range Slider */
.wpc-filter-content input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    margin: 1rem 0;
    cursor: pointer;
}

.wpc-filter-content input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary, #2288c9);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wpc-filter-content input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary, #2288c9);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: none;
}

/* Search input */
.wpc-filter-search-input,
.wpc-filter-content input[type="text"],
.wpc-filter-content input[type="search"] {
    width: 100%;
    padding: 0.625rem;
    font-size: 0.875rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpc-filter-search-input:focus,
.wpc-filter-content input[type="text"]:focus,
.wpc-filter-content input[type="search"]:focus {
    outline: none;
    border-color: var(--color-primary, #2288c9);
    box-shadow: 0 0 0 3px rgba(34, 136, 201, 0.1);
}

/* Dropdown/Select */
.wpc-filter-content select {
    width: 100%;
    padding: 0.625rem;
    font-size: 0.875rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.wpc-filter-content select:focus {
    outline: none;
    border-color: var(--color-primary, #2288c9);
}

/* Show More/Less buttons */
.wpc-show-more-button,
.wpc-show-less-button {
    font-size: 0.8125rem;
    color: var(--color-primary, #2288c9);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0.5rem 0 0;
    margin-top: 0.5rem;
    transition: color 0.2s ease;
}

.wpc-show-more-button:hover,
.wpc-show-less-button:hover {
    color: var(--color-primary-dark, #105a88);
    text-decoration: underline;
}

/* Loading state */
.wpc-filters-overlay {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
}

.wpc-filters-preloader {
    border-color: var(--color-primary, #2288c9);
    border-right-color: transparent;
}

/* Applied Filters / Active filters */
.wpc-filters-selected-items,
.wpc-filters-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.wpc-filters-selected-item,
.wpc-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
    background: var(--color-primary, #2288c9);
    color: #ffffff;
    border-radius: 20px;
    font-weight: 500;
}

.wpc-filters-selected-item button,
.wpc-filter-chip-remove {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    margin: 0 0 0 0.25rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.wpc-filters-selected-item button:hover,
.wpc-filter-chip-remove:hover {
    opacity: 1;
}

/* Submit/Apply button */
.wpc-filters-submit-button,
.wpc-filter-apply-button,
.wpc-filters-widget button[type="submit"] {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--color-primary, #2288c9);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.wpc-filters-submit-button:hover,
.wpc-filter-apply-button:hover,
.wpc-filters-widget button[type="submit"]:hover {
    background: var(--color-primary-dark, #105a88);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 136, 201, 0.3);
}

/* Color/Image Swatches */
.wpc-filter-color-list,
.wpc-filter-image-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.wpc-filter-color-list li,
.wpc-filter-image-list li {
    margin: 0;
}

.wpc-filter-color-item,
.wpc-filter-image-item {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.wpc-filter-color-item:hover,
.wpc-filter-image-item:hover {
    border-color: var(--color-primary, #2288c9);
    transform: scale(1.1);
}

.wpc-filter-color-item.selected,
.wpc-filter-image-item.selected,
input[type="checkbox"]:checked + .wpc-filter-color-item,
input[type="checkbox"]:checked + .wpc-filter-image-item {
    border-color: var(--color-primary, #2288c9);
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(34, 136, 201, 0.2);
}

/* Hierarchical/Nested Lists */
.wpc-filter-content ul ul,
.wpc-filters-ul-list ul {
    margin-top: 0.25rem;
    padding-left: 1.25rem;
    border-left: 2px solid #f0f0f0;
}

.wpc-filter-content ul ul li,
.wpc-filters-ul-list ul li {
    margin: 0.25rem 0;
}

/* Star Ratings */
.wpc-filter-rating {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.wpc-filter-rating-stars {
    display: flex;
    gap: 2px;
    color: #ffc107;
}

/* Price Filter */
.wpc-filter-price-inputs {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
}

.wpc-filter-price-inputs input {
    flex: 1;
    min-width: 0;
}

.wpc-filter-price-separator {
    color: var(--color-text-light, #7a7a73);
    font-weight: 500;
}

/* Number Input Spinners */
.wpc-filter-content input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.wpc-filter-content input[type="number"]::-webkit-outer-spin-button,
.wpc-filter-content input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Date Picker */
.wpc-filter-date-picker {
    position: relative;
}

.wpc-filter-date-picker input {
    padding-right: 2.5rem;
}

.wpc-filter-date-picker::after {
    content: "📅";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Tooltip/Hint Text */
.wpc-filter-hint,
.wpc-filter-tooltip {
    font-size: 0.75rem;
    color: var(--color-text-light, #7a7a73);
    font-style: italic;
    margin-top: 0.25rem;
    display: block;
}

/* Collapsible Sections */
.wpc-filter-collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.5rem 0;
    user-select: none;
}

.wpc-filter-collapsible-header::after {
    content: "▼";
    font-size: 0.75rem;
    color: var(--color-text-light, #7a7a73);
    transition: transform 0.2s ease;
}

.wpc-filter-collapsible-header.collapsed::after {
    transform: rotate(-90deg);
}

.wpc-filter-collapsible-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.wpc-filter-collapsible-content.collapsed {
    max-height: 0;
}

/* Reset/Clear All Filters Button */
.wpc-filters-reset-button,
.wpc-filters-clear-all {
    display: inline-block;
    font-size: 0.875rem;
    color: #dc3545;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    transition: color 0.2s ease;
}

.wpc-filters-reset-button:hover,
.wpc-filters-clear-all:hover {
    color: #c82333;
    text-decoration: underline;
}

/* Filter Tags / Active Filters Display */
.wpc-active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

/* Empty State */
.wpc-filter-empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--color-text-light, #7a7a73);
    font-size: 0.875rem;
}

/* Compatibility with WooCommerce Widgets */
.wpc-filters-widget .woocommerce-widget-layered-nav-list,
.wpc-filters-widget .woocommerce-widget-layered-nav-list__item {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wpc-filters-widget .woocommerce-widget-layered-nav-list__item a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   AJAX Loading States
   ============================================ */
.wpc-filters-overlay.wpc-filters-loading {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpc-filters-preloader {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: var(--color-primary, #2288c9);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Filter Specific Plugin Classes
   ============================================ */

/* Chips/Tags Style */
.wpc-filter-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Dropdown/Select Styling */
.wpc-filter-content .wpc-filter-select-wrapper {
    position: relative;
}

.wpc-filter-content .wpc-filter-select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--color-text-light, #7a7a73);
    font-size: 0.75rem;
}

.wpc-filter-content .wpc-filter-select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.5rem;
}

/* Multiple Select */
.wpc-filter-content select[multiple] {
    height: auto;
    min-height: 120px;
    padding: 0.5rem;
}

.wpc-filter-content select[multiple] option {
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 2px;
}

.wpc-filter-content select[multiple] option:checked {
    background: var(--color-primary, #2288c9);
    color: #ffffff;
}

/* Button Groups */
.wpc-filter-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wpc-filter-button-group button,
.wpc-filter-button-group .wpc-filter-button {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: var(--color-text-body, #595954);
}

.wpc-filter-button-group button:hover,
.wpc-filter-button-group .wpc-filter-button:hover {
    border-color: var(--color-primary, #2288c9);
    background: rgba(34, 136, 201, 0.05);
}

.wpc-filter-button-group button.active,
.wpc-filter-button-group .wpc-filter-button.active,
.wpc-filter-button-group button:checked,
.wpc-filter-button-group .wpc-filter-button:checked {
    background: var(--color-primary, #2288c9);
    color: #ffffff;
    border-color: var(--color-primary, #2288c9);
}

/* Horizontal Filters (if using inline layout) */
.wpc-filters-horizontal {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.wpc-filters-horizontal .wpc-filter {
    flex: 1;
    min-width: 200px;
}

/* Mobile-Optimized Checkboxes */
@media (max-width: 1024px) {
    .wpc-filter-content input[type="checkbox"],
    .wpc-filter-content input[type="radio"] {
        width: 20px;
        height: 20px;
    }
    
    .wpc-filter-content label {
        padding: 0.625rem;
        font-size: 0.9375rem;
    }
}

/* ============================================
   Integration with Theme Color Scheme
   ============================================ */

/* Use theme's accent color for primary elements */
.wpc-filter-content a:not(.wpc-filters-reset-button),
.wpc-term-name:hover,
.wpc-filter-title a:hover {
    color: var(--color-primary, #2288c9);
}

/* Secondary color for certain elements */
.wpc-filter-secondary-action {
    color: var(--color-secondary, #166734);
}

/* Match WooCommerce product cards styling */
.rf-filter-sidebar-inner {
    font-family: var(--font-body, 'Poppins', sans-serif);
}

/* Ensure consistent border radius with theme */
.wpc-filter-content input,
.wpc-filter-content select,
.wpc-filter-content button,
.wpc-filter-button-group button,
.wpc-filter-color-item,
.wpc-filter-image-item {
    border-radius: 6px;
}

/* ============================================
   Custom Scrollbar for Desktop Sidebar
   ============================================ */
@media (min-width: 1025px) {
    .rf-filter-sidebar-inner {
        scrollbar-width: thin;
        scrollbar-color: #c0c0c0 #f0f0f0;
    }
    
    .rf-filter-sidebar-inner::-webkit-scrollbar {
        width: 8px;
    }
    
    .rf-filter-sidebar-inner::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 4px;
    }
    
    .rf-filter-sidebar-inner::-webkit-scrollbar-thumb {
        background: #c0c0c0;
        border-radius: 4px;
    }
    
    .rf-filter-sidebar-inner::-webkit-scrollbar-thumb:hover {
        background: #a0a0a0;
    }
}

/* ============================================
   Products Section
   ============================================ */
.rf-products-section {
    min-height: 400px;
}

/* Adjust product grid columns for filter layout */
@media (min-width: 1025px) {
    /* With filter sidebar, use 4 columns instead of 5 */
    .rf-shop-content-wrapper .rf-products-grid .products,
    .rf-shop-content-wrapper .woocommerce ul.products,
    .rf-shop-content-wrapper .woocommerce-page ul.products,
    .rf-shop-content-wrapper ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (min-width: 1400px) {
    /* On very large screens, go back to 5 columns */
    .rf-shop-content-wrapper .rf-products-grid .products,
    .rf-shop-content-wrapper .woocommerce ul.products,
    .rf-shop-content-wrapper .woocommerce-page ul.products,
    .rf-shop-content-wrapper ul.products {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

@media (max-width: 1024px) {
    /* On tablets and mobile, use default responsive grid from shop.css */
    .rf-shop-content-wrapper .rf-products-grid .products,
    .rf-shop-content-wrapper .woocommerce ul.products,
    .rf-shop-content-wrapper .woocommerce-page ul.products,
    .rf-shop-content-wrapper ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .rf-shop-content-wrapper .rf-products-grid .products,
    .rf-shop-content-wrapper .woocommerce ul.products,
    .rf-shop-content-wrapper .woocommerce-page ul.products,
    .rf-shop-content-wrapper ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .rf-shop-content-wrapper .rf-products-grid .products,
    .rf-shop-content-wrapper .woocommerce ul.products,
    .rf-shop-content-wrapper .woocommerce-page ul.products,
    .rf-shop-content-wrapper ul.products {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   Mobile Filter Sidebar
   ============================================ */
@media (max-width: 1024px) {
    .rf-shop-content-wrapper {
        display: block; /* Change from grid to block on mobile */
        position: relative;
    }
    
    /* Mobile toggle button */
    .rf-filter-toggle {
        display: flex !important; /* Force display on mobile */
        align-items: center;
        justify-content: center;
        position: fixed;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 100;
        background: var(--color-primary, #2288c9);
        color: #ffffff;
        border: none;
        border-radius: 0 8px 8px 0;
        padding: 1rem 0.5rem;
        cursor: pointer;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
        transition: all 0.3s ease;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        font-size: 0.875rem;
        font-weight: 600;
        letter-spacing: 0.05em;
    }
    
    .rf-filter-toggle:hover {
        padding-right: 0.75rem;
        background: var(--color-primary-dark, #105a88);
    }
    
    .rf-filter-toggle svg {
        width: 20px;
        height: 20px;
        margin-bottom: 0.5rem;
        transform: rotate(90deg);
    }
    
    /* Filter sidebar - slide in from left */
    .rf-filter-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        max-height: 100vh;
        transform: translateX(-100%);
        z-index: 1000;
        transition: transform 0.3s ease;
        overflow-y: auto;
        padding-top: 0; /* Remove top padding on mobile */
    }
    
    .rf-filter-sidebar.is-open {
        transform: translateX(0);
    }
    
    .rf-filter-sidebar-inner {
        border-radius: 0;
        height: 100%;
        padding: 2rem 1.5rem;
        padding-top: 24px;
        border-radius: 15px;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.2);
    }
    
    /* Close button in sidebar header - Only visible on mobile */
    .rf-filter-close {
        display: flex !important; /* Force display on mobile */
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .rf-filter-close:hover {
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.35);
    }
    
    .rf-filter-close svg {
        width: 18px;
        height: 18px;
        color: #ffffff;
    }
    
    /* Overlay when filters are open */
    .rf-filter-overlay {
        display: block !important; /* Show on mobile */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .rf-filter-overlay.is-visible {
        opacity: 1;
        visibility: visible;
    }
    
    /* Hide toggle when sidebar is open */
    .rf-filter-sidebar.is-open ~ .rf-filter-toggle {
        opacity: 0;
        pointer-events: none;
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .rf-filter-sidebar {
        width: 100%;
        max-width: 100%;
    }
    
    .rf-filter-toggle {
        padding: 0.75rem 0.375rem;
        font-size: 0.8125rem;
    }
}

/* ============================================
   Scrollbar Styling for Filter Sidebar
   ============================================ */
.rf-filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.rf-filter-sidebar::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.rf-filter-sidebar::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

.rf-filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* ============================================
   Accessibility - Focus States
   ============================================ */
.rf-filter-toggle:focus-visible,
.rf-filter-close:focus-visible,
.wpc-filter-content a:focus-visible,
.wpc-filter-content button:focus-visible,
.wpc-filter-content input:focus-visible,
.wpc-filter-content select:focus-visible,
.wpc-filters-submit-button:focus-visible {
    outline: 2px solid var(--color-primary, #2288c9);
    outline-offset: 2px;
}

.wpc-filter-content label:focus-within {
    background-color: rgba(34, 136, 201, 0.08);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .rf-filter-sidebar,
    .rf-filter-overlay,
    .rf-filter-toggle,
    .wpc-filter-content *,
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Filter Animations
   ============================================ */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.rf-filter-sidebar.is-open {
    animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rf-filter-overlay.is-visible {
    animation: fadeIn 0.3s ease;
}

/* Loading State Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.wpc-filters-overlay.active,
.wpc-filter-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth Height Transitions for Collapsibles */
.wpc-filter-collapsible-content {
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                padding 0.3s ease;
}

.wpc-filter-collapsible-content.collapsed {
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .rf-filter-sidebar,
    .rf-filter-toggle,
    .rf-filter-overlay {
        display: none !important;
    }
    
    .rf-shop-content-wrapper {
        grid-template-columns: 1fr !important;
    }
}

