.filter-layout {
    display: grid;
    grid-template-columns: minmax(260px, 310px) minmax(0, 1fr);
    align-items: start;
    gap: 28px;
}

.filter-panel {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 116px);
    overflow: hidden;
}

.filter-card {
    display: flex;
    max-height: calc(100vh - 116px);
    overflow: hidden;
    flex-direction: column;
    border: 1px solid #dce5f2;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
}
.filter-card form {
    display: flex;
    min-height: 0;
    overflow: hidden;
    flex: 1;
    flex-direction: column;
}
.filter-card__scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    flex: 1;
}

.filter-card__scroll::-webkit-scrollbar {
    width: 6px;
}

.filter-card__scroll::-webkit-scrollbar-track {
    background: transparent;
}

.filter-card__scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cbd5e1;
}

.filter-card__actions {
    flex: 0 0 auto;
    display: grid;
    gap: 9px;
    padding: 18px 22px 22px;
    background: #fff;
    border-top: 1px solid #e8edf4;
}
.filter-card__header {
    position: relative;
    padding: 24px;
    background:
        radial-gradient(
            circle at top left,
            rgba(37, 99, 235, 0.12),
            transparent 58%
        ),
        linear-gradient(
            145deg,
            #f4f8ff,
            #fff
        );
    border-bottom: 1px solid #e5ebf3;
}

.filter-card__eyebrow {
    display: block;
    margin-bottom: 6px;
    color: #146ef5;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.filter-card__title {
    margin: 0;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.filter-card__description {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.45;
}

.filter-card__count {
    position: absolute;
    top: 22px;
    right: 22px;
    display: inline-flex;
    min-width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border-radius: 999px;
    background: #146ef5;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.filter-group {
    border-bottom: 1px solid #edf1f6;
}

.filter-group:last-of-type {
    border-bottom: 0;
}

.filter-group__summary {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
    color: #172033;
    font-size: 0.94rem;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.filter-group__summary::-webkit-details-marker {
    display: none;
}

.filter-group__summary:hover {
    background: #f8faff;
}

.filter-group__summary-end {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.filter-group__active-count {
    display: inline-flex;
    min-width: 23px;
    height: 23px;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(20, 110, 245, 0.1);
    color: #146ef5;
    font-size: 0.72rem;
    font-weight: 700;
}

.filter-group__chevron {
    width: 9px;
    height: 9px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.filter-group[open] .filter-group__chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.filter-group__content {
    padding: 0 22px 20px;
}

.filter-label {
    margin-bottom: 7px;
    color: #526079;
    font-size: 0.8rem;
    font-weight: 600;
}

.filter-price-input {
    position: relative;
}

.filter-price-input .form-control {
    min-height: 44px;
    padding-right: 48px;
    border-color: #dce3ed;
    border-radius: 12px;
    background: #fafcff;
}

.filter-price-input span {
    position: absolute;
    top: 50%;
    right: 14px;
    color: #94a3b8;
    font-size: 0.77rem;
    font-weight: 700;
    transform: translateY(-50%);
    pointer-events: none;
}

.filter-options {
    display: grid;
    gap: 9px;
}

.filter-options--scroll {
    max-height: 245px;
    overflow-y: auto;
    padding-right: 6px;
}

.filter-options--scroll::-webkit-scrollbar {
    width: 5px;
}

.filter-options--scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cbd5e1;
}

.filter-option {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.filter-option:hover {
    border-color: #e0e7f1;
    background: #f8faff;
}

.filter-option:has(.form-check-input:checked) {
    border-color: rgba(20, 110, 245, 0.22);
    background: rgba(20, 110, 245, 0.065);
}

.filter-option .form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
    border-color: #cbd5e1;
}

.filter-option__label {
    color: #334155;
    font-size: 0.88rem;
    line-height: 1.3;
}

.filter-card__actions {
    position: sticky;
    bottom: 0;
    display: grid;
    gap: 9px;
    padding: 18px 22px 22px;
    background:
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.92),
            #fff 28%
        );
    border-top: 1px solid #e8edf4;
}

.filter-card__actions .btn {
    min-height: 44px;
    border-radius: 12px;
    font-weight: 650;
}

.filter-results-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 20px;
}

.filter-results-header__eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #146ef5;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.filter-results-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.filter-results-header p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 0.92rem;
}

@media (max-width: 1199.98px) {
    .filter-layout {
        grid-template-columns: 270px minmax(0, 1fr);
        gap: 22px;
    }
}

@media (max-width: 991.98px) {
    .filter-layout {
        display: block;
    }

    .filter-panel {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 1055;
        width: min(92vw, 380px);
        height: 100dvh;
        overflow-y: auto;
        background: #fff;
        transform: translateX(100%);
        transition: transform 0.25s ease;
    }

    .filter-panel.is-open {
        transform: translateX(0);
    }

    .filter-card {
        min-height: 100%;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .filter-card__header {
        padding-top: 18px;
    }

    .filter-results-header {
        margin-top: 22px;
    }
}

@media (max-width: 575.98px) {
    .filter-results-header {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-results-header .btn {
        width: 100%;
    }
}
@media (max-width: 991.98px) {
    .filter-panel {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 1055;
        width: min(92vw, 380px);
        height: 100dvh;
        max-height: none;
        overflow-y: auto;
        background: #fff;
        transform: translateX(100%);
        transition: transform 0.25s ease;
    }

    .filter-card {
        min-height: 100%;
        max-height: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .filter-card form {
        overflow: visible;
    }

    .filter-card__scroll {
        overflow: visible;
    }
}