/**
 * filters.css — панель фільтрів
 */

/* ══ SIDEBAR ══ */
.filters-sidebar {
    position: sticky;
    top: calc(var(--header-h) + var(--sp-4));
    width: var(--sidebar-w);
    background: var(--c-surface);
    border-radius: var(--r-xl);
    padding: var(--sp-5);
    box-shadow: var(--shadow-card);
    max-height: calc(100vh - var(--header-h) - var(--sp-8));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--c-border) transparent;
    flex-shrink: 0;
}

.results-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--sp-5); padding-bottom: var(--sp-4);
    border-bottom: 2px solid var(--c-border); gap: var(--sp-3);
}
.results-count { font-size: var(--text-sm); font-weight: 600; color: var(--c-text-muted); }
.results-count strong { color: var(--c-primary); font-size: var(--text-md); font-weight: 800; }

.btn-reset {
    display: none; align-items: center; gap: var(--sp-1);
    padding: var(--sp-1) var(--sp-3); border-radius: var(--r-full);
    background: transparent; border: 1.5px solid var(--c-accent);
    color: var(--c-accent-text); font-size: var(--text-xs); font-weight: 700;
    cursor: pointer; transition: all var(--tr);
}
.btn-reset:hover { background: var(--c-accent-light); transform: scale(1.04); }
.btn-reset.is-visible { display: inline-flex; }

.filter-group { margin-bottom: var(--sp-5); }
.filter-group:last-child { margin-bottom: 0; }
.filter-label {
    display: block; font-size: var(--text-xs); font-weight: 800;
    color: var(--c-primary); text-transform: uppercase;
    letter-spacing: 0.1em; margin-bottom: var(--sp-3);
}

.search-input {
    width: 100%; padding: var(--sp-3) var(--sp-4);
    border: 2px solid var(--c-border); border-radius: var(--r-lg);
    font-size: var(--text-sm); font-family: var(--font-sans);
    color: var(--c-text); background: var(--c-surface);
    transition: border-color var(--tr), box-shadow var(--tr);
}
.search-input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(75,138,201,.15); outline: none; }
.search-input::placeholder { color: var(--c-text-light); }

.filter-btns { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.btn-filter {
    padding: var(--sp-2) var(--sp-3); border-radius: var(--r-full);
    border: 2px solid var(--c-btn-filter-border);
    background: var(--c-btn-filter-bg); color: var(--c-btn-filter-text);
    font-size: var(--text-xs); font-weight: 700;
    cursor: pointer; transition: all var(--tr); white-space: nowrap; line-height: 1.4;
}
.btn-filter:hover { background: var(--c-btn-filter-hover-bg); border-color: var(--c-primary); transform: translateY(-1px); }

/* Активна — тільки колір рамки і тексту, font-weight не чіпаємо */
.btn-filter.active {
    border-color: var(--c-accent);
    border-width: 2px;
    color: var(--c-accent-text);
    background: var(--c-btn-filter-bg);
}

.age-btns .btn-filter { min-width: 2.5rem; text-align: center; padding: var(--sp-2); border-radius: var(--r-md); }

/* ══ АДРЕСА → ЛОКАЦІЯ ══ */
.address-item { margin-bottom: var(--sp-2); }

.address-btn {
    width: 100%; text-align: left;
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md);
    border: 2px solid var(--c-btn-filter-border);
    background: var(--c-btn-filter-bg); color: var(--c-btn-filter-text);
    font-size: var(--text-xs); font-weight: 700;
    cursor: pointer; transition: all var(--tr);
}
.address-btn:hover { border-color: var(--c-primary); }
.address-name { flex: 1; text-align: left; }

.address-btn.active {
    border-color: var(--c-accent);
    border-width: 2px;
    color: var(--c-accent-text);
    background: var(--c-btn-filter-bg);
}

.address-arrow {
    flex-shrink: 0; color: var(--c-text-muted); transition: transform var(--tr);
}
.address-btn.is-open .address-arrow { transform: rotate(90deg); }

.location-list {
    display: none;
    padding: var(--sp-2) 0 0 var(--sp-4);
    flex-direction: row; flex-wrap: wrap; gap: var(--sp-2);
}
.location-list.is-open { display: flex; }

.location-btn {
    padding: var(--sp-1) var(--sp-3); border-radius: var(--r-full);
    border: 1.5px solid var(--c-border);
    background: var(--c-surface); color: var(--c-text-muted);
    font-size: var(--text-xs); font-weight: 600;
    cursor: pointer; transition: all var(--tr);
}
.location-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }

.location-btn.active {
    border-color: var(--c-accent);
    border-width: 2px;
    color: var(--c-accent-text);
    background: var(--c-surface);
}

/* ══ DRAWER ══ */
.filters-drawer {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--c-surface);
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    padding: 0 var(--sp-5) var(--sp-8);
    max-height: 82vh; overflow-y: auto;
    z-index: 200;
    box-shadow: 0 -4px 24px rgba(0,0,0,.15);
    transform: translateY(100%);
    transition: transform var(--tr-slow);
    touch-action: pan-y;
}
.filters-drawer.is-open { transform: translateY(0); }

.drawer-handle {
    display: flex; justify-content: center; align-items: center;
    padding: var(--sp-4) 0 var(--sp-3);
    cursor: grab;
    margin: 0 calc(-1 * var(--sp-5));
    padding-inline: var(--sp-5);
}
.drawer-handle:active { cursor: grabbing; }
.drawer-handle__bar {
    width: 40px; height: 4px;
    background: var(--c-border-dark);
    border-radius: var(--r-full);
}

.drawer-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    z-index: 190; opacity: 0; pointer-events: none;
    transition: opacity var(--tr-slow);
}
.drawer-backdrop.is-visible { opacity: 1; pointer-events: auto; }

/* ══ МЕДІА ══ */
@media (max-width: 1024px) { .filters-sidebar { display: none; } }
@media (min-width: 1025px) { .filters-drawer { display: none; } .drawer-backdrop { display: none; } }