/* Category Pills Horizontal Scrollbar on Mobile */
.horizontal-menu {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
.horizontal-menu::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Custom styling for book filter facet checkboxes with custom scrollbars */
.book-filter-options {
    max-height: 140px;
    overflow-y: auto;
    overscroll-behavior: auto;
}

.book-filter-options label {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.35;
    cursor: pointer;
}

.book-filter-options input[type="checkbox"],
.book-filter-options input[type="radio"] {
    flex: 0 0 auto;
    margin-right: 0.5rem;
}

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

.book-filter-options::-webkit-scrollbar-thumb {
    background-color: #ced4da;
    border-radius: 999px;
}

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

/* Ensure form preserves flex column in scrollable modal */
.modal-dialog-scrollable #filter-form {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.modal-dialog-scrollable #filter-form .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Ensure modal and backdrop sit above fixed header navbar (z-index: 9999) */
#filter-section {
    z-index: 10500 !important;
}

.modal-backdrop {
    z-index: 10400 !important;
}

#filter-section .modal-content {
    max-height: 88vh;
}

@media (max-width: 575.98px) {
    #filter-section .modal-dialog {
        margin: 0.5rem auto;
        max-height: calc(100vh - 1rem);
    }

    #filter-section .modal-content {
        max-height: calc(100vh - 1rem);
    }

    #filter-section .modal-header {
        padding: 0.75rem 1rem;
    }
}

