/**
 * Currency Selector Styles
 *
 * Styles for the floating currency selector widget that appears on
 * search results, cart, and checkout pages.
 */

/* ==========================================================================
   Currency Selector Container
   ========================================================================== */

.wpr-currency-selector {
	/* background: #ffffff; */
	border: 1px solid;
	border-radius: 24px;
	/* box-shadow: 0 2px 8px rgba(0, 113, 161, 0.15); */
	padding: 0;
	min-width: auto;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

/* Floating position (default/legacy behavior) */
.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-block;
	margin: 10px 0;
}

/* Menu item styles */
.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;
	min-width: auto;
	/* box-shadow: 0 2px 4px rgba(0, 113, 161, 0.15);
	border: 2px solid rgba(0, 113, 161, 0.3); */
}

.menu-item.wpr-currency-menu-item .wpr-currency-selector-label {
	display: none; /* Hide label in menu */
}

.menu-item.wpr-currency-menu-item .wpr-currency-select {
	padding: 8px 32px 8px 12px;
	font-size: inherit;
	border: none;
	background-color: transparent;
	color: inherit;
	font-weight: 600;
}

.wpr-currency-selector:hover {
	/* box-shadow: 0 4px 12px rgba(0, 113, 161, 0.25); */
	transform: translateY(-1px);
	/* border-color: #005a8d; */
}

/* 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 #0071a1; */
	border-radius: 50%;
	animation: wpr-spin 0.8s linear infinite;
}

@keyframes wpr-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Label
   ========================================================================== */

.wpr-currency-selector-label {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	color: #0071a1;
	margin: 0;
	padding: 8px 0 8px 14px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

/* ==========================================================================
   Select Dropdown
   ========================================================================== */

.wpr-currency-selector select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	width: auto;
	min-width: 80px;
	padding: 10px 36px 10px 14px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	/* color: #0071a1; */
	/* 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%230071a1%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 12px center;
	background-size: 12px;
	border: none;
	border-radius: 24px;
	outline: none;
	cursor: pointer;
	text-transform: uppercase;
	letter-spacing: 1px;
	transition: all 0.2s ease;
}

/* Show only currency code when closed */
.wpr-currency-selector select option {
	text-transform: uppercase;
	font-weight: 600;
	font-size: 14px;
	padding: 8px 12px;
}

.wpr-currency-selector select:hover {
	background-color: rgba(0, 113, 161, 0.05);
}

/* .wpr-currency-selector select:focus {
	outline: 2px solid #0071a1; 
	outline-offset: -2px;
	background-color: rgba(0, 113, 161, 0.08);
} */

.wpr-currency-selector select:active {
	transform: scale(0.98);
}

.wpr-currency-selector select:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	background-color: #f5f5f5;
}

/* ==========================================================================
   Currency Options
   ========================================================================== */

.wpr-currency-selector option {
	padding: 8px;
	font-size: 14px;
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */

@media (max-width: 768px) {
	.wpr-currency-selector {
		top: auto;
		bottom: 20px;
		right: 20px;
		left: auto;
		min-width: 160px;
		padding: 10px 12px;
	}

	.wpr-currency-selector-label {
		font-size: 11px;
		margin-bottom: 6px;
	}

	.wpr-currency-selector select {
		font-size: 13px;
		padding: 6px 10px;
		padding-right: 28px;
		background-size: 10px;
		background-position: right 6px center;
	}
}

@media (max-width: 480px) {
	.wpr-currency-selector {
		right: 10px;
		bottom: 10px;
		min-width: 140px;
		padding: 8px 10px;
	}

	.wpr-currency-selector-label {
		font-size: 10px;
	}

	.wpr-currency-selector select {
		font-size: 12px;
		padding: 5px 8px;
		padding-right: 24px;
	}
}

/* ==========================================================================
   Alternative: Button-based Selector (Optional)
   ========================================================================== */

.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;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
	.wpr-currency-selector {
		border-radius: 20px;
		gap: 6px;
	}
	
	.wpr-currency-selector-label {
		font-size: 10px;
		padding: 6px 0 6px 12px;
	}
	
	.wpr-currency-selector select {
		font-size: 14px;
		padding: 8px 32px 8px 12px;
		min-width: 70px;
	}
	
	/* Stack label and select on very small screens */
	@media (max-width: 480px) {
		.wpr-currency-selector {
			flex-direction: column;
			align-items: flex-start;
			gap: 4px;
			padding: 8px 12px;
		}
		
		.wpr-currency-selector-label {
			padding: 0;
		}
		
		.wpr-currency-selector select {
			width: 100%;
		}
	}
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.wpr-currency-selector {
		display: none;
	}
}
