/**
 * Big Wheel Region Switcher
 * Colours come from :root vars printed by the plugin (Settings > Region Switcher).
 */

:root {
	--bw-accent: #EA5A4B;
	--bw-hover: #CD3A3A;
	--bw-dark: #202020;
	--bw-btn: #DB3A3C;
	--bw-btn-text: #E23C3C;
}

/* Trigger ----------------------------------------------------------------- */
.bw-switch-trigger {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: none;
	border: 0;
	padding: 6px 10px;
	margin: 0;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .06em;
	color: inherit;
	cursor: pointer;
	border-radius: 4px;
	transition: color .25s ease, background-color .25s ease;
}

.bw-switch-trigger svg {
	width: 21px;
	height: 21px;
	display: block;
}

.bw-switch-trigger:hover,
.bw-switch-trigger:focus-visible {
	color: var(--bw-hover);
	background: transparent;
}

.bw-switch-trigger:focus-visible {
	outline: 2px solid var(--bw-hover);
	outline-offset: 2px;
}

.bw-switch-trigger__label {
	text-transform: uppercase;
}

/* Overlay ----------------------------------------------------------------- */
.bw-switch[hidden] {
	display: none;
}

.bw-switch {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.bw-switch__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(32, 32, 32, .72);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .3s ease;
}

.bw-switch.is-open .bw-switch__backdrop {
	opacity: 1;
}

.bw-switch__panel {
	position: relative;
	width: 100%;
	max-width: 560px;
	/* Four regions can outgrow a laptop viewport — let the panel scroll
	   rather than pushing the last card off screen. */
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border-radius: 6px;
	padding: 46px 44px 40px;
	box-shadow: 0 30px 70px rgba(0, 0, 0, .3);
	font-family: inherit;
	text-align: center;
	opacity: 0;
	transform: translateY(14px) scale(.98);
	transition: opacity .3s ease, transform .3s cubic-bezier(.2, .8, .3, 1);
}

.bw-switch.is-open .bw-switch__panel {
	opacity: 1;
	transform: none;
}

.bw-switch__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 38px;
	height: 38px;
	padding: 8px;
	background: none;
	border: 0;
	border-radius: 50%;
	color: #9a9a9a;
	cursor: pointer;
	transition: color .2s ease, background-color .2s ease;
}

.bw-switch__close svg {
	width: 100%;
	height: 100%;
	fill: none;
}

.bw-switch__close:hover {
	color: var(--bw-accent);
	background: #f4f4f4;
}

.bw-switch__eyebrow {
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--bw-accent);
}

.bw-switch__title {
	margin: 0 0 14px;
	font-size: 28px;
	line-height: 1.2;
	font-weight: 600;
	color: var(--bw-dark);
}

.bw-switch__intro {
	margin: 0 auto 30px;
	max-width: 40ch;
	font-size: 15px;
	line-height: 1.65;
	color: #6b6b6b;
}

.bw-switch__note {
	margin: 22px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: #9a9a9a;
}

/* Cards ------------------------------------------------------------------- */
.bw-switch__grid {
	display: grid;
	gap: 12px;
}

.bw-switch__card {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	padding: 14px 16px;
	text-align: left;
	cursor: pointer;
	background: #fff;
	border: 2px solid #e6e6e6;
	border-radius: 5px;
	font: inherit;
	color: var(--bw-dark);
	transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}

.bw-switch__card:hover {
	border-color: var(--bw-accent);
	background: rgba(0, 0, 0, .015);
	transform: translateY(-3px);
	box-shadow: 0 12px 26px rgba(0, 0, 0, .12);
}

.bw-switch__card:focus-visible {
	outline: 2px solid var(--bw-accent);
	outline-offset: 3px;
}

.bw-switch__card:active {
	transform: translateY(-1px);
}

.bw-switch__flag {
	flex: 0 0 auto;
	line-height: 0;
}

.bw-switch__flag svg {
	width: 54px;
	height: 36px;
	display: block;
	border-radius: 4px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
	filter: saturate(.85);
	transition: filter .25s ease, transform .25s ease;
}

.bw-switch__card:hover .bw-switch__flag svg {
	filter: saturate(1.1);
	transform: scale(1.06);
}

.bw-switch__label {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.bw-switch__country {
	font-size: 17px;
	font-weight: 600;
}

.bw-switch__detail {
	font-size: 13px;
	color: #7a7a7a;
}

.bw-switch__mark {
	margin-left: auto;
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	padding: 4px;
	border-radius: 50%;
	color: #fff;
	background: var(--bw-accent);
	opacity: 0;
	transform: scale(.6);
	transition: opacity .2s ease, transform .2s ease;
}

.bw-switch__mark svg {
	width: 100%;
	height: 100%;
	display: block;
}

.bw-switch__card.is-current {
	border-color: var(--bw-accent);
}

.bw-switch__card.is-current .bw-switch__mark {
	opacity: 1;
	transform: none;
}

.bw-switch__card.is-current .bw-switch__flag svg {
	filter: saturate(1.1);
}

/* Mobile ------------------------------------------------------------------ */
@media (max-width: 600px) {
	.bw-switch__panel {
		padding: 36px 18px 24px;
		max-height: calc(100vh - 24px);
	}

	.bw-switch__title {
		font-size: 22px;
	}

	.bw-switch__intro {
		font-size: 14px;
		margin-bottom: 24px;
	}

	.bw-switch__note {
		font-size: 12px;
		margin-top: 18px;
	}

	.bw-switch__card {
		padding: 12px;
		gap: 12px;
	}

	.bw-switch__grid {
		gap: 9px;
	}

	.bw-switch__flag svg {
		width: 44px;
		height: 30px;
	}

	.bw-switch__country {
		font-size: 15px;
	}

	.bw-switch__detail {
		font-size: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.bw-switch__backdrop,
	.bw-switch__panel,
	.bw-switch__card,
	.bw-switch__flag svg,
	.bw-switch__mark {
		transition: none !important;
	}

	.bw-switch__panel {
		transform: none;
	}
}

/* ===========================================================================
   First-visit prompt — a corner card, never a blocking modal.
   ========================================================================= */

.bw-prompt[hidden] {
	display: none;
}

.bw-prompt {
	/* Impreza sets position on footer descendants, which drops this to the
	   bottom of the document. Forced so the card stays pinned to the window. */
	position: fixed !important;
	top: auto !important;
	left: auto !important;
	right: 24px !important;
	bottom: 24px !important;
	z-index: 99999 !important;
	width: 340px;
	max-width: calc(100vw - 32px);
	box-sizing: border-box;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 16px 44px rgba(32, 32, 32, .22);
	padding: 20px 20px 16px;
	font-family: inherit;
	text-align: left;
	opacity: 0;
	transform: translateY(16px);
	pointer-events: none;
	transition: opacity .35s ease, transform .35s cubic-bezier(.2, .8, .3, 1);
}

.bw-prompt.is-visible {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

.bw-prompt::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: var(--bw-accent);
	border-radius: 6px 6px 0 0;
}

.bw-prompt__close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 30px;
	height: 30px;
	padding: 8px;
	border: 0;
	background: none;
	border-radius: 50%;
	color: #b0b0b0;
	cursor: pointer;
	transition: color .2s ease, background-color .2s ease;
}

.bw-prompt__close svg {
	width: 100%;
	height: 100%;
	display: block;
	fill: none;
}

.bw-prompt__close:hover {
	color: var(--bw-hover);
	background: #f4f4f4;
}

.bw-prompt__head {
	display: flex;
	align-items: center;
	gap: 11px;
	margin: 0 0 8px;
	padding-right: 24px;
}

.bw-prompt__flag {
	flex: 0 0 auto;
	line-height: 0;
}

.bw-prompt__flag svg {
	width: 34px;
	height: 23px;
	display: block;
	border-radius: 3px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .1);
}

.bw-prompt__title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--bw-dark);
}

.bw-prompt__text {
	margin: 0 0 14px;
	font-size: 13px;
	line-height: 1.55;
	color: #6b6b6b;
}

.bw-prompt__actions {
	display: flex;
	gap: 8px;
}

.bw-prompt__btn {
	flex: 1 1 0;
	min-width: 0;
	padding: 10px 8px;
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.bw-prompt__btn--yes {
	border: 1px solid var(--bw-btn);
	background: var(--bw-btn);
	color: #fff;
}

/* Both buttons share the same hover: dark fill, red text. */
.bw-prompt__btn--yes:hover {
	background: var(--bw-dark);
	border-color: var(--bw-dark);
	color: var(--bw-btn-text);
}

/* Equal weight to the correction — the people it serves are the ones the
   geolocation got wrong, and they should not have to hunt for it. */
.bw-prompt__btn--no {
	border: 1px solid #dcdcdc;
	background: #fff;
	color: var(--bw-dark);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
}

.bw-prompt__btn--no:hover {
	background: var(--bw-dark);
	border-color: var(--bw-dark);
	color: var(--bw-btn-text);
}

.bw-prompt__btn-flag {
	line-height: 0;
}

.bw-prompt__btn-flag svg {
	width: 20px;
	height: 14px;
	display: block;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .1);
}

.bw-prompt__stay[hidden] {
	display: none;
}

.bw-prompt__stay {
	display: block;
	width: 100%;
	margin: 10px 0 0;
	padding: 2px 0;
	background: none;
	border: 0;
	font: inherit;
	font-size: 12px;
	color: #8a8a8a;
	text-align: center;
	cursor: pointer;
	transition: color .2s ease;
}

.bw-prompt__stay:hover {
	color: var(--bw-dark);
	text-decoration: underline;
}

.bw-prompt__foot {
	margin: 9px 0 0;
	font-size: 11px;
	line-height: 1.45;
	color: #a6a6a6;
}

.bw-prompt__btn:focus-visible,
.bw-prompt__stay:focus-visible,
.bw-prompt__close:focus-visible {
	outline: 2px solid var(--bw-btn);
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.bw-prompt {
		right: 12px !important;
		left: 12px !important;
		bottom: 12px !important;
		width: auto;
		padding: 20px 18px 16px;
	}

	.bw-prompt__actions {
		flex-direction: column;
	}

	.bw-prompt__btn {
		white-space: normal;
		padding: 11px 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bw-prompt {
		transition: none;
		transform: none;
	}
}

/* ===========================================================================
   Returning-visitor bar — quiet strip along the bottom, never a modal.
   ========================================================================= */

.bw-bar[hidden] {
	display: none;
}

.bw-bar {
	position: fixed !important;
	top: auto !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	z-index: 99998 !important;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 13px 56px 13px 20px;
	background: var(--bw-dark);
	color: #fff;
	font-family: inherit;
	box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
	transform: translateY(100%);
	transition: transform .35s cubic-bezier(.2, .8, .3, 1);
}

.bw-bar.is-visible {
	transform: none;
}

.bw-bar__text {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.4;
}

.bw-bar__btn {
	flex: 0 0 auto;
	padding: 8px 18px;
	border: 1px solid var(--bw-btn);
	border-radius: 4px;
	background: var(--bw-btn);
	color: #fff;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .2s ease, color .2s ease;
}

.bw-bar__btn:hover,
.bw-bar__btn:focus {
	background: transparent;
	color: var(--bw-btn-text);
	text-decoration: none;
}

.bw-bar__close {
	position: absolute;
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
	width: 30px;
	height: 30px;
	padding: 7px;
	border: 0;
	border-radius: 50%;
	background: none;
	color: rgba(255, 255, 255, .55);
	cursor: pointer;
	transition: color .2s ease, background-color .2s ease;
}

.bw-bar__close svg {
	width: 100%;
	height: 100%;
	display: block;
	fill: none;
}

.bw-bar__close:hover {
	color: #fff;
	background: rgba(255, 255, 255, .1);
}

.bw-bar__btn:focus-visible,
.bw-bar__close:focus-visible {
	outline: 2px solid var(--bw-btn-text);
	outline-offset: 2px;
}

@media (max-width: 700px) {
	.bw-bar {
		flex-direction: column;
		gap: 10px;
		padding: 14px 46px 14px 16px;
		text-align: center;
	}

	.bw-bar__text {
		font-size: 13px;
	}

	.bw-bar__close {
		top: 10px;
		right: 8px;
		transform: none;
	}
}

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