/**
 * Bivest AJAX Product Filters — styles aligned with Online Shop theme.
 */

.bivest-widget {
    margin-bottom: 0;
}

.bivest-filter-panel {
    font-family: "Open Sans", sans-serif;
    font-size: 14px;
}

.bivest-filter-block {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e8e8;
}

.bivest-filter-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.bivest-filter-toggle {
    display: none;
}

.bivest-filter-block-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin: 0 0 10px;
    padding: 0;
    font-family: "Oswald", sans-serif;
    font-size: 15px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #1d1c22;
    line-height: 1.3;
}

.bivest-filter-block.is-collapsible .bivest-filter-toggle-icon::before {
    content: "\25B6";
    display: inline-block;
    font-size: 10px;
    transition: transform 0.25s ease;
    color: #074d73;
}

.bivest-filter-block.is-collapsible .bivest-filter-toggle:checked + .bivest-filter-block-title .bivest-filter-toggle-icon::before {
    transform: rotate(90deg);
}

.bivest-filter-block.is-collapsible .bivest-filter-toggle:not(:checked) ~ .bivest-filter-list,
.bivest-filter-block.is-collapsible .bivest-filter-toggle:not(:checked) ~ .bivest-price-inputs,
.bivest-filter-block.is-collapsible .bivest-filter-toggle:not(:checked) ~ .bivest-price-slider {
    display: none;
}

.bivest-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

.bivest-filter-item {
    margin: 0 0 6px;
}

.bivest-filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 2px;
    transition: background-color 0.2s ease;
    color: #333;
}

.bivest-filter-checkbox-label:hover {
    background-color: #f3f3f3;
}

.bivest-filter-checkbox-label.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.bivest-filter-checkbox {
    margin: 0;
    accent-color: #074d73;
    flex-shrink: 0;
}

.bivest-filter-term-name {
    flex: 1;
}

.bivest-filter-count {
    color: #888;
    font-size: 12px;
}

.bivest-price-inputs {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.bivest-price-field {
    flex: 1;
}

.bivest-price-field label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.bivest-price-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-size: 14px;
    box-sizing: border-box;
    color: #333;
}

.bivest-price-separator {
    color: #999;
    padding-bottom: 8px;
}

.bivest-price-slider {
    padding: 8px 4px 4px;
}

.bivest-price-slider-track {
    position: relative;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
}

.bivest-price-slider-range {
    position: absolute;
    height: 100%;
    background: #074d73;
    border-radius: 3px;
    left: 0;
    right: 0;
}

.bivest-range-min,
.bivest-range-max {
    position: absolute;
    top: 50%;
    width: 100%;
    height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    transform: translateY(-50%);
}

.bivest-range-min::-webkit-slider-thumb,
.bivest-range-max::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #074d73;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    pointer-events: all;
}

.bivest-range-min::-moz-range-thumb,
.bivest-range-max::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #074d73;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    pointer-events: all;
}

.bivest-filter-reset {
    margin-top: 12px;
}

.bivest-filter-reset-btn {
    width: 100%;
    text-align: center;
    padding: 10px 16px !important;
    font-family: "Oswald", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 14px !important;
    border: 1px solid #ddd !important;
    background: #fff !important;
    color: #1d1c22 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bivest-filter-reset-btn:hover,
.bivest-filter-reset-btn:focus {
    background: #074d73 !important;
    border-color: #074d73 !important;
    color: #fff !important;
}

.bivest-filter-empty {
    color: #888;
    font-size: 13px;
    margin: 0;
}

/* AJAX preload overlay */
.bivest-products-ajax-wrapper {
    position: relative;
    min-height: 120px;
}

.bivest-products-preloader {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(1px);
}

.bivest-products-preloader[hidden] {
    display: none !important;
}

.bivest-preloader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8e8e8;
    border-top-color: #074d73;
    border-radius: 50%;
    animation: bivest-spin 0.7s linear infinite;
}

.bivest-preloader-text {
    font-family: "Oswald", sans-serif;
    font-size: 14px;
    color: #1d1c22;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bivest-products-ajax-wrapper.is-loading .bivest-products-content {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.bivest-products-ajax-wrapper.is-loading {
    aria-busy: true;
}

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

/* Active filters indicator */
.bivest-active-filters-count {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    font-size: 11px;
    background: #074d73;
    color: #fff;
    border-radius: 10px;
    vertical-align: middle;
}

@media (max-width: 767px) {
    .bivest-filter-list {
        max-height: none;
    }

    .bivest-price-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .bivest-price-separator {
        display: none;
    }
}
