/* Auction filters on the listing pages (fragments/bidFilterBar.html).
   Direction follows the page: the rows are flex, so Kurdish and Arabic (body.rtl) mirror on their own. */

.bid-filters {
    margin: 0 0 20px;
}

.bid-filters__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.bid-filters__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #d5d9e0;
    border-radius: 20px;
}

.bid-filters__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #5687f6;
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

.bid-filters__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bid-filters__clear-all {
    margin-inline-start: auto;
}

/* ---- chips ---- */
.bid-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 4px 14px;
    border: 1px solid #d5d9e0;
    border-radius: 20px;
    background: #fff;
    color: #1c2434;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}

.bid-chip:hover {
    border-color: #5687f6;
}

.bid-chip:focus-visible {
    outline: 2px solid #5687f6;
    outline-offset: 2px;
}

.bid-chip--on {
    background: #5687f6;
    border-color: #5687f6;
    color: #fff;
    font-weight: 600;
}

.bid-chip--day {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding-top: 6px;
    padding-bottom: 6px;
}

.rtl .bid-chip--day {
    align-items: flex-end;
}

.bid-chip--day small {
    font-size: 11px;
    opacity: .75;
}

/* The date chip is the date input, drawn as a chip. */
.bid-chip--date {
    position: relative;
}

.bid-chip--date input[type="date"] {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 0;
    min-width: 130px;
    cursor: pointer;
}

.bid-chip--on input[type="date"] {
    color-scheme: dark;
}

/* ---- panel ---- */
.bid-filters__panel {
    background: #fff;
}

.bid-filters__body {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
}

.bid-filters__group {
    min-width: 0;
}

.bid-filters__label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-weight: 600;
}

.bid-filters__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bid-filters__failed {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bid-filters__state {
    padding: 32px 16px;
    text-align: center;
}

.bid-filters__backdrop {
    display: none;
}

/* Large screens: the panel is a bar under the summary row. */
@media (min-width: 992px) {
    .bid-filters__panel {
        margin-top: 8px;
        padding: 14px 18px;
        border: 1px solid #e4e7ec;
        border-radius: 12px;
    }

    .bid-filters__summary:not(:has(.bid-filters__clear-all)) {
        display: none;
    }

    .bid-filters__clear-all {
        margin-inline-start: 0;
    }
}

/* Below that: a sheet from the bottom, over a dimmed page. */
@media (max-width: 991.98px) {
    /* Filters button and Clear all share the first row; the chips of what is on wrap beneath. */
    .bid-filters__chips {
        order: 3;
        flex-basis: 100%;
    }

    .bid-filters__panel {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 1060;
        display: flex;
        flex-direction: column;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, .18);
        transform: translateY(105%);
        visibility: hidden;
        transition: transform .25s ease, visibility 0s .25s;
    }

    .bid-filters__panel.is-open {
        transform: translateY(0);
        visibility: visible;
        transition: transform .25s ease;
    }

    .bid-filters__panel-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px 8px;
    }

    .bid-filters__body {
        flex-direction: column;
        flex: 1 1 auto;
        overflow-y: auto;
        padding: 8px 16px 16px;
    }

    .bid-filters__panel-foot {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid #e4e7ec;
    }

    .bid-filters__panel-foot .btn {
        display: block;
        width: 100%;
        white-space: nowrap;
    }

    .bid-filters__backdrop {
        position: fixed;
        inset: 0;
        z-index: 1055;
        display: block;
        background: rgba(0, 0, 0, .4);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
    }

    .bid-filters__backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    body.bid-filters-open {
        overflow: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bid-filters__panel,
    .bid-filters__backdrop,
    .bid-chip {
        transition: none;
    }
}
