/**
 * Country/region selector (Phase 9D header utility item) + first-visit
 * geo-suggestion banner. Presentation only — see template-parts/header/
 * region-selector.php and geo-suggestion.php for the business-logic
 * boundary. Loads only when karataki_region_context() returns non-null
 * (Regional Pricing on) and never on the transactional Cart/Checkout
 * header — see includes/class-assets.php.
 */

.k-region-selector {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

/* Minimal outline globe, purely decorative (aria-hidden, no flags — see
   region-selector.php) — currentColor so it tracks the same color/hover/
   dark-mode rules as the select text next to it with no separate rule. */
.k-region-selector__icon {
	flex: none;
}

/* A plain native <select>, styled to read as one more utility-bar text
   item (same approach as .k-theme-toggle in components/header.css) rather
   than a distinct boxed control. Typography (11px/500/uppercase/tracked)
   comes from the k-nav-link class on the element (region-selector.php),
   not inherit — see the same reasoning on .k-search__toggle/.k-theme-toggle.
   The option reset below keeps that from also reaching the dropdown list. */
.k-region-selector__select {
	appearance: none;
	-webkit-appearance: none;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	color: inherit;
	cursor: pointer;
	max-width: 120px;
	text-overflow: ellipsis;
}

/* Real option list keeps normal reading typography — only the closed
   trigger (the select element itself) gets the uppercase/tracked treatment. */
.k-region-selector__select option {
	font-size: var(--k-text-body-sm);
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
}

.k-region-selector__select:hover,
.k-region-selector__select:focus-visible {
	color: var(--k-color-accent);
}

.k-region-selector__select:focus-visible {
	outline: 1px solid var(--k-color-accent);
	outline-offset: 4px;
}

.k-region-selector__currency {
	font-size: 11px;
	letter-spacing: var(--k-tracking-nav);
	text-transform: uppercase;
	color: var(--k-color-muted-2);
}

/* Same breakpoint/reasoning as .k-theme-toggle: a 5th utility-bar item
   would push the hamburger button off-screen at phone widths, so this
   moves into the mobile panel below 900px instead (see mobile-panel.php's
   own copy, driven by the same assets/js/region-selector.js). */
@media (max-width: 899px) {
	.k-header__utility .k-region-selector {
		display: none;
	}
}

.k-mobile-panel .k-region-selector {
	padding: 18px 0;
	border-bottom: 1px solid var(--k-border-hairline);
	margin-bottom: 18px;
}

.k-mobile-panel .k-region-selector__select {
	max-width: none;
	flex: 1;
}

/* First-visit geo-suggestion banner — a slim, dismissible strip directly
   under the header, in normal document flow (not fixed/sticky: a one-time
   nudge doesn't need to follow scroll). Rendered `hidden` server-side
   always; assets/js/region-selector.js reveals it only after checking this
   exact country hasn't already been dismissed. */
.k-geo-suggest {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(10px, 2vw, 20px);
	flex-wrap: wrap;
	padding: 12px var(--k-gutter);
	background: var(--k-color-bg-surface);
	border-bottom: 1px solid var(--k-border-hairline);
	font-size: 13px;
	color: var(--k-color-text);
}

.k-geo-suggest__text {
	margin: 0;
}

.k-geo-suggest__actions {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-shrink: 0;
}

.k-geo-suggest__switch {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-weight: 600;
	color: var(--k-color-accent);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.k-geo-suggest__switch:hover,
.k-geo-suggest__switch:focus-visible {
	color: var(--k-color-text);
}

.k-geo-suggest__dismiss {
	background: none;
	border: 0;
	padding: 0;
	line-height: 1;
	font-size: 18px;
	color: var(--k-color-muted-2);
	cursor: pointer;
}

.k-geo-suggest__dismiss:hover,
.k-geo-suggest__dismiss:focus-visible {
	color: var(--k-color-text);
}

.k-geo-suggest[hidden] {
	display: none;
}
