.bd-filters-modern {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.bd-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    cursor: pointer;
    padding: 8px;
    margin: -8px -8px 8px -8px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.bd-filters-header:hover {
    background: #f8f9fa;
}

.bd-filters-title {
    font-weight: 600;
    font-size: 16px;
    color: #495057;
    flex: 1;
    pointer-events: none;
}

.bd-filters-minimize {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    color: #6c757d;
    transition: all 0.2s ease;
    line-height: 1;
}

.bd-filters-minimize:hover {
    background: #e9ecef;
    color: #495057;
}

.bd-filters-modern.minimized {
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.bd-filters-modern.minimized:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.bd-filters-modern.minimized .bd-filters-content {
    display: none;
}

.bd-filters-modern.minimized .bd-filters-header {
    margin-bottom: 0;
}

.bd-filters-modern.minimized .bd-filters-title {
    font-size: 14px;
}

.bd-filters-modern.minimized .bd-filters-minimize {
    display: none;
}

.bd-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.bd-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bd-filter-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin: 0;
}

.bd-size-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}

.bd-size-toggle {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bd-size-toggle:hover {
    border-color: #007bff;
}

.bd-size-toggle:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.bd-size-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    margin-top: 4px;
    padding: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 300px;
    max-width: 500px;
    width: max-content;
    max-height: 400px;
    overflow: hidden;
    flex-direction: column;
}

.bd-size-menu.open {
    display: flex;
}

.bd-size-search {
    width: calc(100% - 24px);
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    margin: 12px 12px 0 12px;
    outline: none;
    flex-shrink: 0;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.bd-size-search:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

.bd-size-search::placeholder {
    color: #999;
    font-style: italic;
}

.bd-group-hidden {
    display: none;
}

.bd-bh-band-group {
    margin-bottom: 12px;
}

.bd-bh-band-group:last-child {
    margin-bottom: 0;
}

.bd-bh-band-header {
    font-size: 12px;
    font-weight: 600;
    color: #007bff;
    background: #f8f9ff;
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    text-align: left;
    border: 1px solid #e3f2fd;
    border-left: 3px solid #007bff;
}

.bd-size-tabs {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 0;
    gap: 4px;
    padding: 0 12px;
    background: white;
    position: sticky;
    top: 52px;
    z-index: 9;
    flex-shrink: 0;
}

.bd-size-tab {
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    position: relative;
    bottom: -2px;
}

.bd-size-tab:hover {
    background: #e9ecef;
    color: #495057;
}

.bd-size-tab.active {
    background: white;
    border-color: #007bff;
    color: #007bff;
    border-bottom: 2px solid white;
    z-index: 1;
}

.bd-size-groups {
    max-height: 280px;
    overflow-y: auto;
    padding: 12px;
    flex: 1;
}

.bd-size-tab-content {
    display: none;
}

.bd-size-tab-content.active {
    display: block;
}

.bd-size-group {
    margin-bottom: 16px;
}

.bd-size-group:last-child {
    margin-bottom: 0;
}

.bd-size-group-header {
    font-weight: 600;
    font-size: 12px;
    color: #007bff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    background: #f8f9ff;
    border-radius: 4px;
    margin-bottom: 6px;
    border-left: 3px solid #007bff;
}

.bd-size-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
}

.bd-size-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.bd-size-option:hover {
    background: #f8f9ff;
    border-color: #007bff;
}

.bd-size-option.checked {
    background: #e3f2fd;
    border-color: #007bff;
    color: #0056b3;
}

.bd-size-option.hidden {
    display: none;
}

.bd-size-option input {
    margin: 0;
    flex-shrink: 0;
}

.bd-size-option-text {
    font-weight: 500;
}

.bd-size-option input:checked + .bd-size-option-text {
    color: #007bff;
    font-weight: 600;
}

.bd-search-hint {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.bd-clear-all-btn:hover {
    background: #e9ecef !important;
    border-color: #adb5bd !important;
    color: #495057 !important;
}

.bd-no-results {
    text-align: center;
    color: #999;
    font-size: 13px;
    padding: 16px;
}

@media (max-width: 768px) {
    .bd-size-menu {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: 400px;
        max-height: 70vh;
        z-index: 9999;
        box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    }
    
    .bd-size-search {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 10px 12px;
    }
    
    .bd-size-tabs {
        gap: 2px;
        margin-bottom: 8px;
    }
    
    .bd-size-tab {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .bd-size-options-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
    }
    
    .bd-size-option {
        font-size: 12px;
        padding: 8px 4px;
    }
    
    .bd-bh-band-header {
        font-size: 11px;
        padding: 4px 8px;
        margin-bottom: 4px;
    }
    
    .bd-active-filters {
        margin-top: 12px;
    }
    
    .bd-filter-chips {
        gap: 6px;
    }
    
    .bd-filter-chip {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .bd-clear-all-btn {
        font-size: 11px;
        padding: 3px 6px;
    }
}

/* Mobile overlay backdrop */
.bd-size-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.bd-size-menu-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .bd-size-menu-backdrop {
        display: none;
    }
    
    .bd-size-menu-backdrop.active {
        display: block;
    }
    
    .bd-size-menu.open {
        background: white;
        border: none;
        box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    }
    
    .bd-size-menu.open .bd-size-search {
        background: white;
        border: 1px solid #dee2e6;
    }
    
    .bd-size-menu.open .bd-size-tab {
        background: #f8f9fa;
        color: #495057;
    }
    
    .bd-size-menu.open .bd-size-tab.active {
        background: #007bff;
        color: white;
        border-color: #007bff;
    }
    
    .bd-size-menu.open .bd-bh-band-header {
        background: #f8f9fa;
        color: #495057;
        border-color: #dee2e6;
    }
    
    .bd-size-menu.open .bd-size-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

.bd-size-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    margin: 0;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    color: #495057;
    flex-shrink: 0;
}

.bd-size-menu-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    color: #6c757d;
    line-height: 1;
    transition: all 0.2s ease;
}

.bd-size-menu-close:hover {
    background: #e9ecef;
    color: #495057;
}

@media (min-width: 1024px) {
    .bd-filters-toggle {
        display: block;
    }
}

.bd-active-filters {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.bd-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.bd-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #007bff;
    background: #007bff;
    color: white;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.bd-filter-chip:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.bd-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    color: white;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.bd-chip-remove:hover {
    background: rgba(255,255,255,0.5);
}

.bd-modern-select {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 100%;
}

.bd-modern-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.bd-price-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bd-price-input {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    font-size: 14px;
    width: 80px;
    transition: all 0.2s ease;
}

.bd-price-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.bd-clear-btn {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
}

.bd-clear-btn:hover {
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
}

.bd-loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.bd-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .bd-filters-modern {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .bd-filter-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .bd-filter-label {
        font-size: 13px;
    }
    
    .bd-modern-select, .bd-price-input {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .bd-size-toggle {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .bd-clear-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Sale Toggle */
.bd-sale-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bd-sale-toggle:hover {
    border-color: #28a745;
}

.bd-sale-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #28a745;
}

.bd-sale-toggle input[type="checkbox"]:checked + .bd-sale-toggle-text {
    color: #28a745;
    font-weight: 600;
}

.bd-sale-toggle-text {
    font-size: 14px;
    color: #495057;
    transition: color 0.2s ease;
}

.bd-sale-toggle:has(input:checked) {
    border-color: #28a745;
    background: #d4edda;
}

/* Fallback for browsers without :has() support */
.bd-sale-toggle.active {
    border-color: #28a745;
    background: #d4edda;
}

@media (max-width: 768px) {
    .bd-sale-toggle {
        padding: 10px 12px;
    }

    .bd-sale-toggle-text {
        font-size: 14px;
    }
}

/* Load More Button */
.bd-load-more-container {
    text-align: center;
    padding: 30px 20px;
    margin-top: 20px;
}

.bd-load-more-btn {
    display: inline-block;
    padding: 14px 40px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.bd-load-more-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.bd-load-more-btn:active:not(:disabled) {
    transform: translateY(0);
}

.bd-load-more-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.bd-load-more-status {
    color: #666;
    font-size: 14px;
    padding: 10px;
}

@media (max-width: 768px) {
    .bd-load-more-btn {
        width: 100%;
        max-width: 300px;
        padding: 16px 30px;
        font-size: 16px;
    }
}

/* Fix for Image Flipper plugin after AJAX load */
/* Container created by JS to wrap both images */
ul.products li.product .bd-image-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
}

ul.products li.product .bd-image-wrapper .attachment-woocommerce_thumbnail {
    display: block;
    width: 100%;
    height: auto;
}

ul.products li.product .bd-image-wrapper img.secondary-image,
ul.products li.product .bd-image-wrapper img.wp-post-image--secondary {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive product grid - dynamisk baseret på vinduesbredde */
ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 0 20px;
    list-style: none;
}

ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
}

/* Minimum kolonner ved forskellige bredder */
@media (min-width: 1400px) {
    ul.products {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (min-width: 1800px) {
    ul.products {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 768px) {
    ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
