/**
 * STL Woopy sidebar toggle — matches native .woopy_woocommerce_filters_button look,
 * scaled up for touch (Fontello \e863, theme colors, alter_bg bar).
 */

.stl-woopy-sidebar-toggle-wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0 0 1.8em;
}

.stl-woopy-sidebar-toggle-wrap:last-child {
	margin-bottom: 0;
}

/* Toggled by woopy-sidebar-toggle.js when viewport >= data-stl-hide-from (px). */
.stl-woopy-sidebar-toggle-wrap--hidden-wide {
	display: none !important;
}

/* Before JS / no JS: default breakpoint 1024 (Woopy tablet line). Other values rely on script only. */
@media (min-width: 1024px) {
	.stl-woopy-sidebar-toggle-wrap[data-stl-hide-from="1024"] {
		display: none !important;
	}
}

.stl-woopy-sidebar-toggle {
	box-sizing: border-box;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	flex-wrap: nowrap;

	width: 100%;
	min-height: 56px;
	padding: 1rem 1.5rem;
	margin: 0;

	/* Same voice as .woopy_woocommerce_filters_button, one step larger on small screens */
	font-size: 1.125rem;
	line-height: 1.375;
	font-weight: inherit;
	letter-spacing: inherit;
	text-decoration: none !important;

	color: var(--theme-color-text_dark);
	background-color: var(--theme-color-alter_bg_color, var(--theme-color-bg_color));
	border: 1px solid var(--theme-color-alter_bd_color, var(--theme-color-bd_color));
	border-radius: var(--theme-var-rad4, 4px);

	box-shadow: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	user-select: none;
	transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 1023px) {
	.stl-woopy-sidebar-toggle {
		padding-left: max(1.5rem, calc(1rem + env(safe-area-inset-left, 0px)));
		padding-right: max(1.5rem, calc(1rem + env(safe-area-inset-right, 0px)));
		/* Extra legibility on phones */
		font-size: 1.1875rem;
		line-height: 1.35;
		min-height: 58px;
	}
}

.stl-woopy-sidebar-toggle__label {
	display: inline-block;
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/*
 * Same glyph + metrics as .woopy_woocommerce_filters_button:before (woocommerce-extensions.css).
 * Overrides utility icon classes on the <a> so it always matches the theme Filters control.
 */
.stl-woopy-sidebar-toggle[class*="icon-"]::before {
	font-family: "fontello", sans-serif !important;
	content: "\e863" !important;
	margin: 0 10px 0 0 !important;
	font-weight: 400 !important;
	line-height: 0 !important;
	font-size: 1.05em !important;
	font-style: normal !important;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	flex-shrink: 0;
}

/* Text-only: no pseudo-icon */
.stl-woopy-sidebar-toggle:not([class*="icon-"])::before {
	content: none !important;
	display: none !important;
}

/* Native Woopy hover/focus (text link behavior, on a bar) */
.stl-woopy-sidebar-toggle:hover,
.stl-woopy-sidebar-toggle:focus {
	color: var(--theme-color-text);
	background-color: var(--theme-color-alter_bg_hover, var(--theme-color-alter_bg_color, var(--theme-color-bg_color)));
	border-color: var(--theme-color-alter_bd_hover, var(--theme-color-alter_bd_color, var(--theme-color-bd_color)));
	outline: none;
}

.stl-woopy-sidebar-toggle:active {
	opacity: 0.92;
}

.stl-woopy-sidebar-toggle:focus-visible {
	outline: 2px solid var(--theme-color-text_link, var(--theme-color-bd_color));
	outline-offset: 2px;
}

/* Desktop: still bigger than the stock text-only control, but not a huge bar */
@media (min-width: 1024px) {
	.stl-woopy-sidebar-toggle-wrap {
		width: auto;
		display: inline-block;
		vertical-align: middle;
		margin-bottom: 1.8em;
	}

	.stl-woopy-sidebar-toggle {
		width: auto;
		min-width: 11rem;
		min-height: 52px;
		padding: 0.85rem 1.35rem;
		font-size: 1rem;
		line-height: 22px;
	}
}

.elementor-widget-stl_woopy_sidebar_toggle .stl-woopy-sidebar-toggle-wrap {
	width: 100%;
}

@media (min-width: 1024px) {
	.elementor-widget-stl_woopy_sidebar_toggle .stl-woopy-sidebar-toggle-wrap {
		width: auto;
	}
}
