/* ==========================================================================
   Filter Studio — mobile off-canvas drawer

   Gated on .fst-mobile-on (set on <html> by fst-mobile.js) rather than a media
   query, because the breakpoint is a dashboard setting and a media query
   cannot read one. Without that class NOTHING here applies, so desktop
   rendering is byte-for-byte unchanged.

   Nothing here styles or hides products. The button simply takes the slot the
   filter panel vacated, so no sidebar column has to be collapsed at all.
   ========================================================================== */

.fst-mobile-bar,
.fst-drawer {
	display: none;
}

/* --- 1. The Filter button ------------------------------------------------- */

/*
 * Deliberately in normal flow — no sticky, no fixed. JS drops this into the
 * exact slot the filter panel vacated, so it appears where the desktop panel
 * sat and scrolls with the page like any other block.
 */
.fst-mobile-on .fst-mobile-bar {
	display: block;
	margin: 0 0 14px;
}

.fst-mobile-on .fst-mobile-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	min-height: 48px;
	padding: 12px 18px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	appearance: none;
}

.fst-mobile-on .fst-mobile-toggle:focus-visible {
	outline: 2px solid var(--fst-accent, #d6a94c);
	outline-offset: 2px;
}

/* Button styles — chosen in Filter Studio → Mobile filter drawer. */

.fst-mobile-on .fst-mobile-toggle--solid {
	background: var(--fst-bg, #0b0b0e);
	border: 1px solid var(--fst-line, rgba(128, 128, 128, 0.25));
	border-radius: 10px;
	color: var(--fst-text, #f2f2f4);
}

.fst-mobile-on .fst-mobile-toggle--outline {
	background: transparent;
	border: 2px solid currentColor;
	border-radius: 10px;
	color: inherit;
}

.fst-mobile-on .fst-mobile-toggle--pill {
	background: var(--fst-accent, #d6a94c);
	border: 0;
	border-radius: 999px;
	color: var(--fst-tick, #14140f);
}

.fst-mobile-on .fst-mobile-toggle--minimal {
	min-height: 0;
	padding: 6px 0;
	background: none;
	border: 0;
	border-radius: 0;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.fst-mobile-on .fst-mobile-toggle__icon {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
}

/* --- 2. Drawer ------------------------------------------------------------ */

.fst-mobile-on .fst-drawer {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 999999;
	display: block;
	width: 100%;
	height: 100%;
	visibility: hidden;
	pointer-events: none;
}

.fst-mobile-on .fst-drawer.is-open {
	visibility: visible;
	pointer-events: auto;
}

.fst-mobile-on .fst-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.fst-mobile-on .fst-drawer.is-open .fst-drawer__backdrop {
	opacity: 1;
}

.fst-mobile-on .fst-drawer__dialog {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	width: min(86vw, 380px);
	height: 100%;
	background: var(--fst-bg, #0b0b0e);
	color: var(--fst-text, #f2f2f4);
	/* Slides in from the left. */
	transform: translate3d(-100%, 0, 0);
	transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
}

.fst-mobile-on .fst-drawer.is-open .fst-drawer__dialog {
	transform: translate3d(0, 0, 0);
}

.fst-mobile-on .fst-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex: 0 0 auto;
	padding: 14px 16px;
	border-bottom: 1px solid var(--fst-line, rgba(128, 128, 128, 0.25));
}

.fst-mobile-on .fst-drawer__title {
	margin: 0;
	padding: 0;
	/* Follows the set's Heading size, like the group headings inside. */
	font-size: var(--fst-heading-size, 16px);
	font-weight: 600;
	line-height: 1.2;
	color: inherit;
}

.fst-mobile-on .fst-drawer__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: -6px -6px -6px 0;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 8px;
	color: inherit;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	appearance: none;
}

.fst-mobile-on .fst-drawer__close:focus-visible {
	outline: 2px solid var(--fst-accent, #d6a94c);
	outline-offset: 2px;
}

.fst-mobile-on .fst-drawer__body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 0 16px;
}

/*
 * Neutralise the panel's own frame inside the drawer. .fst-panel sets these
 * with !important, so these need both !important and the extra specificity.
 */
.fst-mobile-on .fst-drawer .fst-panel {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 0 8px !important;
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
}

/* The panel's own submit row is redundant next to the drawer's Apply. */
.fst-mobile-on .fst-drawer .fst-panel .fst-actions {
	display: none;
}

/*
 * Footer hidden by default. Filters apply on mobile exactly as on desktop, so
 * in auto mode the tap has already applied and in ajax mode the results are
 * already swapped — an Apply button would be a no-op. JS adds --has-apply only
 * when the set genuinely waits for one.
 */
.fst-mobile-on .fst-drawer__foot {
	display: none;
	flex: 0 0 auto;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--fst-line, rgba(128, 128, 128, 0.25));
}

.fst-mobile-on .fst-drawer--has-apply .fst-drawer__foot {
	display: block;
}

.fst-mobile-on .fst-drawer__apply {
	display: block;
	width: 100%;
	min-height: 48px;
	padding: 13px 18px;
	background: var(--fst-accent, #d6a94c);
	border: 0;
	border-radius: 10px;
	color: var(--fst-tick, #14140f);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	appearance: none;
}

.fst-mobile-on .fst-drawer__apply:focus-visible {
	outline: 2px solid var(--fst-text, #f2f2f4);
	outline-offset: 2px;
}

/* --- 4. Scroll lock ------------------------------------------------------- */

body.fst-scroll-locked {
	position: fixed;
	width: 100%;
	overflow: hidden;
}

/* --- Reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.fst-drawer__dialog,
	.fst-drawer__backdrop {
		transition: none;
	}
}
