/*
 * Navegação unificada (header escuro + drawer) — usada pelo picker,
 * personalização e shell do simulador via v2/partials/nav-header.php.
 * Os estilos .shell-header / .shell-lang / .shell-menu-btn / .shell-drawer
 * viveram no shell.css até serem extraídos para aqui; o shell.css já não
 * os define. O topbar de contactos continua no picker.css (só existe nas
 * páginas picker/personalização).
 */

/* Altura do header partilhada com o layout do shell (shell.css usa a mesma
   variável para posicionar o palco e as quick-actions). */
:root {
	--shell-header-h: 64px;
}

@media (min-width: 640px) {
	:root {
		--shell-header-h: 72px;
	}
}

@media (min-width: 1024px) {
	:root {
		--shell-header-h: 80px;
	}
}

/* Utilitário sr-only — também definido no shell.css; duplicado aqui para as
   páginas que só carregam nav.css (picker/personalização). */
.shell-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	clip: rect(0 0 0 0);
	overflow: hidden;
	white-space: nowrap;
}

.shell-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: var(--shell-header-h);
	padding: 0.5rem 1rem;
	background: #000;
	color: #fff;
}

@media (min-width: 640px) {
	.shell-header {
		padding: 0.5rem 2rem;
	}
}

@media (min-width: 1024px) {
	.shell-header {
		padding: 0.5rem 3rem;
	}
}

/* o header é sempre flex de um único filho (__inner), que replica o layout
   antigo; assim o modificador --container só precisa de limitar o __inner */
.shell-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	width: 100%;
	min-width: 0;
}

/* container: conteúdo do header alinhado com a topbar/conteúdo (72rem).
   Espelha a .picker-topbar__inner: o padding horizontal vive DENTRO das
   72rem (border-box), senão o inner fica 2rem mais à esquerda que a topbar.
   O fundo do header continua full-width. */
.shell-header.shell-header--container {
	padding-left: 0;
	padding-right: 0;
}

.shell-header--container .shell-header__inner {
	max-width: 72rem;
	margin: 0 auto;
	padding: 0 1.25rem;
	box-sizing: border-box;
}

@media (min-width: 640px) {
	.shell-header--container .shell-header__inner {
		padding: 0 2rem;
	}
}

.shell-header-logo {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	min-width: 0;
}

.shell-header-logo img {
	display: block;
	height: 38px;
	width: auto;
	max-width: min(200px, 52vw);
	object-fit: contain;
}

@media (min-width: 640px) {
	.shell-header-logo img {
		height: 46px;
		max-width: 220px;
	}
}

@media (min-width: 1024px) {
	.shell-header-logo img {
		height: 52px;
		max-width: 240px;
	}
}

/* ── Navegação principal (desktop) ── */

/* A nav agrupa-se à esquerda junto ao logótipo (margin-right: auto empurra as
   ações do header para a direita); com poucos itens de menu não fica órfã a
   meio do header. */
.shell-nav {
	display: none;
	min-width: 0;
	margin-right: auto;
}

@media (min-width: 1024px) {
	.shell-nav {
		display: block;
		margin-left: 1.25rem;
	}
}

.shell-nav__list {
	display: flex;
	align-items: center;
	gap: 1.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.shell-nav__item {
	position: relative;
}

.shell-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem 0;
	border: 0;
	background: transparent;
	color: rgba(255, 255, 255, 0.78);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: color 0.15s ease;
}

.shell-nav__link:hover,
.shell-nav__link:focus-visible {
	color: #fff;
	outline: none;
}

.shell-nav__link--active {
	color: #edae17;
}

.shell-nav__caret {
	width: 0.6rem;
	height: 0.6rem;
	opacity: 0.8;
	transition: transform 0.15s ease;
}

.shell-nav__item.is-open .shell-nav__caret {
	transform: rotate(180deg);
}

.shell-nav__dropdown {
	position: absolute;
	top: calc(100% + 0.8rem);
	left: 50%;
	transform: translateX(-50%);
	z-index: 130;
	display: none;
	min-width: 14rem;
	max-height: min(70vh, 30rem);
	overflow-y: auto;
	padding: 0.45rem;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 12px;
	background: #1a1f24;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.shell-nav__item.is-open .shell-nav__dropdown {
	display: block;
}

.shell-nav__dropdown-list,
.shell-nav__dropdown-sublist {
	margin: 0;
	padding: 0;
	list-style: none;
}

.shell-nav__dropdown-group {
	padding: 0.25rem 0;
}

.shell-nav__dropdown-group + .shell-nav__dropdown-group {
	border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.shell-nav__dropdown-group-title {
	display: block;
	padding: 0.45rem 0.65rem 0.2rem;
	color: rgba(255, 255, 255, 0.45);
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.shell-nav__dropdown-link a,
.shell-nav__dropdown-link span {
	display: block;
	padding: 0.5rem 0.65rem;
	border-radius: 8px;
	color: rgba(255, 255, 255, 0.86);
	font-size: 0.84rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.shell-nav__dropdown-link a:hover,
.shell-nav__dropdown-link a:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	outline: none;
}

.shell-nav__dropdown-link.is-disabled span {
	color: rgba(255, 255, 255, 0.35);
	cursor: default;
}

/* ── Ações do header ── */

.shell-header-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-shrink: 0;
}

@media (min-width: 640px) {
	.shell-header-actions {
		gap: 1.25rem;
	}
}

/* Pesquisa do picker dentro do header escuro. No header antigo (que quebrava
   linha) a pesquisa ocupava uma linha própria no mobile; no header unificado
   só há espaço a partir de desktop. */
.shell-header .picker-search--header {
	display: none;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: #fff;
}

@media (min-width: 1024px) {
	.shell-header .picker-search--header {
		display: flex;
		order: 0;
		flex-basis: auto;
		width: 14rem;
		padding: 0.45rem 0.8rem;
	}
}

.shell-header .picker-search--header .picker-search__input {
	color: #fff;
	background: transparent;
}

.shell-header .picker-search--header .picker-search__icon {
	color: rgba(255, 255, 255, 0.55);
}

.shell-header .picker-search--header .picker-search__input::placeholder {
	color: rgba(255, 255, 255, 0.55);
}

.shell-header-classic {
	font-size: 0.75rem;
	color: rgba(255, 255, 255, 0.6);
	text-decoration: none;
	white-space: nowrap;
}

.shell-header-classic:hover {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.shell-header-cart {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.35rem;
	height: 2.35rem;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 9999px;
	color: #fff;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.shell-header-cart:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.35);
}

.shell-header-cart svg {
	width: 1.05rem;
	height: 1.05rem;
}

.shell-header-cart span {
	position: absolute;
	top: -0.3rem;
	right: -0.3rem;
	min-width: 1.15rem;
	height: 1.15rem;
	padding: 0 0.25rem;
	border-radius: 9999px;
	background: #edae17;
	color: #000;
	font-size: 0.68rem;
	font-weight: 900;
	line-height: 1.15rem;
	text-align: center;
}

.shell-header-user {
	position: relative;
}

.shell-header-user summary {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	height: 2.35rem;
	max-width: 9.5rem;
	padding: 0 0.7rem;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 9999px;
	color: #fff;
	font-size: 0.78rem;
	font-weight: 800;
	cursor: pointer;
	list-style: none;
}

.shell-header-user summary::-webkit-details-marker {
	display: none;
}

.shell-header-user summary svg {
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
}

.shell-header-user summary span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.shell-header-user-menu {
	position: absolute;
	top: calc(100% + 0.55rem);
	right: 0;
	z-index: 130;
	min-width: 10.5rem;
	padding: 0.35rem;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;
	background: #1a1f24;
	box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
}

.shell-header-user-menu a,
.shell-header-user-menu button {
	display: block;
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: rgba(255, 255, 255, 0.86);
	font: inherit;
	font-size: 0.82rem;
	font-weight: 700;
	text-align: left;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.shell-header-user-menu a:hover,
.shell-header-user-menu a:focus-visible,
.shell-header-user-menu button:hover,
.shell-header-user-menu button:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	outline: none;
}

@media (max-width: 639px) {
	.shell-header-actions {
		gap: 0.55rem;
	}

	.shell-header-user summary {
		justify-content: center;
		width: 2.35rem;
		padding: 0;
	}

	.shell-header-user summary span {
		display: none;
	}
}

/* ── Seletor de idioma ── */

.shell-lang-wrap {
	position: relative;
}

.shell-lang {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
}

.shell-lang-icon {
	width: 1.15rem;
	height: 1.15rem;
	opacity: 0.95;
}

.shell-lang-chevron {
	width: 0.65rem;
	height: 0.65rem;
	opacity: 0.85;
	transition: transform 0.15s ease;
}

.shell-lang-wrap.is-open .shell-lang-chevron {
	transform: rotate(180deg);
}

.shell-lang-dropdown {
	position: absolute;
	top: calc(100% + 0.55rem);
	right: 0;
	z-index: 120;
	min-width: 11.5rem;
	padding: 0.35rem;
	border-radius: 12px;
	background: #1a1f24;
	border: 1px solid rgba(255, 255, 255, 0.12);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.shell-lang-dropdown[hidden] {
	display: none;
}

.shell-lang-option {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	width: 100%;
	padding: 0.55rem 0.65rem;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: rgba(255, 255, 255, 0.88);
	font-size: 0.875rem;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
}

.shell-lang-option:hover,
.shell-lang-option:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	outline: none;
}

.shell-lang-option[aria-selected="true"] {
	background: rgba(216, 154, 19, 0.14);
	color: #f3c86a;
}

.shell-lang-flag {
	flex: 0 0 auto;
	width: 1.65rem;
	height: 1.1rem;
	border-radius: 2px;
	overflow: hidden;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.shell-lang-flag svg {
	display: block;
	width: 100%;
	height: 100%;
}

.shell-lang-option-label {
	flex: 1 1 auto;
	white-space: nowrap;
}

.shell-header-divider {
	width: 1px;
	height: 1.75rem;
	background: rgba(255, 255, 255, 0.22);
}

.shell-menu-btn {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.35rem;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.shell-menu-btn span {
	display: block;
	height: 2px;
	width: 1.75rem;
	border-radius: 9999px;
	background: #fff;
}

@media (min-width: 640px) {
	.shell-menu-btn {
		width: 2.75rem;
		height: 2.75rem;
		gap: 0.4rem;
	}

	.shell-menu-btn span {
		width: 2.25rem;
		height: 3px;
	}
}

/* ── Drawer (menu lateral unificado) ── */

.shell-drawer {
	position: fixed;
	inset: 0;
	z-index: 100;
	pointer-events: none;
}

.shell-drawer.is-open {
	pointer-events: auto;
}

.shell-drawer-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0);
	transition: background 0.28s ease;
}

.shell-drawer.is-open .shell-drawer-backdrop {
	background: rgba(0, 0, 0, 0.55);
}

.shell-drawer-panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(88vw, 320px);
	background: #11161a;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.28s ease;
	box-shadow: -8px 0 40px rgba(0, 0, 0, 0.45);
}

.shell-drawer.is-open .shell-drawer-panel {
	transform: translateX(0);
}

.shell-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.25rem 1.25rem 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	flex-shrink: 0;
}

.shell-drawer-title {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.15em;
	color: rgba(255, 255, 255, 0.55);
}

.shell-drawer-close {
	width: 2rem;
	height: 2rem;
	border: 0;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.65);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.shell-drawer-close svg {
	width: 1rem;
	height: 1rem;
}

.shell-drawer-close:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.shell-drawer-body {
	flex: 1;
	overflow-y: auto;
	padding: 0.65rem 0.75rem 1rem;
	scrollbar-width: none;
}

.shell-drawer-body::-webkit-scrollbar {
	display: none;
}

.shell-drawer-section + .shell-drawer-section {
	margin-top: 1rem;
	padding-top: 0.85rem;
	border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.shell-drawer-section-title {
	display: block;
	padding: 0 0.75rem 0.4rem;
	color: rgba(255, 255, 255, 0.4);
	font-size: 0.66rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.shell-drawer-list {
	padding: 0;
	list-style: none;
	margin: 0;
}

.shell-drawer-item {
	margin-bottom: 0.25rem;
}

.shell-drawer-link {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.65rem 0.75rem;
	border-radius: 12px;
	text-decoration: none;
	color: rgba(255, 255, 255, 0.8);
	transition: background 0.15s ease;
}

.shell-drawer-link:hover {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
}

.shell-drawer-item.ativo .shell-drawer-link {
	background: rgba(216, 154, 19, 0.12);
	color: #d89a13;
}

.shell-drawer-icon {
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 10px;
	background: #2a2f36;
	flex-shrink: 0;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.shell-drawer-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.shell-drawer-icon-placeholder {
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 9999px;
	background: rgba(255, 255, 255, 0.1);
}

.shell-drawer-name {
	flex: 1;
	font-size: 0.88rem;
	font-weight: 600;
	line-height: 1.3;
}

.shell-drawer-check {
	width: 1.1rem;
	height: 1.1rem;
	flex-shrink: 0;
	color: #d89a13;
}

/* Links simples (navegação e vestuário) — sem ícone */
.shell-drawer-navlink {
	display: block;
	padding: 0.55rem 0.75rem;
	border-radius: 10px;
	color: rgba(255, 255, 255, 0.82);
	font-size: 0.88rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s ease;
}

.shell-drawer-navlink:hover {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
}

.shell-drawer-navlink.ativo {
	background: rgba(216, 154, 19, 0.12);
	color: #d89a13;
}

.shell-drawer-contacts {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.shell-drawer-contact {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.45rem 0.75rem;
	border-radius: 10px;
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.82rem;
	font-weight: 600;
	text-decoration: none;
}

.shell-drawer-contact:hover {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
}

.shell-drawer-contact svg {
	width: 1.05rem;
	height: 1.05rem;
	flex-shrink: 0;
}

.shell-drawer-footer {
	padding: 1rem 1.25rem;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	flex-shrink: 0;
}

.shell-drawer-classic {
	display: block;
	font-size: 0.78rem;
	color: rgba(255, 255, 255, 0.45);
	text-decoration: none;
	text-align: center;
}

.shell-drawer-classic:hover {
	color: rgba(255, 255, 255, 0.75);
	text-decoration: underline;
	text-underline-offset: 2px;
}

@media (min-width: 640px) {
	.shell-drawer-panel {
		width: min(75vw, 340px);
	}
}

@media (min-width: 1024px) {
	.shell-drawer-panel {
		width: 320px;
	}
}

/* ── Tema claro (theme => 'light') — header branco, textos escuros,
      carrinho em pílula preta; o drawer mantém-se escuro ── */

.shell-header--light {
	background: #fff;
	color: #11161a;
	border-bottom: 1px solid #e2e2e2;
}

.shell-header--light .shell-nav__link {
	color: rgba(17, 22, 26, 0.72);
}

.shell-header--light .shell-nav__link:hover,
.shell-header--light .shell-nav__link:focus-visible {
	color: #000;
}

.shell-header--light .shell-nav__link--active {
	color: #b8860b;
}

.shell-header--light .shell-nav__dropdown {
	background: #fff;
	border-color: #e4e4e4;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

.shell-header--light .shell-nav__dropdown-group + .shell-nav__dropdown-group {
	border-top-color: #ececec;
}

.shell-header--light .shell-nav__dropdown-group-title {
	color: rgba(17, 22, 26, 0.45);
}

.shell-header--light .shell-nav__dropdown-link a,
.shell-header--light .shell-nav__dropdown-link span {
	color: #22272c;
}

.shell-header--light .shell-nav__dropdown-link a:hover,
.shell-header--light .shell-nav__dropdown-link a:focus-visible {
	background: #f2f3f5;
	color: #000;
}

.shell-header--light .shell-nav__dropdown-link.is-disabled span {
	color: rgba(17, 22, 26, 0.35);
}

.shell-header--light .shell-header-classic {
	color: rgba(17, 22, 26, 0.55);
}

.shell-header--light .shell-header-classic:hover {
	color: #000;
}

/* Carrinho: pílula preta como no header antigo do picker */
.shell-header--light .shell-header-cart {
	background: #000;
	border-color: #000;
	color: #fff;
}

.shell-header--light .shell-header-cart:hover {
	background: #262626;
	border-color: #262626;
}

.shell-header--light .shell-header-user summary {
	border-color: rgba(17, 22, 26, 0.25);
	color: #11161a;
}

.shell-header--light .shell-header-user-menu {
	background: #fff;
	border-color: #e4e4e4;
	box-shadow: 0 16px 34px rgba(0, 0, 0, 0.14);
}

.shell-header--light .shell-header-user-menu a,
.shell-header--light .shell-header-user-menu button {
	color: #22272c;
}

.shell-header--light .shell-header-user-menu a:hover,
.shell-header--light .shell-header-user-menu a:focus-visible,
.shell-header--light .shell-header-user-menu button:hover,
.shell-header--light .shell-header-user-menu button:focus-visible {
	background: #f2f3f5;
	color: #000;
}

.shell-header--light .shell-lang {
	color: #11161a;
}

.shell-header--light .shell-lang-dropdown {
	background: #fff;
	border-color: #e4e4e4;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.shell-header--light .shell-lang-option {
	color: #22272c;
}

.shell-header--light .shell-lang-option:hover,
.shell-header--light .shell-lang-option:focus-visible {
	background: #f2f3f5;
}

.shell-header--light .shell-lang-option[aria-selected="true"] {
	background: rgba(216, 154, 19, 0.14);
	color: #8a6203;
}

.shell-header--light .shell-lang-flag {
	box-shadow: 0 0 0 1px rgba(17, 22, 26, 0.14);
}

.shell-header--light .shell-header-divider {
	background: rgba(17, 22, 26, 0.18);
}

.shell-header--light .shell-menu-btn span {
	background: #11161a;
}

.shell-header--light .picker-search--header {
	background: #fff;
	border-color: #bdbdbd;
	color: #11161a;
}

.shell-header--light .picker-search--header .picker-search__input {
	color: #11161a;
}

.shell-header--light .picker-search--header .picker-search__input::placeholder {
	color: rgba(17, 22, 26, 0.45);
}

.shell-header--light .picker-search--header .picker-search__icon {
	color: rgba(17, 22, 26, 0.4);
}
