/* path: /wp-content/themes/bedrebyttede/assets/css/components/surface-states.css */

/* Core Transition Tokens for Surface Elements */
:root {
    --surface-transition-glide: transform 0.4s var(--ease-out), opacity 0.3s ease;
    --surface-transition-stagger: 0.05s;
}

/* Section Card States */
.bb-filter-section {
    transition: var(--surface-transition-glide);
}

/* Loading / Empty States */
.bb-filter-empty-hint {
    font-size: var(--fs-sm);
    color: var(--text-3);
    padding: var(--space-4);
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: var(--radius-2);
    margin: var(--space-4) 0;
}

/* Interactive Feedback */
.bb-toggle-box input:checked+span {
    transition: all var(--dur-2) var(--ease-out);
}

/* Scroll Shadow States (Optional polish for long lists) */
.bb-filter-surface__body {
    position: relative;
}

.bb-filter-surface__body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--space-8);
    background: linear-gradient(to top, var(--surface) 0%, transparent 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bb-filter-surface__body[data-scrolled="true"]::after {
    opacity: 1;
}

/* Smart Floating Footer States */
/* Smart Floating Footer States */
.bb-filter-surface__foot {
    transition: opacity 0.3s var(--ease-out), transform 0.4s var(--ease-out), visibility 0.3s;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    position: absolute;
    bottom: 30px;
    /* Margin bottom */
    left: 50%;
    transform: translateX(-50%);
    /* Centered */
    width: 60%;
    /* Pill width */
    min-width: fit-content;
    max-width: 320px;
    z-index: 20;

    /* Liquid Glass Pill Styling */
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    /* Semi-transparent for glass */
    backdrop-filter: blur(12px);
    /* Blur effect */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    /* Soft shadow */
    padding: 2px;
    /* Internal spacing for content */

    /* Safe area and mobile polish */
    margin-bottom: env(safe-area-inset-bottom, 0);
}

[data-bb-total-count] {
    transition: opacity 0.2s ease;
    display: inline-block;
    min-width: 1ch;
}

[data-bb-total-count]:empty::before {
    content: '…';
}

/* Dark mode adjustment if generic --surface-inverse exists, mostly hardcoded for effect now */
@media (prefers-color-scheme: dark) {
    .bb-filter-surface__foot {
        background: rgba(30, 30, 30, 0.75);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Hidden state applied by JS during focus */
.bb-filter-surface.is-foot-hidden .bb-filter-surface__foot {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 20px);
    /* Keep centered + slide down */
    pointer-events: none;
}

/* Base Body Clearance */
.bb-filter-surface__body {
    scroll-behavior: smooth;
    padding-bottom: 120px !important;
}

/* === Modern Toggle Switch (Simple iOS style) === */
.bb-switch-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: var(--space-2) 0;
}

.bb-switch-wrap .bb-field__label {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--text);
    font-weight: 500;
}

.bb-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.bb-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.bb-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--line);
    /* Unchecked bg */
    transition: .3s;
    border-radius: 34px;
}

.bb-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bb-switch input:checked+.bb-switch-slider {
    background-color: var(--brand);
    /* Checked bg */
}

.bb-switch input:focus+.bb-switch-slider {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand);
}

.bb-switch input:checked+.bb-switch-slider:before {
    transform: translateX(20px);
}

/* === Dynamic Spec Reset UI === */
.bb-spec-reset-wrap {
    display: flex;
}

button.bb-link {
    background: none;
    border: none;
    padding: 0;
    font-size: var(--fs-xs);
    cursor: pointer;
}


/* === Generic Disabled Button Polish === */
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(1);
}