/**
 * Bulkstar Shop AJAX Filters Styles
 * Theme-safe reset and clean design matching reference perfectly.
 */

:root {
    --bulkstar-accent: #F89D10;
    --bulkstar-accent-light: #FFECC7;
    --bulkstar-accent-text: #E68500;
    --bulkstar-text-dark: #111111;
    --bulkstar-text-body: #333333;
    --bulkstar-border: #EDEDED;
    --bulkstar-radius: 8px;
}

.bulkstar-shop-filter-widget {
    width: 100%;
    font-family: inherit;
    box-sizing: border-box;
}

/* Sidebar Box Container */
.bulkstar-shop-filter-widget .bulkstar-filter-sidebar {
    width: 100%;
    background: #ffffff;
    box-sizing: border-box;
}

/* Header */
.bulkstar-shop-filter-widget .bulkstar-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bulkstar-border);
}

.bulkstar-shop-filter-widget .bulkstar-filter-main-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--bulkstar-text-dark);
    line-height: 1;
}

.bulkstar-shop-filter-widget .bulkstar-filter-clear-all {
    color: #888888;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    transition: color .2s;
    user-select: none;
}

.bulkstar-shop-filter-widget .bulkstar-filter-clear-all:hover {
    color: var(--bulkstar-accent);
}

/* Toggles Section (Promotions & Discounts) */
.bulkstar-shop-filter-widget .bulkstar-filter-toggles-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--bulkstar-border);
}

.bulkstar-shop-filter-widget .bulkstar-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bulkstar-shop-filter-widget .bulkstar-toggle-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--bulkstar-text-dark);
    user-select: none;
}

/* Switch Styling (iOS style) */
.bulkstar-shop-filter-widget .bulkstar-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin: 0;
}

.bulkstar-shop-filter-widget .bulkstar-switch-input {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    position: absolute;
}

.bulkstar-shop-filter-widget .bulkstar-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #D2D4D7;
    transition: .2s ease-in-out;
    border-radius: 34px;
}

.bulkstar-shop-filter-widget .bulkstar-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .2s ease-in-out;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.bulkstar-shop-filter-widget .bulkstar-switch-input:checked + .bulkstar-slider {
    background-color: var(--bulkstar-accent);
}

.bulkstar-shop-filter-widget .bulkstar-switch-input:checked + .bulkstar-slider:before {
    transform: translateX(20px);
}

/* Accordion Filter Groups */
.bulkstar-shop-filter-widget .bulkstar-filter-group {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--bulkstar-border);
}

.bulkstar-shop-filter-widget .bulkstar-filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.bulkstar-shop-filter-widget .bulkstar-group-header {
    all: unset;
    box-sizing: border-box;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    cursor: pointer !important;
    text-align: left !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 0 12px 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    user-select: none;
}

.bulkstar-shop-filter-widget .bulkstar-group-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--bulkstar-text-dark);
    margin: 0;
}

.bulkstar-shop-filter-widget .bulkstar-chevron-icon {
    transition: transform .2s ease;
    color: #333333;
    flex-shrink: 0;
}

.bulkstar-shop-filter-widget .bulkstar-filter-group.bulkstar-collapsed .bulkstar-chevron-icon {
    transform: rotate(-90deg);
}

.bulkstar-shop-filter-widget .bulkstar-filter-group.bulkstar-collapsed .bulkstar-group-body {
    display: none;
}

/* Category Tree (Theme-safe styling) */
.bulkstar-shop-filter-widget .bulkstar-category-tree-list,
.bulkstar-shop-filter-widget .bulkstar-subcategory-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.bulkstar-shop-filter-widget .bulkstar-category-tree-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bulkstar-shop-filter-widget .bulkstar-cat-action {
    all: unset;
    box-sizing: border-box;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    text-align: left !important;
    border: none !important;
    box-shadow: none !important;
    transition: all .15s ease;
    user-select: none;
}

.bulkstar-shop-filter-widget .bulkstar-cat-parent-action {
    padding: 7px 10px !important;
    border-radius: 6px !important;
    color: var(--bulkstar-text-body) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    background: transparent !important;
}

.bulkstar-shop-filter-widget .bulkstar-cat-parent-action:hover {
    color: var(--bulkstar-accent) !important;
}

/* Active Parent Category Pill (Matches User Reference Image) */
.bulkstar-shop-filter-widget .bulkstar-cat-active > .bulkstar-cat-parent-action {
    background: var(--bulkstar-accent-light) !important;
    background-color: var(--bulkstar-accent-light) !important;
    color: var(--bulkstar-accent-text) !important;
    font-weight: 700 !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
}

/* Subcategories */
.bulkstar-shop-filter-widget .bulkstar-subcategory-list {
    margin: 4px 0 6px 0 !important;
    padding-left: 14px !important;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bulkstar-shop-filter-widget .bulkstar-subcat-action {
    padding: 5px 8px !important;
    border-radius: 4px !important;
    color: #444444 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    background: transparent !important;
}

.bulkstar-shop-filter-widget .bulkstar-subcat-action:hover {
    color: var(--bulkstar-accent) !important;
}

.bulkstar-shop-filter-widget .bulkstar-subcat-active > .bulkstar-subcat-action {
    color: var(--bulkstar-accent) !important;
    font-weight: 700 !important;
}

/* Price Range Inputs */
.bulkstar-shop-filter-widget .bulkstar-price-inputs-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.bulkstar-shop-filter-widget .bulkstar-price-input-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #D5D8DC;
    border-radius: 6px;
    padding: 0 10px;
    height: 38px;
    box-sizing: border-box;
    transition: border-color .2s;
}

.bulkstar-shop-filter-widget .bulkstar-price-input-box:focus-within {
    border-color: var(--bulkstar-accent);
}

.bulkstar-shop-filter-widget .bulkstar-curr-prefix {
    color: #777777;
    font-size: 14px;
    margin-right: 4px;
    user-select: none;
}

.bulkstar-shop-filter-widget .bulkstar-price-input {
    all: unset;
    box-sizing: border-box;
    width: 100% !important;
    font-size: 14px !important;
    color: var(--bulkstar-text-dark) !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.bulkstar-shop-filter-widget .bulkstar-price-separator {
    color: #666666;
    font-size: 14px;
    flex-shrink: 0;
}

/* Dual Range Slider */
.bulkstar-shop-filter-widget .bulkstar-dual-slider-container {
    position: relative;
    width: 100%;
    height: 20px;
    display: flex;
    align-items: center;
}

.bulkstar-shop-filter-widget .bulkstar-slider-track-bg {
    position: absolute;
    width: 100%;
    height: 4px;
    background-color: #E8E8E8;
    border-radius: 4px;
    z-index: 1;
}

.bulkstar-shop-filter-widget .bulkstar-slider-track-fill {
    position: absolute;
    height: 4px;
    background-color: var(--bulkstar-accent);
    border-radius: 4px;
    z-index: 2;
}

.bulkstar-shop-filter-widget .bulkstar-range-slider {
    position: absolute;
    width: 100%;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: transparent;
    z-index: 3;
    margin: 0;
    padding: 0;
    border: none;
}

.bulkstar-shop-filter-widget .bulkstar-range-slider::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--bulkstar-accent);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.bulkstar-shop-filter-widget .bulkstar-range-slider::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--bulkstar-accent);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Brands Checkboxes */
.bulkstar-shop-filter-widget .bulkstar-brands-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.bulkstar-shop-filter-widget .bulkstar-brands-list-wrapper::-webkit-scrollbar {
    width: 4px;
}

.bulkstar-shop-filter-widget .bulkstar-brands-list-wrapper::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.bulkstar-shop-filter-widget .bulkstar-brand-checkbox-row {
    all: unset;
    box-sizing: border-box;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 4px 0 !important;
    cursor: pointer !important;
    user-select: none !important;
    color: var(--bulkstar-text-body) !important;
    font-size: 14px !important;
    transition: color .15s;
}

.bulkstar-shop-filter-widget .bulkstar-brand-checkbox-row:hover {
    color: var(--bulkstar-accent) !important;
}

.bulkstar-shop-filter-widget .bulkstar-brand-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

/* Custom Checkbox Square */
.bulkstar-shop-filter-widget .bulkstar-custom-check {
    width: 18px;
    height: 18px;
    border: 1.5px solid #C7C7C7;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #ffffff;
    transition: all .15s ease;
}

.bulkstar-shop-filter-widget .bulkstar-custom-check svg {
    opacity: 0;
    transform: scale(0.6);
    transition: all .15s ease;
}

.bulkstar-shop-filter-widget .bulkstar-brand-checkbox:checked + .bulkstar-custom-check {
    background-color: var(--bulkstar-accent);
    border-color: var(--bulkstar-accent);
}

.bulkstar-shop-filter-widget .bulkstar-brand-checkbox:checked + .bulkstar-custom-check svg {
    opacity: 1;
    transform: scale(1);
}

.bulkstar-shop-filter-widget .bulkstar-brand-name {
    line-height: 1.2;
    font-weight: 400;
}

/* Loading Overlay on Products Container during AJAX */
.bulkstar-products-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity .2s ease;
}
