/* Alpakahof Shop Filter – v0.1.11 */

/* =========================================================
   TOOLBAR VOR DEN PRODUKTKARTEN (AVADA STACKING CONTEXT)
   =========================================================
   Die Toolbar liegt in einem eigenen Fusion-Fullwidth-Container;
   das Produktgrid im nachfolgenden Container. Beide erhalten
   eine definierte Stapelreihenfolge, damit geoeffnete Facets
   nicht unter Post Cards/Produktbildern landen.
   Der Website-Header bleibt auf einer hoeheren Ebene.
   ========================================================= */

.fusion-fullwidth:has(#ah-shop-toolbar) {
	position: relative;
	z-index: 30;
	overflow: visible;
}

#ah-shop-grid {
	position: relative;
	z-index: 1;
}

/* =========================================================
   DESKTOP TOOLBAR
   ========================================================= */

.ahsf {
	position: sticky;
	top: var(--ahsf-sticky-top, 1rem);
	z-index: 50;
	width: 100%;
	background: #fff;
	border: 1px solid rgba(45, 43, 61, 0.08);
	border-radius: 0.5rem;
	box-shadow: 0 0.375rem 1.5rem rgba(45, 43, 61, 0.08);
}

.ahsf__inner {
	padding: 0.85rem 1rem;
}

.ahsf__compact {
	display: none;
}

.ahsf__top {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-width: 0;
}

.ahsf__categories {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 0.35rem;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: thin;
	padding-bottom: 0.1rem;
}

.ahsf__category {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	min-height: 2.5rem;
	padding: 0.55rem 0.8rem;
	border-radius: 0.5rem;
	color: #2d2b3d;
	text-decoration: none;
	font-weight: 500;
	line-height: 1.2;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.ahsf__category:hover,
.ahsf__category:focus-visible {
	background: rgba(241, 210, 119, 0.24);
	color: #2d2b3d;
}

.ahsf__category.is-active {
	background: #f1d277;
	color: #2d2b3d;
}

.ahsf__facets {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.65rem;
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid rgba(45, 43, 61, 0.08);
}

.ahsf__facet {
	position: relative;
}

.ahsf__facet > summary,
.ahsf__sort select,
.ahsf__stock {
	display: inline-flex;
	align-items: center;
	min-height: 2.5rem;
	border: 1px solid rgba(45, 43, 61, 0.15);
	border-radius: 0.5rem;
	background: #fff;
	color: #2d2b3d;
	padding: 0.55rem 0.75rem;
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
}

.ahsf__facet > summary {
	list-style: none;
}

.ahsf__facet > summary::-webkit-details-marker {
	display: none;
}

/* Pfeil als SVG statt Schriftzeichen: optisch vertikal zentriert. */
.ahsf__facet > summary::after {
	content: "";
	display: block;
	flex: 0 0 0.75rem;
	width: 0.75rem;
	height: 0.75rem;
	margin-left: 0.6rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%232D2B3D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 0.75rem auto;
}

.ahsf__panel {
	position: absolute;
	left: 0;
	top: calc(100% + 0.4rem);
	z-index: 60;
	min-width: 13rem;
	max-height: 18rem;
	overflow: auto;
	padding: 0.65rem;
	border: 1px solid rgba(45, 43, 61, 0.1);
	border-radius: 0.5rem;
	background: #fff;
	box-shadow: 0 0.75rem 2rem rgba(45, 43, 61, 0.12);
}

.ahsf__check {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.45rem;
	cursor: pointer;
}

.ahsf input {
	accent-color: #f1d277;
}

.ahsf__panel--price {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	min-width: 17rem;
}

.ahsf__panel--price label {
	display: grid;
	gap: 0.3rem;
	font-size: 0.875rem;
}

.ahsf__panel--price input {
	width: 100%;
	min-height: 2.5rem;
	padding: 0.5rem 0.6rem;
	border: 1px solid rgba(45, 43, 61, 0.15);
	border-radius: 0.5rem;
	font: inherit;
}

.ahsf__stock {
	gap: 0.5rem;
}

.ahsf__sort {
	margin-left: auto;
}

.ahsf__sort select {
	font-size: 1rem;
	width: 14rem;
	max-width: 14rem;
	-webkit-appearance: none;
	appearance: none;
	padding-right: 2.25rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%232D2B3D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 0.75rem auto;
}

/* Desktop: Schriftgroesse der nativen Sortieroptionen */
.ahsf__sort select option {
	font-size: 1rem;
}

.ahsf__actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.ahsf__apply,
.ahsf__reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.5rem;
	border-radius: 0.5rem;
	padding: 0.55rem 0.8rem;
	font: inherit;
	text-decoration: none;
	cursor: pointer;
}

.ahsf__apply {
	border: 0;
	background: #2d2b3d;
	color: #fff;
}

.ahsf__reset {
	color: #2d2b3d;
	background: transparent;
}

body.ahsf-is-loading #ah-shop-grid {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

/* =========================================================
   RESPONSIVE CONTROL BAR – TABLET + MOBILE
   ========================================================= */

.ahsf__drawer,
.ahsf__drawer-backdrop {
	display: none;
}

@media (max-width: 80rem) {
	.ahsf {
		border-radius: 0.5rem;
	}


	.ahsf__inner {
		padding: 0.75rem;
	}

	.ahsf__desktop {
		display: none;
	}

	.ahsf__compact {
		display: block;
	}

	.ahsf__compact-context {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 1rem;
		margin-bottom: 0.65rem;
		color: #2d2b3d;
	}

	.ahsf__compact-label {
		font-size: 0.75rem;
		line-height: 1rem;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		opacity: 0.62;
	}

	.ahsf__compact-context strong {
		text-align: right;
		font-size: 0.95rem;
		line-height: 1.25rem;
	}

	.ahsf__compact-actions {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 0.5rem;
	}

	.ahsf__compact-button {
		min-width: 0;
		min-height: 2.75rem;
		border: 1px solid rgba(45, 43, 61, 0.16);
		border-radius: 0.5rem;
		background: #fff;
		color: #2d2b3d;
		padding: 0.7rem 0.75rem;
		font: inherit;
		font-weight: 600;
		line-height: 1.15;
		cursor: pointer;
	}

	.ahsf__compact-button:hover,
	.ahsf__compact-button:focus-visible {
		background: rgba(241, 210, 119, 0.18);
		border-color: rgba(45, 43, 61, 0.24);
	}

	.ahsf__drawer-backdrop {
		position: fixed;
		inset: 0;
		z-index: 2147483645;
		display: block;
		background: rgba(22, 20, 30, 0.42);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.2s ease, visibility 0.2s ease;
	}

	.ahsf__drawer {
		position: fixed;
		z-index: 2147483646;
		top: 0;
		right: 0;
		display: flex;
		flex-direction: column;
		width: min(28rem, 92vw);
		height: 100%;
		background: #fff;
		box-shadow: -0.75rem 0 2.5rem rgba(45, 43, 61, 0.16);
		transform: translateX(102%);
		visibility: hidden;
		transition: transform 0.24s ease, visibility 0.24s ease;
	}

	body.ahsf-drawer-open {
		overflow: hidden;
	}

	body.ahsf-drawer-open .ahsf__drawer-backdrop {
		opacity: 1;
		visibility: visible;
	}

	body.ahsf-drawer-open .ahsf__drawer {
		transform: translateX(0);
		visibility: visible;
	}

	.ahsf__drawer-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		min-height: 4.25rem;
		padding: 0.8rem 1rem;
		border-bottom: 1px solid rgba(45, 43, 61, 0.09);
	}

	.ahsf__drawer-title {
		margin: 0 !important;
		color: #2d2b3d !important;
		font-family: inherit !important;
		font-size: 1.5rem !important;
		font-weight: 700 !important;
		line-height: 1.25 !important;
		letter-spacing: 0 !important;
		text-transform: none !important;
	}

	.ahsf__drawer-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 2.75rem;
		height: 2.75rem;
		border: 0;
		border-radius: 50%;
		background: transparent;
		color: #2d2b3d;
		font-size: 2rem;
		line-height: 1;
		cursor: pointer;
	}

	.ahsf__drawer-body {
		flex: 1 1 auto;
		min-height: 0;
		overflow-y: auto;
		padding: 0 1rem 1rem;
		-webkit-overflow-scrolling: touch;
	}

	.ahsf__drawer-section {
		padding-top: 0.35rem;
	}

	.ahsf__drawer-categories {
		display: grid;
	}

	.ahsf__drawer-category {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		min-height: 3.35rem;
		border-bottom: 1px solid rgba(45, 43, 61, 0.08);
		color: #2d2b3d;
		text-decoration: none;
		font-weight: 600;
	}

	.ahsf__drawer-category.is-active {
		color: #2d2b3d;
		background: rgba(241, 210, 119, 0.18);
		margin-inline: -0.5rem;
		padding-inline: 0.5rem;
		border-radius: 0.5rem;
		border-bottom-color: transparent;
	}

	.ahsf__drawer-group {
		margin: 0;
		padding: 1rem 0;
		border: 0;
		border-bottom: 1px solid rgba(45, 43, 61, 0.08);
	}

	.ahsf__drawer-group legend {
		width: 100%;
		padding-top: 0.7rem;
		margin-bottom: 0.7rem;
		color: #2d2b3d;
		font-size: 1rem;
		font-weight: 700;
	}

	.ahsf__drawer-options {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.4rem 0.75rem;
	}

	.ahsf__drawer-check,
	.ahsf__drawer-radio,
	.ahsf__drawer-stock {
		display: flex;
		align-items: center;
		gap: 0.65rem;
		min-height: 2.75rem;
		color: #2d2b3d;
		cursor: pointer;
	}

	.ahsf__drawer-check input,
	.ahsf__drawer-radio input,
	.ahsf__drawer-stock input {
		width: 1.1rem;
		height: 1.1rem;
		flex: 0 0 auto;
	}

	.ahsf__drawer-price {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 0.75rem;
	}

	.ahsf__drawer-price label {
		display: grid;
		gap: 0.35rem;
	}

	.ahsf__drawer-price input {
		width: 100%;
		min-height: 2.75rem;
		border: 1px solid rgba(45, 43, 61, 0.16);
		border-radius: 0.5rem;
		padding: 0.55rem 0.65rem;
		font: inherit;
	}

	.ahsf__drawer-stock {
		margin-top: 0.85rem;
	}

	.ahsf__drawer-footer {
		position: sticky;
		bottom: 0;
		display: grid;
		grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
		gap: 0.6rem;
		margin: 1rem -1rem -1rem;
		padding: 0.8rem 1rem;
		background: #fff;
		border-top: 1px solid rgba(45, 43, 61, 0.09);
	}

	.ahsf__drawer-reset,
	.ahsf__drawer-apply {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 3rem;
		border-radius: 0.5rem;
		padding: 0.65rem 0.8rem;
		font: inherit;
		font-weight: 600;
		text-decoration: none;
	}

	.ahsf__drawer-reset {
		border: 1px solid rgba(45, 43, 61, 0.14);
		background: #fff;
		color: #2d2b3d;
	}

	.ahsf__drawer-apply {
		border: 0;
		background: #2d2b3d;
		color: #fff;
		cursor: pointer;
	}

	.ahsf__drawer-sort-options {
		display: grid;
	}

	.ahsf__drawer-radio {
		border-bottom: 1px solid rgba(45, 43, 61, 0.08);
	}

	.ahsf__drawer-radio:last-child {
		border-bottom: 0;
	}
}

/* Mobile: Bottom Sheet */
@media (max-width: 47.9375rem) {
	.ahsf {
		top: var(--ahsf-sticky-top, 0.5rem);
	}

	.ahsf__inner {
		padding: 0.65rem;
	}

	.ahsf__compact-context {
		margin-bottom: 0.55rem;
	}

	.ahsf__compact-actions {
		gap: 0.35rem;
	}

	.ahsf__compact-button {
		min-height: 2.75rem;
		padding-inline: 0.35rem;
		font-size: 0.82rem;
	}

	.ahsf__drawer {
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		height: auto;
		max-height: 88vh;
		border-radius: 1rem 1rem 0 0;
		transform: translateY(102%);
		box-shadow: 0 -0.75rem 2.5rem rgba(45, 43, 61, 0.16);
	}

	body.ahsf-drawer-open .ahsf__drawer {
		transform: translateY(0);
	}

	.ahsf__drawer-head {
		min-height: 4rem;
	}

	.ahsf__drawer-title {
		font-size: 1.375rem !important;
	}

	.ahsf__drawer-options {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ahsf__category,
	.ahsf__drawer,
	.ahsf__drawer-backdrop,
	body.ahsf-is-loading #ah-shop-grid {
		transition: none;
	}
}
