/**
 * Italiashop AJAX Filters - Clean Woodmart-Style Sidebar
 */

.italiashop-filters-container {
    position: relative;
    font-family: inherit;
    color: #333;
    margin-bottom: 30px;
}

/* --- ACTIVE FILTER CHIPS --- */
.itf-active-filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ebebeb;
}

.itf-active-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.itf-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f4f4f4;
    color: #333;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.itf-chip:hover {
    background: #eaeaea;
    border-color: #ccc;
}

.itf-chip-remove {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #888;
    background: none;
    border: none;
    padding: 0;
}

.itf-chip-remove:hover {
    color: #d9534f;
}

.itf-clear-all-btn {
    background: none;
    border: 1px dashed #d9534f;
    color: #d9534f;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.itf-clear-all-btn:hover {
    background: #d9534f;
    color: #fff;
    border-style: solid;
}

/* --- ACCORDION CONTAINER (CLEAN WOODMART FLAT STYLE) --- */
.itf-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.itf-acc-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid #ebebeb;
    border-radius: 0;
    padding-bottom: 22px;
    margin-bottom: 22px;
    overflow: visible;
}

.itf-acc-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* --- ACCORDION HEADER --- */
.itf-acc-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 14px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.itf-acc-title {
    font-size: 18px;
    font-weight: 700;
    color: #242424;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.itf-acc-icon {
    position: relative;
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.itf-acc-icon::before,
.itf-acc-icon::after {
    content: '';
    position: absolute;
    background-color: #767676;
    transition: all 0.2s ease;
}

.itf-acc-icon::before {
    top: 5px;
    left: 0;
    right: 0;
    height: 2px;
}

.itf-acc-icon::after {
    top: 0;
    bottom: 0;
    left: 5px;
    width: 2px;
}

.itf-acc-item:not(.itf-collapsed) .itf-acc-icon::after {
    transform: rotate(90deg);
    opacity: 0;
}

/* --- ACCORDION CONTENT --- */
.itf-acc-content {
    padding: 0;
    border-top: none;
    transition: all 0.25s ease;
}

.itf-acc-item.itf-collapsed .itf-acc-content {
    display: none;
}

/* --- SEARCH INPUT IN FILTERS --- */
.itf-search-box {
    margin-bottom: 12px;
}

.itf-term-search {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.itf-term-search:focus {
    border-color: #333;
}

/* --- LIST OF TERMS (CATEGORIES & ATTRIBUTES) --- */
.itf-term-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 260px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
}

.itf-term-list::-webkit-scrollbar {
    width: 5px;
}

.itf-term-list::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.itf-term-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.itf-term-item {
    margin-bottom: 10px;
}

.itf-term-item:last-child {
    margin-bottom: 0;
}

.itf-sub-term-list {
    list-style: none;
    margin: 8px 0 0 16px;
    padding: 0;
    border-left: 2px solid #eee;
    padding-left: 10px;
}

/* --- CUSTOM CHECKBOX --- */
.itf-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    user-select: none;
    transition: color 0.15s ease;
    line-height: 1.4;
    width: 100%;
}

.itf-checkbox-label:hover {
    color: #000;
}

.itf-checkbox-label input[type="checkbox"] {
    display: none;
}

.itf-custom-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: #fff;
}

.itf-checkbox-label input[type="checkbox"]:checked + .itf-custom-checkbox {
    background: #242424;
    border-color: #242424;
}

.itf-checkbox-label input[type="checkbox"]:checked + .itf-custom-checkbox::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.itf-term-name {
    flex-grow: 1;
}

.itf-term-count {
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 1px 8px;
    font-size: 12px;
    color: #777;
    background: #fff;
    min-width: 20px;
    text-align: center;
    margin-left: 8px;
    font-weight: 400;
    flex-shrink: 0;
    line-height: 1.5;
}

/* --- BRAND / MANUFACTURER STYLES --- */
.itf-brand-item {
    padding: 2px 0;
}

.itf-brand-logo-wrap {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 10px;
}

.itf-brand-logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease;
}

.itf-brand-item:hover .itf-brand-logo {
    transform: scale(1.08);
}

.itf-brand-item .itf-term-name {
    font-size: 14px;
    font-weight: 500;
    color: #2b2b2b;
}

/* --- PRICE SLIDER (MATCHING SCREENSHOT) --- */
.itf-price-filter-wrap {
    padding: 4px 0 6px 0;
}

.itf-range-slider {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
    margin: 8px 0 16px 0;
}

/* Base track line */
.itf-range-slider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e5e5e5;
    z-index: 1;
}

/* Active range track line */
.itf-slider-track {
    position: absolute;
    height: 2px;
    background-color: #242424;
    top: 50%;
    margin-top: -1px;
    z-index: 2;
    border-radius: 0;
}

/* Transparent overlaid range inputs */
.itf-range-slider input[type="range"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    outline: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    z-index: 5;
}

/* WebKit slider thumb: 4px wide, 14px high vertical black bar */
.itf-range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 4px;
    height: 14px;
    background: #242424;
    border: none;
    border-radius: 0;
    cursor: ew-resize;
    pointer-events: auto;
    position: relative;
    z-index: 10;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.itf-range-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scaleY(1.15);
    background-color: #000;
}

/* Mozilla slider thumb */
.itf-range-slider input[type="range"]::-moz-range-thumb {
    width: 4px;
    height: 14px;
    background: #242424;
    border: none;
    border-radius: 0;
    cursor: ew-resize;
    pointer-events: auto;
    position: relative;
    z-index: 10;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.itf-range-slider input[type="range"]::-moz-range-thumb:hover {
    transform: scaleY(1.15);
    background-color: #000;
}

.itf-range-slider input[type="range"]::-moz-range-track {
    background: transparent;
    border: none;
}

/* Controls Row: "Цена: 0 € — 1 600 €" on left, "[Филтър]" button on right */
.itf-price-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.itf-price-text-wrap {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.itf-price-prefix {
    color: #767676;
    font-size: 14px;
    font-weight: 400;
}

.itf-price-values {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    color: #242424;
    font-weight: 700;
    font-size: 14px;
}

.itf-price-sep {
    color: #767676;
    font-weight: 400;
}

.itf-price-apply-btn {
    background-color: #242424;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.itf-price-apply-btn:hover {
    background-color: #000000;
    color: #ffffff;
}

.itf-price-apply-btn:active {
    transform: scale(0.96);
}

/* --- AJAX LOADING STATE ON PRODUCTS --- */
.itf-products-loading {
    position: relative;
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.itf-products-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.4);
    z-index: 10;
}

.itf-products-loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #242424;
    border-radius: 50%;
    animation: itf-spin 0.8s linear infinite;
    z-index: 9999;
}

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

.itf-no-products {
    padding: 30px;
    text-align: center;
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 8px;
    color: #666;
    font-size: 15px;
    margin: 20px 0;
}