/**
 * Front-end styles for [masterbbq_map].
 *
 * Scoped under .mbbq so the plugin cannot leak styles into the host theme, and
 * built on CSS custom properties so the site's brand colours can be overridden
 * from the theme without touching this file.
 */

.mbbq {
	--mbbq-distributor: #b8321f;
	--mbbq-stockist: #2f6f4e;
	--mbbq-ink: #1d2327;
	--mbbq-muted: #5b6670;
	--mbbq-line: #dfe3e6;
	--mbbq-surface: #fff;
	--mbbq-surface-alt: #f6f7f8;
	--mbbq-radius: 6px;
	--mbbq-gap: 20px;

	box-sizing: border-box;
	color: var(--mbbq-ink);
	margin: 0 0 2em;
}

.mbbq *,
.mbbq *::before,
.mbbq *::after {
	box-sizing: inherit;
}

/* Controls ------------------------------------------------------------- */

.mbbq__controls {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 12px var(--mbbq-gap);
	margin-bottom: 14px;
}

.mbbq__search {
	flex: 1 1 260px;
	min-width: 0;
}

.mbbq__search-input {
	border: 1px solid var(--mbbq-line);
	border-radius: var(--mbbq-radius);
	font: inherit;
	padding: 10px 12px;
	width: 100%;
}

.mbbq__search-input:focus {
	border-color: var(--mbbq-distributor);
	outline: 2px solid transparent;
	outline-offset: 2px;
	box-shadow: 0 0 0 3px rgba(184, 50, 31, 0.18);
}

.mbbq__filters {
	border: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 0;
	padding: 0;
}

.mbbq__filter {
	align-items: center;
	cursor: pointer;
	display: inline-flex;
	font-size: 0.95em;
	gap: 7px;
	user-select: none;
}

.mbbq__swatch {
	border-radius: 50%;
	display: inline-block;
	height: 13px;
	width: 13px;
}

.mbbq__filter--distributor .mbbq__swatch {
	background: var(--mbbq-distributor);
}

.mbbq__filter--stockist .mbbq__swatch {
	background: var(--mbbq-stockist);
}

/* Layout --------------------------------------------------------------- */

.mbbq__layout {
	display: grid;
	gap: var(--mbbq-gap);
	grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.mbbq__layout--map-only {
	grid-template-columns: minmax(0, 1fr);
}

.mbbq__map {
	background: var(--mbbq-surface-alt);
	border: 1px solid var(--mbbq-line);
	border-radius: var(--mbbq-radius);
	min-height: 320px;
	width: 100%;
	z-index: 0; /* keep tiles under sticky theme headers */
}

/* List ----------------------------------------------------------------- */

.mbbq__panel {
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.mbbq__count {
	color: var(--mbbq-muted);
	font-size: 0.85em;
	letter-spacing: 0.02em;
	margin: 0 0 8px;
	text-transform: uppercase;
}

.mbbq__list {
	border: 1px solid var(--mbbq-line);
	border-radius: var(--mbbq-radius);
	list-style: none;
	margin: 0;
	max-height: 520px;
	overflow-y: auto;
	padding: 0;
}

.mbbq__item + .mbbq__item {
	border-top: 1px solid var(--mbbq-line);
}

.mbbq__item-button {
	background: var(--mbbq-surface);
	border: 0;
	border-left: 3px solid transparent;
	cursor: pointer;
	display: block;
	font: inherit;
	padding: 12px 14px;
	text-align: left;
	transition: background-color 0.15s ease, border-color 0.15s ease;
	width: 100%;
}

.mbbq__item-button:hover,
.mbbq__item-button:focus-visible {
	background: var(--mbbq-surface-alt);
}

.mbbq__item.is-active .mbbq__item-button {
	background: var(--mbbq-surface-alt);
	border-left-color: var(--mbbq-distributor);
}

.mbbq__item-type {
	display: block;
	font-size: 0.7em;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin-bottom: 3px;
	text-transform: uppercase;
}

.mbbq__item-type--distributor {
	color: var(--mbbq-distributor);
}

.mbbq__item-type--stockist {
	color: var(--mbbq-stockist);
}

.mbbq__item-name {
	display: block;
	font-weight: 600;
	line-height: 1.3;
}

.mbbq__item-address {
	color: var(--mbbq-muted);
	display: block;
	font-size: 0.86em;
	line-height: 1.45;
	margin-top: 3px;
}

.mbbq__no-results {
	color: var(--mbbq-muted);
	margin: 12px 2px 0;
}

.mbbq-empty {
	color: #5b6670;
}

/* Popup ---------------------------------------------------------------- */

.mbbq-popup {
	min-width: 190px;
}

.mbbq-popup__type {
	font-size: 0.7em;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin: 0 0 2px;
	text-transform: uppercase;
}

.mbbq-popup__type--distributor {
	color: #b8321f;
}

.mbbq-popup__type--stockist {
	color: #2f6f4e;
}

.mbbq-popup__name {
	font-size: 1.05em;
	line-height: 1.25;
	margin: 0 0 6px;
}

.mbbq-popup p {
	margin: 0 0 5px;
}

.mbbq-popup__address,
.mbbq-popup__hours {
	color: #5b6670;
	line-height: 1.45;
}

/* Marker cluster ------------------------------------------------------- */

.mbbq .marker-cluster-small div,
.mbbq .marker-cluster-medium div,
.mbbq .marker-cluster-large div {
	background: rgba(184, 50, 31, 0.85);
	color: #fff;
	font-weight: 600;
}

.mbbq .marker-cluster-small,
.mbbq .marker-cluster-medium,
.mbbq .marker-cluster-large {
	background: rgba(184, 50, 31, 0.32);
}

/* Small screens -------------------------------------------------------- */

@media (max-width: 782px) {
	.mbbq__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.mbbq__map {
		height: 380px !important; /* override the shortcode's desktop height */
	}

	.mbbq__list {
		max-height: 400px;
	}
}

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