/**
 * Frontend Styles
 *
 * @package WC_Multilingual_Pro
 */

/* ── Shared switcher (language + currency) ─────────────────────── */

.wcmp-switcher {
	display: inline-block;
	position: relative;
	font-size: 14px;
}

.wcmp-switcher-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: transparent;
	border: 1px solid rgba(255,255,255,0.35);
	border-radius: 4px;
	color: inherit;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color 0.2s, background 0.2s;
	font-size: inherit;
}

.wcmp-switcher-trigger:hover {
	border-color: rgba(255,255,255,0.7);
	background: rgba(255,255,255,0.08);
}

.wcmp-switcher-arrow {
	font-size: 10px;
	opacity: 0.7;
	margin-left: 2px;
}

.wcmp-switcher-flag {
	width: 18px;
	height: 13px;
	border-radius: 2px;
	vertical-align: middle;
}

.wcmp-switcher-symbol {
	font-weight: 600;
	min-width: 14px;
	text-align: center;
}

.wcmp-switcher-label {
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Dropdown list */
.wcmp-switcher-list {
	display: none;
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	min-width: 160px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.12);
	list-style: none;
	margin: 0;
	padding: 4px 0;
	z-index: 9999;
}

.wcmp-switcher:hover .wcmp-switcher-list,
.wcmp-switcher.wcmp-open .wcmp-switcher-list {
	display: block;
}

.wcmp-switcher-option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	color: #333;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s;
}

.wcmp-switcher-option:hover {
	background: #f5f5f5;
	color: #111;
	text-decoration: none;
}

.wcmp-switcher-option.wcmp-switcher-active {
	font-weight: 600;
	color: #111;
}

.wcmp-switcher-check {
	margin-left: auto;
	color: #2271b1;
	font-size: 13px;
}

/* ── Flags switcher (type="flags") ─────────────────────────────── */
.wcmp-switcher-flags {
	display: flex;
	gap: 10px;
	align-items: center;
}

.wcmp-switcher-flags a {
	display: inline-block;
	opacity: 0.6;
	transition: opacity 0.3s;
}

.wcmp-switcher-flags a:hover,
.wcmp-switcher-flags a.active {
	opacity: 1;
}

.wcmp-flag {
	width: 24px;
	height: 18px;
	border: 1px solid #ddd;
	border-radius: 2px;
}

/* Legacy selects (kept for backwards compat) */
.wcmp-switcher-dropdown {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 3px;
	background: #fff;
	cursor: pointer;
	min-width: 120px;
}

/* ── Combined language + currency switcher ─────────────────────── */

.wcmp-cs {
	display: inline-block;
	position: relative;
	font-size: 14px;
}

.wcmp-cs-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: transparent;
	border: 1px solid rgba(255,255,255,0.35);
	border-radius: 6px;
	color: inherit;
	cursor: pointer;
	white-space: nowrap;
	font-size: inherit;
	transition: border-color 0.2s, background 0.2s;
}

.wcmp-cs-trigger:hover {
	border-color: rgba(255,255,255,0.7);
	background: rgba(255,255,255,0.1);
}

.wcmp-cs-trigger[aria-expanded="true"] .wcmp-cs-chevron {
	transform: rotate(180deg);
}

.wcmp-cs-chevron {
	transition: transform 0.2s;
	opacity: 0.75;
	flex-shrink: 0;
}

.wcmp-cs-trigger-text {
	font-weight: 600;
	letter-spacing: 0.03em;
}

.wcmp-cs-flag {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(255,255,255,0.3);
	flex-shrink: 0;
}

/* Panel */
.wcmp-cs-panel {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	width: 220px;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 30px rgba(0,0,0,0.15);
	overflow: hidden;
	z-index: 9999;
}

.wcmp-cs-panel[hidden] {
	display: none;
}

/* Language list */
.wcmp-cs-langs {
	max-height: 50vh;
	overflow-y: auto;
	padding: 6px 8px;
}

.wcmp-cs-lang-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 7px 8px;
	border-radius: 8px;
	text-decoration: none;
	color: #111;
	transition: background 0.15s;
	gap: 8px;
}

.wcmp-cs-lang-row:hover {
	background: #f5f5f5;
	text-decoration: none;
	color: #111;
}

.wcmp-cs-lang-row.wcmp-cs-active {
	font-weight: 600;
	background: #f0f4ff;
}

.wcmp-cs-lang-name {
	font-size: 13px;
}

.wcmp-cs-lang-code {
	color: #888;
	font-size: 11px;
}

.wcmp-cs-lang-flag {
	border: 2px solid #e5e7eb;
}

/* Currency pills */
.wcmp-cs-currencies {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	padding: 8px 10px 10px;
	border-top: 1px solid #e5e7eb;
}

.wcmp-cs-curr-pill {
	display: inline-block;
	background: #f1f1f1;
	border: none;
	border-radius: 6px;
	padding: 3px 7px;
	font-size: 12px;
	cursor: pointer;
	color: #333;
	text-decoration: none;
	transition: background 0.15s;
	line-height: 1.4;
}

.wcmp-cs-curr-pill:hover {
	background: #ddd;
	color: #111;
	text-decoration: none;
}

.wcmp-cs-curr-pill.wcmp-cs-curr-active {
	background: #2271b1;
	color: #fff;
	font-weight: 600;
}

.wcmp-cs-curr-pill.wcmp-cs-curr-active:hover {
	background: #1a5a8c;
	color: #fff;
}
