/**
 * Language + currency switcher (header + first-visit modal)
 *
 * @package WP_SEO_Tour_System
 */

.cr-header__brand-cluster {
	display: flex;
	align-items: center;
	gap: clamp(12px, 2vw, 20px);
	flex: 0 0 auto;
	min-width: 0;
}

.wts-lang {
	position: relative;
	flex-shrink: 0;
}

.wts-lang__trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: box-shadow 0.2s ease, background 0.2s ease;
}

.wts-lang__trigger:hover,
.wts-lang__trigger[aria-expanded="true"] {
	background: #f1f5f9;
	box-shadow: 0 0 0 1px #e2e8f0;
}

.wts-lang__trigger:focus-visible {
	outline: 2px solid #99203b;
	outline-offset: 2px;
}

.wts-lang__flag {
	display: block;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.wts-lang__flag--tr {
	background-image: url("../images/flags/tr.svg");
}

.wts-lang__flag--en {
	background-image: url("../images/flags/en.svg");
}

.wts-lang__flag--es {
	background-image: url("../images/flags/es.svg");
}

.wts-lang__dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 220px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
	border: 1px solid #e8edf2;
	padding: 6px 0;
	z-index: 10060;
}

.wts-lang__item {
	display: grid;
	grid-template-columns: 32px 1fr auto;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	text-decoration: none;
	color: #1e293b;
	transition: background 0.15s ease;
}

.wts-lang__item:hover,
.wts-lang__item.is-active {
	background: #eef6ff;
}

.wts-lang__item.is-active .wts-lang__name {
	color: #2563eb;
	font-weight: 600;
}

.wts-lang__name {
	font-size: 14px;
	line-height: 1.3;
}

.wts-lang__code {
	font-size: 12px;
	color: #94a3b8;
	font-weight: 500;
}

/* First-visit modal */
.wts-lang-modal[hidden] {
	display: none !important;
}

.wts-lang-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.wts-lang-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
}

.wts-lang-modal__panel {
	position: relative;
	width: 100%;
	max-width: 400px;
	background: #fff;
	border-radius: 16px;
	padding: 28px 24px 20px;
	box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
}

.wts-lang-modal__close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 36px;
	height: 36px;
	border: none;
	background: #f1f5f9;
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #475569;
}

.wts-lang-modal__title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 700;
	color: #0f172a;
}

.wts-lang-modal__desc {
	margin: 0 0 16px;
	font-size: 13px;
	line-height: 1.5;
	color: #64748b;
}

.wts-lang-modal__list .wts-lang__item {
	border-radius: 10px;
	margin-bottom: 4px;
}

html.wts-lang-modal-open {
	overflow: hidden;
}

.wts-lang__item--loading {
	opacity: 0.55;
	pointer-events: none;
}

/* Confirmation toast (cookie mode) */
.wts-lang-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 100001;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	background: #0f172a;
	color: #fff;
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
	font-size: 14px;
	line-height: 1.4;
	max-width: min(92vw, 420px);
	animation: wts-lang-toast-in 0.35s ease;
}

.wts-lang-toast--hide {
	animation: wts-lang-toast-out 0.3s ease forwards;
}

.wts-lang-toast__text {
	flex: 1;
}

.wts-lang-toast__close {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

@keyframes wts-lang-toast-in {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

@keyframes wts-lang-toast-out {
	to {
		opacity: 0;
		transform: translateX(-50%) translateY(12px);
	}
}

@media (max-width: 767px) {
	.wts-lang-toast {
		bottom: max(16px, env(safe-area-inset-bottom));
	}
}

@media (max-width: 1024px) {
	.cr-header__brand-cluster .wts-lang--header {
		display: none;
	}

	.cr-header__mobile-lang .wts-lang--header {
		display: block;
	}

	.cr-header__mobile-lang .wts-lang__dropdown {
		right: 0;
		left: auto;
	}
}

@media (min-width: 1025px) {
	.cr-header__mobile-lang {
		display: none !important;
	}
}

/* Currency switcher (English-only mode) */
.wts-currency {
	position: relative;
	flex-shrink: 0;
}

.wts-currency__trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 12px;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	color: #1e293b;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.wts-currency__trigger:hover,
.wts-currency__trigger[aria-expanded="true"] {
	border-color: #cbd5e1;
	box-shadow: 0 0 0 1px #e2e8f0;
}

.wts-currency__trigger:focus-visible {
	outline: 2px solid #99203b;
	outline-offset: 2px;
}

.wts-currency__symbol {
	font-size: 15px;
	line-height: 1;
}

.wts-currency__code {
	font-size: 12px;
	letter-spacing: 0.02em;
	color: #64748b;
}

.wts-currency__dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 200px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
	border: 1px solid #e8edf2;
	padding: 6px 0;
	z-index: 10060;
}

.wts-currency__item {
	display: grid;
	grid-template-columns: 28px 1fr auto;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 10px 14px;
	border: none;
	background: transparent;
	text-align: left;
	cursor: pointer;
	color: #1e293b;
	font: inherit;
}

.wts-currency__item:hover,
.wts-currency__item.is-active {
	background: #eef6ff;
}

.wts-currency__item.is-active .wts-currency__item-label {
	color: #2563eb;
	font-weight: 600;
}

.wts-currency__item-symbol {
	font-size: 15px;
}

.wts-currency__item-label {
	font-size: 14px;
}

.wts-currency__item-code {
	font-size: 12px;
	color: #94a3b8;
	font-weight: 500;
}

.wts-currency__item--loading {
	opacity: 0.55;
	pointer-events: none;
}

/* Trust bar (footer — right of Secure payment) */
.cr-trust-bar__item--currency {
	position: relative;
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.wts-currency--trust-bar {
	position: relative;
}

.wts-currency--trust-bar .wts-currency__trigger {
	min-height: 36px;
	padding: 0 10px;
	font-size: 12px;
	border-color: #e2e8f0;
	background: #fff;
}

.wts-currency--trust-bar .wts-currency__dropdown {
	top: auto;
	bottom: calc(100% + 8px);
	left: auto;
	right: 0;
	min-width: 188px;
}

@media (max-width: 1024px) {
	.cr-header__brand-cluster .wts-currency--header {
		display: none;
	}

	.cr-header__mobile-lang .wts-currency--header {
		display: block;
	}

	.cr-header__mobile-lang .wts-currency__dropdown {
		right: 0;
		left: auto;
	}
}

@media (min-width: 1025px) {
	.cr-header__mobile-lang .wts-currency--header {
		display: none;
	}
}
