/* ========================================
   Multi Currency Plugin - Frontend Styles
   ======================================== */

.mc-switcher-wrapper {
	display: inline-block;
	position: relative;
	margin: 15px 0;
}

/* Main Dropdown Container */
.mc-currency-dropdown {
	position: relative;
	display: inline-block;
}

/* Main Toggle Button */
.mc-currency-button {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background-color: #fff;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	white-space: nowrap;
	width: auto;
	min-width: auto;
}

.mc-currency-button:hover {
	border-color: #0073aa;
	background-color: #f5f5f5;
	box-shadow: 0 2px 8px rgba(0, 115, 170, 0.12);
}

.mc-currency-button:active,
.mc-currency-button:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.mc-currency-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	background-color: #f9f9f9;
}

/* Flag Icon */
.mc-flag-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 16px;
	flex-shrink: 0;
	border-radius: 2px;
	overflow: hidden;
}

.mc-flag-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* Currency Code */
.mc-currency-code {
	font-weight: 600;
	min-width: 40px;
}

/* Dropdown Arrow */
.mc-dropdown-arrow {
	font-size: 11px;
	margin-left: 4px;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.mc-currency-options.visible ~ .mc-currency-button .mc-dropdown-arrow {
	transform: rotate(180deg);
}

/* Loading State */
.mc-loading {
	display: inline-block;
	animation: mc-spin 0.8s linear infinite;
}

@keyframes mc-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* Success State */
.mc-success {
	color: #46b450;
	font-weight: bold;
}

/* Dropdown Menu */
.mc-currency-options {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 100%;
	margin-top: 4px;
	background-color: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	z-index: 1000;
	display: none;
	overflow: hidden;
}

.mc-currency-options.visible {
	display: block;
	animation: mc-slideDown 0.2s ease-out;
}

@keyframes mc-slideDown {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Currency Options (Items) */
.mc-currency-option {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 12px 14px;
	border: none;
	background-color: #fff;
	color: #333;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
	text-align: left;
	white-space: nowrap;
}

.mc-currency-option:first-child {
	border-radius: 4px 4px 0 0;
}

.mc-currency-option:last-child {
	border-radius: 0 0 4px 4px;
}

.mc-currency-option:hover {
	background-color: #f0f0f0;
}

.mc-currency-option.active {
	background-color: #0073aa;
	color: #fff;
}

.mc-currency-option:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Currency Name Text */
.mc-currency-name {
	flex: 1;
}

/* ========================================
   Product Page Integration
   ======================================== */

.mc-product-page-switcher {
	margin: 20px 0 !important;
	padding: 15px !important;
	background-color: #f9f9f9;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	transition: all 0.3s ease;
}

.mc-product-page-switcher.loading {
	background-color: #fff3cd;
	opacity: 0.85;
}

.mc-product-page-switcher.success {
	background-color: #d4edda;
}

.mc-product-page-switcher label {
	display: block;
	margin-bottom: 10px;
	font-weight: 600;
	color: #333;
	font-size: 14px;
}

.mc-product-page-switcher .mc-switcher-wrapper {
	margin: 0 !important;
}

/* ========================================
   Body State Class
   ======================================== */

body.currency-switching {
	pointer-events: none;
}

body.currency-switching .price,
body.currency-switching .woocommerce-variation-price {
	opacity: 0.4;
	transition: opacity 0.2s ease;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
	.mc-currency-button {
		font-size: 13px;
		padding: 9px 12px;
		gap: 6px;
	}

	.mc-flag-emoji {
		font-size: 18px;
	}

	.mc-currency-code {
		min-width: 35px;
	}

	.mc-product-page-switcher {
		margin: 15px 0 !important;
		padding: 12px !important;
	}
}

@media (max-width: 480px) {
	.mc-currency-button {
		font-size: 12px;
		padding: 8px 10px;
		gap: 6px;
	}

	.mc-flag-emoji {
		font-size: 16px;
	}

	.mc-currency-code {
		min-width: 30px;
	}

	.mc-currency-option {
		padding: 10px 12px;
		font-size: 13px;
	}

	.mc-product-page-switcher {
		margin: 15px -15px 0 -15px !important;
		padding: 12px 15px !important;
		border: none;
		border-top: 1px solid #e0e0e0;
		border-radius: 0;
	}
}
