.jb-suite-search-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 2.2fr);
    max-width: 1160px;
    margin: -1px auto;
    padding: 0 8px;
}

.jb-suite-search-filters {
    width: 100%;
    border-bottom: 1px solid #e5e1d9;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 5;
    overflow-y: visible;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.jb-suite-search-loading .jb-suite-search-filters-inner {
    display: none;
}

.jb-suite-search-filters-skeleton {
    display: none;
    gap: 10px;
    padding: 12px 16px;
    overflow-x: auto;
    max-width: 1160px;
    margin: 0 auto;
}

.jb-suite-search-loading .jb-suite-search-filters-skeleton {
    display: flex;
}

.jb-suite-search-filters-skeleton span {
    display: inline-block;
    height: 28px;
    width: 110px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 200% 100%;
    animation: jb-suite-skeleton 1.2s ease-in-out infinite;
}

.jb-suite-search-filters-inner {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    max-width: 1160px;
    margin: 0 auto;
}

.jb-suite-search-filters-inner::-webkit-scrollbar {
    height: 6px;
}

.jb-suite-search-filters-inner::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}

.jb-suite-filter-chip {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.jb-suite-filter-chip:hover {
    color: #111827;
}

.jb-suite-filter-chip::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 2px;
    margin-bottom: 2px;
}

.jb-suite-filter {
    position: relative;
}

.jb-suite-filters-reset-link {
    border: 0;
    background: transparent;
    color: #111827;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
    display: none;
    align-items: center;
}

.jb-suite-filters-reset-link.is-visible {
    display: inline-flex;
}

.jb-suite-filters-reset-link:hover {
    color: #0056d2;
}

.jb-suite-filter-panel {
    position: absolute;
    top: calc(100% + 20px);
    left: 0;
    background: #fff;
    border: 1px solid #e5e1d9;
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    width: 280px;
    padding: 16px;
    display: none;
    z-index: 50;
}

.jb-suite-filter-panel[data-panel="all-filters"] {
    position: fixed;
    left: auto;
    right: 0;
    top: 50px;
    bottom: 0;
    width: 420px;
    max-width: calc(100% - 32px);
    overflow: auto;
    z-index: 1000;
    border-radius: 0;
}

.jb-suite-filter-panel[data-panel="all-filters"] .jb-suite-filter-panel-footer {
    position: sticky;
    bottom: -20px;
    background: #fff;
    padding: 0;
    border-top: 1px solid #e5e1d9;
    z-index: 2;
    width: 100%;
    left: 0;
}

.jb-suite-filter-panel-footer .jb-suite-filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.jb-suite-filter.is-open .jb-suite-filter-panel {
    display: block;
}

.jb-suite-filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid #e5e1d9;
    padding-bottom: 10px;
}

.jb-suite-filter-panel-header h3 {
    margin: 0;
    font-size: 15px;
}

.jb-suite-filter-close {
    border: 0;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
}

.jb-suite-filter-options {
    display: grid;
    gap: 10px;
    font-size: 14px;
    color: #374151;
}

.jb-suite-filter-group {
    padding: 12px 0;
    border-bottom: 1px solid #eef0f4;
}

.jb-suite-filter-group h4 {
    margin: 0 0 8px;
    font-size: 14px;
}

.jb-suite-filter-options label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jb-suite-category-node {
    display: grid;
    gap: 6px;
}

.jb-suite-category-parent-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.jb-suite-category-parent-option,
.jb-suite-category-child-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.jb-suite-category-parent-option {
    flex: 1 1 auto;
}

.jb-suite-category-children-toggle {
    border: 0;
    background: transparent;
    color: #4b5563;
    width: 24px;
    height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.jb-suite-category-children-toggle span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.jb-suite-category-node.is-open .jb-suite-category-children-toggle span {
    transform: rotate(45deg);
}

.jb-suite-category-children {
    display: grid;
    gap: 6px;
    margin-left: 26px;
}

.jb-suite-category-children[hidden] {
    display: none;
}

.jb-suite-filter-panel[data-panel="categories"] .jb-suite-filter-options {
    max-height: 52vh;
    overflow: auto;
    padding-right: 4px;
}

.jb-suite-filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 20px;
}

.jb-suite-filter-cancel {
    border: 0;
    background: transparent;
    font-weight: 600;
    cursor: pointer;
    color: #374151;
}

.jb-suite-filter-apply {
    border: 0;
    background: #2563eb;
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
}

.jb-suite-filter-reset {
    border: 0;
    background: transparent;
    font-weight: 600;
    cursor: pointer;
    color: #111827;
}

@media (max-width: 991px) {
    body.jb-suite-filters-open {
        overflow: hidden;
    }

    body.jb-suite-filters-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1;
        pointer-events: auto;
    }

    body.jb-suite-filters-open .jb-suite-search-grid {
        pointer-events: none;
    }

    .jb-suite-search-filters {
        z-index: 1;
    }

    .jb-suite-search-grid {
        grid-template-columns: 1fr;
        padding: 12px;
        margin-bottom: 100px;
    }

    .jb-suite-search-filters-inner {
        display: flex;
        gap: 10px;
        padding: 8px 5px;
        max-width: 1160px;
        margin: 0 auto;
        overflow: auto;
    }

    .jb-suite-filter-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
        width: 100%;
        z-index: 10000;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
        overflow: auto;
        background: #fff;
        pointer-events: auto;
    }

    .jb-suite-filter-panel[data-panel="all-filters"] {
        left: auto;
        right: 0;
        top: 0;
        bottom: 0;
        border-radius: 0;
        max-height: none;
        width: 100%;
    }

    .jb-suite-filter-panel[data-panel="all-filters"] .jb-suite-filter-options {
        padding-bottom: 80px;
    }

    .jb-suite-filter-panel-header {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 2;
        padding-top: 16px;
    }

    .jb-suite-filter-actions {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding-bottom: 16px;
    }

    .jb-suite-filter-apply {
        width: auto;
        justify-content: center;
    }
}
