/**
 * Currency Selector Styles
 *
 * Styles for the currency selector widget styled to match the
 * roomcloud-form pill bar aesthetic.
 */

.wpr-currency-selector {
	display: flex;
	align-items: center;
	background: #fff;
	border-radius: 60px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	height: 52px;
	transition: box-shadow 0.2s ease;
}

.wpr-currency-selector:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* Floating position */
.wpr-currency-selector--floating {
	position: fixed;
	top: 120px;
	right: 20px;
	z-index: 9999;
}

/* Static position (inline with content) */
.wpr-currency-selector--static {
	position: relative;
	display: inline-flex;
	margin: 10px 0;
}

/* Label acts as the trigger container (like .wpr-trigger) */
.wpr-currency-selector-label {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	padding: 8px 16px;
	height: 100%;
	cursor: pointer;
	border-radius: 60px;
	transition: background-color 0.2s ease;
	margin: 0;
	width: 100%;
}

.wpr-currency-selector-label:hover {
	background-color: #f0f2f4;
}

/* Reuse form's wpr-trigger-label styles for the label text */

/* Value wrapper matches .wpr-trigger-value style */
.wpr-currency-selector .wpr-trigger-value {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: #111;
	line-height: 18.2px;
	width: 100%;
}

/* Select dropdown styled as trigger value */
.wpr-currency-selector select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	display: block;
	width: 100%;
	padding: 0 24px 0 0;
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
	line-height: inherit;
	background-color: transparent;
	background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1%201l5%205%205-5%22%20stroke%3D%22%23666%22%20stroke-width%3D%222%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E');
	background-repeat: no-repeat;
	background-position: right 4px center;
	background-size: 10px;
	border: none !important;
	border-radius: 0;
	outline: none;
	cursor: pointer;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	height: auto !important;
	box-shadow: none;
	font-family: inherit;
}

.wpr-currency-selector select:hover {
	opacity: 0.8;
}

.wpr-currency-selector select:focus-visible {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
	border-radius: 4px;
}

.wpr-currency-selector select:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Option styling */
.wpr-currency-selector option {
	text-transform: uppercase;
	font-weight: 500;
	font-size: 14px;
	padding: 8px 12px;
}

/* Menu item integration */
.menu-item.wpr-currency-menu-item {
	display: flex;
	align-items: center;
}

.menu-item.wpr-currency-menu-item .wpr-currency-selector {
	margin: 0 10px;
	padding: 0;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	height: auto;
}

.menu-item.wpr-currency-menu-item .wpr-currency-selector-label {
	display: none;
}

.menu-item.wpr-currency-menu-item select {
	padding: 8px 32px 8px 12px;
	font-size: inherit;
	border: none;
	background-color: transparent;
	color: inherit;
	font-weight: 600;
}

/* Loading state */
.wpr-currency-selector.wpr-loading {
	opacity: 0.6;
	pointer-events: none;
}

.wpr-currency-selector.wpr-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #0073aa;
	border-radius: 50%;
	animation: wpr-spin 0.8s linear infinite;
}

@keyframes wpr-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Button-based selector (alternative) */
.wpr-currency-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.wpr-currency-option {
	padding: 6px 12px;
	font-size: 13px;
	font-weight: 500;
	color: #555;
	background: #f5f5f5;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
}

.wpr-currency-option:hover {
	background: #0071a1;
	color: #fff;
	border-color: #0071a1;
}

.wpr-currency-option.active {
	background: #0071a1;
	color: #fff;
	border-color: #0071a1;
	pointer-events: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
	.wpr-currency-selector {
		height: 46px;
	}

	.wpr-currency-selector--floating {
		top: auto;
		bottom: 20px;
		right: 20px;
		left: auto;
	}

	.wpr-currency-selector-label {
		padding: 6px 12px;
	}

	.wpr-currency-selector select {
		min-width: 70px;
		background-size: 9px;
		background-position: right 2px center;
	}
}

@media (max-width: 480px) {
	.wpr-currency-selector {
		height: 42px;
	}

	.wpr-currency-selector--floating {
		right: 10px;
		bottom: 10px;
	}

	.wpr-currency-selector-label {
		padding: 4px 10px;
	}

	.wpr-currency-selector select {
		min-width: 60px;
		font-size: 13px;
	}
}

/* Print */
@media print {
	.wpr-currency-selector {
		display: none;
	}
}
