.bmw-ajax-filters-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bmw-ajax-filters-panel,
.bmw-ajax-filters-spacer {
    display: none;
}

.bmw-ajax-filters-overlay {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 16px;
    background: rgb(255 255 255 / 75%);
    color: #1e1e1e;
    font: inherit;
    font-weight: 600;
    cursor: progress;
}

.bmw-ajax-filters-overlay[hidden] {
    display: none;
}

.bmw-ajax-filters-pending-removal {
    opacity: 0.5;
    text-decoration: line-through;
}

.bmw-ajax-filters-overlay::before {
    content: '';
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-inline-end: 10px;
    border: 2px solid #ddd;
    border-top-color: var(--primary-bg-color, #1e1e1e);
    border-radius: 50%;
    animation: bmw-ajax-filters-spin 0.8s linear infinite;
}

@keyframes bmw-ajax-filters-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .bmw-ajax-filters-overlay::before {
        animation: none;
    }
}

main.site-content.bmw-ajax-filters-loading {
    opacity: 0.55;
    pointer-events: none;
}

@media screen and (max-width: 768px) {
    #sidebar-shop .bmw-ajax-filters-spacer {
        display: block;
        flex: 0 0 auto;
    }

    #sidebar-shop .bmw-ajax-filters-panel {
        display: block;
        position: fixed;
        left: var(--bmw-ajax-panel-left, 0px);
        bottom: 0;
        width: var(--bmw-ajax-panel-width, 100%);
        box-sizing: border-box;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
        z-index: 100;
        background: #fff;
        border-top: 1px solid #e5e5e5;
        box-shadow: 0 -4px 12px rgb(0 0 0 / 6%);
    }

    #sidebar-shop .bmw-ajax-filters-panel[hidden] {
        display: none;
    }

    #sidebar-shop .bmw-ajax-filters-show,
    #sidebar-shop .bmw-ajax-filters-clear {
        display: block;
        box-sizing: border-box;
        width: 100%;
        min-height: 44px;
        margin: 0;
        padding: 12px 16px;
        border: 0;
        border-radius: 8px;
        background: var(--primary-bg-color, #1e1e1e);
        color: var(--primary-text-color, #fff);
        font: inherit;
        font-weight: 600;
        line-height: 1.4;
        text-align: center;
        text-transform: none;
        white-space: normal;
        cursor: pointer;
    }

    #sidebar-shop .bmw-ajax-filters-clear {
        margin-top: 8px;
        border: 1px solid var(--dark-color, #212121);
        background: transparent;
        color: var(--dark-color, #212121);
    }

    #sidebar-shop .bmw-ajax-filters-clear[hidden] {
        display: none;
    }

    #sidebar-shop .bmw-ajax-filters-show:focus-visible,
    #sidebar-shop .bmw-ajax-filters-clear:focus-visible {
        outline: 2px solid var(--primary-bg-color, #1e1e1e);
        outline-offset: 3px;
    }

    #sidebar-shop .bmw-ajax-filters-show:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    #sidebar-shop .bmw-ajax-filters-show[aria-busy="true"] {
        cursor: progress;
    }
}

.bmw-filter-challenge {
    box-sizing: border-box;
    width: min(440px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 32px 28px 24px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    color: #262626;
    box-shadow: 0 24px 80px rgb(0 0 0 / 24%);
    font: inherit;
    text-align: center;
}

.bmw-filter-challenge::backdrop {
    background: rgb(15 23 32 / 55%);
    backdrop-filter: blur(4px);
}

.bmw-filter-challenge__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: #14ad51;
    color: #fff;
    font-size: 24px;
}

.bmw-filter-challenge h2 {
    margin: 0 0 12px;
    font-size: 24px;
    line-height: 1.25;
    color: inherit;
}

.bmw-filter-challenge p {
    margin: 0 0 24px;
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

.bmw-filter-challenge__widget {
    display: flex;
    justify-content: center;
    min-height: 65px;
    margin-bottom: 24px;
}

.bmw-filter-challenge .bmw-filter-challenge__countdown {
    margin: 0;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

@media not all and (min-width: 360px) {
    .bmw-filter-challenge { padding: 24px 16px; }
}

.bmw-shape-challenge {
    box-sizing: border-box;
    width: min(440px, calc(100vw - 24px));
    height: min(650px, calc(100dvh - 24px));
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 32px 0 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 80px rgb(0 0 0 / 24%);
}

.bmw-shape-challenge::backdrop {
    background: rgb(15 23 32 / 55%);
    backdrop-filter: blur(4px);
}

.bmw-shape-challenge iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.bmw-shape-challenge__close {
    position: absolute;
    top: 2px;
    right: 8px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--dark-color, #212121);
    font-size: 24px;
    line-height: 28px;
    cursor: pointer;
}
