/**
 * Currency switcher and the note above the cart and checkout.
 * Colours come from the text around the switcher, so it fits light and dark footers; the
 * Dystinctly theme adds its own footer styles on top.
 */

.dyt-currency {
	position: relative;
	display: inline-block;
	font-size: 14px;
	line-height: 1.3;
}

.dyt-currency .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.dyt-currency__menu {
	position: relative;
}

.dyt-currency__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	padding: 0 14px 0 6px;
	border: 1px solid currentColor;
	border-radius: 999px;
	cursor: pointer;
	list-style: none;
	user-select: none;
	font-weight: 600;
}

.dyt-currency__toggle::-webkit-details-marker {
	display: none;
}

.dyt-currency__toggle::marker {
	content: "";
}

.dyt-currency__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 28px;
	padding: 0 6px;
	border-radius: 999px;
	background: rgba(127, 127, 127, 0.18);
	font-size: 13px;
	font-weight: 700;
}

.dyt-currency__chevron {
	flex: none;
	transition: transform 0.15s ease;
}

/* The chevron points the way the list opens. */
.dyt-currency--up .dyt-currency__chevron,
.dyt-currency--down .dyt-currency__menu[open] .dyt-currency__chevron {
	transform: rotate(180deg);
}

.dyt-currency--up .dyt-currency__menu[open] .dyt-currency__chevron {
	transform: none;
}

.dyt-currency__list {
	position: absolute;
	z-index: 100;
	right: 0;
	bottom: calc(100% + 8px);
	box-sizing: border-box;
	width: 270px;
	max-width: calc(100vw - 32px);
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #FFFFFF;
	color: #1B1523;
	border-radius: 16px;
	box-shadow: 0 18px 40px rgba(27, 21, 35, 0.2), 0 0 0 1px rgba(27, 21, 35, 0.08);
	text-align: left;
}

.dyt-currency--down .dyt-currency__list {
	top: calc(100% + 8px);
	bottom: auto;
}

.dyt-currency__list li {
	margin: 0;
}

.dyt-currency__option {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	padding: 8px 10px;
	border-radius: 10px;
	color: #1B1523 !important;
	text-decoration: none !important;
}

.dyt-currency__option:hover,
.dyt-currency__option:focus-visible {
	background: #F7F1FB;
}

.dyt-currency__option:focus-visible {
	outline: 2px solid #7B19B8;
	outline-offset: -2px;
}

.dyt-currency__option .dyt-currency__symbol {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	box-sizing: border-box;
	border-radius: 999px;
	background: #EFE3F6;
	color: #651497;
	font-size: 13px;
	font-weight: 700;
}

.dyt-currency__option[aria-current="true"] .dyt-currency__symbol {
	background: #7B19B8;
	color: #FFFFFF;
}

.dyt-currency__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.dyt-currency__code {
	font-weight: 700;
}

.dyt-currency__name {
	font-size: 13px;
	color: #4B4554;
}

.dyt-currency__hint {
	font-size: 12px;
	color: #6E6777;
}

.dyt-currency__check {
	flex: none;
	margin-left: auto;
	color: #7B19B8;
}

/* p. so it outranks the block editor's flow spacing, which would otherwise remove the gap below. */
p.dyt-currency-note {
	margin: 0 0 20px;
	padding: 12px 16px;
	border-radius: 12px;
	background: #F7F1FB;
	color: #1B1523;
	font-size: 15px;
	line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
	.dyt-currency__chevron {
		transition: none;
	}
}
