/* ============================================
   filters.css — v1.2 (только фильтры, без дублей)
   ============================================ */
.filters-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

@media (max-width: 768px) {
    .filters-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        margin-bottom: 1rem;
    }
}

.filters-sidebar h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.3rem;
}

.filter-group input[type="text"],
.filter-group input[type="number"] {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.filter-group input[type="text"]:focus,
.filter-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
}

.radio-group input[type="radio"]:checked {
    accent-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-light);
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-inputs input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.range-inputs span {
    color: var(--text-light);
}

.price-slider {
    margin-top: 0.5rem;
}

.price-slider input[type="range"] {
    width: 100%;
    margin: 0.3rem 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.price-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-light);
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.filter-actions .btn-block {
    width: 100%;
    justify-content: center;
}

.catalog-header {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.catalog-header .result-count {
    font-size: 0.85rem;
    color: var(--text-light);
}

.catalog-header select {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    background: #fff;
}

/* ===== ПОИСК С КРЕСТИКОМ ===== */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper input {
    width: 100%;
    padding-right: 2.5rem;
}

.search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    display: none;
    /* скрыт по умолчанию */
    color: #94a3b8;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    line-height: 0;
}

.search-clear:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.search-clear:active {
    background: #e2e8f0;
}

.search-wrapper input:not(:placeholder-shown)~.search-clear {
    display: block;
    /* показываем, когда есть текст */
}