.custom-product-filter {
    margin-bottom: 30px;
}

.custom-product-filter .filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 20px;
}

.custom-product-filter .filter-button {
    display: inline-block;
    padding: 1px 10px;
    background-color: var(--e-global-color-a2f848f);
    text-decoration: none;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    cursor: pointer;
}

.custom-product-filter .filter-button.active {
    background-color: var(--e-global-color-accent);
    color: black;
}

.custom-product-filter .filter-button:hover {
    background-color: var(--e-global-color-accent);
}

.custom-product-filter .filter-button.active:hover {
    background-color: var(--e-global-color-accent);
}

.custom-product-filter .count {
    font-size: 0.8em;
    opacity: 0.8;
}

.custom-product-filter .product-filter-select {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.custom-product-filter .filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-product-filter .filter-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.custom-product-filter .filter-checkbox {
    margin-right: 8px;
}

/* Produktliste Styling */
.custom-products-grid {
    margin-bottom: 30px;
}

.custom-products-grid .elementor-loop-container {
    display: flex;
    flex-direction: column;
}

/* Produktitem Styling */
.custom-products-grid .product-item {
    background-color: #ffffff;
    border: 1px solid #eee;
    transition: box-shadow 0.3s ease;
    overflow: hidden;
}

.custom-products-grid .product-item:nth-child(odd) {
    background-color: #D9DADB33;
}

.custom-products-grid .product-item:hover {
    /*background-color: rgba(0, 0, 0, 0.1);*/
}

/* Elementor-spezifische Styles */
.custom-products-grid .e-con-full {
    width: 100%;
}

.custom-products-grid .e-flex {
    display: flex;
}

.custom-products-grid a {
    text-decoration: none;
    color: inherit;
}

/* Heading Styles */
.custom-products-grid .elementor-heading-title {
    margin: 0;
}

.custom-products-grid h3.elementor-heading-title {
    color: #0e84c3;
    font-size: 1.1em;
    font-weight: 500;
}

/* Button Styles */
.custom-products-grid .elementor-button {
    background-color: #b6c828;
    color: white;
    border-radius: 20px;
    padding: 8px 20px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    transition: background-color 0.3s ease;
}

.custom-products-grid .elementor-button:hover {
    background-color: #9dae23;
}

/* Ladeindikator */
.elementor-loop-container.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.elementor-loop-container.loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #b6c828;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

/* Lazy Loading Styles */
.load-more-indicator {
    text-align: center;
    padding: 20px 0;
    width: 100%;
}

.load-more-indicator .spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #b6c828;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/*
 * Grid
 */

.product-content,
.elementor-post .elementor-grid-item .product-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-top: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
    padding-right: 0px;
}

.product-content-link {
    width: 100%;
    display: flex;
    gap: 0px 0px;
    border-style: solid;
    border-width: 0px;
    border-top-width: 0px;
    border-right-width: 1px;
    border-bottom-width: 0px;
    border-left-width: 0px;
    border-color: var(--e-global-color-c141d66);
    padding: 20px 30px;
    flex-direction: column;
    flex-basis: auto;
    flex-grow: 0;
    flex-shrink: 1;
    flex: var(--flex-grow) var(--flex-shrink) var(--flex-basis);
}

.product-actions {
    width: 200px;
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: center;
    gap: 5px 5px;
}

.custom-products-grid {
    margin-bottom: 30px;
}

.custom-products-grid .elementor-loop-container {
    display: grid;
    grid-template-columns: repeat(var(--columns, 3), 1fr);
}

.custom-products-grid.columns-1 .elementor-loop-container {
    --columns: 1;
}

.custom-products-grid.columns-2 .elementor-loop-container {
    --columns: 2;
}

.custom-products-grid.columns-3 .elementor-loop-container {
    --columns: 3;
}

.custom-products-grid.columns-4 .elementor-loop-container {
    --columns: 4;
}

.custom-products-grid .product-title {
    font-size: 20px;
    margin: 0;
}

.custom-products-grid .next-event {
    color: #666;
    font-size: 14px;
}

.custom-products-grid .guaranteed-icon {
    display: inline-block;
    color: #4CAF50;
    font-weight: bold;
    margin-left: 5px;
}

.custom-products-grid .details-button {
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    padding: 2px 15px;
    background-color: var(--e-global-color-7464098);
    border: 1px solid var(--e-global-color-7464098);
    text-transform: uppercase;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    transition: background-color 0.3s ease;
}

.custom-products-grid .details-button:hover {
    background-color: var(--e-global-color-83c6b28);
    color: var(--e-global-color-7464098);
}

/* ========================================= */
/* Multi-Level B2B Filter Styles           */
/* ========================================= */

.multi-level-product-filter .filter-controls {
    display: grid;
    /* Use grid for easy alignment */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    /* Responsive columns */
    gap: 15px;
    /* Spacing between filter elements */
    align-items: end;
    /* Align items at the bottom (useful if labels wrap) */
}

.multi-level-product-filter .filter-select-wrap {
    display: flex;
    flex-direction: column;
    /* Stack label above select */
}

.multi-level-product-filter .filter-select-wrap label {
    font-size: 0.9em;
    margin-bottom: 5px;
    color: #555;
}

.multi-level-product-filter .product-filter-select {
    width: 100%;
    padding: 10px 8px;
    /* Slightly larger padding */
    border-radius: 4px;
    border: 1px solid #ccc;
    /* Slightly darker border */
    background-color: #fff;
    font-size: 1em;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.multi-level-product-filter .product-filter-select:focus {
    border-color: var(--e-global-color-accent, #b6c828);
    /* Highlight with accent color */
    outline: none;
    box-shadow: 0 0 0 2px rgba(182, 200, 40, 0.3);
    /* Optional focus shadow */
}


/* ========================================= */
/* Target Design Filter Styles             */
/* ========================================= */

.multi-level-product-filter.style-target-design {
    background-color: var(--e-global-color-9b945b2);
    /* Blauer Hintergrund (Anpassen nach Bedarf) */
    padding: 30px;
    /* Innenabstand */
    border-radius: 30px 30px 0px 0px;
    /* Abgerundete Ecken */
    margin-bottom: -20px;
}

.multi-level-product-filter.style-target-design .filter-title {
    color: #ffffff;
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 25px;
}

.multi-level-product-filter.style-target-design .filter-controls {
    display: grid;
    /* 4 Spalten erzwingen oder auto-fit beibehalten? Probieren wir 4 feste */
    grid-template-columns: repeat(4, 1fr);
    /* 4 gleiche Spalten */
    gap: 20px;
    /* Abstand zwischen den Filtern */
    align-items: center;
    /* Vertikal zentrieren (optional) */
}

/* Labels für die Selects ausblenden (wie im Zieldesign) */
.multi-level-product-filter.style-target-design .filter-select-wrap label {
    color: white;
}

/* Styling für die Select-Felder selbst */
.multi-level-product-filter.style-target-design .product-filter-select {
    width: 100%;
    padding: 12px 40px 12px 15px;
    /* Oben/Unten, Rechts (für Pfeil), Links */
    border-radius: 4px;
    /* Leicht abgerundete Ecken */
    border: 1px solid #ced4da;
    /* Heller Rand */
    background-color: #ffffff;
    /* Weißer Hintergrund */
    color: #495057;
    /* Dunkle Schriftfarbe */
    font-size: 1rem;
    /* Standardschriftgröße */
    line-height: 1.5;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;

    /* Standard-Aussehen entfernen (wichtig für Custom Pfeil) */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Custom Pfeil als Hintergrundbild (Base64 kodiertes SVG) */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    /* Position rechts */
    background-size: 16px 12px;
    /* Größe des Pfeils */
}

/* Optional: Hover/Focus Zustand für die Selects */
.multi-level-product-filter.style-target-design .product-filter-select:focus {
    border-color: #86b7fe;
    /* Leichter blauer Rand bei Fokus */
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    /* Leichter blauer Schatten */
}

/* ========================================= */
/* Product List & Item Styles (Adjustments) */
/* ========================================= */

/* Ensure the container has relative positioning if needed for absolute positioned overlays like spinners */
.custom-products-grid {
    position: relative;
    /* Needed if spinner inside grid uses absolute */
    margin-bottom: 30px;
}

.custom-products-grid .elementor-loop-container.product-list-container {
    /* Using flex column from original CSS */
    display: flex;
    flex-direction: column;
    /* Add transition for smoother updates? Maybe not needed if just replacing content */
    /* transition: opacity 0.3s ease; */
}

/* Loading state overlay for the list container itself */
.custom-products-grid .product-list-container.loading {
    opacity: 0.5;
    pointer-events: none;
    /* Prevent interaction while loading */
    min-height: 100px;
    /* Prevent collapsing completely when empty during load */
}

/* Styles for messages inside the product list */
.custom-products-grid .product-list-container .no-products-found,
.custom-products-grid .product-list-container .filter-error {
    padding: 40px 20px;
    text-align: center;
    background-color: #f9f9f9;
    border: 1px dashed #ddd;
    margin: 20px 0;
    /* Add some space */
    color: #666;
    width: 100%;
    /* Ensure it takes full width if grid is applied */
}

.custom-products-grid .product-list-container .filter-error {
    color: #dc3232;
    /* Red for errors */
    border-color: #dc3232;
}

/* ========================================= */
/* Load More Indicator & Button Styles     */
/* ========================================= */

.load-more-indicator {
    text-align: center;
    padding: 30px 0;
    width: 100%;
    /* display: none; Should be controlled by JS */
}

/* Spinner uses existing animation 'spin' */
.load-more-indicator .spinner {
    display: inline-block;
    width: 30px;
    /* Slightly smaller spinner */
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    /* Lighter border */
    border-top-color: var(--e-global-color-accent, #b6c828);
    /* Accent color for spinner */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
    /* Center spinner above button */
    vertical-align: middle;
    /* Align if text is next to it */
}

.load-more-indicator .load-more-button {
    /* Reuse Elementor button styles if possible or define custom */
    display: inline-block;
    background-color: var(--e-global-color-accent, #b6c828);
    /* Accent color */
    color: white;
    /* Use text color that contrasts well */
    border: 1px solid var(--e-global-color-accent, #b6c828);
    padding: 10px 25px;
    font-size: 1em;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 50px;
    /* Rounded corners like details button */
    cursor: pointer;
    transition: all 0.3s ease;
    /* display: none; Should be controlled by JS */
}

.load-more-indicator .load-more-button:hover {
    background-color: var(--e-global-color-83c6b28, #9dae23);
    /* Darker accent or secondary color */
}

/* Hide spinner when button is visible (controlled by JS adding/removing button usually) */
/* Alternatively, JS can hide the spinner directly when button is shown */
.load-more-indicator .load-more-button:not(:hidden)~.spinner,
/* If spinner is AFTER button */
.load-more-indicator .spinner:has(+ .load-more-button:not(:hidden))

/* If spinner is BEFORE button (using :has) */
    {
    /* display: none; */
    /* Maybe better to let JS handle spinner visibility directly */
}

/* Loading state specific for the button container (optional) */
.load-more-indicator.is-loading .load-more-button {
    display: none;
    /* Hide button when loading */
}

.load-more-indicator.is-loading .spinner {
    display: inline-block;
    /* Ensure spinner shows when loading */
}

/* Responsive Adjustments for Filters */
@media (max-width: 991px) {

    /* Adjust breakpoint as needed */
    .multi-level-product-filter .filter-controls {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        /* Smaller minimum width on medium screens */
        gap: 10px;
    }

    .multi-level-product-filter.style-target-design .filter-controls {
        grid-template-columns: repeat(2, 1fr);
        /* 2 Spalten */
        gap: 15px;
    }

    .multi-level-product-filter.style-target-design {
        padding: 20px;
    }

    .multi-level-product-filter.style-target-design .filter-title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .custom-products-grid .e-flex {
        flex-direction: column;
    }

    .custom-products-grid .elementor-button-wrapper {
        margin-top: 10px;
    }

    .product-content,
    .elementor-post .elementor-grid-item .product-item {
        flex-wrap: wrap;
    }

    .product-actions {
        width: 100%;
        padding-bottom: 20px;
    }

    .custom-products-grid .details-button {
        width: 100%;
        text-align: center;
        margin: 0px 30px;
    }

    .product-content-link {
        border-right-width: 0px;
    }

    .multi-level-product-filter .filter-controls {
        grid-template-columns: 1fr 1fr;
        /* Force two columns on smaller screens */
        gap: 10px;
    }

    .multi-level-product-filter .product-filter-select {
        padding: 8px 6px;
    }

    .multi-level-product-filter.style-target-design .filter-controls {
        grid-template-columns: 1fr;
        /* 1 Spalte */
        gap: 15px;
    }

    .multi-level-product-filter.style-target-design .product-filter-select {
        padding: 10px 40px 10px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .custom-products-grid .elementor-loop-container {
        grid-template-columns: 1fr;
    }

    .multi-level-product-filter .filter-controls {
        grid-template-columns: 1fr;
        /* Stack filters vertically */
        gap: 15px;
        /* Increase gap when stacked */
    }
}
