/**
 * Sidebar Filters
 * @package RoiArt
 */

.shop-filters {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.shop-filters__active {
    margin-bottom: var(--space-md);
}

.shop-filters__clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-danger);
    text-decoration: none;
    padding: 8px 14px;
    border: 1px solid var(--color-danger);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.shop-filters__clear::before {
    content: '✕';
    font-size: 11px;
}

.shop-filters__clear:hover {
    background: var(--color-danger);
    color: #fff;
}

/* ── Filter Group ── */

.filter-group {
    border-bottom: 1px solid var(--color-border);
}

.filter-group:first-of-type {
    border-top: 1px solid var(--color-border);
}

.filter-group__header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-primary);
    text-align: left;
    gap: var(--space-sm);
    letter-spacing: 0.02em;
}

.filter-group__header:hover {
    color: var(--color-primary);
}

.filter-group__arrow {
    margin-left: auto;
    transition: transform 0.25s;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.filter-group.is-open .filter-group__arrow {
    transform: rotate(180deg);
}

.filter-group__count {
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.filter-group__body {
    padding-bottom: var(--space-lg);
}

/* ── Price ── */

.filter-price {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-price__input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    background: var(--color-bg-white);
    -moz-appearance: textfield;
    transition: border-color 0.2s;
}

.filter-price__input::-webkit-inner-spin-button,
.filter-price__input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.filter-price__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(154, 71, 233, 0.08);
}

.filter-price__sep {
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 600;
}

.filter-price__currency {
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 700;
}

/* ── Search ── */

.filter-search {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: var(--space-sm);
    transition: border-color 0.2s;
}

.filter-search:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(154, 71, 233, 0.08);
}

/* ── Checklist ── */

.filter-checklist {
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.filter-checklist::-webkit-scrollbar {
    width: 4px;
}

.filter-checklist::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 7px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-secondary);
    transition: background 0.15s;
    line-height: 1.3;
}

.filter-check:hover {
    background: var(--color-bg-light);
}

.filter-check.is-hidden {
    display: none;
}

.filter-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.filter-check__mark {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid #c5c5c5;
    border-radius: 4px;
    background: #fff;
    transition: all 0.15s;
    position: relative;
}

.filter-check:hover .filter-check__mark {
    border-color: var(--color-primary);
}

.filter-check input:checked + .filter-check__mark {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.filter-check input:checked + .filter-check__mark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1.5px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-check__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: var(--color-text-primary);
}

.filter-check__count {
    color: var(--color-text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

/* ── Show More ── */

.filter-show-more {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: var(--space-sm) 0 0;
    text-align: left;
}

.filter-show-more:hover {
    text-decoration: underline;
}

/* ── Submit ── */

.shop-filters__submit {
    margin-top: var(--space-lg);
    width: 100%;
    padding: 13px;
    background: var(--gradient-button);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition-fast);
    letter-spacing: 0.02em;
}

.shop-filters__submit:hover {
    opacity: 0.85;
}

/* ── Responsive ── */

@media (max-width: 991px) {
    .wc-archive__sidebar {
        position: static;
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--color-border);
        padding-bottom: var(--space-md);
        margin-bottom: var(--space-md);
    }

    .shop-filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .filter-group {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        padding: 0 var(--space-sm);
        flex: 0 0 auto;
    }

    .filter-group:first-of-type {
        border-top: 1px solid var(--color-border);
    }

    .filter-group__body {
        position: absolute;
        z-index: 100;
        background: var(--color-bg-white);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-md);
        padding: var(--space-md);
        min-width: 240px;
        top: 100%;
        left: 0;
    }

    .filter-group {
        position: relative;
    }

    .shop-filters__submit {
        flex: 0 0 auto;
        width: auto;
        padding: 10px 24px;
        margin-top: 0;
    }

    .shop-filters__active {
        margin-bottom: 0;
    }
}
