.site-header--top-bar-hidden .site-header__top-bar .algol-country-selector {
	display: none;
}

html.algol-country-selector-open .site-header.site-header--top-bar-hidden .site-header__top-bar .algol-country-selector {
	display: block;
}

/*
 * Chemicals header group (.site-header__top-bar) already supplies background,
 * constrained + global padding, and the scroll-hide target. The block fills that
 * shell instead of painting a second bar. Do not set overflow:hidden here: the
 * desktop panel is position:absolute and must paint outside the bar.
 */
.site-header__top-bar:has(.algol-country-selector) {
	max-height: none;
	padding-block: 0 !important;
}

.site-header__top-bar.is-layout-constrained > .algol-country-selector,
.site-header__top-bar .algol-country-selector {
	max-width: var(--wp--style--global--wide-size);
	min-width: 0;
	flex: 1 1 auto;
	background-color: transparent;
}

.site-header__top-bar .algol-country-selector__inner {
	max-width: none;
	padding-left: 0;
	padding-right: 0;
}

@media (max-width: 991px) {
	html.algol-country-selector-open,
	html.algol-country-selector-open body {
		overflow: hidden;
	}

	/*
	 * overflow:hidden breaks sticky only after a scroll. Pin then, not at
	 * scroll 0 — fixed top:0 would slide under the WP admin bar.
	 */
	html.algol-country-selector-pinned .site-header {
		position: fixed;
		top: 0;
		right: 0;
		left: 0;
		width: 100%;
		background-color: var(--wp--preset--color--lightergray, #ececec);
	}

	@media screen and (min-width: 783px) {
		html.algol-country-selector-pinned body.admin-bar .site-header {
			top: 32px;
		}
	}

	html.algol-country-selector-open .site-header__main {
		display: none;
	}
}

html.algol-country-selector-open .site-header.site-header--top-bar-hidden .site-header__top-bar {
	max-height: none;
	pointer-events: auto;
}

html.algol-country-selector-open .site-header.site-header--top-bar-hidden .site-header__top-bar > * {
	display: revert;
}

.algol-country-selector {
	width: 100%;
	background-color: var(--wp--preset--color--lightergray, #ececec);
	font-size: inherit;
}

.algol-country-selector--banner {
	min-width: 0;
	flex: 1 1 auto;
}

.algol-country-selector--toggle {
	width: auto;
	flex: 0 0 auto;
	background-color: transparent;
}

.algol-country-selector__inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem;
	max-width: var(--wp--style--global--wide-size);
	margin: 0 auto;
	padding-top: var(--wp--preset--spacing--xxs);
	padding-bottom: var(--wp--preset--spacing--xxs);
	padding-left: var(--wp--style--root--padding-left);
	padding-right: var(--wp--style--root--padding-right);
}

.algol-country-selector__banner {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	gap: 0.5rem;
	margin: 0;
	min-width: 0;
	font-size: var(--wp--preset--font-size--normal);
}

.algol-country-selector__banner-text {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 1rem;
	line-height: 1.5;
	white-space: normal;
	overflow-wrap: break-word;
}

.algol-country-selector__flag-slot {
	flex: 0 0 auto;
	width: 21px;
	height: 15px;
}

.algol-country-selector__flag {
	box-sizing: border-box;
	display: block;
	width: 21px;
	height: 15px;
	border: 0.75px solid var(--wp--preset--color--tertiary, #414141);
	border-radius: 3px;
	object-fit: cover;
}

.algol-country-selector__dropdown {
	position: relative;
	flex: 0 0 auto;
}

.algol-country-selector__toggle {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	gap: 4px;
	margin: 0;
	padding: 8px 16px;
	border: 0;
	border-radius: 24px;
	background-color: var(--wp--preset--color--white, #fff);
	color: var(--wp--preset--color--tertiary, #414141);
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	line-height: 1.5;
	cursor: pointer;
	text-align: left;
	white-space: nowrap;
}

.algol-country-selector__toggle:hover,
.algol-country-selector__toggle:focus-visible {
	background-color: var(--wp--preset--color--lime-green, var(--wp--preset--color--secondary, #bccf21));
}

.algol-country-selector__toggle-label {
	font-weight: 400;
}

.algol-country-selector__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 21px;
	height: 21px;
}

.algol-country-selector__icon-leaf--globe {
	display: block;
	max-width: none;
	max-height: none;
}

.algol-country-selector__icon-leaf--chevron {
	display: block;
	width: 9.29px;
	height: 5.26px;
	max-width: none;
	max-height: none;
	transform: rotate(180deg);
}

.algol-country-selector__toggle[aria-expanded="true"] .algol-country-selector__icon-leaf--chevron {
	transform: none;
}

.algol-country-selector__panel {
	position: absolute;
	z-index: 30;
	top: calc(100% + 0.5rem);
	inset-inline-end: 0;
	/* min-width: 22.75rem; */
	width: max-content;
	padding: 24px;
	border: 1px solid var(--wp--preset--color--mediumgray, #a0a0a0);
	border-radius: 16px;
	background: var(--wp--preset--color--white, #fff);
	box-shadow: 0 8px 28px rgba(65, 65, 65, 0.12)
}

.algol-country-selector__columns {
	display: flex;
	align-items: flex-start;
	gap: 24px;
}

.algol-country-selector__column {
	flex: 0 0 auto;
}

.algol-country-selector__column + .algol-country-selector__column {
	border-inline-start: 1px solid var(--wp--preset--color--primary, #84329b);
	padding-inline-start: 24px;
}

.algol-country-selector__heading {
	margin: 0 0 24px;
	padding-inline-start: 16px;
	color: var(--wp--preset--color--primary, #84329b);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	line-height: 1.5;
}

.algol-country-selector__list {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.algol-country-selector__item {
	margin: 0;
}

.algol-country-selector__item a,
.algol-country-selector__item > span {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 20px;
	color: var(--wp--preset--color--tertiary, #414141);
	text-decoration: none;
	font-weight: 400;
	line-height: 1;
}

.algol-country-selector__item a:hover,
.algol-country-selector__item a:focus-visible {
	color: var(--wp--preset--color--primary, #84329b);
}

.algol-country-selector__dot {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--wp--preset--color--primary, #84329b);
	opacity: 0;
}

.algol-country-selector__item.is-selected .algol-country-selector__dot {
	opacity: 1;
}

.algol-country-selector__item-label {
	white-space: nowrap;
}


.site-header__main--container .algol-country-selector--toggle {
	flex: 0 0 auto;
}

@media (max-width: 991px) {
	.site-header__main--container .algol-country-selector--toggle {
		order: 2;
	}

	.algol-country-selector__banner-text,
	.algol-country-selector__banner {
		font-size: var(--wp--preset--font-size--small);
	}

	.algol-country-selector__panel {
		position: fixed;
		top: var(--algol-country-panel-top, 0);
		right: 0;
		bottom: 0;
		left: 0;
		inset-inline-end: 0;
		z-index: 15;
		min-width: 0;
		width: 100%;
		max-width: none;
		padding: 16px 24px;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		overflow: auto;
		box-sizing: border-box;
	}

	.algol-country-selector__columns {
		flex-direction: column;
		gap: 16px;
	}

	.algol-country-selector__column {
		width: 100%;
	}

	.algol-country-selector__column + .algol-country-selector__column {
		border-inline-start: 0;
		border-top: 1px solid var(--wp--preset--color--primary, #84329b);
		padding-inline-start: 0;
		padding-top: 16px;
	}

	.algol-country-selector__heading {
		margin-bottom: 8px;
		padding-inline-start: 0;
		font-size: var(--wp--preset--font-size--medium);
	}

	.algol-country-selector__list--countries,
	.algol-country-selector__list--languages {
		display: grid;
		width: 100%;
	}

	.algol-country-selector__list--countries {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 8px;
	}

	.algol-country-selector__list--languages {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 4px;
	}

	.algol-country-selector__item a,
	.algol-country-selector__item > span {
		min-height: 44px;
	}

	.algol-country-selector__item-label {
		font-size: var(--wp--preset--font-size--normal);
		overflow: hidden;
		text-overflow: ellipsis;
	}
}

@media (max-width: 480px) {
	.algol-country-selector__list--countries {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.algol-country-selector--editor {
	margin: 0;
	padding: 0.5rem 0.75rem;
	border: 1px dashed var(--wp--preset--color--primary, #84329b);
	background: var(--wp--preset--color--lightergray, #ececec);
}
