/* Region Selector: full-screen glass overlay. No card/box anywhere —
   content sits directly on the blurred glass, centered. */

.ylian-region-trigger {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 999998;
	background: transparent;
	border: none;
	padding: 6px 10px;
	font-size: 12px;
	letter-spacing: 0.02em;
	color: rgba(0, 0, 0, 0.55);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ylian-region-trigger:hover {
	color: rgba(0, 0, 0, 0.85);
}

/* Applied by header-region-icon.js once it relocates this same element
   (id="ylian-region-trigger") from its original wp_footer position into
   Astra's Primary Header, next to the cart icon. Fully overrides the
   fixed bottom-left positioning above -- position: static so it lays
   out inline with the rest of the header row instead of floating loose
   over the page. */
.ylian-region-trigger--header {
	position: static;
	left: auto;
	bottom: auto;
	z-index: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	padding: 0;
	margin-right: 14px;
	text-decoration: none;
	/* v18: explicit reset, even though the base .ylian-region-trigger
	   rule above already sets background/border to nothing -- a visible
	   white circle was reported behind the icon on desktop. Computed
	   styles showed the actual cause was almost certainly the icon PNG's
	   own flattened-to-white background from an earlier resize step (now
	   fixed at the image level, see assets/img/region-icon-earth.png),
	   not CSS -- but resetting box-shadow/border-radius here too costs
	   nothing and rules out Astra's own focus-item styling (several
	   Astra header elements get a subtle hover/focus circle) as a
	   contributing factor for good. */
	background: transparent;
	box-shadow: none;
	border-radius: 0;
}

.ylian-region-trigger--header img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

/* v18: on mobile only, the earth icon moves to the FRONT of the search+
   cart cluster (earth -> search -> cart) instead of sitting between them
   (search -> earth -> cart, header-region-icon.js's DOM insertion order,
   which reads fine on desktop but looked cramped/unbalanced on mobile).
   921px matches Astra's own --ast-header-break-point default, where it
   switches from the desktop to the mobile header layout -- confirmed by
   reading the actual @media rules Astra emits around .ast-header-woo-cart
   on this site, rather than assuming a common default. order works here
   because the parent (.site-header-primary-section-right) is already a
   flex container -- Astra's own layout, not something this plugin sets
   up -- so this only needs to change this one element's order, not
   restructure anything. Desktop is intentionally untouched: no order
   set outside this media query, so it keeps its natural DOM position. */
@media (max-width: 921px) {
	.ylian-region-trigger--header {
		order: -1;
	}
}

.ylian-region-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
	overflow-y: auto;
	padding: 40px 20px;

	/* Slightly darker than the /solie/enter reference glass, so white
	   text reads clearly -- adjust the alpha here if it doesn't match
	   once compared side-by-side on the live site. */
	background: rgba(8, 8, 8, 0.68);
	-webkit-backdrop-filter: blur(18px);
	backdrop-filter: blur(18px);

	opacity: 1;
	transition: opacity 0.35s ease;
}

.ylian-region-overlay.is-active {
	display: flex;
}

.ylian-region-overlay.is-fading {
	opacity: 0;
	pointer-events: none;
}

/* Primary defense against overlapping picks (see region-selector.js):
   while a request is in flight, the whole country grid is inert and
   dimmed -- a second click physically cannot start a second request
   until the first one settles, so there's nothing left to race. */
.ylian-region-overlay.is-loading .ylian-region-overlay__columns {
	opacity: 0.45;
	pointer-events: none;
}

.ylian-region-overlay__inner {
	width: 100%;
	max-width: 1100px;
	text-align: center;
	color: #fff;
}

.ylian-region-overlay__logo {
	display: block;
	width: 150px;
	height: auto;
	max-width: 40vw;
	margin: 0 auto 28px;
}

.ylian-region-overlay__question {
	font-size: 22px;
	font-weight: 300;
	margin-bottom: 48px;
}

.ylian-region-overlay__columns {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 32px;
	text-align: left;
	justify-items: center;
}

.ylian-region-overlay__column {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.ylian-region-overlay__column--rest {
	justify-content: flex-start;
}

.ylian-region-overlay__col-title {
	font-size: 11px;
	letter-spacing: 0.12em;
	color: rgba(255, 255, 255, 0.55);
	margin-bottom: 6px;
}

.ylian-region-overlay__country,
.ylian-region-overlay__rest-button {
	background: transparent;
	border: none;
	padding: 2px 0;
	color: #fff;
	font-size: 15px;
	font-weight: 300;
	cursor: pointer;
	opacity: 1;
	transition: opacity 0.2s ease;
	text-align: center;
}

.ylian-region-overlay__rest-button {
	font-size: 15px;
	letter-spacing: 0.08em;
}

/* Hover dimming: JS toggles this class on every country button except
   the one currently hovered -- simpler and more broadly compatible than
   a pure-CSS sibling-dimming approach across a whole grid. */
.ylian-region-overlay__country.is-dimmed {
	opacity: 0.35;
}

.ylian-region-overlay__hover-line {
	margin-top: 40px;
	min-height: 18px;
	font-size: 13px;
	letter-spacing: 0.04em;
	color: rgba(255, 255, 255, 0.75);
}

.ylian-region-overlay__confirm {
	margin-top: 12px;
	min-height: 24px;
	font-size: 18px;
	font-weight: 300;
}

@media (max-width: 767px) {
	/* align-items: center on the base rule clips the top padding once
	   content (the 1-column country list, taller than the grid layout)
	   overflows the viewport height inside overflow-y: auto -- the
	   browser can't center content taller than its container, and the
	   "negative" offset that would create collapses to 0 instead of
	   preserving padding-top. flex-start makes the content start right
	   after padding-top and simply scroll from there, which is the
	   correct behavior once scrolling is already in play. */
	.ylian-region-overlay {
		align-items: flex-start;
	}

	.ylian-region-overlay__columns {
		grid-template-columns: 1fr;
		gap: 26px;
	}

	.ylian-region-overlay__logo {
		width: 110px;
		margin-bottom: 20px;
	}

	.ylian-region-overlay__question {
		font-size: 18px;
		margin-bottom: 32px;
	}
}
