.amfd-filter-bar,
.amfd-drawer {
	display: none;
}

@media (max-width: 920px) {
	html.amfd-lock-scroll,
	html.amfd-lock-scroll body {
		overflow: hidden;
	}

	body.amfd-js .ast-left-sidebar #primary,
	body.amfd-js .ast-right-sidebar #primary,
	body.amfd-js.woocommerce-page.ast-left-sidebar #primary,
	body.amfd-js.woocommerce-page.ast-right-sidebar #primary {
		float: none;
		width: 100%;
	}

	body.amfd-js:not(.amfd-sidebar-docked) #secondary {
		display: none;
	}

	.amfd-filter-bar {
		display: flex;
		position: sticky;
		top: var(--amfd-button-top, 0);
		z-index: 90;
		align-items: center;
		justify-content: flex-start;
		margin: 0 0 16px;
		padding: 8px 0;
		background: var(--ast-global-color-5, #fff);
	}

	body.admin-bar .amfd-filter-bar {
		top: 46px;
	}

	.amfd-filter-button {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 44px;
		padding: 10px 16px;
		border: 1px solid var(--ast-border-color, #d9d9d9);
		border-radius: 4px;
		background: var(--ast-global-color-0, #0170b9);
		color: #fff;
		font: inherit;
		font-weight: 600;
		line-height: 1.2;
		cursor: pointer;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	}

	.amfd-filter-button:focus {
		outline: 2px solid currentColor;
		outline-offset: 2px;
	}

	.amfd-filter-button__icon {
		position: relative;
		width: 18px;
		height: 14px;
		margin-right: 8px;
		border-top: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
	}

	.amfd-filter-button__icon::before {
		position: absolute;
		top: 4px;
		left: 0;
		width: 18px;
		border-top: 2px solid currentColor;
		content: "";
	}

	.amfd-drawer {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 999999;
		visibility: hidden;
		pointer-events: none;
	}

	.amfd-drawer[aria-hidden="false"] {
		visibility: visible;
		pointer-events: auto;
	}

	.amfd-drawer__overlay {
		position: absolute;
		inset: 0;
		background: rgba(17, 24, 39, 0.55);
		opacity: 0;
		transition: opacity 180ms ease;
	}

	.amfd-drawer[aria-hidden="false"] .amfd-drawer__overlay {
		opacity: 1;
	}

	.amfd-drawer__panel {
		position: absolute;
		top: 0;
		left: 0;
		display: flex;
		flex-direction: column;
		width: min(88vw, 380px);
		height: 100%;
		max-width: 100%;
		background: var(--ast-global-color-5, #fff);
		color: var(--ast-global-color-3, #1f2937);
		box-shadow: 8px 0 28px rgba(0, 0, 0, 0.2);
		transform: translateX(-105%);
		transition: transform 220ms ease;
	}

	.amfd-drawer[aria-hidden="false"] .amfd-drawer__panel {
		transform: translateX(0);
	}

	.amfd-drawer__header {
		display: flex;
		flex: 0 0 auto;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		min-height: 60px;
		padding: 14px 18px;
		border-bottom: 1px solid var(--ast-border-color, #e5e7eb);
	}

	.amfd-drawer__title {
		margin: 0;
		font-size: 1.125rem;
		font-weight: 700;
		line-height: 1.3;
	}

	.amfd-drawer__close {
		position: relative;
		flex: 0 0 auto;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 1px solid var(--ast-border-color, #d9d9d9);
		border-radius: 4px;
		background: transparent;
		color: inherit;
		cursor: pointer;
	}

	.amfd-drawer__close:focus {
		outline: 2px solid currentColor;
		outline-offset: 2px;
	}

	.amfd-drawer__close span::before,
	.amfd-drawer__close span::after {
		position: absolute;
		top: 19px;
		left: 10px;
		width: 18px;
		border-top: 2px solid currentColor;
		content: "";
	}

	.amfd-drawer__close span::before {
		transform: rotate(45deg);
	}

	.amfd-drawer__close span::after {
		transform: rotate(-45deg);
	}

	.amfd-drawer__body {
		flex: 1 1 auto;
		min-height: 0;
		padding: 18px;
		overflow: auto;
		-webkit-overflow-scrolling: touch;
	}

	.amfd-drawer__body #secondary,
	.amfd-drawer__body .widget-area,
	.amfd-drawer__body .sidebar-main {
		display: block;
		float: none;
		width: 100%;
		margin: 0;
		padding: 0;
	}

	.amfd-drawer__body .widget {
		margin-bottom: 24px;
	}
}

@media (min-width: 783px) and (max-width: 920px) {
	body.admin-bar .amfd-filter-bar {
		top: 32px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.amfd-drawer__overlay,
	.amfd-drawer__panel {
		transition: none;
	}
}
