.filters {
    width: 320px;
    min-width: 320px;
    max-height: calc(100vh - 145px);
    background: var(--bg-card);
    border: 1px solid var(--lotus-border);
    border-radius: 18px;
    position: sticky;
    top: 120px;
    overflow: hidden;
}

.filters-form {
    height: 100%;
    max-height: inherit;
    display: flex;
    flex-direction: column;
}

.filters-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid var(--lotus-border);
}

.filters-header h3 {
    font-size: 20px;
    line-height: 1.2;
}

.filters-reset {
    color: #999999;
    text-decoration: none;
    font-size: 13px;
}

.filters-reset:hover {
    color: var(--lotus-red);
}

.filters-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 18px;
}

.filter-group {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
}

.filter-title::-webkit-details-marker {
    display: none;
}

.filter-title::after {
    content: "⌄";
    color: #999999;
    transition: transform 0.2s;
}

.filter-group[open] .filter-title::after {
    transform: rotate(180deg);
}

.filter-count {
    margin-left: auto;
    min-width: 24px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--lotus-soft);
    color: var(--lotus-muted);
    font-size: 12px;
    text-align: center;
}

.filter-options {
    margin-top: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    cursor: pointer;
}

.filters .filter-options .filter-option.filter-option--extra {
    display: none;
}

.filters .filter-group.is-expanded .filter-options .filter-option.filter-option--extra {
    display: flex;
}

.filter-show-more {
    display: inline-block;
    width: auto;
    margin-top: 4px;
    padding: 0;
    background: transparent;
    color: var(--lotus-red);
    border: none;
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
}

.filter-show-more:hover {
    background: transparent;
    text-decoration: underline;
}

.filter-show-more:active {
    transform: none;
}

.filters-actions {
    flex-shrink: 0;
    padding: 14px 18px 18px;
    background: var(--bg-card);
    border-top: 1px solid var(--lotus-border);
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.04);
}

.filters-submit {
    width: 100%;
    padding: 12px;
    background: var(--lotus-red);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
}

.filters-submit:hover {
    background: var(--lotus-red-dark);
}

.filters-submit:active {
    transform: scale(0.98);
}

.filters-empty {
    color: var(--lotus-muted);
    font-size: 14px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox input {
    display: none;
}

.checkbox span {
    position: relative;
    padding-left: 26px;
}

.checkbox span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 16px;
    height: 16px;
    border: 2px solid #cccccc;
    border-radius: 4px;
    background: var(--bg-card);
    transition: 0.2s;
}

.checkbox span::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 5px;
    width: 6px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: 0.2s;
}

.checkbox input:checked + span::before {
    background: var(--lotus-red);
    border-color: var(--lotus-red);
}

.checkbox input:checked + span::after {
    transform: rotate(45deg) scale(1);
}

.checkbox:hover span::before {
    border-color: var(--lotus-red);
}

/* --- Color filter --- */
.filter-options--colors {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.color-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;

    min-height: 34px;
    padding: 6px 8px;

    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;

    cursor: pointer;
    transition: 0.2s;
}

.color-filter-option:hover {
    border-color: var(--lotus-red);
    background: #fff;
}

.color-filter-option input {
    display: none;
}

.color-filter-option__swatch {
    flex-shrink: 0;

    width: 18px;
    height: 18px;

    background: var(--swatch-color);
    border: 1px solid #d1d5db;
    border-radius: 50%;

    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.color-filter-option__name {
    min-width: 0;

    color: var(--lotus-dark);
    font-size: 13px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.color-filter-option input:checked + .color-filter-option__swatch {
    outline: 2px solid var(--lotus-red);
    outline-offset: 2px;
}

.color-filter-option:has(input:checked) {
    border-color: var(--lotus-red);
    background: #fff5f5;
}

.filters .filter-options--colors .filter-option.filter-option--extra {
    display: none;
}

.filters .filter-group.is-expanded .filter-options--colors .filter-option.filter-option--extra {
    display: flex;
}