/* =========================================================================
   Country / region switch — loewe.com's "Choose country or region" panel.
   Markup: inc/region.php. Behaviour: assets/region.js.

   Same proportions and motion as the shop's Filters panel (shop.css .ao-fp)
   and the basket drawer: from the right on desktop (≈ 488px at 1440, as
   Loewe's), half the screen 768–1023px, a full-screen sheet from the bottom
   on phones. Scrim 30%.

   Loewe, measured at 1440 (29 Nov):
     title 18px, 24px from the top; close 24px, 24px in
     "Shipping to United Kingdom" 18px, 72px under the title
     continents: rows 36px, 14px, a 16px + on the right
                (here: the site's ▸ before the name, turning ▾ when open)
     countries: two columns (213px, 14px apart), rows 36px, 14px;
                the chosen one underlined
     foot: a black bar, "Shop in France (Français)"
   ========================================================================= */

/* ---- Trigger: "United Kingdom (£)" ---- */
.ao-rg-trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem; /* as "All details" on the product page */
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	border-radius: 0;
	cursor: pointer;
	text-align: left;
}
/* ▸ — the product page's details arrow (single-product.css .ao-details__open::before) */
.ao-rg-trigger::before,
.ao-rg__toggle::before {
	content: "";
	flex: none;
	width: 0;
	height: 0;
	border-left: 0.35em solid currentColor;
	border-block: 0.25em solid transparent;
}
.ao-rg-trigger__label {
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	transition: background-size 0.2s cubic-bezier(0, 0, 0.58, 1);
}
.ao-rg-trigger:hover .ao-rg-trigger__label,
.ao-rg-trigger:focus-visible .ao-rg-trigger__label { background-size: 100% 1px; }
.ao-rg-trigger:focus:not(:focus-visible) { outline: none; }
.ao-rg-trigger .screen-reader-text,
.ao-rg .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---- Panel ---- */
.ao-rg {
	position: fixed;
	inset: 0;
	z-index: 100002; /* above the phone menu and the basket drawer */
	font-family: var(--ao-sans, 'Founders Grotesk', 'Helvetica Neue', Arial, sans-serif);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--ao-ink, #000);
	-webkit-font-smoothing: antialiased;
}
.ao-rg[hidden] { display: none; }
.ao-rg *, .ao-rg *::before, .ao-rg *::after { box-sizing: border-box; }
.ao-rg button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	border-radius: 0;
	cursor: pointer;
	text-align: left;
	-webkit-tap-highlight-color: transparent;
}
.ao-rg :focus:not(:focus-visible) { outline: none; }
.ao-rg :focus-visible { outline: 1px solid var(--ao-ink, #000); outline-offset: 3px; }
.ao-rg ul { list-style: none; margin: 0; padding: 0; }
.ao-rg h2, .ao-rg h3 { margin: 0; font: inherit; }

.ao-rg__scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.3);
	opacity: 0;
	transition: opacity 0.2s cubic-bezier(0.42, 0, 1, 1);
}
.ao-rg.is-open .ao-rg__scrim { opacity: 1; }

.ao-rg__panel {
	--ao-rg-inner: calc(100% - 2 * var(--ao-gutter, 30px));
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: calc(var(--ao-gutter, 30px) + var(--ao-rg-inner) / 5 + 0.8 * max(12.5rem, var(--ao-rg-inner) / 6));
	display: flex;
	flex-direction: column;
	background: var(--ao-paper, #f8e9e5);
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.42, 0, 1, 1); /* closing */
	outline: none;
}
.ao-rg.is-open .ao-rg__panel {
	transform: none;
	transition: transform 0.5s ease-out; /* opening */
}

.ao-rg__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	flex: none;
	padding: 24px 24px 0;
}
.ao-rg .ao-rg__title { font-size: 18px; line-height: 1.25; }
.ao-rg__close { display: grid; place-items: center; width: 24px; height: 24px; }
.ao-rg__close .ao-icon { width: var(--ao-basket-close-size, 20px); height: var(--ao-basket-close-size, 20px); }

.ao-rg__body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	position: relative; /* offsetTop of the countries is measured from here */
	padding: 72px 24px 24px;
}
.ao-rg .ao-rg__heading { font-size: 18px; line-height: 1.25; margin-bottom: 13px; }

/* Continents */
/* Continents: ▸ before the name, turning to ▾ when open (0.2s, as the
   checkout's order-summary toggle). Replaces Loewe's + on the right. */
.ao-rg__toggle {
	display: flex !important;
	align-items: center;
	justify-content: flex-start;
	gap: 0.5rem;
	width: 100%;
	min-height: 36px;
}
.ao-rg__toggle::before { transition: transform 0.2s var(--ao-ease-out, ease-out); }
.ao-rg__toggle[aria-expanded='true']::before { transform: rotate(90deg); }
.ao-rg__toggle:hover span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Countries: two columns */
.ao-rg__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 14px;
	padding-bottom: 12px !important;
}
.ao-rg__list[hidden] { display: none; }
.ao-rg__country {
	display: block;
	width: 100%;
	min-height: 36px;
	padding: 8px 0 !important;
	line-height: 1.4;
}
.ao-rg__country span,
.ao-rg__country { text-decoration: none; }
.ao-rg__country:hover,
.ao-rg__country[aria-pressed='true'] {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* Foot: the site's black block, label top-left */
.ao-rg__foot {
	flex: none;
	padding: 16px 24px 24px;
	background: var(--ao-paper, #f8e9e5);
}
.ao-rg .ao-rg__apply {
	display: block;
	width: 100%;
	min-height: 72px;
	padding: 16px 16px 36.4px !important;
	background: var(--ao-ink, #000);
	color: #fff;
	font-weight: 500;
}
.ao-rg .ao-rg__apply:hover { opacity: 0.88; }
.ao-rg .ao-rg__apply[aria-busy='true'] { opacity: 0.6; cursor: progress; }

html.ao-rg-locked,
html.ao-rg-locked body { overflow: hidden; }

@media (max-width: 1023px) {
	.ao-rg__panel { width: 50%; }
	.ao-rg__head { padding: 16px 16px 0; }
	.ao-rg__body { padding: 56px 16px 16px; }
	.ao-rg__foot { padding: 16px 16px 20px; }
}

@media (max-width: 767px) {
	.ao-rg__panel {
		width: 100%;
		transform: translateY(100%);
		padding-bottom: env(safe-area-inset-bottom);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ao-rg__scrim,
	.ao-rg__panel,
	.ao-rg.is-open .ao-rg__panel { transition: none; }
	.ao-rg__toggle::before { transition: none; }
}

/* Phone menu foot: same weight as the other links there (header.css). */
.ao-drawer .ao-drawer__foot .ao-rg-trigger { font-weight: 500; }
