/* Search Overlay Styles for WordPress */
.search-overlay-container {
    --so-accent-color: #3b82f6;
    --so-overlay-bg: rgba(243, 244, 246, 0.95);
    --so-text-color: #111827;
    --so-text-color-light: #6b7280;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999998;
    display: none;
    align-items: flex-start;
    justify-content: center;
    background-color: var(--so-overlay-bg);
    color: var(--so-text-color);
}

.search-overlay {
    width: 100%;
    max-width: 95vw;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 90vh;
}

.search-overlay-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    height: 100%;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 60px;
    font-size: 24px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s;
    background-color: #fff;
    color: var(--so-text-color);
}

.search-input:focus {
    border-color: var(--so-accent-color);
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 27px;
    transform: translateY(-50%);
    color: var(--so-text-color-light);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.search-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    color: #6b7280;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.search-results-container {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: transparent;
    flex: 1;
}

/* Custom scrollbar styling */
.search-results-container::-webkit-scrollbar {
    width: 8px;
}

.search-results-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.search-results-container::-webkit-scrollbar-thumb {
    background: var(--so-accent-color);
    border-radius: 4px;
}

.search-results-container::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--so-accent-color) 80%, black);
}

.search-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--so-text-color-light);
}

.search-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid var(--so-accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--so-text-color-light);
}

.search-welcome {
    text-align: center;
    padding: 40px 20px;
    color: var(--so-text-color-light);
}

.search-results {
    /* Results container */
}

/* Grid-based layout for search results */
.search-results-grid {
    display: grid;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Default fallback only for non-cards layout */
.search-results-grid:not(.layout-cards) {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Products per row variations - Base rules (will be overridden by responsive rules) */
.search-results-grid.layout-cards.products-per-row-1,
.so_search_results_grid.layout-cards.products-per-row-1 {
    grid-template-columns: 1fr !important;
}

.search-results-grid.layout-cards.products-per-row-2,
.so_search_results_grid.layout-cards.products-per-row-2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

.search-results-grid.layout-cards.products-per-row-3,
.search-results-grid.layout-cards.products-per-row-4,
.so_search_results_grid.layout-cards.products-per-row-3,
.so_search_results_grid.layout-cards.products-per-row-4 {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* Products per row when sidebar is collapsed (filters closed) */
.search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-1 {
    grid-template-columns: repeat(2, 1fr);
}

.search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-2 {
    grid-template-columns: repeat(3, 1fr);
}

.search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-3,
.search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Ensure no horizontal overflow */
.search-results-grid.layout-cards .grid-product {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

/* Responsive adjustments for products per row */
/* Extra Large Desktop (1400px+) */
@media (min-width: 1400px) {
    /* Filters open: Max 3 products */
    .search-results-grid.layout-cards.products-per-row-1 {
        grid-template-columns: 1fr !important;
    }
    .search-results-grid.layout-cards.products-per-row-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .search-results-grid.layout-cards.products-per-row-3,
    .search-results-grid.layout-cards.products-per-row-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    /* Filters closed: Max 4 products */
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-1 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-2 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-3,
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-4 {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Large Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    /* Filters open: Max 2 products */
    .search-results-grid.layout-cards.products-per-row-1 {
        grid-template-columns: 1fr !important;
    }
    .search-results-grid.layout-cards.products-per-row-2,
    .search-results-grid.layout-cards.products-per-row-3,
    .search-results-grid.layout-cards.products-per-row-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Filters closed: Max 3 products */
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-1 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-2,
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-3,
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Tablet Large (900px - 1199px) */
@media (min-width: 900px) and (max-width: 1199px) {
    /* Filters open: Max 2 products */
    .search-results-grid.layout-cards.products-per-row-1 {
        grid-template-columns: 1fr !important;
    }
    .search-results-grid.layout-cards.products-per-row-2,
    .search-results-grid.layout-cards.products-per-row-3,
    .search-results-grid.layout-cards.products-per-row-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Filters closed: Max 3 products */
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-1 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-2,
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-3,
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Tablet Small (700px - 899px) */
@media (min-width: 700px) and (max-width: 899px) {
    /* Filters open: Max 2 products */
    .search-results-grid.layout-cards.products-per-row-1,
    .search-results-grid.layout-cards.products-per-row-2,
    .search-results-grid.layout-cards.products-per-row-3,
    .search-results-grid.layout-cards.products-per-row-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Filters closed: Max 2 products */
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-1 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-2,
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-3,
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Mobile: always 2 products per row */
@media (max-width: 699px) {
    .search-results-grid.layout-cards.products-per-row-1,
    .search-results-grid.layout-cards.products-per-row-2,
    .search-results-grid.layout-cards.products-per-row-3,
    .search-results-grid.layout-cards.products-per-row-4,
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-1,
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-2,
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-3,
    .search-page-layout.sidebar-collapsed .search-results-grid.layout-cards.products-per-row-4 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        visibility: visible !important;
    }
    
    .grid-product__content-wrap {
        padding: 12px;
    }
    
    .grid-product__title {
        font-size: 14px;
    }
    
    .grid-product__price {
        font-size: 16px;
    }
    
    .grid-product__action-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Ensure proper spacing between 2 columns on mobile */
    .search-results-grid.layout-cards {
        gap: 8px;
    }
    
    .grid-product {
        min-width: 0;
    }
}

/* Base product item styling */
.grid-product {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    text-decoration: none;
    background-color: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

a.grid-product, a.grid-product:hover {
    color: inherit;
    text-decoration: none;
}

.grid-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #d1d5db;
}

.grid-product__image-wrap {
    display: block;
    position: relative;
    padding-bottom: 100%; /* Perfect square aspect ratio */
    background-color: transparent;
    border-bottom: none;
    overflow: hidden;
}

.grid-product__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.grid-product:hover .grid-product__image {
    transform: scale(1.05);
}

/* Product Badge (NIEUW) */
.grid-product__badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 3;
    padding: 0.25rem 0.55rem;
    font-size: 0.70rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    border-radius: 4px;
    pointer-events: none;
}

.grid-product__badge.badge-new,
.grid-product__badge--new {
    background: #000080;
    transform: rotate(4deg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.grid-product__badge.badge-sale {
    background: #dc2626;
}

.grid-product__content-wrap {
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-grow: 1;
    position: relative;
}

/* Battery badge bottom-right */
.grid-product__battery {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.92);
    color: #111827;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    font-size: 11px;
    font-weight: 700;
    z-index: 4;
}

.grid-product__battery svg {
    color: #16a34a; /* groen icoon */
}

.grid-product__wrap-inner {
    padding: 0; /* Replaced by content-wrap */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.grid-product__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 10px;
}

.grid-product__title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #1f2937;
    line-height: 1.3;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-product__title a {
    text-decoration: none;
}

.grid-product__title mark {
    background-color: #fef3c7;
    color: #92400e;
    padding: 2px 4px;
    border-radius: 3px;
}

.stock-status {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.stock-status.in-stock {
    background-color: #d1fae5;
    color: #065f46;
}

.stock-status.out-of-stock {
    background-color: #fee2e2;
    color: #991b1b;
}

.layout-cards.search-results-grid .grid-product {
    flex-direction: column;
}

.layout-list.search-results-grid,
.search-page-layout .layout-list.search-results-grid,
.search-page-layout.sidebar-collapsed .layout-list.search-results-grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
}

.layout-list .grid-product {
    flex-direction: row;
    width: 100% !important;
    max-width: none !important;
}

.layout-list .grid-product__image-wrap {
    width: 200px;
    min-width: 200px;
    padding-bottom: 0;
    height: 150px;
    border-bottom: none;
    border-right: 1px solid #e5e7eb;
}

.layout-list .grid-product__content-wrap {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    width: 100%;
    box-sizing: border-box;
}

.layout-list .grid-product__header {
    margin-bottom: 8px;
}

.layout-list .grid-product__description {
    margin-bottom: 12px;
    flex-grow: 1;
    color: #6b7280;
    line-height: 1.5;
    font-size: 14px;
    max-height: none;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    display: block;
    overflow: visible;
}

.layout-list .grid-product__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.layout-list .grid-product__price {
    font-weight: 700;
    color: #000000;
    font-size: 16px;
    margin: 4px 0;
}

.layout-list .grid-product__store {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 3px;
    backdrop-filter: blur(4px);
    z-index: 3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.layout-list .grid-product__action-btn {
    background: #850000;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.layout-list .grid-product__action-btn:hover {
    background: #650000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(133, 0, 0, 0.3);
    color: #ffffff;
    text-decoration: none;
}

.grid-product__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.grid-product__categories span {
    background-color: #f1f5f9;
    color: #475569;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grid-product__price {
    font-weight: 700;
    color: #000000;
    font-size: 18px;
    margin: 8px 0 4px 0;
}

/* Store/Location Name - Over the image */
.grid-product__store {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    z-index: 3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Main Category Sections */
.main-category-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.main-category-header {
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--so-text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.main-category-header:hover {
    background: #f8fafc;
}

.main-category-section.collapsed .main-category-header {
    border-bottom: none;
}

.main-category-section.collapsed .filter-content {
    display: none;
}

.subcategory-item {
    display: block;
    padding: 8px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.subcategory-item:last-child {
    border-bottom: none;
}

.subcategory-item:hover {
    background: #f8fafc;
}

.subcategory-item input[type="checkbox"] {
    margin-right: 8px;
}

/* Subcategory expand/collapse functionality */
.subcategory-expandable {
    margin-bottom: 4px;
}

.subcategory-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.subcategory-expand-icon {
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: var(--so-text-color-light);
    padding: 8px;
    margin: -6px; /* Compensate padding to maintain visual spacing */
    border-radius: 3px;
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subcategory-expand-icon:hover {
    color: var(--so-accent-color);
    background: color-mix(in srgb, var(--so-accent-color) 10%, transparent);
}

.subcategory-expand-icon.expanded {
    transform: rotate(90deg);
    color: var(--so-accent-color);
}

.subcategory-children {
    margin-top: 4px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.subcategory-children.collapsed {
    display: none;
    max-height: 0;
}

.subcategory-children:not(.collapsed) {
    display: block;
    max-height: none;
}

.subcategory-expand-placeholder {
    width: 16px; /* Same width as the expand icon (12px + 4px padding) */
    height: 16px;
    display: inline-block;
    flex-shrink: 0;
}

.subcategory-simple {
    margin-bottom: 4px;
    margin-left: 2px !important;
}

/* Price Range Slider */
.price-slider-container {
    padding: 0;
}

.price-slider-header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.price-range-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--so-text-color);
    background: #f8fafc;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #e5e7eb;
}

.dual-range-slider {
    position: relative;
    height: 40px;
    margin-bottom: 24px;
}

.range-slider {
    position: absolute;
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    border-radius: 3px;
}

.range-slider::-webkit-slider-track {
    width: 100%;
    height: 6px;
    background: color-mix(in srgb, var(--so-accent-color) 30%, #e5e7eb);
    border-radius: 3px;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--so-accent-color);
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    pointer-events: all;
    position: relative;
    z-index: 2;
}

.range-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    background: color-mix(in srgb, var(--so-accent-color) 30%, #e5e7eb);
    border-radius: 3px;
    border: none;
}

.range-slider::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--so-accent-color);
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    pointer-events: all;
}

.range-slider:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--so-accent-color) 20%, #e5e7eb);
}

.range-slider:focus::-moz-range-thumb {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--so-accent-color) 20%, #e5e7eb);
}

.price-input-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.price-input-group {
    flex: 1;
}

.price-input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--so-text-color-light);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-input-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    color: var(--so-text-color);
    transition: border-color 0.2s ease;
    text-align: center;
}

.price-input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--so-accent-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--so-accent-color) 10%, transparent);
}

.price-apply-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--so-accent-color);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.price-apply-btn:hover {
    background: color-mix(in srgb, var(--so-accent-color) 90%, black);
    transform: translateY(-1px);
}

.price-apply-btn:active {
    transform: translateY(0);
}

.grid-product__description {
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 16px;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.grid-product__description mark {
    background-color: #fef3c7;
    color: #92400e;
    padding: 2px 4px;
    border-radius: 3px;
}

.grid-product__footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

/* Product Action Button */
.grid-product__action-btn {
    background: #850000;
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.grid-product__action-btn:hover {
    background: #650000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(133, 0, 0, 0.3);
    color: #ffffff;
    text-decoration: none;
}

/* Full Search Page Styles */
#search-page-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 20px 0;
    margin-bottom: 20px;
}

#search-page-stats {
    color: #6b7280;
    font-size: 14px;
}

#search-page-sorting select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    color: var(--so-text-color);
}

.search-page-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
    width: 100%;
}

.search-page-pagination .page-numbers {
    padding: 8px 16px;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: var(--so-text-color);
    transition: all 0.2s ease;
    background: #ffffff;
}

.search-page-pagination .page-numbers:hover {
    border-color: var(--so-accent-color);
    background-color: #f0f9ff;
}

.search-page-pagination .page-numbers.current {
    background-color: var(--so-accent-color);
    color: #ffffff;
    border-color: var(--so-accent-color);
}

.search-page-pagination .page-numbers.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.grid-product__image, .grid-product__image-wrap, .grid-product--loading {
    transition: opacity 0.2s ease;
}

.search-result-item {
    margin-bottom: 20px;
}

.search-result-image,
.search-result-image img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.search-overlay-auto-button {
    position: fixed;
    z-index: 999;
}

.search-overlay-auto-button.search-overlay-top-right {
    top: 20px;
    right: 20px;
}

.search-overlay-auto-button.search-overlay-top-left {
    top: 20px;
    left: 20px;
}

.search-overlay-auto-button.search-overlay-bottom-right {
    bottom: 20px;
    right: 20px;
}

.search-overlay-auto-button.search-overlay-bottom-left {
    bottom: 20px;
    left: 20px;
}

.admin-bar .search-overlay-auto-button.search-overlay-top-right,
.admin-bar .search-overlay-auto-button.search-overlay-top-left {
    top: 52px;
}

.search-overlay-button {
    background: var(--so-accent-color);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.search-overlay-button:hover {
    background: color-mix(in srgb, var(--so-accent-color) 90%, black);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--so-accent-color) 30%, transparent);
}

.search-overlay-button:focus {
    outline: 2px solid var(--so-accent-color);
    outline-offset: 2px;
}

.search-overlay-widget-container {
    margin-bottom: 20px;
}

.search-overlay-widget-container .search-overlay-button {
    width: 100%;
    justify-content: center;
}

.search-overlay-menu-item {
    display: inline-block;
    position: relative;
}

.search-overlay-menu-button {
    background: none;
    border: none;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.search-overlay-menu-button:hover {
    opacity: 0.8;
}

body.search-overlay-open {
    overflow: hidden;
}

/* Tablet responsive adjustments */
@media (max-width: 1200px) and (min-width: 769px) {
    .search-overlay {
        max-width: 90vw;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .search-overlay-container {
        padding: 10px;
    }
    
    .search-overlay {
        max-width: 95vw;
        margin-top: 20px;
    }
    
    .search-overlay-content {
        margin-top: 0;
        max-height: 95vh;
    }
    
    .search-input-container {
        padding: 15px;
    }
    
    .search-results-container {
        padding: 15px;
    }
    
    .search-input {
        font-size: 18px;
        padding: 14px 16px 14px 50px;
    }
    
    .search-overlay-auto-button {
        right: 15px;
        bottom: 15px;
    }
    
    .search-overlay-button {
        font-size: 14px;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .search-overlay-container {
        padding: 10px;
    }
    
    .search-overlay-content {
        margin-top: 10px;
        max-height: 98vh;
    }
    
    .search-input-container {
        padding: 12px;
    }
    
    .search-results-container {
        padding: 12px;
        /* Zorg dat resultaten niet verdwijnen op mobiel */
        max-height: none !important;
    }
    
    .search-input {
        font-size: 16px;
        padding: 12px 14px 12px 45px;
    }
    
    .search-overlay-auto-button {
        right: 10px;
        bottom: 10px;
    }
    
    .search-overlay-button {
        font-size: 14px;
        padding: 8px 16px;
    }
}

.wp-admin .search-overlay-button {
    background: #0073aa;
    color: #ffffff;
}

.search-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* .search-page-top-bar removed */

.search-page-main-search {
    max-width: 600px;
    margin: 0 auto;
}

.search-page-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
    transition: grid-template-columns 0.3s ease;
    background: transparent;
    width: 100%;
}

/* Ensure list layout uses full width */
.layout-list .search-page-layout,
body.layout-list .search-page-layout {
    width: 100% !important;
    max-width: 100% !important;
}

.search-page-layout.sidebar-collapsed {
    grid-template-columns: 0 1fr;
    gap: 0;
}

.search-page-sidebar {
    position: sticky;
    top: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 280px;
}

.search-page-layout.sidebar-collapsed .search-page-sidebar {
    width: 0;
    min-width: 0;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
}

.sidebar-toggle-main {
    flex-shrink: 0;
}

.sidebar-toggle-main .sidebar-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--so-accent-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    height: 40px; /* Match other controls height */
    box-sizing: border-box;
}

.sidebar-toggle-main .sidebar-toggle-btn:hover {
    background: color-mix(in srgb, var(--so-accent-color) 90%, black);
    transform: translateY(-1px);
}

.search-stats {
    font-size: 16px;
    color: var(--so-text-color-light);
    font-weight: 500;
    margin: 0;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.active-filter-tag {
    background: var(--so-accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.active-filter-tag button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 8px;
}

/* Desktop layout: normal layout - nothing special needed */

.compact-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.search-page-secondary-search {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0;
}

.secondary-search-wrapper {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    max-width: 400px;
    width: 100%;
    height: 40px; /* Match select height */
    transition: border-color 0.2s ease;
}

.secondary-search-wrapper:focus-within {
    border-color: var(--so-accent-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--so-accent-color) 10%, transparent);
}

#secondary-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 12px;
    font-size: 14px;
    background: transparent;
    color: var(--so-text-color);
    height: 100%;
}

#secondary-search-input::placeholder {
    color: var(--so-text-color-light);
}

#secondary-search-button {
    background: var(--so-accent-color);
    color: #ffffff;
    border: none;
    border-radius: 0 5px 5px 0;
    padding: 0 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
}

#secondary-search-button:hover {
    background: color-mix(in srgb, var(--so-accent-color) 90%, black);
}

.layout-toggle {
    display: flex;
    background: transparent;
    /*border: 1px solid #e5e7eb;
    border-radius: 8px;*/
    padding: 4px;
}

/* When filters are closed, layout-toggle takes full width like search-page-header */
.search-page-layout.sidebar-collapsed .layout-toggle {
    padding-left: 0;
    padding-right: 0;
    width: 100%;
}

.search-page-layout.sidebar-collapsed .search-controls {
    padding-left: 0;
    padding-right: 0;
}

.layout-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--so-text-color-light);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px; /* Match other controls height */
    box-sizing: border-box;
}

.layout-btn.active,
.layout-btn:hover {
    background: var(--so-accent-color);
    color: white;
}

.sorting-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sorting-controls label {
    font-size: 14px;
    color: var(--so-text-color);
    white-space: nowrap;
}

.sorting-controls select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 160px;
    height: 40px; /* Match search input height */
    box-sizing: border-box;
}

/* Sorting icon button (mobile) */
.sorting-icon-btn {
    display: none; /* desktop default */
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: var(--so-accent-color);
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}
.sorting-icon-btn:hover { transform: translateY(-1px); }
.sorting-icon-btn:active { transform: translateY(0); }
.sorting-icon-btn svg { stroke: #fff; }

/* Popup wrapper for the select on mobile */
.sorting-controls {
    position: relative;
}
.sorting-popup {

    
    background: #fff;
  
    z-index: 20;
}
.sorting-controls.open .sorting-popup { display: block; }
.sorting-popup label { display: block; font-size: 12px; color: var(--so-text-color-light); margin-top: -20px;}
.sorting-popup select { min-width: 200px; }

/* Responsive: onder 900px icoon tonen, select verbergen; boven 900px omgekeerd */
@media (max-width: 899px) {
    .sorting-icon-btn { display: inline-flex; }
    .sorting-controls > label,
    .sorting-controls > select { display: none; }
}
@media (min-width: 900px) {
    .sorting-icon-btn { display: none; }
   
}

.search-results-wrapper {
    min-height: auto; /* Verwijder de vaste minimumhoogte */
    width: 100%;
}

/* Ensure layout-list wrapper uses full width */
.layout-list .search-results-wrapper {
    width: 100% !important;
}

/* Force full width for entire container when in list layout */
.search-page-container.layout-list,
.layout-list .search-page-container {
    width: 100% !important;
    max-width: 100% !important;
}

.layout-list .search-page-main {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: visible;
}

.search-results-container {
    display: block; /* container is block; de interne grid bepaalt kolommen */
    height: auto;
    width: 100%;
}

/* Ensure layout-list results use full width */
.layout-list .search-results-container {
    width: 100% !important;
}

.search-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--so-text-color-light);
}

.search-loading .search-spinner {
    margin: 0 auto 20px;
}

.search-no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--so-text-color-light);
}

.no-results-icon {
    margin-bottom: 20px;
    opacity: 0.5;
}

.search-no-results h3 {
    color: var(--so-text-color);
    margin-bottom: 8px;
    font-size: 24px;
}

.search-no-results p {
    font-size: 16px;
    margin: 0;
}

.search-welcome {
    text-align: center;
    padding: 60px 20px;
    color: var(--so-text-color-light);
    background: transparent;
    border-radius: 12px;
    margin: 20px 0;
}

.search-welcome h3 {
    color: var(--so-text-color);
    margin-bottom: 12px;
    font-size: 24px;
}

.search-welcome p {
    font-size: 16px;
    margin: 0;
}

.search-page-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Responsive design for search page */
@media (max-width: 1024px) {
    .search-page-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .search-page-layout.sidebar-collapsed {
        grid-template-columns: 1fr;
    }
    
    .search-page-sidebar {
        position: static;
        width: 100%;
        order: 2;
    }
    
    .search-page-main {
        order: 1;
    }
    
    .search-page-layout.sidebar-collapsed .search-page-sidebar {
        display: none;
    }
    
    .search-page-filters {
        margin-bottom: 0;
    }
    
    .search-page-header {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 20px;
    }
    
    .search-controls {
        justify-content: space-between;
        margin-top: 12px;
    }
    
    .compact-controls {
        gap: 12px;
    }
    
    .search-page-secondary-search {
        margin: 12px 0;
    }
    
    .secondary-search-wrapper {
        max-width: 100%;
    }
    
    .search-page-main-search {
        max-width: 100%;
    }
    
    .floating-filter-toggle {
        position: static;
        transform: none;
        margin-bottom: 20px;
        animation: none;
    }
    
    .sidebar-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    .search-page-container {
        padding: 12px;
    }
    
    .search-page-header {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 12px;
    }
    
    /* Mobile: reorganize search controls layout */
    .search-controls {
        flex-direction: column;
        gap: 16px;
        margin-top: 0;
        position: relative; /* For absolute positioning of filter button */
    }
    
    /* Make the top row (search + filter) horizontal */
    .search-controls > .sidebar-toggle-main,
    .search-controls > .search-page-secondary-search {
        order: 1; /* Both get same order to appear on same row */
    }
    
    .search-controls > .sidebar-toggle-main {
        position: absolute;
        right: 0;
        top: 0;
        width: 44px;
        height: 44px;
        z-index: 10;
        display: block !important;
    }
    
    .search-controls > .search-page-secondary-search {
        position: relative;
        padding-right: 52px; /* Extra space for filter button */
        margin: 0;
    }
    
    /* Ensure search wrapper doesn't overlap button */
    .search-controls > .search-page-secondary-search .secondary-search-wrapper {
        width: 100%;
        margin-right: 8px;
    }
    
    /* Other controls go below */
    .compact-controls {
        order: 2;
        width: 100%;
    }
    
    .secondary-search-wrapper {
        height: 44px; /* Slightly larger for mobile touch */
        border-radius: 6px 0 0 6px; /* Round left corners only */
    }
    
    .search-controls > .sidebar-toggle-main .sidebar-toggle-btn {
        height: 44px;
        width: 44px;
        background: var(--so-accent-color);
        border: 1px solid var(--so-accent-color);
    
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        margin: 2px;
    }
    
    .sidebar-toggle-main .sidebar-toggle-btn {
        height: 44px; /* Match search input height */
        width: 44px; /* Square button */
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        min-width: 44px;
    }
    
    /* Hide the text "Filters" on mobile, show only icon */
    .sidebar-toggle-main .sidebar-toggle-text {
        display: none;
    }
    
    .compact-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        width: 100%;
    }
    
    .sorting-controls {
        flex: 1;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }
    
    .sorting-controls select {
        height: 44px; /* Match other controls */
        flex: 1;
        min-width: 120px;
        font-size: 15px;
    }
    
    .layout-toggle {
        flex-shrink: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0 4px;
        gap: 4px;
    }
    
    .layout-btn {
        height: 40px;
        width: 40px;
        padding: 8px;
        border-radius: 6px;
    }
    
    #secondary-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0 16px;
    }
    
    #secondary-search-button {
        width: 44px;
    }
    
    .price-range-inputs {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .price-range-inputs input[type="number"] {
        min-width: auto;
        flex: none;
        height: 44px;
        font-size: 16px;
    }
    
    .search-page-sidebar {
        padding: 16px;
    }
    
    .filter-header {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .collapsible-content {
        padding: 16px;
    }
    
    .search-page-filters h3 {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .active-filters {
        justify-content: flex-start;
        margin-top: 8px;
    }
    
    .active-filter-tag {
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .search-page-container {
        padding: 8px;
    }
    
    .search-page-header {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .compact-controls {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .sidebar-toggle-main {
        order: 1;
        width: 100%;
    }
    
    .sidebar-toggle-main .sidebar-toggle-btn {
        width: 100%;
        justify-content: center;
    }
    
    .sorting-controls {
        order: 2;
        flex: none;
        width: 100%;
    }
    
    .sorting-controls select {
        width: 100%;
        min-width: auto;
    }
    
    .layout-toggle {
        order: 3;
        width: 100%;
        justify-content: center;
        padding: 4px;
    }
    
    .layout-btn {
        flex: 1;
        margin: 0 2px;
    }
    
    .secondary-search-wrapper {
        height: 48px; /* Even larger for small screens */
    }
    
    #secondary-search-input {
        padding: 0 12px;
        font-size: 16px;
    }
    
    #secondary-search-button {
        width: 48px;
    }
}

/* Mobile Filters Overlay */
.mobile-filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    z-index: 999999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.mobile-filters-overlay.active {
    display: flex;
}

.mobile-filters-header {
    position: sticky;
    top: 0;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-filters-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.mobile-filters-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--so-text-color);
    margin: 0;
}

.mobile-filters-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    color: var(--so-text-color-light);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mobile-filters-close:hover {
    background: #f3f4f6;
    color: var(--so-text-color);
}

.mobile-search-sticky {
    margin-bottom: 16px;
}

.mobile-sorting-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.mobile-sorting-controls label {
    font-size: 14px;
    color: var(--so-text-color);
    white-space: nowrap;
    font-weight: 500;
}

.mobile-sorting-controls select {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 140px;
    height: 40px;
    box-sizing: border-box;
}

.mobile-layout-controls {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.mobile-layout-btn {
    background: none;
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--so-text-color-light);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 50px;
    box-sizing: border-box;
}

.mobile-layout-btn.active,
.mobile-layout-btn:hover {
    background: var(--so-accent-color);
    color: white;
    border-color: var(--so-accent-color);
}

.mobile-search-wrapper {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.mobile-search-wrapper:focus-within {
    border-color: var(--so-accent-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--so-accent-color) 10%, transparent);
}

.mobile-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 16px;
    font-size: 16px;
    background: transparent;
    color: var(--so-text-color);
}

.mobile-search-input::placeholder {
    color: var(--so-text-color-light);
}

.mobile-search-button {
    background: var(--so-accent-color);
    color: #ffffff;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
}

.mobile-search-button:hover {
    background: color-mix(in srgb, var(--so-accent-color) 90%, black);
}

.mobile-filters-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 16px;
    -webkit-overflow-scrolling: touch;
}

.mobile-filters-actions {
    position: sticky;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 16px;
    display: flex;
    gap: 12px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-filter-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-filter-clear {
    background: #f3f4f6;
    color: var(--so-text-color);
}

.mobile-filter-clear:hover {
    background: #e5e7eb;
}

.mobile-filter-apply {
    background: var(--so-accent-color);
    color: #ffffff;
}

.mobile-filter-apply:hover {
    background: color-mix(in srgb, var(--so-accent-color) 90%, black);
}

/* Hide sidebar on mobile, show overlay instead */
@media (max-width: 768px) {
    .search-page-sidebar {
        display: none !important;
    }
    
    .search-page-layout {
        grid-template-columns: 1fr !important;
    }
    
    .search-page-layout.sidebar-collapsed {
        grid-template-columns: 1fr !important;
    }
    
    /* Hide layout toggle on mobile */
    .layout-toggle {
        visibility: hidden; /* verberg knoppen, laat container blijven bestaan */
        height: 0;
        padding: 0;
        margin: 0;
    }
    
    /* Hide sorting controls in header on mobile - they'll be in the mobile overlay */
    .sorting-controls {
        display: none !important;
    }
}

/* Legacy filter styling - updated above */

/* Enhanced Category expand/collapse styling */
.category-item {
    margin-bottom: 2px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-expand-wrapper {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-expand-icon {
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--so-text-color-light);
    flex-shrink: 0;
    border-radius: 4px;
    padding: 2px;
}

.category-expand-icon:hover {
    color: var(--so-accent-color);
    background: color-mix(in srgb, var(--so-accent-color) 10%, transparent);
}

.category-expand-icon.expanded {
    transform: rotate(90deg);
    color: var(--so-accent-color);
}

.category-children {
    margin-top: 4px;
    padding-left: 12px; /* halve inspring */
    /* border-left verwijderd */
    display: none;
    transition: all 0.3s ease;
}

.category-children.expanded {
    display: block;
}

.category-expand-icon-placeholder {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
}

.category-item[data-level="1"] .filter-checkbox-label {
    border-left: 2px solid #e5e7eb;
    padding-left: 12px;
    margin-left: -4px;
}

.category-item[data-level="2"] .filter-checkbox-label {
    border-left: 2px solid #d1d5db;
    padding-left: 12px;
    margin-left: -4px;
}

.filter-checkbox-label.subcategory {
    padding: 8px 0;
    font-size: 14px;
    font-weight: 400;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

.filter-placeholder {
    color: var(--so-text-color-light);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Pagination styling */
.pagination-btn {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: var(--so-text-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    margin: 0 2px;
}

.pagination-btn:hover {
    background: #f8fafc;
    border-color: var(--so-accent-color);
}

.pagination-btn.active {
    background: var(--so-accent-color);
    border-color: var(--so-accent-color);
    color: white;
}

.pagination-dots {
    color: var(--so-text-color-light);
    padding: 8px 4px;
    font-size: 14px;
}

/* Search error styling */
.search-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin: 20px 0;
}

.search-page-filters h3 {
    margin: 0 0 24px 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--so-text-color);
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--so-accent-color);
}

.filter-group-container h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--so-text-color);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}

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

.filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--so-text-color);
}

.filter-group input {
    margin: 0;
}

/* Legacy filter item count - updated above */

.filter-placeholder {
    color: var(--so-text-color-light);
    font-style: italic;
}

.search-page-main {
    flex: 1;
    width: 100%;
    max-width: 100%;
}

#search-page-input-container {
    display: flex;
    margin-bottom: 20px;
}

#search-page-input {
    flex-grow: 1;
    border-right-width: 0;
    border-radius: 8px 0 0 8px;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    outline: none;
    transition: border-color 0.2s;
    background-color: #fff;
    color: var(--so-text-color);
}

#search-page-input:focus {
    border-color: var(--so-accent-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--so-accent-color) 10%, transparent);
}

#search-page-submit-button {
    flex-shrink: 0;
    border-radius: 0 8px 8px 0;
    margin-left: 0;
    background: var(--so-accent-color);
    color: #ffffff;
    border: 2px solid var(--so-accent-color);
    padding: 12px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#search-page-submit-button:hover {
    background: color-mix(in srgb, var(--so-accent-color) 90%, black);
} 

.search-page-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;   
    background: #ffffff;
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-results-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Enhanced Sidebar Styling */
.search-page-sidebar {
   /* background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;*/
}

/* Filter Section Styling */
.filter-section {
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--so-text-color);
    margin: 0;
    transition: background-color 0.2s ease;
}

.filter-header:hover {
    background: #f1f5f9;
}

.filter-toggle-icon {
    transition: transform 0.2s ease;
    color: var(--so-text-color-light);
}

.filter-section.collapsed .filter-toggle-icon {
    transform: rotate(-90deg);
}

.filter-section.collapsed .collapsible-content {
    display: none;
}

.collapsible-content {
    padding: 20px;
    background: #ffffff;
}

/* Extra padding for price filter content */
#price-filter-content {
    padding: 24px;
}

/* Price Range Inputs */
.price-range-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.price-range-inputs input[type="number"] {
    flex: 1;
    min-width: 80px;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    color: var(--so-text-color);
    transition: border-color 0.2s ease;
}

.price-range-inputs input[type="number"]:focus {
    outline: none;
    border-color: var(--so-accent-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--so-accent-color) 10%, transparent);
}

.price-range-inputs span {
    color: var(--so-text-color-light);
    font-size: 14px;
    font-weight: 500;
}

/* Modern Button Styling */
#apply-price-filter {
    background: var(--so-accent-color);
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

#apply-price-filter:hover {
    background: color-mix(in srgb, var(--so-accent-color) 90%, black);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--so-accent-color) 25%, transparent);
}

.clear-filters-btn {
    background: #ffffff;
    color: var(--so-text-color);
    border: 2px solid #e5e7eb;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.clear-filters-btn:hover {
    background: #f1f5f9;
    border-color: var(--so-accent-color);
    color: var(--so-accent-color);
    transform: translateY(-1px);
}

.filter-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* Enhanced Filter Count Styling */
.filter-count {
    background: var(--so-accent-color);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
}

/* Enhanced Checkbox Styling */
.filter-checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 0 -12px;
}

.filter-checkbox-label:hover {
    background-color: #f8fafc;
}

.filter-checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    accent-color: var(--so-accent-color);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.filter-label {
    flex: 1;
    font-size: 14px;
    color: var(--so-text-color);
    font-weight: 500;
}

/* Live Search Dropdown Styling */
.live-search-dropdown {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
}

.live-search-loading,
.live-search-no-results,
.live-search-error {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.live-search-loading {
    color: var(--so-accent-color);
    font-weight: 500;
}

.live-search-error {
    color: #dc2626;
}

.live-search-results {
    padding: 8px 0;
}

.live-search-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.live-search-item:last-child {
    border-bottom: none;
}

.live-search-item:hover {
    background-color: #f8fafc;
}

.live-search-image {
    width: 50px;
    height: 50px;
    margin-right: 12px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background-color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-search-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.live-search-image:empty::after {
    content: '📦';
    font-size: 20px;
    color: #9ca3af;
}

.live-search-content {
    flex: 1;
    min-width: 0;
}

.live-search-title {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 4px;
    line-height: 1.3;
}

.live-search-title mark {
    background-color: #fef3c7;
    color: #92400e;
    padding: 1px 2px;
    border-radius: 2px;
}

.live-search-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--so-accent-color);
}

/* View All Button Styling */
.live-search-view-all {
    border-top: 1px solid #e5e7eb;
    padding: 16px;
    text-align: center;
    background-color: #f9fafb;
    border-radius: 0 0 8px 8px;
}

.live-search-view-all-btn {
    display: inline-block;
    background: var(--so-accent-color, #3b82f6);
    color: #ffffff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.live-search-view-all-btn:hover {
    background: color-mix(in srgb, var(--so-accent-color, #3b82f6) 90%, black);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    color: #ffffff;
    text-decoration: none;
}

.live-search-view-all-btn:active {
    transform: translateY(0);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .live-search-dropdown {
        max-width: calc(100vw - 32px);
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
    }
    
    .live-search-item {
        padding: 16px;
    }
    
    .live-search-image {
        width: 50px;
        height: 50px;
    }
    
    .live-search-title {
        font-size: 15px;
    }
    
    .live-search-price {
        font-size: 14px;
    }
}