/**
 * Inline filter dropdowns shortcode styles.
 *
 * Renders two compact pill-style dropdowns (Type and Sort) that match the
 * banner navigation on the website-templates archive.
 *
 * @since 2.4.15
 */

.wp-block-group:has( > .stc-inline-filters ),
.wp-block-group:has( .stc-inline-filters ) {
	z-index: 50;
	position: relative;
}

.stc-inline-filters {
	position: relative;
	z-index: 100;
	display: flex;
	gap: 16px;
	padding: 12px 0;
	align-items: center;
	justify-content: flex-end;
}

.stc-inline-filter {
	position: relative;
	z-index: 1;
	display: inline-block;
}

.stc-inline-filter[data-open="true"] {
	z-index: 2;
}

.stc-inline-filter-toggle,
.stc-inline-filter-toggle:hover,
.stc-inline-filter-toggle:focus,
.stc-inline-filter-toggle:active {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	min-width: 110px;
	padding: 5px 12px;
	background-color: #fff;
	background-image: none;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	color: #535760;
	cursor: pointer;
	line-height: 1.4;
	text-decoration: none;
	box-shadow: none;
	white-space: nowrap;
	outline: none;
}

.stc-inline-filter-toggle:focus-visible {
	box-shadow: 0 0 0 2px rgba( 73, 44, 221, 0.25 );
}

.stc-inline-filter-label {
	flex: 1 1 auto;
	text-align: left;
	overflow: hidden;
	text-overflow: ellipsis;
}

.stc-inline-filter-chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 12px;
	height: 12px;
	flex: 0 0 auto;
	color: #9ca3af;
	transition: transform 0.15s ease;
}

.stc-inline-filter-chevron svg {
	width: 100%;
	height: 100%;
}

.stc-inline-filter-toggle[aria-expanded="true"] .stc-inline-filter-chevron {
	transform: rotate( 180deg );
}

.stc-inline-filter-menu {
	position: absolute;
	top: calc( 100% + 6px );
	left: 0;
	right: auto;
	min-width: 100%;
	max-width: 240px;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	box-shadow: 0 10px 24px rgba( 0, 0, 0, 0.08 );
	z-index: 50;
	display: none;
}

.stc-inline-filter[data-open="true"] .stc-inline-filter-menu {
	display: block;
}

.stc-inline-filter-menu li {
	padding: 6px 12px;
	font-size: 14px;
	font-weight: 600;
	color: #535760;
	cursor: pointer;
	white-space: nowrap;
	transition:
		background 0.15s ease,
		color 0.15s ease;
	margin: 0;
	list-style: none;
	line-height: 1.4;
}

.stc-inline-filter-menu li:hover,
.stc-inline-filter-menu li:focus {
	background: #492cdd;
	color: #fff;
	outline: none;
}
.stc-inline-filter-menu li.is-active:hover,
.stc-inline-filter-menu li.is-active:focus {
	background: #492cdd;
	color: #fff;
}

.stc-inline-filter-menu li.is-active {
	color: #fff;
	background: #492cdd;
	font-weight: 600;
}

.stc-inline-filter-menu li.is-active::after {
	content: "";
}

@media (max-width: 768px) {
	.stc-inline-filters {
		gap: 8px;
	}

	.stc-inline-filter-toggle {
		min-width: 112px;
		padding: 8px 12px;
		font-size: 13px;
	}

	.stc-inline-filter-menu li {
		padding: 8px 12px;
		font-size: 13px;
	}
}

@media (max-width: 480px) {
	.stc-inline-filter-toggle {
		min-width: 0;
		flex: 1 1 auto;
	}

	.stc-inline-filter {
		flex: 1 1 calc( 50% - 4px );
	}
}
