/**
 * Language and currency controls.
 *
 * Two variants of one component: a compact pair in the header, and a roomier
 * pair in the footer. Both are real form controls rather than custom widgets,
 * so keyboard, screen reader and no-JavaScript behaviour come for free.
 *
 * Colours are the brand tokens, not a framework palette. Shadows are layered
 * and tinted with the brand orange at low opacity rather than flat grey. Only
 * transform and opacity animate.
 */

.bwd-locale {
	--bwd-l-brand: #f97d0a;
	--bwd-l-brand-dark: #bb520c;
	--bwd-l-ink: #10151f;
	--bwd-l-muted: #5b6577;
	--bwd-l-line: #e2e6ec;
	--bwd-l-surface: #fff;
	--bwd-l-raised: #f7f8fa;

	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px 16px;
}

.bwd-locale__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	min-width: 0;
}

.bwd-locale__label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bwd-l-muted);
}

/* The control shell carries the border and the icon, so the select itself can
   stay a plain select underneath and keep its native behaviour. */
.bwd-locale__control {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0 34px 0 11px;
	height: 40px;
	border: 1px solid var(--bwd-l-line);
	border-radius: 10px;
	background: var(--bwd-l-surface);
	color: var(--bwd-l-ink);
	box-shadow:
		0 1px 2px rgb(16 21 31 / 5%),
		0 6px 16px rgb(249 125 10 / 6%);
	transition-property: border-color, box-shadow;
	transition-duration: 200ms;
	transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.bwd-locale__control:hover {
	border-color: #fdba74;
	box-shadow:
		0 1px 2px rgb(16 21 31 / 6%),
		0 10px 22px rgb(249 125 10 / 12%);
}

.bwd-locale__control:focus-within {
	border-color: var(--bwd-l-brand);
	box-shadow:
		0 0 0 3px rgb(249 125 10 / 22%),
		0 10px 22px rgb(249 125 10 / 12%);
}

.bwd-locale__control svg {
	flex: none;
	color: var(--bwd-l-muted);
}

.bwd-locale__select {
	appearance: none;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	padding: 0;
	margin: 0;
	min-width: 7.5rem;
	max-width: 14rem;
	cursor: pointer;
}

.bwd-locale__select:focus {
	outline: none;
}

.bwd-locale__chevron {
	position: absolute;
	right: 11px;
	display: grid;
	place-items: center;
	color: var(--bwd-l-muted);
	pointer-events: none;
}

/* Always visible without JavaScript; with it, shown while a choice is pending. */
.bwd-locale__go {
	height: 40px;
	padding: 0 14px;
	border: 1px solid var(--bwd-l-line);
	border-radius: 10px;
	background: var(--bwd-l-raised);
	color: var(--bwd-l-ink);
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition-property: transform, border-color, color;
	transition-duration: 180ms;
	transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.bwd-locale__go:hover {
	border-color: #fdba74;
	color: var(--bwd-l-brand-dark);
}

.bwd-locale__go:focus-visible {
	outline: 2px solid var(--bwd-l-brand);
	outline-offset: 2px;
}

.bwd-locale__go:active {
	transform: translateY(1px);
}

/* Enhanced: hidden until a keyboard choice is pending (see mod-locale.js). */
.bwd-locale__go[hidden] {
	display: none;
}

.bwd-locale__fallback {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
}

/* ---------------------------------------------------------------- footer */

.bwd-locale--footer {
	--bwd-l-ink: #f4f6f9;
	--bwd-l-muted: #99a3b4;
	--bwd-l-line: rgb(255 255 255 / 14%);
	--bwd-l-surface: rgb(255 255 255 / 6%);
	--bwd-l-raised: rgb(255 255 255 / 10%);
}

.bwd-locale--footer .bwd-locale__control {
	box-shadow: none;
}

.bwd-locale--footer .bwd-locale__control:hover,
.bwd-locale--footer .bwd-locale__control:focus-within {
	border-color: var(--bwd-l-brand);
	box-shadow: 0 0 0 3px rgb(249 125 10 / 20%);
}

.bwd-locale--footer .bwd-locale__select option {
	color: #10151f;
}

/* ---------------------------------------------------------------- header */

.bwd-locale--header .bwd-locale__label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.bwd-locale--header .bwd-locale__control {
	height: 36px;
}

.bwd-locale--header .bwd-locale__select {
	min-width: 0;
	max-width: 8.5rem;
	font-size: 13px;
}

@media (max-width: 1919px) {
	/* Below 1920px the full nav, phone and CTA leave no room for both selects;
	   the footer carries the same controls. */
	.bwd-locale--header {
		display: none;
	}
}

/* --------------------------------------------------------------- top bar */

/* Dark strip (#0b0d10). Compact controls sized to the 40px bar. Text is
   #e6e9ee on ~#14181d (about 14:1); borders and icons stay above 3:1. */
.bwd-locale--topbar {
	flex-wrap: nowrap;
	align-items: center;
	gap: 8px;
}

.bwd-locale--topbar .bwd-locale__field {
	flex-direction: row;
	align-items: center;
}

.bwd-locale--topbar .bwd-locale__label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.bwd-locale--topbar .bwd-locale__control {
	height: 26px;
	gap: 6px;
	padding: 0 24px 0 8px;
	border-color: #3a424e;
	border-radius: 7px;
	background: #14181d;
	color: #e6e9ee;
	box-shadow: none;
}

.bwd-locale--topbar .bwd-locale__control:hover {
	border-color: #f97d0a;
	box-shadow: none;
}

.bwd-locale--topbar .bwd-locale__control:focus-within {
	border-color: #f97d0a;
	box-shadow: none;
}

.bwd-locale--topbar .bwd-locale__control:has(.bwd-locale__select:focus-visible) {
	outline: 2px solid #f97d0a;
	outline-offset: 2px;
}

.bwd-locale--topbar .bwd-locale__control svg,
.bwd-locale--topbar .bwd-locale__chevron {
	color: #aab2bf;
}

.bwd-locale--topbar .bwd-locale__chevron {
	right: 7px;
}

.bwd-locale--topbar .bwd-locale__select {
	min-width: 0;
	max-width: 7.5rem;
	font-size: 12px;
	font-weight: 600;
}

.bwd-locale--topbar .bwd-locale__select option {
	color: #10151f;
	background: #fff;
}

.bwd-locale--topbar .bwd-locale__go {
	height: 26px;
	padding: 0 10px;
	font-size: 12px;
	border-color: #3a424e;
	background: #1c2128;
	color: #e6e9ee;
}

.bwd-locale--topbar .bwd-locale__go:hover {
	color: #fdba74;
	border-color: #f97d0a;
}

@media (min-width: 1920px) {
	/* The main header carries the controls from here. */
	.bwd-locale--topbar {
		display: none;
	}
}

/* ---------------------------------------------------------------- drawer */

.bwd-locale--drawer {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	padding-block-end: 4px;
}

.bwd-locale--drawer .bwd-locale__field {
	min-width: 0;
}

.bwd-locale--drawer .bwd-locale__select {
	min-width: 0;
	width: 100%;
}

.bwd-locale--drawer .bwd-locale__control {
	width: 100%;
}

.bwd-locale--drawer .bwd-locale__go {
	grid-column: 1 / -1;
	width: 100%;
}

@media (max-width: 380px) {
	.bwd-locale--drawer {
		grid-template-columns: 1fr;
	}
}

/* ------------------------------------------------------------ preferences */

@media (prefers-reduced-motion: reduce) {
	.bwd-locale__control,
	.bwd-locale__go {
		transition: none;
	}

	.bwd-locale__go:active {
		transform: none;
	}
}

/* ============================================================ popover
   Language + currency in the mega menu's visual system: same surface,
   radius, tinted layered shadow and uppercase brand headings, so the two
   read as one family. Only transform and opacity animate. */

.bwd-lp {
	--lp-brand: var(--color-brand-500, #f97d0a);
	--lp-brand-700: var(--color-brand-700, #bb520c);
	--lp-brand-50: var(--color-brand-50, #fff7ed);
	--lp-ink: var(--color-ink-900, #14181d);
	--lp-muted: var(--color-ink-500, #64707e);
	--lp-line: var(--color-line, #e4e7ec);
	--lp-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
	--lp-out: cubic-bezier(0.22, 1, 0.36, 1);

	position: relative;
	z-index: 70;
}

.bwd-lp > summary { list-style: none; }
.bwd-lp > summary::-webkit-details-marker { display: none; }

/* ---------- trigger ---------- */

.bwd-lp__trigger {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 36px;
	padding: 0 12px 0 10px;
	border: 1px solid var(--lp-line);
	border-radius: 999px;
	background: #fff;
	color: var(--lp-ink);
	font-size: 13px;
	font-weight: 650;
	cursor: pointer;
	user-select: none;
	box-shadow: 0 1px 2px rgb(16 21 31 / 5%), 0 6px 16px rgb(249 125 10 / 6%);
	transition: transform 180ms var(--lp-spring);
}

.bwd-lp__trigger:hover { border-color: #fdba74; }
.bwd-lp__trigger:active { transform: scale(0.97); }
.bwd-lp__trigger:focus-visible { outline: 2px solid var(--lp-brand); outline-offset: 2px; }

.bwd-lp__globe {
	display: inline-flex;
	color: var(--lp-brand);
	transition: transform 600ms var(--lp-spring);
}

.bwd-lp[open] .bwd-lp__globe { transform: rotate(200deg); }

.bwd-lp__now { letter-spacing: 0.02em; }

.bwd-lp__sep {
	inline-size: 1px;
	block-size: 14px;
	background: currentColor;
	opacity: 0.25;
}

.bwd-lp__caret {
	display: inline-flex;
	opacity: 0.6;
	transition: transform 220ms var(--lp-out);
}

.bwd-lp[open] .bwd-lp__caret { transform: rotate(180deg); }

.bwd-lp--topbar .bwd-lp__trigger {
	height: 26px;
	padding: 0 9px 0 8px;
	border-color: #3a424e;
	background: #14181d;
	color: #e6e9ee;
	font-size: 12px;
	box-shadow: none;
}

.bwd-lp--topbar .bwd-lp__trigger:hover,
.bwd-lp--topbar[open] .bwd-lp__trigger { border-color: var(--lp-brand); }

/* ---------- panel ---------- */

.bwd-lp__panel {
	position: absolute;
	inset-block-start: calc(100% + 10px);
	inset-inline-end: 0;
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	gap: 4px 28px;
	inline-size: min(46rem, calc(100vw - 32px));
	max-block-size: min(78vh, 36rem);
	padding: 22px 24px 20px;
	overflow: hidden auto;
	overscroll-behavior: contain;
	white-space: normal;
	text-align: start;
	color: var(--lp-ink);
	background: var(--color-surface, #fff);
	border: 1px solid var(--lp-line);
	border-radius: var(--radius-xl, 1.5rem);
	box-shadow:
		0 1px 2px rgba(122, 54, 18, 0.05),
		0 12px 24px -8px rgba(122, 54, 18, 0.12),
		0 32px 64px -16px rgba(11, 13, 16, 0.2);
	transform-origin: top right;
	animation: bwd-lp-in 260ms var(--lp-spring) both;
}

/* A bridge over the gap so the pointer can travel from trigger to panel. */
.bwd-lp__panel::before {
	content: '';
	position: absolute;
	inset-block-start: -12px;
	inset-inline: 0;
	block-size: 12px;
}

@keyframes bwd-lp-in {
	from { opacity: 0; transform: translateY(-8px) scale(0.97); }
	to   { opacity: 1; transform: none; }
}

/* Soft brand light in the corner: two layered radials. */
.bwd-lp__glow {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background:
		radial-gradient(60% 50% at 100% 0%, rgb(249 125 10 / 10%), transparent 70%),
		radial-gradient(40% 40% at 0% 100%, rgb(251 191 36 / 8%), transparent 70%);
}

.bwd-lp__col { position: relative; z-index: 1; min-inline-size: 0; }
.bwd-lp__col--cur { padding-inline-start: 24px; border-inline-start: 1px dashed var(--color-line-strong, #d0d5dd); }

.bwd-lp__heading { margin: 0 0 10px; padding-inline: 4px; }

/* ---------- languages ---------- */

.bwd-lp__langs,
.bwd-lp__pending,
.bwd-lp__curs { list-style: none; margin: 0; padding: 0; }

.bwd-lp__langs { display: grid; gap: 2px; max-block-size: 24rem; overflow-y: auto; overscroll-behavior: contain; }
.bwd-lp__col--lang > .bwd-lp__search { margin-block-end: 10px; }

.bwd-lp__lang {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 10px;
	border-radius: var(--radius-md, 0.75rem);
	color: inherit;
	text-decoration: none;
	transition: transform 180ms var(--lp-spring);
}

:is(a,button).bwd-lp__lang:hover,
:is(a,button).bwd-lp__lang:focus-visible { background: var(--lp-brand-50); }
:is(a,button).bwd-lp__lang:focus-visible { outline: 2px solid var(--lp-brand); outline-offset: -2px; }
:is(a,button).bwd-lp__lang:active { transform: scale(0.98); }

.bwd-lp__code {
	display: grid;
	place-items: center;
	flex: none;
	inline-size: 34px;
	block-size: 34px;
	border-radius: var(--radius-sm, 0.5rem);
	background: var(--lp-brand-50);
	color: var(--lp-brand-700);
	font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	letter-spacing: 0.04em;
	transition: transform 220ms var(--lp-spring);
}

:is(a,button).bwd-lp__lang:hover .bwd-lp__code { transform: scale(1.08) rotate(-4deg); }

a.bwd-lp__lang[aria-current] .bwd-lp__code {
	background: linear-gradient(135deg, #fb923c, var(--lp-brand) 55%, var(--lp-brand-700));
	color: #fff;
	box-shadow: 0 6px 14px -4px rgb(249 125 10 / 45%);
}

.bwd-lp__names { display: grid; min-inline-size: 0; line-height: 1.3; }
.bwd-lp__native { font-size: 14.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bwd-lp__english { font-size: 12px; color: var(--lp-muted); }

.bwd-lp__tick { margin-inline-start: auto; display: inline-flex; color: var(--lp-brand-700); }

.bwd-lp__more { margin-block-start: 12px; padding-block-start: 12px; border-block-start: 1px solid var(--lp-line); }

.bwd-lp__search {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--lp-line);
	border-radius: 999px;
	background: var(--color-surface-muted, #f7f8fa);
	color: var(--lp-muted);
}

.bwd-lp__search:focus-within { border-color: var(--lp-brand); box-shadow: 0 0 0 3px rgb(249 125 10 / 18%); }

.bwd-lp__search input {
	flex: 1;
	min-inline-size: 0;
	border: 0;
	background: transparent;
	color: var(--lp-ink);
	font: inherit;
	font-size: 13.5px;
	outline: none;
}

.bwd-lp__note { margin: 8px 4px 6px; font-size: 12px; line-height: 1.5; color: var(--lp-muted); }

.bwd-lp__pending {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 4px;
	max-block-size: 11rem;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.bwd-lp__lang.is-soon { padding: 6px 8px; gap: 9px; cursor: default; opacity: 0.62; }
.bwd-lp__lang.is-soon .bwd-lp__code { inline-size: 28px; block-size: 28px; font-size: 10px; background: var(--color-surface-muted, #f1f3f6); color: var(--lp-muted); }
.bwd-lp__lang.is-soon .bwd-lp__native { font-size: 13px; font-weight: 600; }
.bwd-lp__lang.is-soon .bwd-lp__english { font-size: 12px; }

.bwd-lp__soon {
	margin-inline-start: auto;
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--color-surface-muted, #f1f3f6);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--lp-muted);
}

.bwd-lp__empty { margin: 8px 4px 0; font-size: 13px; color: var(--lp-muted); }
[data-bwd-lp-item][hidden], .bwd-lp__empty[hidden] { display: none; }

/* ---------- currencies ---------- */

.bwd-lp__curs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }

.bwd-lp__cur {
	display: grid;
	justify-items: center;
	gap: 2px;
	padding: 9px 4px 8px;
	border: 1px solid var(--lp-line);
	border-radius: var(--radius-md, 0.75rem);
	background: #fff;
	color: inherit;
	text-decoration: none;
	transition: transform 200ms var(--lp-spring);
}

.bwd-lp__cur:hover { border-color: #fdba74; transform: translateY(-2px); }
.bwd-lp__cur:active { transform: scale(0.96); }
.bwd-lp__cur:focus-visible { outline: 2px solid var(--lp-brand); outline-offset: 2px; }

.bwd-lp__sym { font-size: 15px; font-weight: 750; line-height: 1.1; color: var(--lp-brand-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-inline-size: 100%; }
.bwd-lp__iso { font-size: 11px; font-weight: 650; letter-spacing: 0.06em; color: var(--lp-muted); }

.bwd-lp__cur[aria-current] {
	border-color: transparent;
	background: linear-gradient(135deg, #fb923c, var(--lp-brand) 55%, var(--lp-brand-700));
	box-shadow: 0 8px 18px -6px rgb(249 125 10 / 50%);
}

.bwd-lp__cur[aria-current] .bwd-lp__sym,
.bwd-lp__cur[aria-current] .bwd-lp__iso { color: #fff; }

/* Staggered entrance for the rows. */
.bwd-lp[open] .bwd-lp__langs > li,
.bwd-lp[open] .bwd-lp__curs > li { animation: bwd-lp-row 360ms var(--lp-out) both; }
.bwd-lp[open] li:nth-child(2) { animation-delay: 25ms; }
.bwd-lp[open] li:nth-child(3) { animation-delay: 50ms; }
.bwd-lp[open] li:nth-child(4) { animation-delay: 75ms; }
.bwd-lp[open] li:nth-child(n + 5) { animation-delay: 100ms; }

@keyframes bwd-lp-row {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

.bwd-lp--header { display: none; }

@media (min-width: 1920px) {
	.bwd-lp--header { display: block; }
	.bwd-lp--topbar { display: none; }
}

@media (max-width: 1100px) {
	.bwd-lp__panel { grid-template-columns: 1fr; }
	.bwd-lp__col--cur { border-inline-start: 0; padding-inline-start: 0; border-block-start: 1px dashed var(--color-line-strong, #d0d5dd); padding-block-start: 14px; margin-block-start: 8px; }
	.bwd-lp__curs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
	.bwd-lp *,
	.bwd-lp__panel { animation: none !important; transition: none !important; }
}

.bwd-lp__sr { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 1101px) {
	.bwd-lp__panel { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
	.bwd-lp__curs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.bwd-lp__cur { align-content: center; min-block-size: 50px; }

/* Preference controls retain native keyboard submission without crawlable action URLs. */
.bwd-lp form{margin:0} .bwd-lp button.bwd-lp__lang,.bwd-lp button.bwd-lp__cur{font:inherit;text-align:start;inline-size:100%;cursor:pointer} .bwd-lp button.bwd-lp__lang{border:0;background:transparent} .bwd-lp button.bwd-lp__lang:hover,.bwd-lp button.bwd-lp__lang:focus-visible{background:var(--lp-brand-50)}
