/* Engel Store Locator — minimal defaults for the four elements.
 *
 * Kept intentionally light so Bricks' own style controls (applied per-element
 * in the builder) can take over border, padding, font, colour, etc.
 */

/* ── Search ──────────────────────────────────────────────────────────────── */

.engel-sl-search {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.engel-sl-search__field {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	border: 1px solid currentColor;
	border-radius: 4px;
	padding: 0 8px;
	background: transparent;
}

.engel-sl-search__icon {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	opacity: 0.6;
	pointer-events: none;
}

/* Custom-icon glyph (font-icon <i> or SVG <img>) inside .engel-sl-search__icon. */
.engel-sl-search__icon-glyph {
	font-size: 1rem;
	width: auto;
	height: auto;
}
img.engel-sl-search__icon-glyph,
img.engel-sl-search__clear-glyph,
.engel-sl-icon-mask.engel-sl-search__icon-glyph,
.engel-sl-icon-mask.engel-sl-search__clear-glyph {
	width: 18px;
	height: 18px;
}

/* Recolour-able SVG icons rendered via CSS mask. The element's color cascades
 * into background-color: currentColor, and the SVG file masks the shape out of
 * that coloured rectangle. Set width/height directly with the icon-size control
 * (Bricks generates higher-specificity rules that override these defaults). */
.engel-sl-icon-mask {
	display: inline-block;
	width: 18px;
	height: 18px;
	background-color: currentColor;
	-webkit-mask-image: var( --engel-sl-icon-url );
	        mask-image: var( --engel-sl-icon-url );
	-webkit-mask-repeat: no-repeat;
	        mask-repeat: no-repeat;
	-webkit-mask-position: center;
	        mask-position: center;
	-webkit-mask-size: contain;
	        mask-size: contain;
}

.engel-sl-search__input {
	flex: 1;
	min-width: 0;
	padding: 8px 0;
	border: none;
	background: transparent;
	font-size: 1rem;
	line-height: 1.4;
	color: inherit;
	outline: none;
}

.engel-sl-search__input::placeholder {
	opacity: 0.5;
}

.engel-sl-search__clear {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	padding: 4px;
	background: none;
	border: none;
	cursor: pointer;
	opacity: 0.6;
	color: inherit;
	transition: opacity 0.15s;
}

.engel-sl-search__clear:hover { opacity: 1; }

/* Guard against CSS frameworks or themes that override the HTML `hidden`
 * attribute without !important, which would make the clear button visible
 * even when the input is empty. */
.engel-sl-search__clear[hidden],
.engel-sl-search__dropdown[hidden] { display: none !important; }

/* Autocomplete suggestions. Every default below is overridable from the Bricks
 * element panel ("Suggestions dropdown" group on the Store Locator Search
 * element) — background, border, radius, shadow, padding, max height, the gap
 * between field and dropdown, and the item typography / padding / highlight. */
.engel-sl-search__dropdown {
	position: absolute;
	top: calc( 100% + var( --engel-sl-dropdown-offset, 4px ) );
	left: 0;
	right: 0;
	z-index: 9999;
	list-style: none;
	margin: 0;
	padding: 4px 0;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba( 0, 0, 0, 0.12 );
	max-height: 280px;
	overflow-y: auto;
}

/* (hidden state handled above with !important) */

.engel-sl-search__dropdown li {
	padding: 10px 14px;
	cursor: pointer;
	font-size: 0.95rem;
	color: #333;
	transition: background 0.1s;
}

.engel-sl-search__dropdown li:hover,
.engel-sl-search__dropdown li[aria-selected="true"] {
	background: #f0f0f0;
}

/* Builder-only preview. With "Keep dropdown open while styling" enabled, the
 * element renders sample options and omits the `hidden` attribute so the
 * dropdown stays open in the canvas while its controls are adjusted. The
 * markup is only emitted inside the builder; this rule is the second guard so
 * a cached / stale render can never leak the preview onto the live site. */
body:not(.engel-sl-in-builder) .engel-sl-search__dropdown--preview {
	display: none !important;
}

/* Help text shown below the input. */
.engel-sl-search__help {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.4;
	opacity: 0.7;
	color: inherit;
}

/* ── Store Locator Filter (Store Type / Products) ────────────────────────
 * The <select> itself is decorated by Choices.js on demand (see
 * initFilters() in store-locator.js), which supplies its own complete
 * styling via choices.min.css/choices-layer.min.css — the element's own
 * Typography/Border controls target .choices__inner directly. This is just
 * the optional visible label above the field.
 */
.engel-sl-filter__label {
	display: block;
	margin: 0 0 6px;
	font-size: 0.9rem;
	font-weight: 600;
}

/* Per-field "Clear" link (Element_Store_Locator_Filter's "Show reset
 * button" control) — sits below the field itself, the same placement
 * Choices.js's own demos use for a field's auxiliary controls, rather than
 * competing with the label above it. Shown by store-locator.js only once
 * that field has a selection. Sized/coloured/spaced further by the
 * element's own "Reset button style" controls. */
.engel-sl-filter__reset {
	display: block;
	background: none;
	border: none;
	padding: 0;
	margin: 6px 0 0;
	font-size: 0.8rem;
	text-decoration: underline;
	cursor: pointer;
	color: inherit;
	opacity: 0.7;
}
.engel-sl-filter__reset:hover { opacity: 1; }
.engel-sl-filter__reset[hidden] { display: none !important; }

/* Standalone "Reset filters" button (Element_Store_Locator_Filter_Reset) —
 * clears every filter on the page at once. Shown only once at least one is
 * active; styled further by the element's own controls. */
.engel-sl-reset-filters {
	cursor: pointer;
	border: 1px solid currentColor;
	border-radius: 4px;
	padding: 8px 14px;
	background: transparent;
	color: inherit;
	font: inherit;
}
.engel-sl-reset-filters:hover { opacity: 0.75; }
.engel-sl-reset-filters[hidden] { display: none !important; }

/* Fallback box model when "Use Choices.js styling" is off (data-use-choices="0")
 * and the site hasn't set the Native select style controls (border/background/
 * padding) — Choices.js supplies its own box via .choices__inner instead, so
 * this never applies in that mode. */
.engel-sl-filter__select[data-use-choices="0"] {
	border: 1px solid currentColor;
	border-radius: 4px;
	padding: 8px 10px;
	background: transparent;
	color: inherit;
	font: inherit;
}

/* ── Floating-label mode ──────────────────────────────────────────────────
 * The label sits over the input by default and slides up when the input is
 * focused or contains text. CSS-only — no JS required. The render method
 * sets the input's placeholder to a single space so :placeholder-shown
 * correctly matches the empty state.
 */
/* Balanced padding so the user-typed text stays vertically centred in the
 * field. The floating <label> is absolutely positioned so it doesn't depend
 * on this padding for its at-rest position. */
.engel-sl-search--floating .engel-sl-search__field {
	padding-top: 6px;
	padding-bottom: 6px;
}

.engel-sl-search--floating .engel-sl-search__input {
	padding-top: 8px;
	padding-bottom: 8px;
}

.engel-sl-search--floating .engel-sl-search__input::placeholder {
	opacity: 0; /* hide the space we use as the floating-label trigger */
}

.engel-sl-search__label {
	position: absolute;
	left: 12px;
	/* Stay within the field — the right boundary prevents the label text from
	 * extending over the clear button on narrow screens. */
	right: 36px;
	top: 50%;
	transform: translateY( -50% );
	pointer-events: none;
	font-size: 1rem;
	line-height: 1;
	color: inherit;
	opacity: 0.55;
	padding: 0 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: top 0.18s ease, font-size 0.18s ease, opacity 0.18s ease;
}

/* When the search icon is present, push the label past it. */
.engel-sl-search__icon ~ .engel-sl-search__label {
	left: 34px;
}

/* Float up when the input has focus OR contains text. */
.engel-sl-search--floating .engel-sl-search__input:focus ~ .engel-sl-search__label,
.engel-sl-search--floating .engel-sl-search__input:not(:placeholder-shown) ~ .engel-sl-search__label {
	top: 0;
	right: auto; /* release the right constraint once the label is small and at the top */
	font-size: 0.75rem;
	opacity: 1;
	/* Mask the field border behind the label text. Default white; override via
	 * the "Floating label background" control in the Bricks element panel. */
	background: var( --engel-sl-label-bg, #fff );
}

/* ── Geolocation button ──────────────────────────────────────────────────── */

.engel-sl-geolocation {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 14px;
	background: none;
	border: 1px solid currentColor;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.95rem;
	color: inherit;
	line-height: 1.4;
	transition: opacity 0.15s;
	white-space: nowrap;
}

.engel-sl-geolocation:hover   { opacity: 0.75; }
.engel-sl-geolocation:disabled{ opacity: 0.4; cursor: not-allowed; }

.engel-sl-geolocation__icon {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

.engel-sl-geolocation.is-loading {
	animation: engel-sl-pulse 1s infinite;
}

.engel-sl-geolocation.is-error {
	color: #b91c1c;
	border-color: #b91c1c;
	animation: engel-sl-shake 0.4s ease-out 1;
}

@keyframes engel-sl-pulse {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0.4; }
}

@keyframes engel-sl-shake {
	0%, 100%   { transform: translateX(0); }
	25%        { transform: translateX(-3px); }
	75%        { transform: translateX(3px); }
}

/* ── Radius select ───────────────────────────────────────────────────────── */

.engel-sl-radius__select {
	border: 1px solid currentColor;
	border-radius: 4px;
	padding: 8px 10px;
	font-size: 0.95rem;
	background: transparent;
	color: inherit;
	cursor: pointer;
	line-height: 1.4;
}

.engel-sl-radius__select:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ── Expand search button ────────────────────────────────────────────────── */

.engel-sl-expand {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 14px;
	background: none;
	border: 1px solid currentColor;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.95rem;
	color: inherit;
	line-height: 1.4;
	transition: opacity 0.15s;
	white-space: nowrap;
}

.engel-sl-expand:hover    { opacity: 0.75; }
.engel-sl-expand:disabled { opacity: 0.4; cursor: not-allowed; }

.engel-sl-expand__icon {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

/* The `hidden` attribute is only ever set by store-locator.js, which doesn't
   run in the builder — so this needs no builder guard. !important so themes
   that set `display` on buttons can't leak a hidden button onto the page. */
.engel-sl-expand[hidden] { display: none !important; }

/* ── Results counter ─────────────────────────────────────────────────────── */

.engel-sl-results__text:empty {
	display: none;
}

/* ── Distance pill ───────────────────────────────────────────────────────── */

/* Hide the styled distance element entirely when no result is present, so an
   empty pill / chip doesn't show. The .engel-sl-distance--empty class is added
   by store-locator.js when there's no active search or no coords to compute. */
.engel-sl-distance--empty {
	display: none !important;
}

/* Belt and braces: an element with no text is hidden even if the class never
   gets applied — e.g. when the page has no Bricks map so the script bails out
   early and no distance pass ever runs. Excluded inside the builder canvas,
   where the element is always empty and must stay selectable. */
body:not(.engel-sl-in-builder) .engel-sl-distance:empty {
	display: none;
}

/* ── Fallback notice ────────────────────────────────────────────────────── */

.engel-sl-fallback-notice {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 12px 16px;
	border-radius: 4px;
	font-size: 0.95rem;
	line-height: 1.4;
	color: inherit;
}

.engel-sl-fallback-notice[hidden] {
	display: none !important;
}

.engel-sl-fallback-notice__icon {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	opacity: 0.7;
}

.engel-sl-fallback-notice__icon svg {
	width: 18px;
	height: 18px;
}

.engel-sl-fallback-notice__text {
	flex: 1;
}

/* ── Empty state ─────────────────────────────────────────────────────────────
 *
 * Any element given the class engel-sl-no-results is treated as the locator's
 * "no results" block: hidden until a search matches nothing, then revealed by
 * store-locator.js. Author it as an ordinary Bricks block — the plugin only
 * toggles the modifier class, so it keeps whatever display mode Bricks gave it
 * (grid, flex, block) when shown.
 *
 * Give a child element inside it the class engel-sl-no-results__text and the
 * Store Locator Search element's "No-results block text" controls take over
 * that child's content — swapped between a before-search prompt and an
 * empty-search notice, and (once "Before any search" is filled in) the block
 * stays visible from page load instead of only appearing after an empty
 * search. Everything else in the block (an icon, a link) is left alone.
 *
 * Bricks' own query-loop no-results template can't be used here: it renders
 * server-side when the query returns zero posts, and the loop always returns
 * the full store set so the browser can filter it client-side.
 */
.engel-sl-no-results:not(.engel-sl-no-results--visible) {
	display: none !important;
}

/* ── Store Locator Map ──────────────────────────────────────────────────
 *
 * The map element owns its own pins, clusters and popup, sourced from the
 * plugin's /markers endpoint rather than from Bricks map connectors — which
 * is what lets the page show an empty results list and every store's pin at
 * the same time.
 */

.engel-sl-map {
	/* The Height control writes to this element; min-height is the floor for
	   when it is unset or resolves to nothing. */
	position: relative;
	min-height: 240px;
}

/* Absolutely filling the root, rather than height:100%.
 *
 * height:100% needs the parent to have a *resolved* height — against a parent
 * carrying only min-height, CSS resolves it to auto, which collapsed the
 * canvas to zero and made the map disappear entirely. Absolute inset filling
 * works off the parent's padding box however that height was arrived at
 * (control value, percentage, or the floor above), and unlike a flex child it
 * does not stop working if something else restyles the root's display. */
.engel-sl-map__canvas {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	width: 100%;
}

/* "Disable scroll-wheel zoom" mode's hint (bindScrollZoomModifier() in
   store-locator-map.js) — fully ours to style, unlike Google's own built-in
   cooperative-mode hint, which has no documented class name or supported
   customisation. */
.engel-sl-map__scroll-hint {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 3;
	transform: translate(-50%, -50%);
	padding: 0.6em 1.1em;
	font-size: 0.95em;
	color: #fff;
	background: rgba(0, 0, 0, 0.72);
	border-radius: 6px;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.engel-sl-map__scroll-hint.is-visible {
	opacity: 1;
}

/* Sits above the canvas, which now covers the whole element. */
.engel-sl-map__error {
	position: relative;
	z-index: 2;
	margin: 0;
	padding: 0.75em 1em;
	font-size: 0.9em;
	color: #8a1f11;
	background: #fdf0ef;
	border: 1px solid #f2c3bd;
	border-radius: 4px;
}

/* Image markers. AdvancedMarkerElement already places its content's
   bottom-centre on the store's coordinates, which is how a map pin is read, so
   no transform is needed to position it — one here would lift the pin off the
   spot it marks. */
.engel-sl-pin {
	display: block;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.15s ease;
	transform-origin: center bottom;
}

.engel-sl-pin:hover {
	transform: scale(1.08);
}

/* Cluster bubble.
 *
 * Everything here is a *default* that the element's own controls override:
 * typography, padding, border and shadow are emitted by Bricks as
 * `#brxe-ID .engel-sl-cluster` rules, which outrank these plain-class ones.
 *
 * The two colours and the size come from the script instead, as custom
 * properties on the map root — the script has to compute the size per bubble
 * (it grows with the number of stores inside) and the colours are also handed
 * to the Maps API for the pin glyph. Writing them as variables rather than
 * inline styles is what makes them overridable at all: an inline style would
 * beat every stylesheet rule, including the user's own.
 *
 * Size is a *minimum*, not a fixed width, so padding adds to the bubble
 * instead of being swallowed by a fixed box.
 */
.engel-sl-cluster {
	/* inline-flex, not flex: a block-level box would stretch to the width of
	   whatever contains it now that no inline width is written. */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	/* Square regardless of which dimension the content drives, so the 50%
	   radius stays a circle rather than becoming an ellipse. */
	aspect-ratio: 1;
	min-width: var(--engel-sl-cluster-size, 36px);
	min-height: var(--engel-sl-cluster-size, 36px);
	background: var(--engel-sl-cluster-bg, #e8681a);
	color: var(--engel-sl-cluster-text, #ffffff);
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
	font-weight: 600;
	font-size: 0.85rem;
	line-height: 1;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.engel-sl-cluster:hover {
	transform: scale(1.06);
}

/* Google's default InfoWindow chrome (padding, shadow, rounded corners)
   fights a Bricks-designed popup template, which supplies all of that
   itself — studied live against bunnings.com.au/stores, which strips the
   same two rules and supplies its own close button rather than Google's.
   Left un-namespaced (not `.engel-sl-map .gm-style-iw-c`) because Google
   renders the InfoWindow into its own overlay pane, appended to the map's
   container but not nested under `.engel-sl-map` in a way a descendant
   selector can rely on. */
.gm-style-iw-c,
.gm-style-iw-d {
	padding: 0 !important;
}
.gm-style-iw-c {
	box-shadow: none !important;
	border-radius: 0 !important;
	background: transparent !important;
}
.gm-style-iw-d {
	overflow: visible !important;
}

/* Google's own close button, hidden once the card supplies its own (the
   "Custom close button selector" control) — store-locator-map.js adds this
   class to <body> only when that control is set, so a site with no custom
   close element keeps the native one working. */
.engel-sl-hide-default-popup-close .gm-ui-hover-effect {
	display: none !important;
}

/* A close button/icon built into the card in the builder, given this CSS
   class (Style → CSS Classes) — hidden everywhere by default so it never
   shows up in the results list, and revealed only when that same card is
   open as a pin's popup. Pair with the "Custom close button selector"
   control set to ".engel-sl-popup-close" so it actually closes the popup. */
.engel-sl-popup-close {
	display: none;
}
.engel-sl-popup .engel-sl-popup-close {
	display: inline-flex;
}

/* Popup. Kept deliberately plain: the results card supplies its own styling,
   and these rules only need to not fight it. max-width is a fallback only —
   store-locator-map.js sets it inline from the map element's own "Popup max
   width" control (default 400px) the moment the popup opens, so this value
   is never actually seen. */
.engel-sl-popup {
	max-width: 400px;
	font-size: 0.95em;
	line-height: 1.45;
}

/* Plays once per setContent() call (openPopup(), store-locator-map.js) — the
   loading skeleton fading in, then the real content fading in over it once
   it arrives, rather than both appearing as an instant flash. */
.engel-sl-popup--fade {
	animation: engel-sl-popup-fade 0.18s ease both;
}

@keyframes engel-sl-popup-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.engel-sl-popup--fade {
		animation: none;
	}
}

.engel-sl-popup__title {
	margin: 0 0 0.35em;
	font-size: 1.05em;
	line-height: 1.25;
}

.engel-sl-popup p {
	margin: 0 0 0.35em;
}

.engel-sl-popup__loading {
	min-width: 120px;
	min-height: 40px;
	background:
		linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.12) 37%, rgba(0,0,0,0.06) 63%)
		0 0 / 400% 100%;
	animation: engel-sl-shimmer 1.2s ease-in-out infinite;
	border-radius: 3px;
}

@keyframes engel-sl-shimmer {
	from { background-position: 100% 0; }
	to   { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
	.engel-sl-pin,
	.engel-sl-cluster {
		transition: none;
	}
	.engel-sl-popup__loading {
		animation: none;
	}
}

/* Results list while an in-place search is in flight. Dimmed rather than
   emptied, so the layout does not jump and the previous results stay readable
   until the new ones arrive. */
.engel-sl-loading {
	position: relative;
	opacity: 0.5;
	transition: opacity 0.15s ease;
	pointer-events: none;
}

/* Spinner appended to the results list for the same duration — see
   Controller.prototype.setBusy(). Positioned near the top rather than
   centred on the full list so it's visible without depending on the list's
   (variable) height. A white badge behind the ring rather than a bare
   border: the first card's own header sits right underneath at that
   position and can be any store-type colour (including near-black), which
   left a plain currentColor ring unreadable against it. */
.engel-sl-loading-spinner {
	position: absolute;
	top: 24px;
	left: 50%;
	width: 40px;
	height: 40px;
	margin-left: -20px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	z-index: 2;
}

.engel-sl-loading-spinner::after {
	content: "";
	width: 22px;
	height: 22px;
	border: 3px solid rgba(0, 0, 0, 0.15);
	border-top-color: #111;
	border-radius: 50%;
	animation: engel-sl-spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
	.engel-sl-loading {
		transition: none;
	}
	.engel-sl-loading-spinner::after {
		animation: engel-sl-pulse 1.2s ease-in-out infinite;
	}
}

/* Results list markup replaced (a search's results, or clearing back to the
   pristine state) — see playResultsEnterAnimation() in store-locator.js.
   Removing and re-adding this class forces the animation to restart on
   every swap, not just the first one it's ever applied to. */
.engel-sl-results-enter {
	animation: engel-sl-results-enter 0.28s ease both;
}

@keyframes engel-sl-results-enter {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.engel-sl-results-enter {
		animation: none;
	}
}

/* ── Choices.js custom properties for the Filter element ──────────────────
 *
 * Supplies the CSS custom properties Bricks' bundled Choices.js reads for
 * itself, so the Filter element's own style controls can actually reach the
 * properties those variables feed.
 *
 * Bricks wraps *all* of its generated CSS — including every builder control's
 * output — in nested `@layer bricks { @layer <n> { ... } }` blocks, and
 * Choices' own bundled stylesheet uses that identical `bricks` layer name for
 * its rules too (same file header that renamed the JS export: "Modified for
 * Bricks"). Both land in the same merged layer, so this isn't the usual
 * specificity fight: confirmed live that the Filter element's Typography,
 * Border and Background controls each generate a far more specific rule on
 * `#brxe-xxx .engel-sl-filter .bricks-choices__inner` that still loses
 * outright, property by property, to Choices' own much less specific
 * `.bricks-choices__inner` rule — a plain specificity/layer override can't win
 * that from inside the same layer system Bricks itself controls. Any control
 * whose property Choices' own stylesheet doesn't also declare (padding,
 * box-shadow, the placeholder's *text colour* as opposed to its opacity) is
 * unaffected and needs no entry here.
 *
 * The fix sidesteps the layer fight entirely: rather than trying to out-rank
 * the library's own declarations, this supplies the `--choices-*` variables
 * they read via plain, unlayered rules. Unlayered CSS always wins over *any*
 * layered declaration regardless of specificity or layer order, so each
 * variable resolves correctly and the library's own (otherwise perfectly
 * normal) rule picks it up. This whole stylesheet is unlayered, which is why
 * these rules live here rather than in a wp_head <style> block — that block
 * printed on every page on the site, locator or not, whereas this file is
 * enqueued only by the elements that need it.
 *
 * Scoped to the exact selector each control targets, so this can't leak into
 * a sibling — e.g. `--choices-keyline-color` is also what the dropdown's own
 * border reads, but only .bricks-choices__inner gets a value here, leaving
 * the (currently unconfigured) Dropdown border control's own default
 * untouched.
 *
 * Every value below mirrors what the Filter element's controls are configured
 * to today — if a control is ever repointed at a different value, or a
 * currently-unconfigured one (dropdown background/border, option padding,
 * hover background, tag background/text colour) gets configured for the first
 * time and shows the same symptom, add or update its line here to match.
 */
.engel-sl-filter .bricks-choices__inner,
.engel-sl-filter .bricks-choices__list--dropdown .bricks-choices__item {
	--choices-font-size: var(--text-s, inherit);
}

.engel-sl-filter .bricks-choices__inner {
	--choices-base-border: 1px solid;
	--choices-keyline-color: var(--clr-black, currentColor);
	--choices-bg-color: var(--clr-white, #fff);
}

/* ── Filter: chips display (Element_Store_Locator_Filter "Display as: Chips") ──
 * Neutral defaults; a site restyles through the custom properties below or
 * its own classes. The real <input> covers its pill (opacity 0), so the
 * native radio/checkbox keeps keyboard, focus and screen-reader behaviour. */
.engel-sl-filter--chips {
	--engel-sl-chip-h: 44px;
	--engel-sl-chip-gap: 8px;
	--engel-sl-chip-radius: 999px;
	--engel-sl-chip-border: #bdbdbd;
	--engel-sl-chip-bg: #fff;
	--engel-sl-chip-fg: currentColor;
	--engel-sl-chip-on-bg: #0f0f0f;
	--engel-sl-chip-on-fg: #fff;
	--engel-sl-chip-focus: #0f0f0f;
}
.engel-sl-chips {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}
.engel-sl-chips__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--engel-sl-chip-gap);
}
.engel-sl-chip {
	position: relative;
	display: inline-flex;
}
.engel-sl-chip input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}
.engel-sl-chip__face {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: var(--engel-sl-chip-h);
	box-sizing: border-box;
	padding: 0 16px;
	border: 1px solid var(--engel-sl-chip-border);
	border-radius: var(--engel-sl-chip-radius);
	background: var(--engel-sl-chip-bg);
	color: var(--engel-sl-chip-fg);
	white-space: nowrap;
	transition: background-color .2s, border-color .2s, color .2s;
}
.engel-sl-chip--icon .engel-sl-chip__face { padding-left: 12px; }
.engel-sl-chip input:hover + .engel-sl-chip__face { border-color: var(--engel-sl-chip-on-bg); }
.engel-sl-chip input:checked + .engel-sl-chip__face {
	border-color: var(--engel-sl-chip-on-bg);
	background: var(--engel-sl-chip-on-bg);
	color: var(--engel-sl-chip-on-fg);
}
.engel-sl-chip input:focus-visible + .engel-sl-chip__face {
	outline: 2px solid var(--engel-sl-chip-focus);
	outline-offset: 2px;
}
.engel-sl-chip__dot {
	flex: none;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--engel-sl-chip-dot, currentColor);
	box-shadow: 0 0 0 1.5px var(--engel-sl-chip-bg);
}
.engel-sl-chip__icon.engel-sl-icon-mask {
	width: 20px;
	height: 20px;
}
.engel-sl-filter--chips .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
[data-engel-filter-count][hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
	.engel-sl-chip__face { transition: none; }
}

/* Results text with nothing to say (no search yet, no initial text): keep the
 * live region in the DOM but take it out of the layout. */
.engel-sl-results--empty {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Results card whose pin popup is open (store-locator.js initActiveCardSync).
 * Sites style the card itself; this is only a visible default. */
.engel-sl-card--active > * { outline: 2px solid currentColor; outline-offset: -2px; }
gmp-advanced-marker[data-engel-active] img { transform: scale(1.2); transform-origin: 50% 100%; }
.engel-sl-chip__img {
	flex: none;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: cover;
	background: #fff;
}

/* Suggestion dropdown: "nothing matched" row (not an option). */
.engel-sl-search__empty {
	padding: 10px 16px;
	opacity: .7;
	cursor: default;
}

/* ── Map: built-in buttons, key, bottom sheet (Store Locator Map) ──────────
 * Neutral defaults; the site restyles via these classes. */
.engel-sl-map { position: relative; }
.engel-sl-map--fullscreen { background: #fff; }
.engel-sl-map--fullscreen .engel-sl-map__canvas { height: 100% !important; }
.engel-sl-map__ctrl {
	position: absolute;
	z-index: 3;
	top: 16px;
	right: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.engel-sl-map__ctrl-group {
	display: flex;
	flex-direction: column;
	border: 1px solid #d9d9d9;
	border-radius: 6px;
	background: #fff;
	overflow: hidden;
}
.engel-sl-map__ctrl button {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: #fff;
	color: #0f0f0f;
	cursor: pointer;
}
.engel-sl-map__ctrl button + button { border-top: 1px solid #d9d9d9; }
.engel-sl-map__ctrl button:hover { background: #f2f2f2; }
.engel-sl-map__ctrl button:focus-visible { outline: 2px solid #0f0f0f; outline-offset: -2px; }
.engel-sl-map__ctrl button[hidden] { display: none; }
.engel-sl-map__legend {
	position: absolute;
	z-index: 3;
	left: 16px;
	bottom: 16px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	max-width: calc(100% - 32px);
	box-sizing: border-box;
	margin: 0;
	padding: 10px 14px;
	list-style: none;
	border: 1px solid #d9d9d9;
	border-radius: 6px;
	background: #fff;
	font-size: 13px;
}
.engel-sl-map__legend li { display: inline-flex; align-items: center; gap: 6px; }
.engel-sl-map__legend img { width: 14px; height: auto; }
.engel-sl-map__sheet {
	position: absolute;
	z-index: 4;
	left: 12px;
	right: 12px;
	bottom: 12px;
	max-height: calc(100% - 24px);
	overflow-y: auto;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 14px 30px rgba(0, 0, 0, .22);
}
.engel-sl-map__sheet[hidden] { display: none; }
.engel-sl-map__sheet-close {
	position: absolute;
	z-index: 1;
	top: 4px;
	right: 4px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
}
.engel-sl-map--sheet-open .engel-sl-map__legend { display: none; }
@media (prefers-reduced-motion: no-preference) {
	.engel-sl-map__sheet:not([hidden]) { animation: engel-sl-sheet-in .25s ease-out both; }
	@keyframes engel-sl-sheet-in { from { transform: translateY(12px); opacity: 0; } }
}
/* A card that brings its own close element (popup close selector) uses it in
 * the sheet too, so the sheet's built-in one steps aside. */
.engel-sl-map__sheet:has(.engel-sl-popup-close) .engel-sl-map__sheet-close { display: none; }
