/* SearchSidebar.css */

#filters-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 1rem;
}

.filter-boxes {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: center;
}

.filter-box {
    background: #000000;
    overflow: hidden;
    width: 100%;
}

/* Mécanisme Plus de Filtres (Mobile) */
.more-filters-btn {
    display: none;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    color: #fff;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    margin: 0.5rem 0;
}

.more-filters-btn .less-text {
    display: none;
}

.more-filters-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 767px) {
    .more-filters-btn {
        display: flex;
    }

    .more-filters-container {
        display: none;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .more-filters-checkbox:checked~.more-filters-container {
        display: flex;
    }

    .more-filters-checkbox:checked~.more-filters-btn .more-text {
        display: none;
    }

    .more-filters-checkbox:checked~.more-filters-btn .less-text {
        display: inline;
    }

    .more-filters-checkbox:checked~.more-filters-btn svg {
        transform: rotate(180deg);
    }
}

@media (min-width: 768px) {
    .more-filters-container {
        display: contents;
        /* Se comporte comme s'il n'existait pas pour le layout */
    }
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: .75rem;
}

.filter-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.filter-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--fs-base);
    font-weight: 400;
    color: #ffffff;
    text-transform: capitalize;
    margin: 0;
}

.filter-title svg {
    width: 20px;
    height: 20px;
}

.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.filter-toggle.is-open {
    transform: rotate(45deg);
}

.filter-content.is-open .search-wrapper,
.filter-content.is-open .range-filter {
    height: auto;
    margin-top: .5rem;
    padding: 1rem;
    transition: opacity 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
    opacity: 1;
}

.search-wrapper,
.range-filter {
    border: .0625rem solid rgba(255, 255, 255, 0.5);
    border-radius: .75rem;
    height: 0;
    opacity: 0;
}

/* Search input in filters */
.search-box {

    position: relative;
    margin-bottom: 12px;
    height: 3.1875rem;
    background-color: rgba(255, 255, 255, 0.5);
    padding: .5rem;
    border-radius: .5rem;
    display: flex;
    gap: .25rem;
}

.search-input {
    width: 100%;
    height: 2.1875rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    color: #000000;
    background-color: #fff;
    outline: none;
}

.search-btn {
    background: transparent;
    border: none;
    width: 2.1875rem;
    height: 2.1875rem;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border-radius: 50%;
}

.search-btn svg {
    width: 1.3125rem;
    height: 1.3125rem;
    color: #e22415;
}

.search-list {
    position: relative;
    max-height: 8.25rem;
    overflow-y: auto;
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;

    /* Changer le scroll pour avoir la couleur primaire*/
    scrollbar-width: thin;
    scrollbar-color: #e22415 #000000;

    /* Webkit */
    &::-webkit-scrollbar {
        width: 8px;
    }

    &::-webkit-scrollbar-track {
        background: #000000;
    }

    &::-webkit-scrollbar-thumb {
        background: #e22415;
        border-radius: 4px;
    }


    /* Fait en sorte que le scroll ne coupe pas les éléments, peut-être un snap scroll */
    scroll-snap-type: y mandatory;
}

.search-item {
    padding: 8px 12px;
    align-content: center;
    font-size: var(--fs-base);
    color: #fff;
    cursor: pointer;
    border-radius: 6px;
    user-select: none;
    /* min-height: 30px;
    height: auto; */
    display: block;
    scroll-snap-align: start;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.search-item.is-selected {
    background-color: rgb(226, 36, 21);
    color: white;
}

/* Range sliders */
.range-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.range-input {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px;
    font-size: 12px;
    color: #fff;
    text-align: center;
    width: 100%;
}

.range-slider {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.range-slider input[type="range"] {
    position: absolute;
    width: 100%;
    background: transparent;
    appearance: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
}

/* Action buttons */
.filter-submit {
    border-radius: var(--radius-md);
    padding: .625rem 1rem;

    font-weight: 600;
    font-size: var(--fs-base);
    line-height: 150%;
    letter-spacing: -0.01em;
    text-align: center;
    color: #fff;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    border: 1px solid #e22415;
    outline: none;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    z-index: 1;
    background: #050505;
    transition: color 0.3s ease;
    flex-shrink: 0;
    width: max-content;
}

.filter-clear {
    outline: none;
    border: none;
    background-color: transparent;
    width: fit-content;
    margin: 0 auto;
    padding: 0;
    text-align: center;
    font-weight: 400;
    font-size: 14px;
    line-height: 150%;
    letter-spacing: -0.01em;
    text-align: center;
    color: #fff;
    cursor: pointer;
    transition: 0.3s color linear;
}

.filter-clear:hover {
    color: #e22415;
    text-decoration: underline;
}

/* Selected items display in sidebar filters */
.selected-tags {
    padding: .5rem 1rem .75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    background: transparent;
}

.selected-tags:empty {
    display: none;
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .625rem;
    background: rgba(226, 36, 21, 0.9);
    border-radius: .25rem;
    font-family: "Inter", sans-serif;
    font-size: .8125rem;
    font-weight: 500;
    color: #fff;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.selected-tag:hover {
    background: rgba(226, 36, 21, 1);
}

.selected-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
}

.selected-remove:hover {
    transform: scale(1.1);
}

.selected-remove svg {
    width: .625rem;
    height: .625rem;
    fill: #fff;
}

.selected-tags {
    display: flex;
}