/*
 * NOP Translate: il selettore delle lingue.
 *
 * Colori e forme si cambiano dal pannello (scheda Switcher) o con le
 * variabili qui sotto, dal CSS del tema:
 * .nopdtr-switcher { --nopdtr-bg: #111; --nopdtr-fg: #fff; }
 */

.nopdtr-switcher {
	--nopdtr-bg: #ffffff;
	--nopdtr-fg: #1d2327;
	--nopdtr-muted: #646970;
	--nopdtr-line: rgba(16, 24, 40, .12);
	--nopdtr-hover: rgba(255, 194, 26, .16);
	--nopdtr-hover: color-mix(in srgb, var(--nopdtr-accent) 14%, transparent);
	--nopdtr-accent: #B07A00;
	--nopdtr-radius: 10px;
	--nopdtr-shadow: 0 12px 32px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .06);

	position: relative;
	display: inline-block;
	font: 500 14px/1.3 inherit;
	font-family: inherit;
	color: var(--nopdtr-fg);
	z-index: 50;
}

.nopdtr-switcher ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nopdtr-switcher a {
	color: inherit;
	text-decoration: none;
}

.nopdtr-switcher__code {
	font-weight: 700;
	letter-spacing: .04em;
	font-size: .86em;
}

.nopdtr-switcher__code + .nopdtr-switcher__name {
	margin-left: .45em;
}

/* ---- Tendina ---- */

.nopdtr-switcher .nopdtr-switcher__current,
.nopdtr-switcher .nopdtr-switcher__current:hover,
.nopdtr-switcher .nopdtr-switcher__current:focus,
.nopdtr-switcher .nopdtr-switcher__current:active {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	width: auto;
	margin: 0;
	padding: 8px 12px;
	background: var(--nopdtr-bg) !important; /* i temi e Elementor colorano ogni <button>: il pulsante segue le variabili. */
	color: var(--nopdtr-fg) !important;
	border: 1px solid var(--nopdtr-line) !important;
	border-radius: var(--nopdtr-radius);
	font: inherit;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	box-shadow: none;
	transition: border-color .15s ease, background-color .15s ease;
}

.nopdtr-switcher .nopdtr-switcher__current:hover,
.nopdtr-switcher .nopdtr-switcher__current:focus-visible {
	border-color: var(--nopdtr-accent) !important;
}

.nopdtr-switcher__current:focus-visible,
.nopdtr-switcher a:focus-visible {
	outline: 2px solid var(--nopdtr-accent);
	outline-offset: 2px;
}

.nopdtr-switcher__globe {
	color: var(--nopdtr-accent);
	flex: none;
}

.nopdtr-switcher__chevron {
	color: var(--nopdtr-muted);
	flex: none;
	transition: transform .18s ease;
}

.nopdtr-switcher.is-open .nopdtr-switcher__chevron {
	transform: rotate(180deg);
}

.nopdtr-switcher--dropdown .nopdtr-switcher__list {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 100%;
	max-height: min(60vh, 420px);
	overflow-y: auto;
	padding: 6px;
	background: var(--nopdtr-bg);
	border: 1px solid var(--nopdtr-line);
	border-radius: var(--nopdtr-radius);
	box-shadow: var(--nopdtr-shadow);
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}

.nopdtr-switcher.is-open .nopdtr-switcher__list {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .15s ease, transform .15s ease, visibility 0s;
}

.nopdtr-switcher--dropdown .nopdtr-switcher__list a {
	display: flex;
	align-items: center;
	min-height: 38px;
	padding: 8px 12px;
	border-radius: calc(var(--nopdtr-radius) - 4px);
}

.nopdtr-switcher--dropdown .nopdtr-switcher__list a:hover {
	background: var(--nopdtr-hover);
}

.nopdtr-switcher__list a[aria-current="true"] {
	color: var(--nopdtr-accent);
	font-weight: 700;
}

/* ---- Bandiere ---- */

.nopdtr-flag {
	display: inline-block;
	flex: none;
	width: 20px;
	height: 15px;
	margin: 0 .5em 0 0;
	padding: 0;
	border: 0;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(16, 24, 40, .14);
	object-fit: cover;
	vertical-align: -2px;
}

.nopdtr-switcher__current .nopdtr-flag {
	margin-right: 0;
}

.nopdtr-flag:last-child {
	margin-right: 0;
}

.nopdtr-switcher--nice .nopdtr-flag {
	width: 24px;
	height: 18px;
	border-radius: 3px;
}

/* ---- Pulsante "Globe": solo l'icona ---- */

.nopdtr-switcher--globe .nopdtr-switcher__current {
	padding: 8px 10px;
}

.nopdtr-switcher--globe .nopdtr-switcher__globe {
	width: 20px;
	height: 20px;
}

/* ---- Popup ---- */

.nopdtr-popup {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(16, 24, 40, .5);
	opacity: 0;
	visibility: hidden;
	transition: opacity .15s ease, visibility 0s linear .15s;
}

.nopdtr-switcher.is-open .nopdtr-popup {
	opacity: 1;
	visibility: visible;
	transition: opacity .15s ease, visibility 0s;
}

.nopdtr-popup__box {
	position: relative;
	width: min(420px, 100%);
	max-height: min(80vh, 560px);
	overflow-y: auto;
	padding: 18px;
	background: var(--nopdtr-bg);
	color: var(--nopdtr-fg);
	border-radius: calc(var(--nopdtr-radius) + 6px);
	box-shadow: var(--nopdtr-shadow);
}

.nopdtr-popup .nopdtr-popup__close,
.nopdtr-popup .nopdtr-popup__close:hover {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 32px;
	height: 32px;
	min-height: 0;
	margin: 0;
	padding: 0;
	background: transparent !important;
	color: var(--nopdtr-muted) !important;
	border: 0 !important;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.nopdtr-popup .nopdtr-popup__search {
	display: block;
	width: calc(100% - 36px);
	margin: 0 0 12px;
	padding: 9px 12px;
	background: var(--nopdtr-bg);
	color: var(--nopdtr-fg);
	border: 1px solid var(--nopdtr-line);
	border-radius: calc(var(--nopdtr-radius) - 2px);
	font: inherit;
}

.nopdtr-popup .nopdtr-switcher__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 4px;
}

.nopdtr-popup .nopdtr-switcher__list a {
	display: flex;
	align-items: center;
	min-height: 42px;
	padding: 8px 12px;
	border-radius: calc(var(--nopdtr-radius) - 4px);
}

.nopdtr-popup .nopdtr-switcher__list a:hover {
	background: var(--nopdtr-hover);
}

/* ---- Elenco in riga ---- */

.nopdtr-switcher--list ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
}

.nopdtr-switcher--list a {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	opacity: .72;
}

.nopdtr-switcher--list a:hover,
.nopdtr-switcher--list a[aria-current="true"] {
	opacity: 1;
}

/* ---- Pulsante fisso ---- */

.nopdtr-float {
	position: fixed;
	z-index: 99990;
}

.nopdtr-float .nopdtr-switcher__current,
.nopdtr-switcher--pill .nopdtr-switcher__current {
	box-shadow: var(--nopdtr-shadow);
	border-radius: 999px;
	padding: 8px 14px;
}

.nopdtr-float--bottom-right {
	right: 20px;
	bottom: 20px;
}

.nopdtr-float--bottom-left {
	left: 20px;
	bottom: 20px;
}

.nopdtr-float--top-right {
	right: 20px;
	top: 20px;
}

.nopdtr-float--top-left {
	left: 20px;
	top: 20px;
}

.nopdtr-float--bottom-right .nopdtr-switcher__list,
.nopdtr-float--bottom-left .nopdtr-switcher__list {
	top: auto;
	bottom: calc(100% + 8px);
	transform: translateY(4px);
}

.nopdtr-float--bottom-right .nopdtr-switcher__list,
.nopdtr-float--top-right .nopdtr-switcher__list {
	left: auto;
	right: 0;
}

.admin-bar .nopdtr-float--top-right,
.admin-bar .nopdtr-float--top-left {
	top: 52px;
}

@media (max-width: 600px) {
	.nopdtr-float--bottom-right { right: 14px; bottom: 14px; }
	.nopdtr-float--bottom-left { left: 14px; bottom: 14px; }
	.nopdtr-float--top-right { right: 14px; top: 14px; }
	.nopdtr-float--top-left { left: 14px; top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.nopdtr-switcher__list,
	.nopdtr-switcher__chevron,
	.nopdtr-popup,
	.nopdtr-switcher__current {
		transition: none !important;
	}
}

/* ---- Voce del menu ---- */

.nopdtr-menu .nopdtr-switcher__code + .nopdtr-switcher__name {
	margin-left: .4em;
}
