.noxx-locations [hidden] {
	display: none !important;
}

.noxx-locations {
	--noxx-locations-marker: var( --wp--preset--color--contrast, #000 );
	--noxx-locations-marker-dot: #fff;
	--noxx-locations-accent: var( --wp--preset--color--primary, var( --ast-global-color-0, #50b948 ) );
	--noxx-locations-border: rgba( 0, 0, 0, 0.15 );
	--noxx-locations-radius: 8px;
	--noxx-locations-bg: var( --wp--preset--color--base, #fff );
	--noxx-locations-text: var( --wp--preset--color--contrast, #111 );
	--noxx-locations-muted: rgba( 0, 0, 0, 0.6 );
	--noxx-locations-height: 520px;
	color: var( --noxx-locations-text );
	font-size: var( --wp--preset--font-size--small, 0.95rem );
}

.noxx-locations__toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-bottom: 12px;
}

.noxx-locations__toolbar input[type="search"],
.noxx-locations__city-toggle,
.noxx-locations__nearest {
	font: inherit;
	padding: 10px 14px;
	border: 1px solid var( --noxx-locations-border );
	border-radius: var( --noxx-locations-radius );
	background: var( --noxx-locations-bg );
	color: inherit;
	min-height: 44px;
}

.noxx-locations__toolbar input[type="search"] {
	flex: 1 1 220px;
	min-width: 0;
}

.noxx-locations__city {
	position: relative;
	flex: 1 1 100%;
}

@media ( min-width: 782px ) {
	.noxx-locations__city {
		flex: 0 1 220px;
	}
}

.noxx-locations__city-toggle {
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	text-align: left;
}

.noxx-locations__chevron::after {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate( 45deg );
	margin-left: 8px;
}

.noxx-locations__city-panel {
	position: absolute;
	z-index: 20;
	top: calc( 100% + 4px );
	left: 0;
	min-width: 100%;
	background: var( --noxx-locations-bg );
	border: 1px solid var( --noxx-locations-border );
	border-radius: var( --noxx-locations-radius );
	box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.12 );
	padding: 8px;
}

.noxx-locations__city-search {
	width: 100%;
	margin-bottom: 6px;
	padding: 8px 10px;
	border: 1px solid var( --noxx-locations-border );
	border-radius: 6px;
	font: inherit;
}

.noxx-locations__city-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 260px;
	overflow-y: auto;
}

.noxx-locations__city-list button {
	display: block;
	width: 100%;
	text-align: left;
	padding: 8px 10px;
	border: 0;
	background: none;
	font: inherit;
	color: inherit;
	cursor: pointer;
	border-radius: 6px;
}

.noxx-locations__city-list button:hover,
.noxx-locations__city-list button.is-active {
	background: rgba( 0, 0, 0, 0.06 );
	font-weight: 600;
}

.noxx-locations__nearest {
	background: var( --noxx-locations-accent );
	color: var( --noxx-locations-bg );
	border-color: var( --noxx-locations-accent );
	cursor: pointer;
	white-space: nowrap;
	font-weight: 600;
}

.noxx-locations__nearest-icon {
	display: inline-flex;
	flex: 0 0 auto;
	line-height: 0;
}

.noxx-locations__nearest:disabled {
	opacity: 0.5;
}

.noxx-locations__status {
	color: var( --noxx-locations-muted );
	flex-basis: 100%;
}

.noxx-locations__status:empty {
	display: none;
}

.noxx-locations__categories {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	border: 0;
	padding: 0;
	margin: 0;
	flex-basis: 100%;
}

.noxx-locations__body {
	display: grid;
	gap: 16px;
	grid-template-columns: 1fr;
}

.noxx-locations__map-wrap {
	position: relative;
	height: 420px;
	border-radius: var( --noxx-locations-radius );
	overflow: hidden;
	border: 1px solid var( --noxx-locations-border );
}

/* Two class selectors on purpose: Mapbox GL's own stylesheet loads after ours and
   sets `.mapboxgl-map { position: relative }`, which would otherwise win the cascade
   and collapse the container to zero height. */
.noxx-locations__map-wrap .noxx-locations__map {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: #eee;
}

.noxx-locations__map-error,
.noxx-locations__admin-hint {
	margin: 0;
	padding: 24px;
	text-align: center;
	color: var( --noxx-locations-muted );
}

.noxx-locations__controls {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	z-index: 5;
}

.noxx-locations__controls button {
	width: 40px;
	height: 40px;
	border: 1px solid var( --noxx-locations-border );
	border-radius: var( --noxx-locations-radius );
	background: var( --noxx-locations-bg );
	color: var( --noxx-locations-text );
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba( 0, 0, 0, 0.12 );
}

.noxx-locations.noxx-locations .noxx-locations__list {
	list-style: none;
	margin: 0;
	padding: 4px 0;
	display: flex;
	gap: 10px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
}

.noxx-locations__item {
	flex: 0 0 220px;
	scroll-snap-align: center;
	border: 1px solid var( --noxx-locations-border );
	border-radius: var( --noxx-locations-radius );
	padding: 12px;
	background: var( --noxx-locations-bg );
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.noxx-locations__item {
	position: relative;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.noxx-locations__item:hover,
.noxx-locations__item:focus-within {
	border-color: var( --noxx-locations-accent );
}

.noxx-locations__item.is-active {
	border-color: var( --noxx-locations-accent );
}

.noxx-locations__item-arrow {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	color: var( --noxx-locations-muted );
	line-height: 0;
	transition: color 0.15s ease, transform 0.15s ease;
}

.noxx-locations__item:hover .noxx-locations__item-arrow,
.noxx-locations__item:focus-within .noxx-locations__item-arrow {
	color: var( --noxx-locations-accent );
	transform: translateX( 2px );
}

.noxx-locations__item-button {
	all: unset;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding-right: 28px;
}

.noxx-locations__item-city,
.noxx-locations__item-hours {
	font-size: 0.85em;
	color: var( --noxx-locations-muted );
}

.noxx-locations__item-name {
	font-weight: 600;
}

.noxx-locations__item-address {
	font-size: 0.9em;
}

/* Fuel badges in the list, same icons as the popup. A <span> row rather than a <ul> because
   it sits inside the item's <button>. */
.noxx-locations__item-fuels {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	margin-top: 4px;
}

.noxx-locations.noxx-locations .noxx-locations__item-fuels img {
	display: block;
	width: 22px;
	height: 22px;
	padding: 1px;
	box-sizing: border-box;
	border-radius: 50%;
	box-shadow: none;
}

.noxx-locations__item-fuel--text {
	display: inline-flex;
	align-items: center;
	height: 22px;
	padding: 0 8px;
	border: 1px solid var( --noxx-locations-border );
	border-radius: 999px;
	font-size: 0.75em;
	line-height: 1;
}

.noxx-locations__item-distance {
	font-size: 0.85em;
	color: var( --noxx-locations-accent );
	font-weight: 600;
}

.noxx-locations__item-links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	font-size: 0.9em;
}

.noxx-locations__empty {
	margin: 12px 0;
	color: var( --noxx-locations-muted );
}

/* Popup: 240 px wide, name a step larger, address in a lighter tone, contact in full text
   colour, two buttons like the reference design, Material close icon. */
.noxx-locations .mapboxgl-popup-content {
	font: inherit;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var( --noxx-locations-text );
	width: 240px;
	max-width: 240px;
	box-sizing: border-box;
	padding: 18px 18px 16px;
	border-radius: var( --noxx-locations-radius );
	box-shadow: 0 6px 24px rgba( 0, 0, 0, 0.16 );
}

/* Doubled wrapper: the generic button reset below would otherwise strip the icon. */
.noxx-locations.noxx-locations .mapboxgl-popup-close-button,
.noxx-locations.noxx-locations .mapboxgl-popup-close-button:is( :hover, :focus, :focus-visible, :active ) {
	top: 6px;
	right: 6px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23111' d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
	color: transparent;
	font-size: 0;
	line-height: 0;
	cursor: pointer;
}

.noxx-locations.noxx-locations .mapboxgl-popup-close-button:is( :hover, :focus-visible ) {
	background-color: rgba( 0, 0, 0, 0.06 );
}

.noxx-locations__popup {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-right: 14px;
}

.noxx-locations__popup img {
	display: block;
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 6px;
}

.noxx-locations__popup-name {
	display: block;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
}

.noxx-locations__popup-address {
	display: flex;
	flex-direction: column;
	color: var( --noxx-locations-muted );
	line-height: 1.5;
}

.noxx-locations__popup-contact {
	display: flex;
	flex-direction: column;
	gap: 2px;
	line-height: 1.5;
}

/* Doubled wrapper plus the popup class outranks theme link rules such as `.entry-content a`. */
.noxx-locations.noxx-locations .noxx-locations__popup .noxx-locations__popup-contact a,
.noxx-locations.noxx-locations .noxx-locations__popup .noxx-locations__popup-contact a:is( :hover, :focus, :focus-visible, :active ) {
	color: var( --noxx-locations-text );
	text-decoration: none;
	outline: none;
	box-shadow: none;
}

.noxx-locations.noxx-locations .noxx-locations__popup .noxx-locations__popup-contact a:is( :hover, :focus-visible ) {
	text-decoration: underline;
}

.noxx-locations.noxx-locations .noxx-locations__popup-fuels {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px;
	margin: 2px 0 0;
	padding: 0;
}

/* 1 px of transparent padding inside a 26 px box leaves the circle 24 px across but keeps
   its antialiased edge off the box boundary — flush against it, the popup's half-pixel
   vertical offset shaves the top of the circle. */
.noxx-locations__popup-fuels img {
	display: block;
	width: 26px;
	height: 26px;
	padding: 1px;
	box-sizing: border-box;
	border-radius: 50%;
}

/* A fuel type with no badge of its own keeps its name, in a pill the same height as the icons. */
.noxx-locations__popup-fuel--text {
	display: inline-flex;
	align-items: center;
	height: 24px;
	padding: 0 10px;
	border: 1px solid var( --noxx-locations-border );
	border-radius: 999px;
	font-size: 0.8125em;
	line-height: 1;
}

.noxx-locations__popup-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
}

.noxx-locations.noxx-locations .noxx-locations__popup a.noxx-locations__popup-button,
.noxx-locations.noxx-locations .noxx-locations__popup a.noxx-locations__popup-button:is( :hover, :focus, :focus-visible, :active ) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	padding: 8px 12px;
	border: 1px solid var( --noxx-locations-accent );
	border-radius: 6px;
	font-weight: 500;
	text-decoration: none;
	outline: none;
	box-shadow: none;
	transform: none;
	transition: filter 0.15s ease, background-color 0.15s ease;
}

.noxx-locations.noxx-locations .noxx-locations__popup a.noxx-locations__popup-button--primary,
.noxx-locations.noxx-locations .noxx-locations__popup a.noxx-locations__popup-button--primary:is( :hover, :focus, :focus-visible, :active ) {
	background: var( --noxx-locations-accent );
	color: var( --noxx-locations-bg );
}

.noxx-locations.noxx-locations .noxx-locations__popup a.noxx-locations__popup-button--secondary,
.noxx-locations.noxx-locations .noxx-locations__popup a.noxx-locations__popup-button--secondary:is( :hover, :focus, :focus-visible, :active ) {
	background: var( --noxx-locations-bg );
	color: var( --noxx-locations-text );
}

.noxx-locations.noxx-locations .noxx-locations__popup a.noxx-locations__popup-button:is( :hover, :focus-visible ) {
	filter: brightness( 0.92 );
}

.noxx-locations.noxx-locations .noxx-locations__popup a.noxx-locations__popup-button--primary:is( :hover, :focus-visible ) {
	border-color: var( --noxx-locations-text );
	background: var( --noxx-locations-text );
	color: var( --noxx-locations-bg );
	filter: none;
}

@media ( hover: hover ) and ( pointer: fine ) {
	.noxx-locations.noxx-locations .noxx-locations__popup a.noxx-locations__popup-button:focus-visible {
		outline: 2px solid var( --noxx-locations-accent );
		outline-offset: 2px;
	}
}

.noxx-locations__popup-icon {
	flex: 0 0 auto;
}

@media ( min-width: 782px ) {
	/* List on the left, map on the right. The map is first in the markup so it stays
	   on top on small screens; `order` moves it right of the list here. */
	.noxx-locations--with-list .noxx-locations__body {
		grid-template-columns: minmax( 260px, 1fr ) minmax( 0, 2fr );
	}

	.noxx-locations--with-list .noxx-locations__map-wrap {
		order: 2;
	}

	.noxx-locations__map-wrap {
		height: var( --noxx-locations-height );
	}

	.noxx-locations.noxx-locations .noxx-locations__list {
		flex-direction: column;
		overflow-x: visible;
		overflow-y: auto;
		max-height: var( --noxx-locations-height );
		scroll-snap-type: none;
		/* Breathing room between the cards and the scrollbar track on the right. */
		padding-right: 14px;
		scrollbar-gutter: stable;
	}

	.noxx-locations__item {
		flex: 0 0 auto;
	}
}

/* ---------------------------------------------------------------------------
   Button states. Themes ship global :hover, :focus, :focus-visible and :active rules for
   <button>; the doubled wrapper class outranks them, and every control restates its own
   look for all states below so nothing from the theme bleeds through. */
.noxx-locations.noxx-locations button,
.noxx-locations.noxx-locations button:is( :hover, :focus, :focus-visible, :active ) {
	margin: 0;
	padding: 0;
	min-height: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: inherit;
	font: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
	outline: none;
	transform: none;
	filter: none;
	opacity: 1;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, filter 0.15s ease;
}

.noxx-locations.noxx-locations button:disabled {
	opacity: 0.5;
	cursor: default;
}

.noxx-locations.noxx-locations .noxx-locations__city-toggle,
.noxx-locations.noxx-locations .noxx-locations__city-toggle:is( :hover, :focus, :focus-visible, :active ) {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	min-height: 44px;
	padding: 10px 14px;
	border: 1px solid var( --noxx-locations-border );
	border-radius: var( --noxx-locations-radius );
	background: var( --noxx-locations-bg );
	color: var( --noxx-locations-text );
	text-align: left;
}

.noxx-locations.noxx-locations .noxx-locations__city-toggle:is( :hover, :focus-visible ) {
	border-color: var( --noxx-locations-text );
}

.noxx-locations.noxx-locations .noxx-locations__city-list button,
.noxx-locations.noxx-locations .noxx-locations__city-list button:is( :hover, :focus, :focus-visible, :active ) {
	display: block;
	width: 100%;
	padding: 8px 10px;
	border-radius: 6px;
	background: none;
	color: var( --noxx-locations-text );
	text-align: left;
}

.noxx-locations.noxx-locations .noxx-locations__city-list button:is( :hover, :focus-visible ),
.noxx-locations.noxx-locations .noxx-locations__city-list button.is-active {
	background: rgba( 0, 0, 0, 0.06 );
	font-weight: 600;
}

.noxx-locations.noxx-locations .noxx-locations__nearest,
.noxx-locations.noxx-locations .noxx-locations__nearest:is( :hover, :focus, :focus-visible, :active ) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 16px;
	font-weight: 600;
	border: 1px solid var( --noxx-locations-accent );
	border-radius: var( --noxx-locations-radius );
	background: var( --noxx-locations-accent );
	color: var( --noxx-locations-bg );
	white-space: nowrap;
}

.noxx-locations.noxx-locations .noxx-locations__nearest:is( :hover, :focus-visible ) {
	border-color: var( --noxx-locations-text );
	background: var( --noxx-locations-text );
	color: var( --noxx-locations-bg );
}

.noxx-locations.noxx-locations .noxx-locations__controls button,
.noxx-locations.noxx-locations .noxx-locations__controls button:is( :hover, :focus, :focus-visible, :active ) {
	width: 40px;
	height: 40px;
	border: 1px solid var( --noxx-locations-border );
	border-radius: var( --noxx-locations-radius );
	background: var( --noxx-locations-bg );
	color: var( --noxx-locations-text );
	font-size: 18px;
	line-height: 1;
	box-shadow: 0 2px 6px rgba( 0, 0, 0, 0.12 );
}

.noxx-locations.noxx-locations .noxx-locations__controls button:is( :hover, :focus-visible ) {
	border-color: var( --noxx-locations-text );
}

.noxx-locations.noxx-locations .noxx-locations__item-button,
.noxx-locations.noxx-locations .noxx-locations__item-button:is( :hover, :focus, :focus-visible, :active ) {
	display: flex;
	flex-direction: column;
	gap: 2px;
	width: 100%;
	padding-right: 28px;
	box-sizing: border-box;
	background: none;
	color: inherit;
	text-align: left;
}

/* One keyboard focus ring for every control, only on devices with a mouse or keyboard;
   touch browsers may match :focus-visible on tap, which would look like a stray frame. */
@media ( hover: hover ) and ( pointer: fine ) {
	.noxx-locations.noxx-locations button:focus-visible {
		outline: 2px solid var( --noxx-locations-accent );
		outline-offset: 2px;
	}
}


/* The dot inside Mapbox's default pin is its only <circle> (fill="white"); CSS fill outranks the attribute. */
.noxx-locations .mapboxgl-marker svg circle {
	fill: var( --noxx-locations-marker-dot );
}

/* iOS zooms into any text field under 16px when it gets focus. */
@media ( pointer: coarse ) {
	.noxx-locations.noxx-locations input[type="search"],
	.noxx-locations.noxx-locations input[type="text"] {
		font-size: 16px;
	}
}
