:root {
	--gw-line: #e5e7eb;
	--gw-muted: #6b7280;
	--gw-blue: #23539a;
	--gw-country-radius: 4px; /* Bootstrap .form-control */
}

.gw-country-select,
.gw-country-select *,
.gw-country-select *::before,
.gw-country-select *::after {
	box-sizing: border-box;
}

.gw-country-select {
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
}

select.gw-country-select__sync,
select.gw-country-select__sync[hidden] {
	display: none !important;
	pointer-events: none !important;
}

.gw-country-select__control.form-control {
	position: relative;
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.25rem;
	width: 100%;
	max-width: 100%;
	overflow: hidden;
	cursor: pointer;
}

.row .gw-country-select__control {
	margin-bottom: 0.5em;
}

.gw-country-select__trigger {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	font: inherit;
	color: inherit;
	line-height: inherit;
	text-align: left;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.gw-country-select__trigger:focus {
	outline: none;
}

.gw-country-select__trigger-inner {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
	flex: 1;
	overflow: hidden;
	font: inherit;
	line-height: 1.2;
}

.gw-country-select__placeholder {
	color: inherit;
	opacity: 0.5;
	font-family: inherit;
	font-size: 0.8em;
	font-style: italic;
	font-weight: inherit;
	white-space: nowrap;
}

.gw-country-select__name {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font: inherit;
}

.gw-country-select__flag {
	display: inline-block;
	flex: 0 0 auto;
	width: 1.333em;
	height: 1em;
	border-radius: 2px;
}

.gw-country-select__chevron {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin-right: 0.15rem;
	color: var(--gw-muted);
	pointer-events: none;
	transform-origin: 50% 50%;
	transition: transform 0.2s ease;
}

.gw-country-select__chevron svg {
	display: block;
	width: 16px;
	height: 16px;
}

.gw-country-select.is-open .gw-country-select__chevron {
	transform: rotate(180deg);
}

.gw-country-select__control.form-control:focus,
.gw-country-select__control.form-control:focus-visible {
	outline: 0;
}

.gw-country-select__popover {
	position: absolute;
	z-index: 1050;
	top: calc(100% + 0.375rem);
	left: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: var(--gw-country-radius);
	border: 1px solid var(--gw-line);
	background: #fff;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14);
	font-size: 14px;
	line-height: 1.42857143;
}

.gw-country-select__popover[hidden] {
	display: none !important;
}

.gw-country-select__search-wrap {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0.5rem;
	padding: 0 0.75rem;
	border-radius: var(--gw-country-radius);
	border: 1px solid var(--gw-line);
	background: #fff;
}

.gw-country-select__search-icon {
	display: flex;
	color: var(--gw-muted);
	opacity: 0.6;
	flex-shrink: 0;
}

.gw-country-select__search-wrap .gw-country-select__search,
.gw-country-select__search-wrap .gw-country-select__search:hover,
.gw-country-select__search-wrap .gw-country-select__search:focus,
.gw-country-select__search-wrap .gw-country-select__search:active {
	flex: 1;
	min-width: 0;
	height: auto !important;
	margin: 0;
	padding: 6px 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	background-image: none !important;
	font: inherit;
	-webkit-appearance: none !important;
	appearance: none !important;
	color-scheme: light;
}

.gw-country-select__search::-webkit-search-decoration,
.gw-country-select__search::-webkit-search-cancel-button,
.gw-country-select__search::-webkit-search-results-button,
.gw-country-select__search::-webkit-search-results-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.gw-country-select__search:-webkit-autofill,
.gw-country-select__search:-webkit-autofill:hover,
.gw-country-select__search:-webkit-autofill:focus,
.gw-country-select__search:-webkit-autofill:active {
	-webkit-text-fill-color: inherit;
	caret-color: inherit;
	-webkit-box-shadow: 0 0 0 1000px #fff inset !important;
	box-shadow: 0 0 0 1000px #fff inset !important;
	transition: background-color 99999s ease-out;
}

.gw-country-select__list {
	max-height: 18rem;
	overflow: auto;
	padding: 0.25rem 0.5rem 0.5rem;
}

.gw-country-select__group + .gw-country-select__group {
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 2px solid var(--gw-line);
}

.gw-country-select__group-label {
	padding: 0.375rem 0.5rem 0.625rem;
	font-size: 0.85em;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--gw-muted);
}

.gw-country-select__option {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.625rem;
	width: 100%;
	padding: 6px 8px;
	border: 0;
	border-radius: var(--gw-country-radius);
	background: transparent;
	font: inherit;
	text-align: left;
	cursor: pointer;
	user-select: none;
}

.gw-country-select__option:hover,
.gw-country-select__option.is-active {
	background: #f3f4f6;
}

.gw-country-select__option-name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font: inherit;
}

.gw-country-select__check {
	display: flex;
	color: var(--gw-blue);
	opacity: 0;
	flex-shrink: 0;
}

.gw-country-select__option.is-selected .gw-country-select__check,
.gw-country-select__option.is-selected.is-active .gw-country-select__check {
	opacity: 1;
}

.gw-country-select__empty {
	padding: 1rem 0.75rem;
	font: inherit;
	color: var(--gw-muted);
	text-align: center;
}
