/* =================================================================     1. Обертка и активные фильтры     ================================================================= */
.awf-active-wrapper {
    margin-bottom: 20px;
    width: 100%;
}
.awf-active-filters {
    padding: 15px;
    background: #f7f7f7;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}
.awf-active-title {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
}
.awf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Активные чипы */
.awf-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #333;
    color: #fff;
    border-radius: 100px;
    font-size: 13px;
    text-decoration: none;
    transition: background .2s;
}
.awf-chip:hover {
    background: #000;
    color: #fff;
}
.awf-chip-x {
    font-size: 16px;
    line-height: 1;
    font-weight: bold;
    margin-left: 2px;
}
.awf-clear-all {
    display: inline-flex;
    padding: 6px 10px;
    font-size: 13px;
    color: #e74c3c;
    text-decoration: underline;
    font-weight: 500;
}

/* =================================================================     2. Дерево категорий и аккордеон     ================================================================= */
.awf-cat-tree, 
.awf-cat-tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.awf-cat-item {
    margin: 0;
}
.awf-cat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.awf-cat-toggle {
    background-color: transparent !important;
    background-image: url('/wp-content/plugins/artfyodorov-woodmart-filter/assets/img/dropdown.svg') !important;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 14px;
    border: none !important;
    padding: 0 !important;
    width: 16px;
    height: 16px;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.awf-cat-toggle[aria-expanded="true"] {
    transform: rotate(180deg);
}
.awf-cat-toggle-empty {
    background-image: none !important;
    pointer-events: none;
}

.awf-cat-link {
    text-decoration: none;
    color: #444;
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.awf-cat-link:hover {
    color: #000;
}
.awf-cat-link.is-current {
    font-weight: 700;
    color: #000;
}
.awf-cat-count {
    color: #999;
    font-size: 11px;
}
.awf-cat-children {
    padding-left: 15px;
    margin-top: 4px;
    border-left: 1px solid #eee;
}
.awf-cat-up {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
}
.awf-cat-up:hover {
    color: #000;
}

/* =================================================================     3. Внутренние блоки и кнопка "Показать ещё"     ================================================================= */
.awf-scroll-wrap {
    width: 100%;
    height: auto;
}
.awf-scroll-wrap.awf-collapsible {
    max-height: 150px;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.awf-scroll-wrap.awf-collapsible.is-expanded {
    max-height: 2500px;
}

.awf-toggle-more {
    display: inline-block;
    margin-top: 8px;
    padding: 0;
    background: transparent;
    border: none;
    color: #0083ff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    outline: none;
}
.awf-toggle-more:hover {
    color: #0060ba;
    text-decoration: none;
}

/* Оформление атрибутов (чипсов) */
.awf-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 0 15px 0;
}
.awf-option input {
    display: none !important;
}

.awf-option {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 100px;
    background: #2f485f;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1;
    color: #fff;
}
.awf-option:hover {
    background: #3c5a75;
    color: #fff;
}
.awf-option.is-checked {
    background: #0083ff;
    color: #fff;
    border-color: #0083ff;
}
.awf-option.is-checked:hover {
    background: #0070d9;
    border-color: #0070d9;
}

.awf-option-name {
    display: flex;
    color: inherit;
    font-weight: 400;
}
.awf-option.is-checked .awf-option-name {
    font-weight: 500;
}
.awf-option-count {
    color: inherit;
    opacity: 0.6;
    font-size: 12px;
    margin-left: 8px;
}
.awf-option.is-checked .awf-option-count {
    opacity: 0.9;
}

/* =================================================================     4. Горизонтальный скролл и слайдер     ================================================================= */
.awf-slider-wrap {
    position: relative;
    width: 100%;
}

.filters-inner-area {
    display: flex !important;
    flex-wrap: nowrap !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 20px;
    padding-bottom: 25px !important;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filters-inner-area::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.filters-inner-area.is-dragging {
    cursor: grabbing;
    user-select: none;
    scroll-behavior: auto !important;
}

/* Фикс карточек виджетов */
.filter-widget {
    flex: 0 0 280px !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    height: auto !important;
    min-height: 100px !important;
    max-height: none !important;
    box-sizing: border-box !important;
    margin-bottom: 0 !important;
    overflow: visible !important;
}

/* =================================================================     5. Кнопки-стрелки прокрутки (сброс темы и стилизация)     ================================================================= */
button.awf-scroll-btn {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px !important;
    height: 40px !important;
    min-height: unset !important;
    min-width: unset !important;
    border-radius: 50%;
    background: #ffffff !important;
    border: 1px solid #e5e5e5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 !important;
    text-transform: none !important;
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

button.awf-scroll-btn:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18) !important;
    transform: translateY(-50%) scale(1.05);
}

button.awf-scroll-btn.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.awf-scroll-btn--prev {
    left: -18px;
}
.awf-scroll-btn--next {
    right: -18px;
}

/* Настройка тега <img> внутри кнопки прокрутки */
button.awf-scroll-btn .awf-scroll-btn-icon {
    width: 14px !important;
    height: 14px !important;
    max-width: none !important;
    border: none !important;
    box-shadow: none !important;
    display: block;
    object-fit: contain;
}

/* Повороты для стрелок с использованием файла dropdown.svg */
.awf-scroll-btn--prev .awf-scroll-btn-icon {
    content: url('/wp-content/plugins/artfyodorov-woodmart-filter/assets/img/dropdown.svg');
    transform: rotate(90deg);
}

.awf-scroll-btn--next .awf-scroll-btn-icon {
    content: url('/wp-content/plugins/artfyodorov-woodmart-filter/assets/img/dropdown.svg');
    transform: rotate(-90deg);
}

@media (max-width: 768px) {
    button.awf-scroll-btn {
        display: none;
    }
}