/**
 * NOP Translate - Frontend Switcher
 */

.nop-switcher {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	display: inline-flex;
	position: relative;
	box-sizing: border-box;
	line-height: 1.4;
}

.nop-switcher *,
.nop-switcher *::before,
.nop-switcher *::after {
	box-sizing: border-box;
}

/* Dropdown */
.nop-switcher--dropdown {
	position: relative;
}

.nop-switcher--dropdown .nop-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 6px;
	cursor: pointer;
	color: inherit;
	font: inherit;
	transition: background-color .15s ease, border-color .15s ease;
}

.nop-switcher--dropdown .nop-switcher__toggle:hover {
	background: #f7f7f8;
	border-color: rgba(0,0,0,.2);
}

.nop-switcher__arrow {
	font-size: 11px;
	opacity: .6;
	margin-left: 2px;
	transition: transform .2s ease;
	display: inline-block;
}

.nop-switcher--dropdown.is-open .nop-switcher__arrow,
.nop-switcher--dropdown:focus-within .nop-switcher__arrow {
	transform: rotate(180deg);
}

.nop-switcher__menu {
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	min-width: 180px;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: #fff;
	border: 1px solid rgba(0,0,0,.08);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0,0,0,.10);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s;
	z-index: 99999;
	pointer-events: none;
}

/* Abrir via JS (.is-open), via :focus-within ou via :hover (fallbacks robustos) */
.nop-switcher--dropdown.is-open .nop-switcher__menu,
.nop-switcher--dropdown:focus-within .nop-switcher__menu,
.nop-switcher--dropdown:hover .nop-switcher__menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.nop-switcher__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.nop-switcher__item a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 14px;
	color: #111827 !important;
	text-decoration: none !important;
	transition: background-color .12s ease;
	white-space: nowrap;
}

.nop-switcher__item a:hover,
.nop-switcher__item a:focus {
	background: rgba(0,0,0,.04);
	text-decoration: none !important;
}

.nop-switcher__item.is-current a {
	font-weight: 600;
}

/* Inline */
.nop-switcher--inline {
	display: inline-flex;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nop-switcher--inline .nop-switcher__item a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	color: inherit !important;
	text-decoration: none !important;
	border-radius: 4px;
	transition: background-color .12s ease;
}

.nop-switcher--inline .nop-switcher__item a:hover {
	background: rgba(0,0,0,.05);
}

.nop-switcher--inline .nop-switcher__item.is-current a {
	font-weight: 600;
	opacity: .85;
}

/* Tamanhos */
.nop-switcher--small { font-size: 12px; }
.nop-switcher--small .nop-flag { width: 16px; height: 11px; }
.nop-switcher--small .nop-switcher__toggle { padding: 6px 10px; }

.nop-switcher--large { font-size: 16px; }
.nop-switcher--large .nop-flag { width: 24px; height: 17px; }
.nop-switcher--large .nop-switcher__toggle { padding: 10px 18px; }

/* Garantir que dentro do menu de navegação o switcher se comporte bem */
.menu-item .nop-switcher,
.menu-item-has-children .nop-switcher,
li.nop-language-switcher-menu .nop-switcher {
	margin: 0;
}

li.nop-language-switcher-menu {
	list-style: none;
}

li.nop-language-switcher-menu > a {
	display: none !important;
}
