/* Backdrop */
.filter-sheet-backdrop {
    display: none;
}

/* Chips de filtros ativos */
.active-filters-card {
    display: none;
}

@media (max-width: 767px) {

    .active-filters-card {
        display: block;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
        padding: 10px;
        margin: 0 0 12px;
        overflow: hidden;
    }

    .active-filters-scroll {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        max-width: 100%;
    }

        .active-filters-scroll .filter-chip {
            flex: 0 0 auto;
            white-space: nowrap;
        }

    .active-filters-scroll {
        display: inline-flex;
        gap: 8px;
    }

    .filter-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: #f0f2f5;
        color: #333;
        border-radius: 999px;
        padding: 6px 10px;
        font-size: 12px;
        line-height: 1;
        white-space: nowrap;
        text-decoration: none;
        border: 1px solid #e0e2e6;
    }

        .filter-chip:hover,
        .filter-chip:focus {
            text-decoration: none;
            color: #333;
            background: #e6e8ec;
        }

    .filter-chip-remove {
        font-weight: bold;
        font-size: 14px;
        line-height: 1;
        opacity: .6;
    }

    .filter-chip-clear-all {
        background: transparent;
        border: 1px solid #d9534f;
        color: #d9534f;
        font-weight: 600;
    }

    /* Backdrop */
    .filter-sheet-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, .45);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease;
        z-index: 999998;
    }

        .filter-sheet-backdrop.is-open {
            opacity: 1;
            visibility: visible;
        }

    /* Bottom sheet */
    .filter-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 85vh;
        background: #fff;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, .15);
        z-index: 999999;
        display: flex;
        flex-direction: column;
        transform: translateY(100%);
        transition: transform .3s cubic-bezier(.32, .72, 0, 1);
        touch-action: none;
    }

        .filter-sheet.is-open {
            transform: translateY(0);
        }

        .filter-sheet.is-dragging {
            transition: none;
        }

    .filter-sheet-handle {
        display: flex;
        justify-content: center;
        padding: 10px 0 6px;
        cursor: grab;
    }

        .filter-sheet-handle span {
            width: 36px;
            height: 4px;
            border-radius: 4px;
            background: #d8d8d8;
        }

    .filter-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px 10px;
        border-bottom: 1px solid #eee;
    }

        .filter-sheet-header h4 {
            margin: 0;
            font-size: 16px;
            font-weight: 600;
        }

    .filter-sheet-close {
        border: none;
        background: transparent;
        font-size: 24px;
        line-height: 1;
        color: #999;
        padding: 4px 8px;
    }

    .filter-sheet-body {
        flex: 1 1 auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 0 16px;
    }

    .filter-sheet-footer {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid #eee;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, .06);
        background: #fff;
    }

    /* Accordion por nível */
    .filter-accordion-item .list-group-item-heading {
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        outline: none;
    }

    .filter-accordion-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 999px;
        background: #337ab7;
        color: #fff;
        font-size: 11px;
        font-weight: 600;
    }

    .filter-accordion-chevron {
        margin-left: auto;
        transition: transform .2s ease;
    }

    .filter-accordion-item .list-group-item-heading[aria-expanded="true"] .filter-accordion-chevron,
    .filter-accordion-item.is-expanded .filter-accordion-chevron {
        transform: rotate(180deg);
    }

    .category-tree-list {
        margin: 8px 0 4px;
    }

    .category-tree-item {
        padding: 6px 0;
    }
}

/* Busca recente */
.recent-searches-dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e0e2e6;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
    z-index: 30;
    overflow: hidden;
}

    .recent-searches-dropdown.is-open {
        display: block;
    }

.recent-searches-title {
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: .04em;
}

.recent-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
}

    .recent-search-item:hover {
        background: #f7f7f8;
    }

.recent-search-item-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-search-item-remove {
    border: none;
    background: transparent;
    color: #999;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
}

    .recent-search-item-remove:hover {
        color: #d9534f;
    }

.search-field-wrapper {
    position: relative;
}
