/* =============================================================================
 * Peagreen Native Search - front-end styles
 *
 * Design language, top to bottom:
 *   - Structural controls (the search input, buttons, every combobox trigger
 *     in the 'bar' layout) are square-cornered (radius 0) with a bold
 *     border - this plugin's own visual signature.
 *   - Anything the visitor SELECTS (category/tag/artist pills inside a
 *     dropdown, the active-filter chips) is fully rounded where it's a
 *     stand-alone badge (chips), or a plain tinted row where it's part of a
 *     list (dropdown options) - see the colour tokens below.
 *   - Every accent colour reads through --pgns-accent (see below) rather
 *     than being written per element, and it in turn reads through the
 *     site's own --peagreen-* custom properties wherever they exist, with
 *     this plugin's original pink/green as the fallback for a site that
 *     doesn't define them.
 * ========================================================================= */

.pgns {
	/*
	 * Brand colours. These read the SITE's own --peagreen-* custom
	 * properties first (defined once, sitewide - see the brand palette in
	 * the design brief) and only fall back to this plugin's own pink/green
	 * if a property isn't defined, e.g. on a site that doesn't set them.
	 */
	--pgns-license-color: var(--peagreen-pink, #ff66b2);
	--pgns-license-color-dark: var(--peagreen-pink-dark, hsl(336, 77%, 60%));
	--pgns-license-tint: var(--peagreen-pink-tint, hsl(337, 100%, 96%));
	--pgns-exclusive-color: var(--peagreen-green, #16d08b);
	--pgns-exclusive-color-dark: var(--peagreen-green-dark, hsl(142, 60%, 42%));
	--pgns-exclusive-tint: var(--peagreen-green-tint, hsl(160, 38%, 94%));
	--pgns-on-color: var(--peagreen-on-color, #fff);
	--pgns-text: var(--peagreen-base-text, #1d1d1d);
	--pgns-muted: #767676;
	--pgns-border: #dcdcdc;
	--pgns-border-strong: #9a9a9a !important;
	--pgns-bg: #fff;
	--pgns-panel-bg: #fafaf9;
	--pgns-hover: #f4f4f4;

	/*
	 * The widget's current "primary" colour - pink (Licensed) unless
	 * something says otherwise. Two things can say otherwise, in order:
	 *  1. The page-level context: the body gets peagreen-context-license /
	 *     peagreen-context-exclusive on a page dedicated to one license type
	 *     (see the body-class rules below) - the sitewide signal for "which
	 *     brand colour is this page".
	 *  2. This widget's OWN live selection: if the visitor has picked
	 *     exactly one license type in the License Type control right here,
	 *     that takes precedence over the page-level default (see
	 *     [data-pgns-license-active] further down, which is deliberately
	 *     placed after the body-class rules so it wins when both apply).
	 * Every accent-based colour (buttons, chips, focus rings, the filter
	 * badge, selected-option tints) reads through --pgns-accent /
	 * --pgns-accent-dark / --pgns-tint, so re-pointing just these three is
	 * enough to re-theme the whole widget.
	 */
	--pgns-accent: var(--pgns-license-color);
	--pgns-accent-dark: var(--pgns-license-color-dark);
	--pgns-tint: var(--pgns-license-tint);

	position: relative;
	width: 100%;
	box-sizing: border-box;
	color: var(--pgns-text);
	font-size: 16px;
	font-family: 'europa', sans-serif !important;
	line-height: 1.4;
}

/* 1. Page-level default: which license type is this PAGE about. */
body.peagreen-context-license .pgns {
	--pgns-accent: var(--pgns-license-color);
	--pgns-accent-dark: var(--pgns-license-color-dark);
	--pgns-tint: var(--pgns-license-tint);
}

body.peagreen-context-exclusive .pgns {
	--pgns-accent: var(--pgns-exclusive-color);
	--pgns-accent-dark: var(--pgns-exclusive-color-dark);
	--pgns-tint: var(--pgns-exclusive-tint);
}

/* 2. This widget's own live selection - wins over the page-level default
   above (same specificity, declared later). Set by JS on the root element
   whenever exactly one license type is the active filter. */
.pgns[data-pgns-license-active="exclusive"] {
	--pgns-accent: var(--pgns-exclusive-color);
	--pgns-accent-dark: var(--pgns-exclusive-color-dark);
	--pgns-tint: var(--pgns-exclusive-tint);
}

.pgns[data-pgns-license-active="license"] {
	--pgns-accent: var(--pgns-license-color);
	--pgns-accent-dark: var(--pgns-license-color-dark);
	--pgns-tint: var(--pgns-license-tint);
}

.pgns *,
.pgns *::before,
.pgns *::after {
	box-sizing: border-box;
}

.pgns [hidden] {
	display: none !important;
}

/* -----------------------------------------------------------------------
 * Defeat theme / Elementor / reset.css defaults on buttons and form
 * controls (1). Many themes and page builders ship a global reset that
 * repaints every <button>/<input> - default, :hover AND :focus alike - in
 * their own brand colour, sometimes with !important, so a plain
 * higher-specificity .pgns selector alone isn't always enough to win.
 * This neutralises the properties that actually get fought over first;
 * every rule further down that sets one of these same properties on a
 * specific control also carries !important, so nothing loaded elsewhere
 * on the page - regardless of its own specificity or load order - can
 * repaint this widget's buttons, inputs, radios or checkboxes.
 * ----------------------------------------------------------------------- */
.pgns button,
.pgns input[type="search"],
.pgns input[type="text"],
.pgns input[type="radio"],
.pgns input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none !important;
	text-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	font-family: inherit !important;
}

.pgns button:hover,
.pgns button:focus,
.pgns button:active,
.pgns button:focus-visible,
.pgns input:hover,
.pgns input:focus,
.pgns input:focus-visible {
	box-shadow: none !important;
	text-decoration: none !important;
}

/* Search bar */
.pgns .pgns__form {
	display: flex;
	align-items: stretch;
	gap: 0;
	margin: 0;
}

.pgns .pgns__input {
	flex: 1;
	min-width: 0;
	height: 46px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--pgns-border-strong) !important;
	font-family: 'europa', sans-serif !important;
	border-radius: 3px !important;
	background: var(--pgns-bg) !important;
	color: var(--pgns-text) !important;
	font: inherit;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
}

.pgns .pgns__input:focus {
	outline: 2px solid var(--pgns-accent) !important;
	outline-offset: 0;
}

.pgns .pgns__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 46px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--pgns-border-strong) !important;
	border-left: 0 !important;
	border-radius: 0 !important;
	background: var(--pgns-bg) !important;
	color: var(--pgns-text) !important;
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}

.pgns .pgns__btn:hover {
	background: var(--pgns-hover) !important;
}

.pgns .pgns__btn:focus-visible {
	outline: 2px solid var(--pgns-accent) !important;
	outline-offset: -2px;
}

.pgns .pgns__go {
	background: var(--pgns-accent) !important;
	border-color: var(--pgns-accent) !important;
	color: var(--pgns-on-color) !important;
}

.pgns .pgns__go:hover {
	background: var(--pgns-accent-dark) !important;
	border-color: var(--pgns-accent-dark) !important;
}

/* Filter button (modal layout) + its "N active" count badge */
.pgns .pgns__filter-btn.is-active {
	background: var(--pgns-tint) !important;
	border-color: var(--pgns-accent) !important;
	color: var(--pgns-accent-dark) !important;
}

.pgns .pgns__badge {
	position: absolute;
	top: -8px;
	right: -8px;
	z-index: 2;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: var(--pgns-accent-dark);
	color: var(--pgns-on-color);
	font-size: 12px;
	font-weight: 600;
	line-height: 20px;
	text-align: center;
}

/* Active filter chips - border + text in the current accent colour, filled
   with a tint of that same colour, per the brand spec. A redirect-mode
   widget (the global header bar) never renders its own copy of these
   whenever an ajax filters widget is also on the page - see suppressChips
   in search.js - so the same chip never appears twice on one page. */
.pgns .pgns__chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 15px;
}

.pgns .pgns__chips:first-child {
	margin-top: 0;
}

.pgns .pgns__chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 6px 10px 6px 14px;
	border: 1.5px solid var(--pgns-accent) !important;
	border-radius: 999px !important;
	background: var(--pgns-tint) !important;
	color: var(--pgns-accent-dark) !important;
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}

.pgns .pgns__chip:hover {
	filter: brightness(0.97);
}

.pgns .pgns__chip-x {
	font-size: 16px;
	line-height: 1;
	opacity: .7;
}

.pgns .pgns__chip:hover .pgns__chip-x {
	opacity: 1;
}

/* Live-results dropdown (redirect mode, typing in the header search bar) */
.pgns .pgns__drop {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 999;
	max-height: min(70vh, 520px);
	margin-top: 4px;
	overflow-y: auto;
	background: var(--pgns-bg);
	border: 1px solid var(--pgns-border);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.pgns .pgns__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	border-bottom: 1px solid var(--pgns-border);
	color: var(--pgns-text);
	text-decoration: none;
}

.pgns .pgns__item:hover,
.pgns .pgns__item.is-active {
	background: var(--pgns-hover);
}

.pgns .pgns__eyebrow {
	flex: 0 0 68px;
	color: var(--pgns-muted);
	font-size: 11px;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.pgns .pgns__thumb {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border-radius: 3px;
	object-fit: cover;
	background: #eee;
}

.pgns .pgns__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.pgns .pgns__title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pgns .pgns__sub {
	color: var(--pgns-muted);
	font-size: 12px;
}

.pgns mark {
	background: #fff1a8;
	color: inherit;
	padding: 0;
}

.pgns .pgns__pill {
	flex: 0 0 auto;
	padding: 2px 9px;
	border-radius: 10px;
	background: #efefef;
	color: #444;
	font-size: 11px;
}

/* A pill always reflects the PRODUCT's own classification (not whichever
   filter the viewer currently has active), so these read the fixed
   license/exclusive colour variables directly, rather than
   --pgns-accent / --pgns-tint. */
.pgns .pgns__pill--license {
	background: var(--pgns-license-tint);
	color: var(--pgns-license-color-dark);
}

.pgns .pgns__pill--exclusive {
	background: var(--pgns-exclusive-tint);
	color: var(--pgns-exclusive-color-dark);
}

.pgns .pgns__all {
	display: block;
	padding: 12px 16px;
	color: var(--pgns-accent-dark);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
}

.pgns .pgns__all:hover,
.pgns .pgns__all.is-active {
	background: var(--pgns-hover);
}

.pgns .pgns__empty {
	padding: 14px 16px;
	color: var(--pgns-muted);
}

.pgns.is-loading .pgns__input {
	border-color: var(--pgns-muted);
}

/* Filter panel - shared base for every layout (modal/row/sidebar/bar).
   Per-layout rules further down only change how the panel is POSITIONED
   and grouped; a facet's title, its checkbox/radio options and its footer
   buttons all come from here first, so every layout shares one family of
   spacing and type instead of four separately-tuned ones. */
.pgns .pgns__backdrop {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(20, 20, 20, .4);
}

.pgns[data-pgns-layout="modal"] .pgns__panel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	width: min(400px, 100%);
	background: var(--pgns-bg);
	box-shadow: -8px 0 28px rgba(0, 0, 0, .16);
}

.pgns .pgns__panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
	border-bottom: 1px solid var(--pgns-border);
}

.pgns .pgns__panel-title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
}

.pgns .pgns__close {
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0 !important;
	border-radius: 999px !important;
	background: none !important;
	color: inherit !important;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s;
}

.pgns .pgns__close:hover {
	background: var(--pgns-hover) !important;
}

.pgns .pgns__panel-body {
	flex: 1;
	overflow-y: auto;
	padding: 12px 24px 24px;
}

.pgns .pgns__facet {
	margin: 0 0 24px;
	padding: 0;
	border: 0;
}

.pgns .pgns__facet:last-child {
	margin-bottom: 0;
}

.pgns .pgns__facet-title {
	display: block;
	margin: 0 0 10px;
	padding: 0;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--pgns-muted);
}

.pgns .pgns__facet-input {
	width: 100%;
	height: 42px;
	margin: 0 0 10px;
	padding: 0 14px;
	border: 1px solid var(--pgns-border-strong) !important;
	border-radius: 0 !important;
	background: var(--pgns-bg) !important;
	color: var(--pgns-text) !important;
	font: inherit;
	box-shadow: none !important;
}

.pgns .pgns__facet-input:focus {
	outline: 1px solid var(--pgns-accent) !important;
	outline-offset: -1px;
}

.pgns .pgns__opt {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 7px 8px;
	border-radius: 4px;
	cursor: pointer;
	transition: background .12s, color .12s;
}

.pgns .pgns__opt:hover {
	background: var(--pgns-hover) !important;
}

.pgns .pgns__opt:has(input:focus-visible) {
	outline: 2px solid var(--pgns-accent) !important;
	outline-offset: 1px;
}

/* Checkboxes/radios inside a filter list. These get appearance:none from the
 * theme-defeat rule near the top of this file (same reason as every other
 * control here - a theme reset can't be allowed to repaint them), which also
 * strips their native box AND makes accent-color (what this used to rely on
 * for the check/dot) a no-op - together that left nothing but an empty gap
 * where the checkbox used to be (4). Everything below is a full replacement:
 * a real border always, a filled box + a checkmark/dot drawn with ::after
 * once checked - no native rendering involved at any point. */

label.pgns__opt {
	font-size: 0.825rem !important;
}

.pgns .pgns__opt input {
	flex: 0 0 auto;
	position: relative;
	width: 18px;
	height: 18px;
	margin: 0;
	border: 1px solid var(--pgns-border-strong) !important;
	background: var(--pgns-bg) !important;
	cursor: pointer;
}

.pgns .pgns__opt input[type="checkbox"] {
	border-radius: 4px !important;
}

.pgns .pgns__opt input[type="radio"] {
	border-radius: 50% !important;
}

/* Checked: the box itself takes the active context colour (the same accent
 * a checked row is already tinted with elsewhere on the page)... */
.pgns .pgns__opt input:checked {
	border-color: var(--pgns-accent-dark) !important;
}

/* ...and a checkmark in a DARKER tint of that same colour sits on top of it. */
.pgns .pgns__opt input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 2px;
	width: 5px;
	height: 9px;
	border: solid var(--pgns-accent-dark);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.pgns .pgns__opt input[type="radio"]:checked::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--pgns-accent-dark) !important;
	transform: translate(-50%, -50%);
}

.pgns .pgns__opt-name {
	flex: 1;
}

/* Actively-selected filters read the same accent colour throughout the
   plugin - the same tint/text used for the chips below - so a viewer sees
   at a glance, inside ANY multi-select list, which entries are already
   picked, not just in the chips row. */
.pgns .pgns__opt:has(input:checked) {
	background: var(--pgns-tint) !important;
	color: var(--pgns-accent-dark) !important;
}

.pgns .pgns__opt:has(input:checked):hover {
	filter: brightness(0.97);
}

.pgns .pgns__opt.is-locked {
	opacity: .6;
	cursor: default;
}

.pgns .pgns__opt.is-locked:hover {
	background: none !important;
}

.pgns .pgns__opt.is-locked input {
	cursor: not-allowed;
}

.pgns .pgns__opt.is-locked .pgns__opt-name {
	color: var(--pgns-muted);
}

.pgns .pgns__locked {
	margin-left: auto;
	color: var(--pgns-muted);
	font-size: 12px;
	font-weight: 500;
	text-decoration: underline;
}

/* License Type options keep their OWN type colour (Exclusive = green,
   Licensed = pink) rather than whichever colour happens to be the current
   accent, so the two stay visually distinguishable from each other even
   when neither is the active selection - this overrides the generic
   selected-tint rule above for this one facet. No neutral "All" colour is
   needed any more - see (7), licenseFacet() no longer offers that option. */
.pgns .pgns__facet--license .pgns__opt[data-kind="exclusive"] .pgns__opt-name {
	color: var(--pgns-exclusive-color-dark) !important;
}

.pgns .pgns__facet--license .pgns__opt[data-kind="license"] .pgns__opt-name {
	color: var(--pgns-license-color-dark) !important;
}

/* Exclusive/Licensed keep their own colour rather than the current accent
 * (see the comment above these two rules) - same border/fill/dot approach as
 * the generic checked state above, just pinned to each option's own colour
 * instead of following --pgns-accent. */
.pgns .pgns__facet--license .pgns__opt[data-kind="exclusive"] input {
	border-color: var(--pgns-exclusive-color-dark) !important;
}

.pgns .pgns__facet--license .pgns__opt[data-kind="license"] input {
	border-color: var(--pgns-license-color-dark) !important;
}

.pgns .pgns__facet--license .pgns__opt[data-kind="exclusive"] input:checked {
	border-color: var(--pgns-exclusive-color-dark) !important;
}

.pgns .pgns__facet--license .pgns__opt[data-kind="license"] input:checked {
	border-color: var(--pgns-license-color-dark) !important;
}

.pgns .pgns__facet--license .pgns__opt[data-kind="exclusive"] input:checked::after {
	background: var(--pgns-exclusive-color-dark) !important;
}

.pgns .pgns__facet--license .pgns__opt[data-kind="license"] input:checked::after {
	background: var(--pgns-license-color-dark) !important;
}

.pgns .pgns__facet--license .pgns__opt[data-kind="exclusive"]:has(input:checked) {
	background: var(--pgns-exclusive-tint) !important;
	color: var(--pgns-exclusive-color-dark) !important;
}

.pgns .pgns__facet--license .pgns__opt[data-kind="license"]:has(input:checked) {
	background: var(--pgns-license-tint) !important;
	color: var(--pgns-license-color-dark) !important;
}

/* A locked option (Exclusive, for a viewer without Pro access) needs to win
 * over the six per-kind colour rules directly above - same selector shape
 * (.pgns__facet--license .pgns__opt[data-kind=...] ...) so specificity ties,
 * and these come after in the file so the tie goes to greying it out. Every
 * property those rules can set on a locked option gets flattened to a
 * neutral grey here, whichever kind it is. */
.pgns .pgns__facet--license .pgns__opt.is-locked[data-kind="exclusive"] .pgns__opt-name,
.pgns .pgns__facet--license .pgns__opt.is-locked[data-kind="license"] .pgns__opt-name {
	color: var(--pgns-muted) !important;
}

.pgns .pgns__facet--license .pgns__opt.is-locked[data-kind="exclusive"] input,
.pgns .pgns__facet--license .pgns__opt.is-locked[data-kind="license"] input {
	border-color: var(--pgns-border) !important;
	background: var(--pgns-hover) !important;
}

.pgns .pgns__hint {
	margin: 4px 0;
	color: var(--pgns-muted);
	font-size: 13px;
}

.pgns .pgns__more {
	margin: 8px 0 0;
	padding: 4px 0;
	border: 0 !important;
	background: none !important;
	color: var(--pgns-accent-dark) !important;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}

.pgns .pgns__more:hover {
	text-decoration: underline;
}

.pgns .pgns__panel-foot {
	display: flex;
	gap: 12px;
	padding: 16px 24px;
	border-top: 1px solid var(--pgns-border);
}

.pgns .pgns__clear,
.pgns .pgns__apply {
	flex: 1;
	height: 46px;
	margin: 0;
	border: 1px solid var(--pgns-border-strong) !important;
	background: var(--pgns-bg) !important;
	color: var(--pgns-text) !important;
	font-weight: 500;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
}

.pgns .pgns__clear:hover {
	background: var(--pgns-hover) !important;
}

.pgns .pgns__apply {
	background: var(--pgns-accent) !important;
	border-color: var(--pgns-accent) !important;
	color: var(--pgns-on-color) !important;
}

.pgns .pgns__apply:hover {
	background: var(--pgns-accent-dark) !important;
	border-color: var(--pgns-accent-dark) !important;
}

/* Loading state (5): swap the label for three bobbing dots while an ajax
 * request from this click is in flight. Root already gets is-loading added/
 * removed by search.js's load()/runSuggest() - nothing extra to wire up here. */
.pgns__apply {
	position: relative;
}

.pgns__apply-dots {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

.pgns.is-loading .pgns__apply {
	cursor: wait;
	pointer-events: none;
}

.pgns.is-loading .pgns__apply-label {
	visibility: hidden;
}

.pgns.is-loading .pgns__apply-dots {
	display: inline-flex;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.pgns__apply-dots .pgns__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	animation: pgns-bob 0.9s infinite ease-in-out both;
}

.pgns__apply-dots .pgns__dot:nth-child(1) {
	animation-delay: -0.32s;
}

.pgns__apply-dots .pgns__dot:nth-child(2) {
	animation-delay: -0.16s;
}

.pgns__apply-dots .pgns__dot:nth-child(3) {
	animation-delay: 0s;
}

@keyframes pgns-bob {

	0%,
	80%,
	100% {
		transform: translateY(0);
		opacity: .6;
	}

	40% {
		transform: translateY(-4px);
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pgns__apply-dots .pgns__dot {
		animation: none;
		opacity: 1;
	}
}

@media (max-width: 640px) {
	.pgns .pgns__eyebrow {
		flex-basis: 56px;
	}

	.pgns[data-pgns-layout="modal"] .pgns__panel {
		top: auto;
		width: 100%;
		max-height: 88vh;
		box-shadow: 0 -8px 24px rgba(0, 0, 0, .2);
	}
}

/*
 * Layout: row - filters shown inline, always visible, in a wrapping
 * horizontal row (e.g. above the results grid). No backdrop, no open/close
 * state: the markup for this layout never has a .pgns__backdrop and the
 * panel is never [hidden]. A bordered "filter card" so the section reads
 * as one coherent module against the page.
 */
.pgns[data-pgns-layout="row"] .pgns__panel {
	position: static;
	width: 100%;
	margin-top: 16px;
	padding: 20px 24px;
	border: 1px solid var(--pgns-border);
	border-radius: 0;
	background: var(--pgns-panel-bg);
	box-shadow: none;
}

.pgns[data-pgns-layout="row"] .pgns__panel-body {
	display: flex;
	flex-wrap: wrap;
	gap: 22px 32px;
	overflow: visible;
	padding: 0;
}

.pgns[data-pgns-layout="row"] .pgns__facet {
	flex: 1 1 200px;
	min-width: 180px;
	margin: 0;
}

.pgns[data-pgns-layout="row"] .pgns__panel-foot {
	width: 100%;
	margin-top: 20px;
	padding: 16px 0 0;
	border-top: 1px solid var(--pgns-border);
	justify-content: flex-end;
}

.pgns[data-pgns-layout="row"] .pgns__clear,
.pgns[data-pgns-layout="row"] .pgns__apply {
	flex: 0 0 auto;
	height: 42px;
	padding: 0 24px;
}

@media (max-width: 640px) {
	.pgns[data-pgns-layout="row"] .pgns__panel {
		padding: 16px;
	}

	.pgns[data-pgns-layout="row"] .pgns__panel-body {
		flex-direction: column;
		gap: 18px;
	}

	.pgns[data-pgns-layout="row"] .pgns__facet {
		min-width: 0;
		width: 100%;
	}

	.pgns[data-pgns-layout="row"] .pgns__panel-foot {
		justify-content: stretch;
	}

	.pgns[data-pgns-layout="row"] .pgns__clear,
	.pgns[data-pgns-layout="row"] .pgns__apply {
		flex: 1;
	}
}

/*
 * Layout: sidebar - filters shown as a static vertical column. Intended to
 * sit next to the results grid using the page's own layout (an Elementor
 * column, a CSS grid, etc.) - this only stops the panel behaving like an
 * off-canvas dialog; placement next to the results is up to the page.
 */
.pgns[data-pgns-layout="sidebar"] .pgns__panel {
	position: static;
	display: block;
	width: 100%;
	margin-top: 16px;
	padding: 20px 22px;
	background: var(--pgns-panel-bg);
	border: 1px solid var(--pgns-border);
	border-radius: 0;
	box-shadow: none;
}

.pgns[data-pgns-layout="sidebar"] .pgns__panel-body {
	overflow: visible;
	padding: 0;
}

.pgns[data-pgns-layout="sidebar"] .pgns__panel-foot {
	margin-top: 20px;
	padding: 16px 0 0;
	border-top: 1px solid var(--pgns-border);
}

/* Neither inline layout (row/sidebar/bar) has a close button (there is
   nothing to close) or an off-canvas dialog - the panel is simply always
   there - so the head row (title + close) is hidden rather than built
   twice in JS for four layouts. */
.pgns[data-pgns-layout="row"] .pgns__panel-head,
.pgns[data-pgns-layout="sidebar"] .pgns__panel-head,
.pgns[data-pgns-layout="bar"] .pgns__panel-head {
	display: none;
}

/*
 * Layout: bar - filters only, no search input/button at all (the
 * .pgns__form is simply never rendered in PHP for this layout). Modelled
 * on a Behance-style filter toolbar: one row, License Type on the left,
 * Artists/Categories/Tags grouped at the right, each collapsed behind a
 * closed-by-default combobox (.pgns__combo below) rather than shown open
 * and inline - and only one combobox open at a time (see openCombos in
 * search.js). "Clear all"/"Show results" (.pgns__row-actions) sit on that
 * SAME row, past a divider at the far right - see (4) - rather than
 * their own full-width row below, which every other layout still uses
 * (.pgns__panel-foot further up). Active selections surface as removable
 * chips in their own row underneath (.pgns__chips - rendered AFTER the
 * panel in the markup for this one layout, so the DOM/tab order matches
 * the visual order; see class-pgns-frontend.php). No card/border around
 * the whole thing - each control carries its own border instead, matching
 * the site's own search bar look (see .pgns__combo-btn below) rather than
 * being boxed together.
 */
.pgns[data-pgns-layout="bar"] .pgns__panel {
	position: static;
	display: block;
	width: 100%;
	margin-top: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--pgns-border);
}

.pgns[data-pgns-layout="bar"] .pgns__panel-body {
	overflow: visible;
	padding: 0;
}

.pgns[data-pgns-layout="bar"] .pgns__row--bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.pgns[data-pgns-layout="bar"] .pgns__row-end {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}

.pgns[data-pgns-layout="bar"] .pgns__chips {
	padding-bottom: 16px;
	border-bottom: 1px solid var(--pgns-border);
}

/* "Clear all" / "Show results" (4): set apart from the filter combos with
   a divider + extra gap, not just adjacency, so the two clearly read as a
   different kind of control (actions, not more filters) even though
   they're on the same line. */
.pgns[data-pgns-layout="bar"] .pgns__row-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: 12px;
	padding-left: 16px;
	border-left: 1px solid var(--pgns-border);
}

/* Sized to sit inline with the combos on this one row, rather than the
   full-width bar these two buttons get in every other layout (see
   .pgns__panel-foot and the shared .pgns__clear/.pgns__apply rules above)
   - the "too large" buttons from (4). */
.pgns[data-pgns-layout="bar"] .pgns__clear,
.pgns[data-pgns-layout="bar"] .pgns__apply {
	flex: 0 0 auto;
	height: 46px;
	padding: 0 20px;
}

/* The combobox trigger - License Type / Artists / Categories / Tags. Same
   border/height/radius language as the search bar's own input (distinct
   2px border, square corners, white fill), so a control that opens a list
   reads as part of the same family as the text input next to it. The
   chevron (below) is the visual cue that this is a select, not a plain
   button - see (5). */
.pgns__combo {
	position: relative;
	display: inline-flex;
}

.pgns__clear,
.pgns__apply {
	font-family: 'europa', sans-serif !important;
	border-radius: 3px !important;
}

.pgns__clear {
	border: 1px solid var(--pgns-border-strong) !important;
}

.pgns__combo-btn {
	display: inline-flex;
	align-items: center;
	font-family: 'europa', sans-serif;
	gap: 8px;
	height: 46px;
	margin: 0;
	padding: 0 16px;
	border-radius: 3px !important;
	border: 1px solid var(--pgns-border-strong) !important;
	background: var(--pgns-bg) !important;
	color: var(--pgns-text) !important;
	font: inherit;
	font-weight: 500;
	white-space: nowrap;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}

.pgns__combo-btn:hover {
	background: var(--pgns-hover) !important;
}

.pgns__combo-btn:focus-visible {
	outline: 2px solid var(--pgns-accent) !important;
	outline-offset: 2px;
}

.pgns__combo[data-open="true"] .pgns__combo-btn {
	border-color: var(--pgns-accent) !important;
	background: var(--pgns-tint) !important;
}

.pgns__combo-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px !important;
	background: var(--pgns-accent) !important;
	color: var(--pgns-on-color) !important;
	font-size: 11px;
	font-weight: 700;
}

/* Drawn with mask + currentColor rather than a fixed-colour background
   image, so it always matches this button's own text colour (whatever
   that ends up being) instead of risking a chevron that's invisible
   against an unexpected override - and display/size/opacity are pinned
   with !important so nothing else on the page can hide it (5). */
.pgns__combo-chevron {
	flex: 0 0 auto;
	display: block !important;
	width: 11px !important;
	height: 11px !important;
	opacity: 1 !important;
	background-color: currentColor !important;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
	transition: transform .15s;
}

.pgns__combo[data-open="true"] .pgns__combo-chevron {
	transform: rotate(180deg);
}

/* The dropdown panel. Aligned to the left for the License Type combo (the
   left-most control) and to the right for the Artists/Categories/Tags
   group (sitting at the right edge of the row - a left-aligned panel there
   could overflow past the edge of the page), via the .pgns__row-end
   ancestor rather than a per-facet override. */
.pgns__combo-panel {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 40;
	width: max-content;
	min-width: 240px;
	max-width: min(320px, 90vw);
	max-height: 340px;
	overflow-y: auto;
	margin-top: 6px;
	padding: 14px;
	background: var(--pgns-bg) !important;
	border: 1px solid var(--pgns-border-strong) !important;
	box-shadow: 0 12px 28px rgba(0, 0, 0, .14) !important;
}

.pgns__row-end .pgns__combo-panel {
	left: auto;
	right: 0;
}

.pgns__combo-panel .pgns__facet {
	margin: 0;
}

.pgns__combo-panel .pgns__facet-input {
	margin-bottom: 10px;
}

.pgns__combo-panel .pgns__facet-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

@media (max-width: 640px) {
	.pgns[data-pgns-layout="bar"] .pgns__row--bar {
		flex-direction: column;
		align-items: stretch;
	}

	.pgns[data-pgns-layout="bar"] .pgns__row-end {
		margin-left: 0;
		width: 100%;
	}

	.pgns[data-pgns-layout="bar"] .pgns__row-actions {
		margin-left: 0;
		padding-left: 0;
		border-left: 0;
		padding-top: 12px;
		border-top: 1px solid var(--pgns-border);
		width: 100%;
	}

	.pgns[data-pgns-layout="bar"] .pgns__clear,
	.pgns[data-pgns-layout="bar"] .pgns__apply {
		flex: 1 1 auto;
	}

	.pgns[data-pgns-layout="bar"] .pgns__combo {
		flex: 1 1 auto;
	}

	.pgns[data-pgns-layout="bar"] .pgns__combo-btn {
		width: 100%;
		justify-content: space-between;
	}

	.pgns__combo-panel {
		left: 0;
		right: 0;
		width: auto;
		max-width: none;
	}

	.pgns__row-end .pgns__combo-panel {
		left: 0;
		right: 0;
	}
}

/* Results container while the filter bar is re-rendering it (search results template). */
.pgns-is-loading {
	opacity: .55;
	transition: opacity .15s;
}

@media (prefers-reduced-motion: reduce) {
	.pgns-is-loading {
		transition: none;
	}
}

/* Pagination links from [peagreen_native_search_pagination] (WordPress's own markup:
 * nav.pagination > .nav-links > a/span.page-numbers). Square corners and a bold border
 * to match the rest of the plugin; colours follow the site's --peagreen-* properties. */
.pgns-pagination {
	margin: 2rem 0;
}

.pgns-pagination .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.pgns-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .5rem;
}

.pgns-pagination .page-numbers {
	display: inline-block;
	min-width: 2.5rem;
	padding: .5rem .85rem;
	text-align: center;
	border: 1px solid var(--pgns-border-strong) !important;
	border-radius: 0;
	color: var(--peagreen-base-text, #1d1d1d);
	background: transparent;
	text-decoration: none;
	line-height: 1.2;
}

.pgns-pagination a.page-numbers:hover,
.pgns-pagination a.page-numbers:focus-visible {
	background: #f0f0f0;
	transition: 0.2s ease-in;
}

.pgns-pagination .page-numbers.current {
	background: var(--peagreen-base-text, #1d1d1d);
	color: var(--peagreen-on-color, #fff);
}

.pgns-pagination .page-numbers.dots {
	border-color: transparent;
}

.pgns-pagination .page-numbers.current {
	background: var(--e-global-color-primary) !important;
	color: white !important;
}
/* -----------------------------------------------------------------------
 * [peagreen_native_search_button] / "Peagreen Search Button" widget.
 * Deliberately low specificity and no !important, so the Elementor widget's
 * own Style controls ({{WRAPPER}} .pgns-button ...) always win.
 * ----------------------------------------------------------------------- */
.pgns-button {
	--pgns-btn: var(--peagreen-pink, #ff66b2);
	--pgns-btn-dark: var(--peagreen-pink-dark, hsl(336, 77%, 60%));
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	width: var(--pgns-button-width, auto);
	padding: .75em 1.5em;
	border: 1px solid var(--pgns-btn);
	border-radius: 0;
	background-color: var(--pgns-btn);
	color: var(--peagreen-on-color, #fff);
	font-family: 'europa', sans-serif;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}

.pgns-button--exclusive {
	--pgns-btn: var(--peagreen-green, #16d08b);
	--pgns-btn-dark: var(--peagreen-green-dark, hsl(142, 60%, 42%));
}

.pgns-button:hover,
.pgns-button:focus-visible {
	background-color: var(--pgns-btn-dark);
	border-color: var(--pgns-btn-dark);
	color: var(--peagreen-on-color, #fff);
	text-decoration: none;
}

.pgns-button:focus-visible {
	outline: 2px solid var(--pgns-btn);
	outline-offset: 2px;
}

.pgns-button__icon {
	flex: none;
	width: 1.15em;
	height: 1.15em;
}

@media (prefers-reduced-motion: reduce) {
	.pgns-button {
		transition: none;
	}
}

/* -----------------------------------------------------------------------
 * Facet lookup loading state (Artist / Categories / Tags search boxes):
 * a small spinner inside the search box, the current list dimmed until
 * the new results arrive.
 * ----------------------------------------------------------------------- */
.pgns .pgns__facet-search {
	position: relative;
	margin: 0 0 10px;
}

.pgns .pgns__facet-search .pgns__facet-input,
.pgns__combo-panel .pgns__facet-search .pgns__facet-input {
	margin: 0;
	padding-right: 38px;
}

.pgns .pgns__spinner {
	position: absolute;
	top: 50%;
	right: 14px;
	width: 14px;
	height: 14px;
	margin-top: -7px;
	border: 2px solid var(--pgns-border);
	border-top-color: var(--pgns-accent);
	border-radius: 50%;
	animation: pgns-spin .7s linear infinite;
	pointer-events: none;
}

/* The browser's own "clear" (x) in a search input would sit under the spinner. */
.pgns .pgns__facet-search.is-loading .pgns__facet-input::-webkit-search-cancel-button,
.pgns .pgns__facet.is-loading .pgns__facet-input::-webkit-search-cancel-button {
	display: none;
}

.pgns .pgns__facet.is-loading .pgns__facet-list,
.pgns .pgns__facet.is-loading .pgns__more {
	opacity: .45;
	transition: opacity .15s;
}

@keyframes pgns-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.pgns .pgns__spinner {
		animation-duration: 1.6s;
	}
	.pgns .pgns__facet.is-loading .pgns__facet-list,
	.pgns .pgns__facet.is-loading .pgns__more {
		transition: none;
	}
}

/* The widget's own wrapper fills the widget, so the button CAN be full width. */
.pgns-button-wrap {
	display: flex;
	width: 100%;
}

/* Elementor Advanced > Width = "Full Width (100%)" or "Custom": the button
   follows the widget's width instead of staying at its natural size. */
.elementor-widget__width-inherit .pgns-button,
.elementor-widget__width-initial .pgns-button {
	width: 100%;
}

/* [peagreen_native_search_count] */
.pgns-count {
	margin: 0 0 1rem;
	color: var(--peagreen-base-text, #1d1d1d);
	font-variant-numeric: tabular-nums;
}

/* [peagreen_native_search_breadcrumb] */
.pgns-breadcrumb__list {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pgns-breadcrumb__item {
	display: inline-flex;
	align-items: baseline;
	gap: .25rem;
	margin: 0;
}

.pgns-breadcrumb__sep {
	color: var(--pgns-muted, #767676);
	padding: 0 .15rem;
}

.pgns-breadcrumb__link {
	color: inherit;
	text-decoration: none;
}

.pgns-breadcrumb__link:hover,
.pgns-breadcrumb__link:focus-visible {
	text-decoration: underline;
}

.pgns-breadcrumb__current {
	font-weight: 600;
}

.pgns-pagination[hidden],
.pgns-count[hidden] {
	display: none !important;
}

/* -----------------------------------------------------------------------
 * Filter lists that know what else is ticked: product counts per option;
 * an option already ticked that now has nothing left is dimmed.
 * ----------------------------------------------------------------------- */
.pgns .pgns__opt-count {
	margin-left: auto;
	padding-left: 8px;
	color: var(--pgns-muted);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

.pgns .pgns__opt.is-empty .pgns__opt-name {
	color: var(--pgns-muted);
	text-decoration: line-through;
}

/* [peagreen_native_search_suggestions] */
.pgns-suggestions {
	margin: 1rem 0;
	color: var(--peagreen-base-text, #1d1d1d);
}

.pgns-suggestions[hidden] {
	display: none !important;
}

.pgns-suggestions__heading {
	margin: 0 0 .5rem;
	font-weight: 600;
}

.pgns-suggestions__list {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pgns-suggestions__link {
	display: inline-flex;
	gap: .4em;
	align-items: baseline;
	padding: .45rem .85rem;
	border: 1px solid var(--peagreen-pink, #ff66b2);
	color: inherit;
	text-decoration: none;
}

.pgns-suggestions__link:hover,
.pgns-suggestions__link:focus-visible {
	background: var(--peagreen-pink-tint, hsl(337, 100%, 96%));
}

.pgns-suggestions__count {
	color: #767676;
	font-size: .875em;
}
