.yb-filters-v2 {
    /* #fixheader is a 52px fixed bar once the main YachtBook header scrolls away. */
    --yb-filters-v2-fixed-header-height: 52px;
    --yb-filters-v2-sticky-gap: 0.75rem;
}

.yb-filters-v2-preview-banner {
    background: #ffefbf;
    border-bottom: 1px solid #e6c45e;
    color: #493b12;
    font-size: 0.875rem;
    padding: 0.65rem 0;
}

.yb-filters-v2 [hidden],
.yb-filters-v2-backdrop[hidden] {
    display: none !important;
}

.yb-filters-v2-preview-banner strong {
    display: inline-block;
    letter-spacing: 0.08em;
    margin-right: 0.65rem;
}

.yb-filters-v2-page {
    padding-bottom: 3rem;
    padding-top: 1.5rem;
}

.yb-filters-v2-mode-switch {
    background: #edf5fa;
    border-radius: 999px;
    display: inline-flex;
    margin-bottom: 1rem;
    padding: 0.25rem;
}

.yb-filters-v2-mode-switch a {
    border-radius: 999px;
    color: var(--blue, #123b59);
    font-weight: 600;
    min-width: 7rem;
    padding: 0.6rem 1rem;
    text-align: center;
    text-decoration: none;
}

.yb-filters-v2-mode-switch a[aria-current="page"] {
    background: var(--blue, #123b59);
    color: #fff;
}

.yb-filters-v2-toolbar {
    background: #fff;
    border: 1px solid #d9e3ea;
    border-radius: 0.65rem;
    box-shadow: 0 0.25rem 1rem rgba(10, 42, 64, 0.06);
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
}

.yb-filters-v2-toolbar-main {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.yb-filters-v2-total {
    color: #405665;
}

.yb-filters-v2-total strong {
    color: var(--blue, #123b59);
    font-size: 1.25rem;
}

.yb-filters-v2-open {
    align-items: center;
    background: var(--blue, #123b59);
    border: 0;
    border-radius: 0.45rem;
    color: #fff;
    display: none;
    font-weight: 600;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.55rem 0.85rem;
}

.yb-filters-v2-open [data-preview-filter-count],
.yb-filters-v2-section-count {
    align-items: center;
    background: #fff;
    border-radius: 999px;
    color: var(--blue, #123b59);
    display: inline-flex;
    font-size: 0.75rem;
    height: 1.45rem;
    justify-content: center;
    min-width: 1.45rem;
    padding: 0 0.35rem;
}

.yb-filters-v2-sort {
    align-items: center;
    display: flex;
    gap: 0.55rem;
    margin: 0;
}

.yb-filters-v2-sort span {
    color: #607482;
    font-size: 0.85rem;
    font-weight: 600;
}

.yb-filters-v2-sort select {
    background: #fff;
    border: 1px solid #aabcc8;
    border-radius: 0.4rem;
    color: #173b54;
    min-height: 44px;
    padding: 0.5rem 2.2rem 0.5rem 0.7rem;
}

.yb-filters-v2-active {
    align-items: center;
    border-top: 1px solid #e3ebf0;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.yb-filters-v2-chips {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.yb-filters-v2-chip {
    align-items: center;
    background: #e9f4fa;
    border: 1px solid #c7dfea;
    border-radius: 999px;
    color: #163e58;
    display: inline-flex;
    font-size: 0.82rem;
    gap: 0.4rem;
    min-height: 36px;
    padding: 0.35rem 0.65rem;
}

.yb-filters-v2-chip:hover {
    background: #d9edf7;
}

.yb-filters-v2-clear {
    background: transparent;
    border: 0;
    color: #395f78;
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 40px;
    padding: 0.35rem;
    text-decoration: underline;
    white-space: nowrap;
}

.yb-filters-v2-layout {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
}

.yb-filters-v2-panel {
    background: #f5f9fc;
    border: 1px solid #d7e3ea;
    border-radius: 0.65rem;
    max-height: calc(100vh - var(--yb-filters-v2-fixed-header-height) - (2 * var(--yb-filters-v2-sticky-gap)));
    overflow: auto;
    position: sticky;
    top: calc(var(--yb-filters-v2-fixed-header-height) + var(--yb-filters-v2-sticky-gap));
}

.yb-filters-v2-panel-header {
    align-items: center;
    background: #f5f9fc;
    border-bottom: 1px solid #d7e3ea;
    display: flex;
    justify-content: space-between;
    min-height: 62px;
    padding: 0.6rem 0.85rem;
    position: sticky;
    top: 0;
    z-index: 2;
}

.yb-filters-v2-panel-header h1 {
    color: var(--blue, #123b59);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.yb-filters-v2-close {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0.3rem;
    color: #173b54;
    display: none;
    font-size: 1.15rem;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.yb-filters-v2-section {
    border-bottom: 1px solid #dce6ec;
}

.yb-filters-v2-section-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: #173b54;
    display: flex;
    font-size: 0.95rem;
    font-weight: 700;
    justify-content: space-between;
    min-height: 52px;
    padding: 0.65rem 0.9rem;
    text-align: left;
    width: 100%;
}

.yb-filters-v2-section-meta {
    align-items: center;
    display: flex;
    gap: 0.6rem;
}

.yb-filters-v2-section-count {
    background: var(--blue, #123b59);
    color: #fff;
}

.yb-filters-v2-section-toggle i {
    font-size: 0.75rem;
    transition: transform 160ms ease;
}

.yb-filters-v2-section-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.yb-filters-v2-section-content {
    padding: 0 0.85rem 0.85rem;
}

.yb-filters-v2-option-search {
    display: block;
    margin: 0 0 0.65rem;
    position: relative;
}

.yb-filters-v2-option-search i {
    color: #6e8492;
    left: 0.7rem;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.yb-filters-v2-option-search input {
    border: 1px solid #b9cad4;
    border-radius: 0.4rem;
    min-height: 42px;
    padding: 0.5rem 0.6rem 0.5rem 2rem;
    width: 100%;
}

.yb-filters-v2-options {
    display: grid;
    gap: 0.15rem;
}

.yb-filters-v2-option {
    align-items: center;
    border-radius: 0.35rem;
    color: #294b60;
    cursor: pointer;
    display: grid;
    font-size: 0.875rem;
    gap: 0.55rem;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    margin: 0;
    min-height: 42px;
    padding: 0.35rem 0.4rem;
}

.yb-filters-v2-option:hover {
    background: #e6f0f6;
}

.yb-filters-v2-option input {
    height: 1px;
    left: -10000px;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.yb-filters-v2-checkbox {
    align-items: center;
    background: #fff;
    border: 1.5px solid #829aa9;
    border-radius: 0.22rem;
    display: inline-flex;
    height: 20px;
    justify-content: center;
    width: 20px;
}

.yb-filters-v2-checkbox i {
    color: #fff;
    display: none;
    font-size: 0.7rem;
}

.yb-filters-v2-option input:checked + .yb-filters-v2-checkbox {
    background: var(--blue, #123b59);
    border-color: var(--blue, #123b59);
}

.yb-filters-v2-option input:checked + .yb-filters-v2-checkbox i {
    display: inline-block;
}

.yb-filters-v2-option input:focus-visible + .yb-filters-v2-checkbox,
.yb-filters-v2 button:focus-visible,
.yb-filters-v2 select:focus-visible,
.yb-filters-v2 input[type="search"]:focus-visible,
.yb-filters-v2-mode-switch a:focus-visible {
    box-shadow: 0 0 0 3px rgba(30, 129, 187, 0.35);
    outline: 2px solid #126fa3;
    outline-offset: 2px;
}

.yb-filters-v2-option input:checked ~ .yb-filters-v2-option-name {
    color: #102f43;
    font-weight: 700;
}

.yb-filters-v2-option-count {
    background: #e3edf3;
    border-radius: 999px;
    color: #587181;
    font-size: 0.72rem;
    min-width: 1.8rem;
    padding: 0.15rem 0.4rem;
    text-align: center;
}

.yb-filters-v2-option.has-zero-results {
    opacity: 0.55;
}

.yb-filters-v2-option.is-over-limit,
.yb-filters-v2-option.is-filtered-out {
    display: none;
}

.yb-filters-v2-options.is-expanded .yb-filters-v2-option.is-over-limit:not(.is-filtered-out) {
    display: grid;
}

.yb-filters-v2-show-all {
    background: transparent;
    border: 0;
    color: #126b9e;
    font-size: 0.84rem;
    font-weight: 700;
    min-height: 40px;
    padding: 0.35rem 0.4rem;
}

.yb-filters-v2-panel-footer {
    display: none;
}

.yb-filters-v2-results {
    min-height: 24rem;
    min-width: 0;
    position: relative;
}

.yb-filters-v2-status.yb-filters-v2-error {
    background: #fff0f0;
    border: 1px solid #d98b8b;
    border-radius: 0.4rem;
    color: #7c2020;
    display: block;
    height: auto;
    margin: 0 0 1rem;
    overflow: visible;
    padding: 0.75rem;
    position: static;
    width: auto;
}

.yb-filters-v2-results-inner {
    transition: opacity 150ms ease;
}

.yb-filters-v2-results.is-loading .yb-filters-v2-results-inner {
    opacity: 0.35;
}

.yb-filters-v2-loading {
    align-items: center;
    color: #294b60;
    display: flex;
    flex-direction: column;
    font-weight: 600;
    gap: 0.65rem;
    left: 50%;
    position: absolute;
    top: 5rem;
    transform: translateX(-50%);
    z-index: 3;
}

.yb-filters-v2-pagination {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
    margin: 0 0 1rem;
}

.yb-filters-v2-result-list + .yb-filters-v2-pagination {
    margin: 1rem 0 0;
}

.yb-filters-v2-pagination button {
    background: #fff;
    border: 1px solid #b9cad4;
    border-radius: 0.35rem;
    color: #234b65;
    min-height: 40px;
    min-width: 40px;
}

.yb-filters-v2-pagination button[aria-current="page"] {
    background: var(--blue, #123b59);
    border-color: var(--blue, #123b59);
    color: #fff;
    font-weight: 700;
}

.yb-filters-v2-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.yb-filters-v2-empty {
    background: #f5f9fc;
    border: 1px dashed #b9cad4;
    border-radius: 0.65rem;
    color: #405e72;
    padding: 4rem 1rem;
    text-align: center;
}

.yb-filters-v2-empty > i {
    color: #7192a6;
    font-size: 2rem;
    margin-bottom: 0.8rem;
}

.yb-filters-v2-empty h2 {
    color: #173b54;
    font-size: 1.25rem;
}

.yb-filters-v2-backdrop {
    background: rgba(4, 25, 39, 0.58);
    border: 0;
    inset: 0;
    position: fixed;
    width: 100%;
    z-index: 1040;
}

body.yb-filters-v2-lock {
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .yb-filters-v2-preview-banner span {
        display: block;
        margin-top: 0.15rem;
    }

    .yb-filters-v2-page {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-top: 1rem;
    }

    .yb-filters-v2-mode-switch {
        display: flex;
        width: 100%;
    }

    .yb-filters-v2-mode-switch a {
        flex: 1;
        min-width: 0;
    }

    .yb-filters-v2-toolbar {
        border-radius: 0.5rem;
        position: sticky;
        top: calc(var(--yb-filters-v2-fixed-header-height) + var(--yb-filters-v2-sticky-gap));
        z-index: 20;
    }

    .yb-filters-v2-toolbar-main {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .yb-filters-v2-total {
        display: none;
    }

    .yb-filters-v2-open {
        display: inline-flex;
        justify-self: start;
    }

    .yb-filters-v2-sort {
        justify-content: flex-end;
        min-width: 0;
    }

    .yb-filters-v2-sort > span {
        display: none;
    }

    .yb-filters-v2-sort select {
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .yb-filters-v2-active {
        align-items: flex-start;
    }

    .yb-filters-v2-active > .yb-filters-v2-clear {
        display: none;
    }

    .yb-filters-v2-chips {
        flex-wrap: nowrap;
        margin-right: -0.25rem;
        overflow-x: auto;
        padding-bottom: 0.2rem;
    }

    .yb-filters-v2-chip {
        flex: 0 0 auto;
    }

    .yb-filters-v2-layout {
        display: block;
    }

    .yb-filters-v2-panel {
        border: 0;
        border-radius: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        left: auto;
        max-height: none;
        max-width: 420px;
        overflow: hidden;
        position: fixed;
        right: 0;
        top: 0;
        transform: translateX(105%);
        transition: transform 220ms ease;
        width: min(100%, 420px);
        z-index: 1050;
    }

    .yb-filters-v2-panel.is-open {
        transform: translateX(0);
    }

    .yb-filters-v2-panel-header {
        flex: 0 0 auto;
        position: relative;
    }

    .yb-filters-v2-panel-header .yb-filters-v2-clear {
        margin-left: auto;
        margin-right: 0.4rem;
    }

    .yb-filters-v2-close {
        display: inline-flex;
    }

    .yb-filters-v2-panel-body {
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-bottom: 1rem;
    }

    .yb-filters-v2-panel-footer {
        background: #fff;
        border-top: 1px solid #d7e3ea;
        display: block;
        flex: 0 0 auto;
        padding: 0.7rem max(0.85rem, env(safe-area-inset-right)) max(0.7rem, env(safe-area-inset-bottom)) max(0.85rem, env(safe-area-inset-left));
    }

    .yb-filters-v2-panel-footer .btn {
        min-height: 48px;
    }

    .yb-filters-v2-pending {
        color: #805d00;
        display: block;
        font-size: 0.78rem;
        margin-bottom: 0.4rem;
        text-align: center;
    }

    .yb-filters-v2-pagination {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .yb-filters-v2-panel,
    .yb-filters-v2-results-inner,
    .yb-filters-v2-section-toggle i {
        transition: none;
    }
}
