/* ===== MOBILE OVERLAY FILTER ===== */

@media (max-width: 767px) {

    /* Button oben */
    .wcpf-filter-open-btn {
        width: 100%;
        background: #333;
        color: white;
        padding: 14px;
        font-size: 18px;
        border: none;
        margin-bottom: 10px;
    }

    /* Dunkler Hintergrund */
    .wcpf-filter-overlay {
		display: none;
	}

	.wcpf-filter-overlay.open {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 999998;
		background: rgba(0,0,0,0.6);
	}

    /* Slider-Panel */
    .wcpf-filter-panel {
		position: fixed;
		top: 0;
		right: -100%;
		width: 85%;
		max-width: 360px;
		height: 100%;
		background: #fff;
		z-index: 999999;
		box-shadow: -4px 0 20px rgba(0,0,0,0.2);
		overflow-y: auto;
		transition: right .3s ease;
		padding: 80px 20px;
	}

	/* Geöffnet */
	.wcpf-filter-panel.open {
		right: 0;
	}
	
	.wcpf-filter-panel,
	.wcpf-filter-overlay {
		position: fixed !important;     /* nicht relativ zu Divi-Wrappern */
		z-index: 9999999 !important;    /* höher als Divi Header */
		transform: none !important;     /* bricht Divi stacking context */
	}
	
	.wcpf-filter-panel {
		will-change: transform;
	}

	.wcpf-filter-panel .wcpf-form {
		display: block !important;
		opacity: 1 !important;
		visibility: visible !important;
	}

    .wcpf-filter-close {
        position: absolute;
        right: 12px;
        top: 10px;
        background: transparent;
        border: none;
        font-size: 30px;
    }

    /* Damit das originale Filterformular verschwinden kann */
    form.wcpf-form {
        display: none !important;
    }

    /* Accordion-Stil für die Gruppen */
    .wcpf-filter-panel .wcpf-group {
        border-bottom: 1px solid #ddd;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .wcpf-filter-panel .wcpf-group h4 {
        display: flex;
        justify-content: space-between;
        cursor: pointer;
        margin: 0;
        padding: 10px 0;
        font-size: 18px;
    }

    .wcpf-filter-panel .wcpf-group h4::after {
        content: "▾";
        transition: transform .2s;
    }

    .wcpf-group.closed h4::after {
        transform: rotate(-90deg);
    }

    .wcpf-group.closed .wcpf-terms {
        display: none !important;
    }
}
