/*
 * Nav bar — vidro verde só fora da intro (home com #header.alt = transparente como o template).
 * Carregar depois de main.css e site-remove-vertical-lines.css
 */

:root {
	--nav-glass-bg: rgba(18, 42, 30, 0.58);
	--nav-glass-bg-strong: rgba(14, 34, 24, 0.78);
	--nav-glass-border: rgba(255, 255, 255, 0.14);
	--nav-glass-highlight: rgba(255, 255, 255, 0.14);
	--nav-text: rgba(255, 255, 255, 0.94);
	--nav-text-muted: rgba(255, 255, 255, 0.78);
	/* Pills da nav: mesma largura/altura; mais estreitos — ajuste em responsive-global */
	--nav-pill-width: 10.15rem;
	--nav-pill-height: 2.48rem;
}

/* ---------- Intro da home (#header.alt): como o Twenty original ---------- */
#header.alt {
	position: absolute !important;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	height: auto;
	min-height: 0;
	background: transparent !important;
	backdrop-filter: none !important;
	-webkit-backdrop-filter: none !important;
	box-shadow: none !important;
	border-bottom: none !important;
	color: #ffffff !important;
	padding: 2em 2.5em !important;
	z-index: 10000;
}

#header.alt nav {
	position: absolute !important;
	right: 2.5em !important;
	top: 1.75em !important;
	transform: none !important;
}

/* inline-block + baseline (main.css) desalinha links vs .button — flex centraliza na vertical */
#header nav > ul {
	display: flex !important;
	align-items: center !important;
	flex-wrap: wrap;
	justify-content: flex-end;
	row-gap: 0.35em;
	column-gap: 0.65em;
	list-style: none;
	margin: 0;
	padding: 0;
}

#header nav > ul > li {
	margin-left: 0 !important;
	vertical-align: unset;
	flex: 0 0 var(--nav-pill-width);
	width: var(--nav-pill-width);
	max-width: 100%;
}

/* Chips + .button: mesma largura, mesma altura; texto centrado */
#header nav > ul > li > a {
	font-size: 0.84em !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100% !important;
	min-height: var(--nav-pill-height) !important;
	height: var(--nav-pill-height) !important;
	box-sizing: border-box;
	text-align: center;
	white-space: nowrap;
	line-height: 1.1 !important;
	padding: 0 0.3em !important;
}

/* Bem Vindo + MENU: mesmo “chip” dos botões (fundo escuro + borda) */
#header.alt nav > ul > li > a:not(.button) {
	display: flex !important;
	align-items: center;
	justify-content: center;
	background: rgba(12, 28, 20, 0.68) !important;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	border: 1px solid rgba(255, 255, 255, 0.48) !important;
	border-radius: 12px !important;
	padding: 0 0.3em !important;
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.1);
	color: #fff !important;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.1 !important;
	min-height: var(--nav-pill-height) !important;
	height: var(--nav-pill-height) !important;
}

#header.alt nav > ul > li:hover > a:not(.button) {
	background: rgba(18, 42, 32, 0.85) !important;
	border-color: rgba(255, 255, 255, 0.58) !important;
}

#header.alt nav > ul > li.current > a:not(.button) {
	background: rgba(22, 52, 38, 0.9) !important;
	border-color: rgba(131, 211, 201, 0.55) !important;
	box-shadow: 0 2px 18px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(131, 211, 201, 0.22);
}

/* Ícone do submenu (chevron) legível */
#header.alt .submenu > a:before {
	color: rgba(255, 255, 255, 0.95);
	opacity: 1;
}

#header.alt nav ul li .button:not(.primary) {
	background: rgba(12, 28, 20, 0.65) !important;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	border-color: rgba(255, 255, 255, 0.52) !important;
	color: #fff !important;
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

#header.alt nav ul li .button:not(.primary):hover {
	background: rgba(20, 48, 36, 0.88) !important;
	border-color: rgba(255, 255, 255, 0.65) !important;
}

#header.alt nav ul li .button.primary {
	background: linear-gradient(165deg, #5ec9b8 0%, #3da898 100%) !important;
	border-color: rgba(255, 255, 255, 0.55) !important;
	color: #fff !important;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
	box-shadow: 0 3px 22px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2),
		inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#header.alt nav ul li .button.primary:hover {
	background: linear-gradient(165deg, #6fd4c4 0%, #4fb5a8 100%) !important;
}

/* Texto + MENU (fora da intro): mesmo chip que os .button secundários — MENU não era .current */
#header:not(.alt) nav > ul > li > a:not(.button) {
	display: flex !important;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.12) !important;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	border: 1px solid var(--nav-glass-border) !important;
	border-radius: 12px !important;
	padding: 0 0.3em !important;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
	color: var(--nav-text) !important;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.1 !important;
	min-height: var(--nav-pill-height) !important;
	height: var(--nav-pill-height) !important;
}

#header:not(.alt) nav > ul > li:hover > a:not(.button) {
	background: rgba(255, 255, 255, 0.2) !important;
	border-color: rgba(255, 255, 255, 0.22) !important;
	color: #fff !important;
}

#header:not(.alt) nav > ul > li.current > a:not(.button) {
	background: rgba(255, 255, 255, 0.16) !important;
	border-color: rgba(131, 211, 201, 0.45) !important;
	color: #fff !important;
	font-weight: 800;
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(131, 211, 201, 0.15);
}

#header:not(.alt) .submenu > a:before {
	color: rgba(255, 255, 255, 0.92);
	opacity: 1;
}

/* ---------- Demais páginas / home após sair do banner: vidro ---------- */
#header:not(.alt) {
	position: fixed !important;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	height: auto !important;
	min-height: 0;
	padding: max(0.75rem, env(safe-area-inset-top, 0px)) clamp(1rem, 3vw, 2rem) 0.75rem;
	box-sizing: border-box;
	background: var(--nav-glass-bg) !important;
	backdrop-filter: blur(10px) saturate(1.2);
	-webkit-backdrop-filter: blur(10px) saturate(1.2);
	box-shadow: 0 1px 0 var(--nav-glass-border), 0 12px 40px rgba(0, 0, 0, 0.14);
	border-bottom: 1px solid var(--nav-glass-border);
	color: var(--nav-text) !important;
	z-index: 10000;
	overflow: visible;
}

/*
 * Nav absoluta não conta na altura do header (main.css usa height: 50px no #header).
 * Sem h1, a barra ficava mais baixa que os botões — bordas/sombras cortadas no topo.
 * Flex + nav no fluxo: altura segue os itens e ficam verticalmente centrados.
 */
#header:not(.alt):not(:has(h1)) {
	display: flex !important;
	align-items: center;
	justify-content: flex-end;
}

#header:not(.alt):not(:has(h1)) nav {
	position: relative !important;
	right: auto !important;
	top: auto !important;
	transform: none !important;
	flex-shrink: 0;
}

#header:has(h1) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1rem;
}

#header:not(.alt):has(h1) nav {
	position: relative;
	right: auto;
	top: auto;
	transform: none;
	flex: 0 1 auto;
	min-width: 0;
}

#header:not(.alt) h1 {
	margin: 0;
	font-size: 0.95em;
	line-height: 1.2;
	flex: 0 1 auto;
}

#header:not(.alt) h1 a {
	color: var(--nav-text) !important;
	border-bottom: none !important;
	text-decoration: none;
}

#header:not(.alt) h1 a span {
	color: var(--nav-text-muted) !important;
	font-weight: 300;
}

#header.alt nav ul li,
#header:not(.alt) nav ul li {
	border: none !important;
	background: transparent !important;
}

/* Links “solto” (ex.: painel): mantém legível; chips nível superior usam regras > a:not(.button) */
#header:not(.alt) nav ul li a {
	color: var(--nav-text-muted) !important;
	border: 1px solid transparent !important;
	border-radius: 10px;
	font-weight: 600;
	letter-spacing: 0.1em;
}

#header:not(.alt) nav ul li a:hover,
#header:not(.alt) nav ul li:hover > a {
	color: var(--nav-text) !important;
}

/* Submenus aninhados no DOM (não são filho direto de ul > li): fundo suave no hover */
#header:not(.alt) nav ul ul li a:hover:not(.button),
#header:not(.alt) nav ul ul li:hover > a:not(.button) {
	background: var(--nav-glass-highlight) !important;
	border-color: transparent !important;
}

#header:not(.alt) nav ul li .button {
	min-width: 0 !important;
	width: 100% !important;
	line-height: 1.1 !important;
	min-height: var(--nav-pill-height) !important;
	height: var(--nav-pill-height) !important;
	padding: 0 0.3em !important;
	border-radius: 12px !important;
	letter-spacing: 0.06em;
	border-width: 1px !important;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#header:not(.alt) nav ul li .button:not(.primary) {
	background: rgba(255, 255, 255, 0.12) !important;
	border-color: var(--nav-glass-border) !important;
	color: var(--nav-text) !important;
}

#header:not(.alt) nav ul li .button:not(.primary):hover {
	background: rgba(255, 255, 255, 0.2) !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

#header:not(.alt) nav ul li .button.primary {
	background: linear-gradient(165deg, #6fd4c4 0%, #4fb5a8 100%) !important;
	border-color: rgba(255, 255, 255, 0.35) !important;
	color: #fff !important;
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.2);
}

#header:not(.alt) nav ul li .button.primary:hover {
	background: linear-gradient(165deg, #7fdccf 0%, #5fc4b5 100%) !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
}

/* Botões na intro (tamanho / raio) */
#header.alt nav ul li .button {
	min-width: 0 !important;
	width: 100% !important;
	line-height: 1.1 !important;
	min-height: var(--nav-pill-height) !important;
	height: var(--nav-pill-height) !important;
	padding: 0 0.3em !important;
	border-radius: 12px !important;
	letter-spacing: 0.06em;
	border-width: 1px !important;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

/* ---------- Dropdown: claro na intro; vidro no resto ---------- */
body.index:not(.past-intro) .dropotron {
	background: #fff !important;
	backdrop-filter: none !important;
	-webkit-backdrop-filter: none !important;
	border: 1px solid rgba(0, 0, 0, 0.06) !important;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.075) !important;
	color: #7c8081 !important;
	border-radius: 4px;
	overflow: hidden;
}

body.index:not(.past-intro) .dropotron > li {
	border-top-color: rgba(124, 128, 129, 0.2) !important;
}

body.index:not(.past-intro) .dropotron > li > a {
	color: inherit !important;
}

body.index:not(.past-intro) .dropotron > li:hover > a {
	background: #83d3c9 !important;
	color: #fff !important;
}

body.index:not(.past-intro) .dropotron > li.current > a {
	background: #6fbfb4 !important;
	color: #fff !important;
	font-weight: 700;
}

body.index:not(.past-intro) .dropotron.level-0:before {
	border-bottom-color: #fff !important;
}

body.past-intro .dropotron,
body:not(.index) .dropotron {
	background: var(--nav-glass-bg-strong) !important;
	backdrop-filter: blur(8px) saturate(1.18);
	-webkit-backdrop-filter: blur(8px) saturate(1.18);
	border: 1px solid var(--nav-glass-border) !important;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28) !important;
	color: var(--nav-text) !important;
	border-radius: 12px;
	overflow: hidden;
}

body.past-intro .dropotron > li,
body:not(.index) .dropotron > li {
	border-top-color: var(--nav-glass-border) !important;
}

body.past-intro .dropotron > li > a,
body:not(.index) .dropotron > li > a {
	color: var(--nav-text-muted) !important;
}

body.past-intro .dropotron > li:hover > a,
body:not(.index) .dropotron > li:hover > a {
	background: rgba(131, 211, 201, 0.35) !important;
	color: #fff !important;
}

body.past-intro .dropotron > li.current > a,
body:not(.index) .dropotron > li.current > a {
	background: rgba(131, 211, 201, 0.42) !important;
	color: #fff !important;
	font-weight: 700;
}

body.past-intro .dropotron.level-0:before,
body:not(.index) .dropotron.level-0:before {
	border-bottom-color: rgba(22, 48, 35, 0.95) !important;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	#header:not(.alt) {
		background: rgba(14, 34, 24, 0.92) !important;
	}

	body.past-intro .dropotron,
	body:not(.index) .dropotron {
		background: rgba(14, 34, 24, 0.96) !important;
	}
}
