/**
 * Currency switcher frontend styles (list-style dropdown).
 */

.cc-currency-switcher {
	position: relative;
	display: inline-block;
	font-size: 14px;
	text-align: left;
}

.cc-switcher-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
}

.cc-switcher-toggle:hover,
.cc-currency-switcher.is-open .cc-switcher-toggle {
	border-color: #2271b1;
}

.cc-switcher-current {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.cc-switcher-caret {
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 5px solid currentColor;
	opacity: 0.7;
	transition: transform 0.15s ease;
}

.cc-currency-switcher.is-open .cc-switcher-caret {
	transform: rotate(180deg);
}

.cc-switcher-menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 9999;
	min-width: 100%;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	display: none;
	white-space: nowrap;
}

.cc-currency-switcher.is-open .cc-switcher-menu {
	display: block;
}

.cc-switcher-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	margin: 0;
	cursor: pointer;
	color: #1e1e1e;
}

.cc-switcher-item:hover {
	background: #f0f6fc;
}

.cc-switcher-item.is-selected {
	font-weight: 600;
	background: #f6f7f7;
}

.cc-switcher-name {
	line-height: 1.2;
}

/* Flags */
.cc-flag {
	display: inline-block;
	width: 22px;
	height: 15px;
	flex: 0 0 auto;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
	vertical-align: middle;
	overflow: hidden;
}

.cc-flag--svg {
	object-fit: cover;
}

.cc-flag--chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 22px;
	padding: 0 4px;
	height: 15px;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.5px;
	color: #555;
	background: #eee;
	box-shadow: none;
}

.cc-currency-switcher.cc-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Backdrop spinner shown while the currency is being applied */
.cc-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.6);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity 0.15s ease;
}

.cc-overlay.is-visible {
	opacity: 1;
}

.cc-overlay-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 22px 30px;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.cc-spinner {
	width: 34px;
	height: 34px;
	border: 3px solid rgba(0, 0, 0, 0.12);
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: cc-spin 0.7s linear infinite;
}

.cc-overlay-text {
	font-size: 14px;
	color: #333;
}

@keyframes cc-spin {
	to {
		transform: rotate(360deg);
	}
}
