/*
 * LicenseCorner Markets — frontend styles.
 *
 * Notes on specificity:
 *   The market switcher is often dropped into a footer where the theme has
 *   strong opinions about ul/li/button/a styling. To stay visually intact
 *   we (a) reset every internal element, (b) lock down critical visual
 *   rules with !important, and (c) enforce the [hidden] panel state so
 *   themes that override `[hidden]` cannot accidentally reveal the panel.
 */

/* -------------------------------------------------------------------------
 * Region selector ([lc_country_selector])
 * ---------------------------------------------------------------------- */

.lc-markets-selector {
	display: block;
	margin: 1.5em 0;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.4;
	color: #111827;
}

.lc-markets-selector,
.lc-markets-selector * {
	box-sizing: border-box;
}

/* Detected-country callout */

.lc-markets-detected {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin: 0 0 1.5em;
	padding: 13px 16px;
	background: linear-gradient(135deg, rgba(37, 99, 235, .065), rgba(37, 99, 235, .018));
	border: 1px solid rgba(37, 99, 235, .22);
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.lc-markets-detected__flag {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.lc-markets-detected__flag .lc-flag {
	width: 28px !important;
	height: 20px !important;
}

.lc-markets-detected__text {
	flex: 1 1 auto;
	min-width: 200px;
}

.lc-markets-detected__lead {
	margin: 0;
	font-size: 15px;
	line-height: 1.35;
}

.lc-markets-detected__sub {
	margin: .15em 0 0;
	font-size: 13px;
	color: #6b7280;
}

.lc-markets-detected__cta {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	padding: 7px 16px;
	border-radius: 999px;
	background: #2563eb;
	color: #fff !important;
	font-weight: 600;
	font-size: 13px;
	line-height: 1.2;
	text-decoration: none !important;
	transition: background-color .12s ease, transform .12s ease;
}

.lc-markets-detected__cta:hover,
.lc-markets-detected__cta:focus {
	background: #1d4ed8;
	transform: translateY(-1px);
}

/* Search bar */

.lc-markets-search {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0 0 1.5em;
	color: #6b7280;
}

.lc-markets-search__icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: currentColor;
	pointer-events: none;
}

.lc-markets-search__input {
	flex: 1;
	width: 100%;
	box-sizing: border-box;
	min-height: 44px;
	padding: 10px 58px 10px 46px;
	font: inherit;
	font-size: 15px;
	line-height: 1.3;
	border: 1px solid rgba(0, 0, 0, .15);
	border-radius: 12px;
	background: #fff;
	color: #111827;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .12s ease, box-shadow .12s ease;
}

.lc-markets-search__input::placeholder {
	color: #9ca3af;
	opacity: 1;
}

.lc-markets-search__input:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.lc-markets-search:focus-within {
	color: #2563eb;
}

.lc-markets-search__count {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	min-width: 30px;
	padding: 3px 9px;
	font-size: 12px;
	font-weight: 600;
	color: #4b5563;
	background: rgba(0, 0, 0, .06);
	border-radius: 999px;
	text-align: center;
	pointer-events: none;
}

/* Regions */

.lc-markets-regions {
	display: block;
}

.lc-markets-region {
	margin: 0 0 1.9em;
}

.lc-markets-region[hidden] {
	display: none;
}

.lc-markets-region-title {
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #6b7280;
}

.lc-markets-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 10px;
}

.lc-markets-list-item {
	margin: 0;
	padding: 0;
}

.lc-markets-list-item[hidden] {
	display: none !important;
}

.lc-markets-languages {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 7px 0 0 35px;
}

.lc-markets-language {
	display: inline-flex;
	align-items: center;
	min-height: 26px;
	padding: 4px 8px;
	border: 1px solid rgba(17, 24, 39, .12);
	border-radius: 6px;
	background: #ffffff;
	color: #374151 !important;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
}

.lc-markets-language:hover,
.lc-markets-language:focus {
	border-color: rgba(37, 99, 235, .35);
	background: rgba(37, 99, 235, .06);
	color: #1d4ed8 !important;
	outline: none;
}

.lc-markets-language.is-active {
	border-color: #2563eb;
	background: rgba(37, 99, 235, .1);
	color: #1d4ed8 !important;
}

.lc-markets-item {
	display: flex;
	align-items: center;
	gap: 11px;
	min-height: 48px;
	padding: 9px 12px;
	border: 1px solid rgba(17, 24, 39, .11);
	border-radius: 10px;
	background: #fff;
	color: #111827 !important;
	text-decoration: none !important;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .02);
	transition: background-color .12s ease, border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}

.lc-markets-item:hover,
.lc-markets-item:focus {
	background: #fafafa;
	border-color: rgba(37, 99, 235, .35);
	box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
	transform: translateY(-1px);
	outline: none;
}

.lc-markets-item.is-active {
	border-color: #2563eb;
	background: rgba(37, 99, 235, .06);
	box-shadow: 0 0 0 1px #2563eb inset;
}

.lc-markets-item .lc-flag {
	flex: 0 0 auto;
	width: 24px !important;
	height: 17px !important;
}

.lc-markets-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
	line-height: 1.25;
}

.lc-markets-name {
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lc-markets-sub {
	font-size: 12px;
	color: #6b7280;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lc-markets-item.is-active .lc-markets-sub {
	color: #1d4ed8;
}

.lc-markets-meta {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .04em;
	color: #4b5563;
	background: rgba(0, 0, 0, .05);
	padding: 3px 8px;
	border-radius: 999px;
}

.lc-markets-item.is-active .lc-markets-meta {
	color: #1d4ed8;
	background: rgba(37, 99, 235, .12);
}

.lc-markets-check {
	flex: 0 0 auto;
	display: inline-flex;
	color: #1d4ed8;
}

.lc-markets-empty {
	margin: 1em 0;
	padding: 2em 1em;
	text-align: center;
	color: #6b7280;
	background: rgba(0, 0, 0, .02);
	border: 1px dashed rgba(0, 0, 0, .15);
	border-radius: 10px;
	font-size: 15px;
}

@media (max-width: 480px) {
	.lc-markets-detected {
		flex-direction: column;
		align-items: flex-start;
	}
	.lc-markets-detected__cta {
		width: 100%;
		justify-content: center;
	}
	.lc-markets-list {
		grid-template-columns: 1fr;
	}
	.lc-markets-search__input {
		padding-right: 50px;
	}
}

.lc-markets-current {
	display: inline-block;
}

.lc-markets-button {
	display: inline-flex;
	align-items: center;
	padding: .35em .75em;
	border: 1px solid rgba(0, 0, 0, .25);
	border-radius: 999px;
	font-size: .9em;
	line-height: 1.3;
	text-decoration: none;
	color: inherit;
	background: transparent;
}

.lc-markets-button:hover,
.lc-markets-button:focus {
	background: rgba(0, 0, 0, .06);
}

/* -------------------------------------------------------------------------
 * Fallback language prompt
 * ---------------------------------------------------------------------- */

.lc-language-prompt {
	position: fixed;
	right: clamp(16px, 2vw, 32px);
	bottom: clamp(16px, 2vw, 32px);
	z-index: 10000;
	display: block;
	width: min(390px, calc(100vw - 32px));
	padding: 22px;
	border: 1px solid rgba(226, 232, 240, .92);
	border-radius: 14px;
	background:
		linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .96));
	color: #142033;
	box-shadow:
		0 28px 70px rgba(15, 23, 42, .26),
		0 8px 24px rgba(15, 23, 42, .12),
		inset 0 1px 0 rgba(255, 255, 255, .95);
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 14px;
	line-height: 1.35;
	overflow: hidden;
	backdrop-filter: blur(18px);
}

.lc-language-prompt[hidden] {
	display: none !important;
}

.lc-language-prompt__header {
	display: flex;
	align-items: center;
	gap: 9px;
	min-width: 0;
	padding-right: 44px;
	margin-bottom: 9px;
}

.lc-language-prompt__flag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	border: 1px solid rgba(226, 232, 240, .72);
	border-radius: 9px;
	background: #ffffff;
	box-shadow:
		0 8px 18px rgba(15, 23, 42, .12),
		inset 0 1px 0 rgba(255, 255, 255, .92);
	overflow: hidden;
}

.lc-language-prompt__flag .lc-flag {
	width: 100% !important;
	height: 100% !important;
	border-radius: 0 !important;
}

.lc-language-prompt__title {
	margin: 0;
	color: #142033;
	font-size: 18px;
	font-weight: 800;
	letter-spacing: 0;
	line-height: 1.1;
}

.lc-language-prompt__text {
	margin: 0;
	color: #5b6475;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.45;
}

.lc-language-prompt__actions {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
	gap: 10px;
	margin-top: 18px;
}

.lc-language-prompt__choice {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 46px;
	padding: 10px 13px;
	border: 1px solid #d1d8e2;
	border-radius: 9px;
	background:
		linear-gradient(180deg, #ffffff, #fbfdff);
	color: #172033 !important;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
	overflow-wrap: anywhere;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, .9),
		0 8px 18px rgba(15, 23, 42, .06);
	transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}

.lc-language-prompt__choice:hover,
.lc-language-prompt__choice:focus {
	border-color: #3f9f38;
	background: linear-gradient(180deg, #ffffff, #f6fbf5);
	color: #142033 !important;
	box-shadow:
		0 0 0 3px rgba(63, 159, 56, .14),
		0 14px 24px rgba(15, 23, 42, .10);
	outline: none;
	transform: translateY(-2px);
}

.lc-language-prompt__close {
	position: absolute;
	top: 18px;
	right: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid #cfd6df;
	border-radius: 9px;
	background: rgba(248, 250, 252, .9);
	color: #172033;
	font: inherit;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	box-shadow:
		0 8px 18px rgba(15, 23, 42, .08),
		inset 0 1px 0 rgba(255, 255, 255, .85);
	transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.lc-language-prompt__close span {
	display: block;
	margin-top: -3px;
}

.lc-language-prompt__close:hover,
.lc-language-prompt__close:focus {
	border-color: #9ca8b8;
	background: #ffffff;
	color: #111827;
	outline: none;
	transform: translateY(-1px);
}

@media (max-width: 900px) {
	.lc-language-prompt {
		width: min(380px, calc(100vw - 32px));
	}
	.lc-language-prompt__actions {
		grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
	}
}

@media (max-width: 640px) {
	.lc-language-prompt {
		left: 12px;
		right: 12px;
		bottom: 12px;
		width: auto;
		padding: 18px;
		border-radius: 14px;
	}
	.lc-language-prompt__header {
		padding-right: 42px;
	}
	.lc-language-prompt__flag {
		flex-basis: 28px;
		width: 28px;
		height: 28px;
	}
	.lc-language-prompt__actions {
		grid-template-columns: 1fr;
		gap: 10px;
		margin-top: 16px;
	}
	.lc-language-prompt__choice {
		min-height: 44px;
	}
	.lc-language-prompt__close {
		top: 14px;
		right: 14px;
		width: 32px;
		height: 32px;
		font-size: 26px;
	}
}

@media (min-width: 641px) and (max-width: 900px) {
	.lc-language-prompt {
		right: 20px;
		bottom: 20px;
	}
}

/* -------------------------------------------------------------------------
 * Flag image — used in selector, switcher, region list
 * ---------------------------------------------------------------------- */

.lc-flag {
	display: inline-block !important;
	width: 20px !important;
	height: 14px !important;
	object-fit: cover !important;
	border-radius: 2px !important;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .12) !important;
	vertical-align: middle;
	flex: 0 0 auto;
	background: transparent;
}

/* -------------------------------------------------------------------------
 * [lc_market_switcher] — rounded button + searchable dropdown
 *
 * The .lc-switcher root and all internal elements are scoped here. We
 * use `!important` on the rules that themes commonly override (ul/li
 * margins, list-style, link color/decoration, button padding, [hidden]).
 * ---------------------------------------------------------------------- */

.lc-switcher,
.lc-switcher * {
	box-sizing: border-box;
}

.lc-switcher {
	position: relative;
	display: inline-block;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.3;
	color: inherit;
	text-align: left;
}

.lc-switcher [hidden] {
	display: none !important;
}

/* Toggle button — rounded pill */

.lc-switcher__toggle {
	display: inline-flex !important;
	align-items: center;
	gap: .55em;
	padding: .5em .9em .5em .65em !important;
	margin: 0 !important;
	border-radius: 999px !important;
	border: 1px solid rgba(255, 255, 255, .25) !important;
	background: rgba(255, 255, 255, .05) !important;
	color: #ffffff !important;
	font: inherit;
	font-size: 14px;
	line-height: 1.3;
	cursor: pointer;
	max-width: 100%;
	text-decoration: none !important;
	box-shadow: none !important;
	opacity: 1 !important;
	transition: background-color .15s ease, border-color .15s ease;
}

.lc-switcher__toggle:hover,
.lc-switcher__toggle:focus-visible {
	background: rgba(255, 255, 255, .12) !important;
	border-color: rgba(255, 255, 255, .55) !important;
	color: #ffffff !important;
	outline: none;
}

.lc-switcher__toggle[aria-expanded="true"] {
	background: rgba(255, 255, 255, .12) !important;
	border-color: rgba(255, 255, 255, .6) !important;
	color: #ffffff !important;
}

.lc-switcher__toggle,
.lc-switcher__toggle * {
	color: #ffffff !important;
}

.lc-switcher__toggle .lc-switcher__name {
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 220px;
	color: #ffffff !important;
}

.lc-switcher__currency {
	color: rgba(255, 255, 255, .75) !important;
	font-size: .9em;
	margin-left: .15em;
}

.lc-switcher__toggle .lc-switcher__chevron {
	color: rgba(255, 255, 255, .75) !important;
}

.lc-switcher__chevron {
	display: inline-flex;
	margin-left: .15em;
	opacity: .7;
	transition: transform .15s ease;
}

.lc-switcher__toggle[aria-expanded="true"] .lc-switcher__chevron {
	transform: rotate(180deg);
}

/* Panel — solid surface, sits ABOVE the toggle (anchored to footer) */

.lc-switcher__panel {
	position: absolute;
	z-index: 9999;
	bottom: calc(100% + 8px);
	min-width: 280px;
	max-width: min(360px, 92vw);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #ffffff !important;
	color: #111827 !important;
	border: 1px solid rgba(0, 0, 0, .08) !important;
	border-radius: 14px !important;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .35) !important;
	padding: 0 !important;
	margin: 0 !important;
	max-height: none !important;
	text-align: left;
}

.lc-switcher--align-right .lc-switcher__panel {
	right: 0;
	left: auto;
}

.lc-switcher--align-left .lc-switcher__panel {
	left: 0;
	right: auto;
}

/* Search */

.lc-switcher__search {
	padding: 10px;
	border-bottom: 1px solid rgba(0, 0, 0, .08);
	background: #ffffff;
}

.lc-switcher__input {
	display: block !important;
	width: 100% !important;
	box-sizing: border-box !important;
	padding: .55em .8em !important;
	margin: 0 !important;
	border: 1px solid rgba(0, 0, 0, .15) !important;
	border-radius: 8px !important;
	font: inherit !important;
	font-size: 14px !important;
	line-height: 1.3 !important;
	background: #f9fafb !important;
	color: #111827 !important;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none !important;
}

.lc-switcher__input::placeholder {
	color: #6b7280;
	opacity: 1;
}

.lc-switcher__input:focus {
	outline: none !important;
	border-color: #2563eb !important;
	background: #ffffff !important;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .15) !important;
}

/* List — reset bullets + theme paddings */

.lc-switcher__list {
	list-style: none !important;
	margin: 0 !important;
	padding: 4px !important;
	/* Cap visible rows to ~5 — beyond that the user scrolls. */
	max-height: 240px !important;
	min-height: 0 !important;
	overflow-y: auto !important;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	background: transparent;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, .25) transparent;
}

.lc-switcher__list::-webkit-scrollbar {
	width: 8px;
}

.lc-switcher__list::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, .2);
	border-radius: 4px;
}

.lc-switcher__list::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, .35);
}

.lc-switcher__item {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent;
}

.lc-switcher__item::before,
.lc-switcher__item::marker {
	content: none !important;
	display: none !important;
}

.lc-switcher__link {
	display: flex !important;
	align-items: center;
	gap: .65em;
	padding: .55em .65em !important;
	border-radius: 8px !important;
	text-decoration: none !important;
	color: #111827 !important;
	background: transparent;
	box-shadow: none !important;
}

.lc-switcher__link:hover,
.lc-switcher__link:focus-visible {
	background: rgba(0, 0, 0, .05) !important;
	color: #111827 !important;
	outline: none;
}

.lc-switcher__item.is-active .lc-switcher__link {
	background: rgba(37, 99, 235, .08) !important;
	color: #1d4ed8 !important;
	font-weight: 600;
}

.lc-switcher__item.lc-switcher__item--highlighted .lc-switcher__link {
	background: rgba(0, 0, 0, .06) !important;
}

.lc-switcher__link .lc-switcher__name {
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 500;
	max-width: none;
}

.lc-switcher__badge {
	display: inline-block;
	padding: 1px 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .04em;
	color: #4b5563;
	background: rgba(0, 0, 0, .06);
	border-radius: 4px;
	margin-left: auto;
}

.lc-switcher__item.is-active .lc-switcher__badge {
	color: #1d4ed8;
	background: rgba(37, 99, 235, .12);
}

.lc-switcher__check {
	display: inline-flex;
	margin-left: 4px;
	color: #1d4ed8;
}

.lc-switcher__empty {
	padding: 1em !important;
	margin: 0 !important;
	list-style: none !important;
	text-align: center;
	color: #6b7280;
	font-size: .9em;
}

@media (max-width: 480px) {
	.lc-switcher__panel {
		min-width: 240px;
		max-width: 92vw;
	}
	.lc-switcher__name {
		max-width: 160px;
	}
}

/* Final compact sizing guard for optimized/bundled CSS pipelines. */
.lc-language-prompt {
	width: min(390px, calc(100vw - 32px)) !important;
	padding: 22px !important;
	border-radius: 14px !important;
	font-size: 14px !important;
}

.lc-language-prompt__flag {
	flex-basis: 28px !important;
	width: 28px !important;
	height: 28px !important;
}

.lc-language-prompt__title {
	margin: 0 !important;
	font-size: 18px !important;
	line-height: 1.1 !important;
}

.lc-language-prompt__text,
.lc-language-prompt__choice {
	font-size: 14px !important;
}

.lc-language-prompt__actions {
	gap: 10px !important;
	margin-top: 18px !important;
}

.lc-language-prompt__choice {
	min-height: 46px !important;
	padding: 10px 13px !important;
	border-radius: 9px !important;
}

.lc-language-prompt__close {
	top: 18px !important;
	right: 18px !important;
	width: 34px !important;
	height: 34px !important;
	font-size: 28px !important;
	border-radius: 9px !important;
}

@media (max-width: 640px) {
	.lc-language-prompt {
		left: 12px !important;
		right: 12px !important;
		width: auto !important;
		padding: 18px !important;
	}
}
