/**
 * CB Currency Selector Block
 *
 * Compact currency dropdown for header/top bar placement.
 */

.cbm-currency-selector {
	display: inline-flex;
	align-items: center;
	background-color: var(--wp--preset--color--cb-black);
	padding: 0.5em 0.75em;
}

.cbm-currency-selector__form {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 0;
}

.cbm-currency-selector__select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-color: transparent !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23FFFCF5' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.25em center;
	background-size: 0.65em;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	color: var(--wp--preset--color--cb-white);
	cursor: pointer;
	font-family: var(--wp--preset--font-family--editserifpro);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 100;
	line-height: 1.4;
	padding: 0.25em 1.5em 0.25em 0;
	margin: 0;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.cbm-currency-selector__select:focus {
	outline: none !important;
	box-shadow: none !important;
}

.cbm-currency-selector__select:hover {
	opacity: 0.7;
}

/* Remove default browser styling for select */
.cbm-currency-selector__select::-ms-expand {
	display: none;
}

/* Dropdown options - limited browser support */
.cbm-currency-selector__select option {
	background-color: var(--wp--preset--color--cb-black);
	color: var(--wp--preset--color--cb-white);
	font-family: var(--wp--preset--font-family--editserifpro);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 100;
	padding: 0.5em;
}

/* Noscript fallback button */
.cbm-currency-selector__submit {
	background: transparent;
	border: 1px solid currentColor;
	color: inherit;
	cursor: pointer;
	font-family: inherit;
	font-size: inherit;
	margin-left: 0.5em;
	padding: 0.25em 0.5em;
}

/* Admin notice when WooPayments not active */
.cbm-currency-selector__notice {
	color: #666;
	font-size: 12px;
	font-style: italic;
	margin: 0;
}

/* ==========================================================================
   Custom Dropdown (JavaScript-enhanced)
   ========================================================================== */

.cbm-currency-dropdown {
	position: relative;
	display: inline-block;
}

.cbm-currency-dropdown__toggle {
	appearance: none;
	background: transparent;
	border: none;
	color: var(--wp--preset--color--cb-white);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	font-family: var(--wp--preset--font-family--editserifpro);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 100;
	line-height: 1.4;
	padding: 0;
	margin: 0;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.cbm-currency-dropdown__toggle:hover {
	opacity: 0.7;
}

.cbm-currency-dropdown__toggle:focus {
	outline: none;
}

.cbm-currency-dropdown__arrow {
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid var(--wp--preset--color--cb-white);
	transition: transform 200ms ease;
}

.cbm-currency-dropdown--open .cbm-currency-dropdown__arrow {
	transform: rotate(180deg);
}

.cbm-currency-dropdown__list {
	position: absolute;
	top: 100%;
	left: 0;
	margin: 0.5em 0 0;
	padding: 0;
	list-style: none;
	background-color: var(--wp--preset--color--cb-black);
	min-width: 100%;
	z-index: 1000;
}

.cbm-currency-dropdown__item {
	padding: 0.5em 0.75em;
	color: var(--wp--preset--color--cb-white);
	font-family: var(--wp--preset--font-family--editserifpro);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 100;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 150ms ease;
}

.cbm-currency-dropdown__item:hover {
	background-color: rgba(255, 255, 255, 0.1);
}

.cbm-currency-dropdown__item--selected {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
	.cbm-currency-selector__select,
	.cbm-currency-dropdown__toggle,
	.cbm-currency-dropdown__item {
		font-size: 14px;
	}
}
