/* ═══════════════════════════════════════════════════════════════════
   TeeLegend - header.css (faixa de topo, header, pesquisa, menu, gaveta)
   Proposta aprovada: _design-nova-loja/header-proposta.html
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. Faixa de topo (Lavanda, fina): nota no Google | frases a rodar | lojas, WhatsApp, ajuda, idioma ── */
.tl-topo { background: var(--tl-color-lavanda); color: var(--tl-color-noite); font-size: 12.5px; }
.tl-topo__inner { display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center; gap: var(--tl-space-4); min-height: 28px; }
.tl-topo__nota { display: flex; align-items: center; min-width: 0; }
.tl-nota-google { display: inline-flex; align-items: center; gap: 6px; color: var(--tl-color-noite); text-decoration: none; white-space: nowrap; }
.tl-nota-google b { font-weight: 800; }
/* Cinco estrelas cheias por cima de cinco vazias, cortadas à medida da nota (4,8 -> 96%). */
.tl-estrelas { position: relative; display: inline-flex; line-height: 0; }
.tl-estrelas__base, .tl-estrelas__cheias { display: inline-flex; gap: 1px; }
.tl-estrelas__base { color: color-mix(in srgb, var(--tl-color-noite) 22%, transparent); }
.tl-estrelas__cheias { position: absolute; inset: 0 auto 0 0; width: calc(var(--tl-nota, 5) / 5 * 100%); overflow: hidden; color: var(--tl-color-noite); }
.tl-estrelas .tl-icon { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.tl-topo__whatsapp { display: inline-flex; align-items: center; gap: 4px; }
.tl-topo__whatsapp .tl-icon { width: 15px; height: 15px; color: var(--tl-color-whatsapp); }
.tl-topo__promessas { position: relative; display: grid; margin: 0; padding: 0; list-style: none; text-align: center; }
.tl-topo__promessas li { grid-area: 1 / 1; display: flex; align-items: center; justify-content: center; gap: var(--tl-space-2); font-weight: 700; letter-spacing: .02em; white-space: nowrap; opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease; }
.tl-topo__promessas li.is-on { opacity: 1; transform: none; }
.tl-topo__promessas .tl-icon { width: 16px; height: 16px; color: var(--tl-color-noite); }
.tl-topo__links { display: flex; justify-content: flex-end; align-items: center; gap: var(--tl-space-4); }
.tl-topo__links a { color: var(--tl-color-noite); text-decoration: none; font-weight: 600; }
.tl-idiomas { display: inline-flex; align-items: center; gap: 2px; padding-left: var(--tl-space-4); border-left: 1px solid color-mix(in srgb, var(--tl-color-noite) 25%, transparent); }
.tl-idiomas a, .tl-idiomas span { padding: 2px 6px; border-radius: var(--tl-radius-sm); font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.tl-idiomas .is-atual { background: var(--tl-color-noite); color: var(--tl-color-lavanda); }
@media (prefers-reduced-motion: reduce) { .tl-topo__promessas li { transform: none; transition-property: opacity; } } /* fica só o fade */

/* ── 2. Header fixo (Noite) ── */
.tl-header { position: sticky; top: 0; z-index: 100; background: var(--tl-color-noite); color: var(--tl-color-paper); }
.tl-header a { color: inherit; }
.admin-bar .tl-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tl-header { top: 0; } }
.tl-header.is-scrolled { box-shadow: 0 2px 14px color-mix(in srgb, var(--tl-color-noite) 35%, transparent); }
/* Checkout: header simples continua claro (logo "claro"). */
.tl-header--simples { background: var(--tl-color-paper); color: var(--tl-color-ink); border-bottom: 1px solid var(--tl-color-line); }

/* Logo e pesquisa à esquerda, ações à direita (a pesquisa já não fica ao centro: liberta espaço para "Entrar"). */
.tl-header__inner { display: flex; align-items: center; gap: var(--tl-space-6); min-height: 72px; }
.tl-header__brand { flex: none; min-width: 0; margin-right: var(--tl-space-2); }
.tl-header__brand a { display: inline-block; }
.tl-header__brand img { height: 30px; width: auto; display: block; }
.tl-header__actions { flex: 1 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: var(--tl-space-2); }
.tl-header__action { position: relative; display: grid; place-items: center; width: var(--tl-h-acao); height: var(--tl-h-acao); border-radius: var(--tl-radius); color: var(--tl-color-paper); text-decoration: none; }
@media (hover: hover) { .tl-header__action:hover { background: var(--tl-color-noite-2); } }
.tl-header__action .tl-icon { width: 24px; height: 24px; }
/* Conta: ícone e texto ("Entrar" / "A minha conta"). */
.tl-header__conta { display: inline-flex; gap: var(--tl-space-2); width: auto; padding: 0 var(--tl-space-3) 0 10px; font-size: 14px; font-weight: 600; white-space: nowrap; }
/* Regra única dos botões de ação (DESIGN.md, "Botões de ação do header"): ajuda, conta/entrar, favoritos e carrinho
   têm a mesma altura (--tl-h-acao), o mesmo raio (--tl-radius) e o mesmo material: caixa Noite-2 com contorno lavanda
   muito leve; ao passar o rato ou com o painel aberto, o mesmo tom ciano. Só o conteúdo muda (ícone, texto, avatar). */
.tl-header__fav, .tl-header__cart, .tl-header__conta, .tl-header .tl-perfil__botao { border-radius: var(--tl-radius); background: var(--tl-color-noite-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tl-color-lavanda) 14%, transparent); transition: background-color var(--tl-dur-hover) var(--tl-ease-suave), box-shadow var(--tl-dur-hover) var(--tl-ease-suave); }
@media (hover: hover) {
	.tl-header__fav:hover, .tl-header__cart:hover, .tl-header__conta:hover, .tl-header .tl-perfil__botao:hover { background: color-mix(in srgb, var(--tl-color-brand) 16%, var(--tl-color-noite-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tl-color-brand) 45%, transparent); }
}
.tl-header .tl-header__conta[aria-expanded="true"], .tl-header .tl-perfil__botao[aria-expanded="true"] { background: color-mix(in srgb, var(--tl-color-brand) 16%, var(--tl-color-noite-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tl-color-brand) 45%, transparent); }
/* "Entrar" (sem sessão): só o ícone e o texto, sem caixa (como no Games2Egypt); a caixa aparece no hover.
   O contorno fica transparente (não "none") para a transição ser contínua. Os outros botões mantêm a caixa. */
body:not(.logged-in) .tl-header .tl-header__conta:not(.tl-ajuda__botao, :hover) { background: transparent; box-shadow: inset 0 0 0 1px transparent; }
.tl-header__fav .tl-header__count, .tl-header__cart .tl-header__count { top: -5px; right: -5px; box-shadow: 0 0 0 2px var(--tl-color-noite); }
/* Sem rótulos por baixo dos ícones: continuam lá para leitores de ecrã (e os títulos ao passar o rato). */
.tl-header__label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tl-header__count {
	position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px;
	border-radius: 9px; background: var(--tl-color-brand); color: var(--tl-color-brand-ink);
	font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}
.tl-header__count:empty, .tl-header__count[data-count="0"] { display: none; }
/* Pulso quando entra um artigo (main.js põe .is-mais); com reduced-motion, a regra global anula-o. */
.tl-header__count.is-mais { animation: tl-conta .32s var(--tl-ease); }
@keyframes tl-conta { 35% { transform: scale(1.25); } }
.tl-header__toggle { display: none; background: none; border: 0; color: inherit; padding: 0; width: 44px; height: 44px; place-items: center; }

/* ── 3. Pesquisa: caixa contornada, lupa à direita (vira X com texto) ── */
.tl-pesquisa { position: relative; flex: 0 1 512px; min-width: 0; } /* 20% mais curta (era 640) */
.tl-pesquisa__form { display: flex; align-items: center; height: var(--tl-h-acao); padding: 0 var(--tl-space-1) 0 var(--tl-space-4); background: transparent; border: 1px solid color-mix(in srgb, var(--tl-color-lavanda) 45%, transparent); border-radius: var(--tl-radius); transition: border-color var(--tl-dur-hover) var(--tl-ease-suave), background-color var(--tl-dur-hover) var(--tl-ease-suave), box-shadow var(--tl-dur-hover) var(--tl-ease-suave); }
@media (hover: hover) { .tl-pesquisa__form:hover { border-color: color-mix(in srgb, var(--tl-color-lavanda) 70%, transparent); } }
/* Ao escrever: brilho ciano discreto (também é o indicador de foco da caixa). */
.tl-pesquisa__form:focus-within {
	border-color: color-mix(in srgb, var(--tl-color-brand) 75%, transparent); background: var(--tl-color-noite-2);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tl-color-brand) 16%, transparent), 0 0 18px color-mix(in srgb, var(--tl-color-brand) 22%, transparent);
}
.tl-pesquisa__input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; outline: 0; color: var(--tl-color-paper); font-size: 16px; } /* 16px: o iPhone não faz zoom */
.tl-pesquisa__input::placeholder { color: var(--tl-color-lavanda); opacity: .75; }
.tl-pesquisa__input::-webkit-search-cancel-button { display: none; }
.tl-pesquisa__limpar, .tl-pesquisa__ir { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border: 0; border-radius: var(--tl-radius); background: none; color: var(--tl-color-paper); cursor: pointer; }
@media (hover: hover) { .tl-pesquisa__limpar:hover, .tl-pesquisa__ir:hover { background: color-mix(in srgb, var(--tl-color-lavanda) 12%, transparent); } }
.tl-pesquisa__limpar .tl-icon, .tl-pesquisa__ir .tl-icon { width: 20px; height: 20px; }
.tl-pesquisa__limpar[hidden] { display: none; }
.tl-pesquisa__cancelar { display: none; } /* só no telemóvel (secção 7) */
.tl-pesquisa__limpar:not([hidden]) + .tl-pesquisa__ir { display: none; } /* com texto: só o X (Enter pesquisa) */

.tl-pesquisa__lista {
	position: absolute; left: 0; top: calc(100% + 8px); z-index: 120; width: min(820px, calc(100vw - 2 * var(--tl-gutter)));
	display: grid; grid-template-columns: 240px minmax(0, 1fr);
	background: var(--tl-color-paper); color: var(--tl-color-ink); border: 1px solid var(--tl-color-line); border-radius: var(--tl-radius-lg); box-shadow: 0 24px 60px color-mix(in srgb, var(--tl-color-noite) 18%, transparent); overflow: hidden;
}
/* A caixa das sugestões é branca dentro do header Noite: repõe o texto escuro (o header pinta os links de branco). */
.tl-header .tl-pesquisa__lista a { color: var(--tl-color-ink); }
.tl-header .tl-pesquisa__lista a.tl-pesquisa__tudo { color: var(--tl-color-brand-text); }
.tl-pesquisa__lista[hidden] { display: none; }
.tl-pesquisa__col { padding: var(--tl-space-4) 18px; min-width: 0; }
.tl-pesquisa__col + .tl-pesquisa__col { border-left: 1px solid var(--tl-color-line); }
.tl-pesquisa__titulo { margin: 0 0 var(--tl-space-2); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tl-color-ink-soft); }
.tl-pesquisa__uni { display: flex; justify-content: space-between; gap: var(--tl-space-2); padding: 6px var(--tl-space-2); margin: 0 -8px; border-radius: var(--tl-radius); font-weight: 600; text-decoration: none; }
.tl-pesquisa__uni small { color: var(--tl-color-ink-soft); font-weight: 400; }
.tl-pesquisa__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-pesquisa__chips a { padding: 6px 10px; border-radius: var(--tl-radius); background: var(--tl-color-paper-alt); font-size: 13px; font-weight: 600; text-decoration: none; }
.tl-pesquisa__prod { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--tl-space-3); align-items: center; padding: 6px var(--tl-space-2); margin: 0 -8px; border-radius: var(--tl-radius); text-decoration: none; }
.tl-pesquisa__prod img, .tl-pesquisa__prod .sem-img { width: 48px; height: 60px; object-fit: contain; border-radius: var(--tl-radius); background: var(--tl-color-paper-alt); }
.tl-pesquisa__prod b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-pesquisa__prod span { font-size: 12.5px; color: var(--tl-color-ink-soft); }
.tl-pesquisa__prod em { font-style: normal; font-weight: 800; font-size: 14px; white-space: nowrap; text-align: right; }
.tl-pesquisa__prod em small { display: block; font-weight: 400; font-size: 11px; color: var(--tl-color-ink-soft); }
.tl-pesquisa__uni:hover, .tl-pesquisa__prod:hover, .tl-pesquisa__lista .is-ativo { background: var(--tl-color-paper-alt); }
.tl-pesquisa__lista mark { background: none; color: var(--tl-color-brand-text); font-weight: 800; }
.tl-pesquisa__tudo { grid-column: 1 / -1; padding: var(--tl-space-3) 18px; border-top: 1px solid var(--tl-color-line); text-align: center; font-weight: 700; color: var(--tl-color-brand-text); text-decoration: none; }
.tl-pesquisa__vazio { padding: var(--tl-space-2) 0; font-size: 14px; color: var(--tl-color-ink-soft); }
.tl-pesquisa__corrigido { grid-column: 1 / -1; margin: 0; padding: var(--tl-space-3) 18px; border-bottom: 1px solid var(--tl-color-line); background: var(--tl-color-highlight-soft); font-size: 14px; }
.tl-pesquisa__titulo + .tl-pesquisa__uni ~ .tl-pesquisa__titulo, .tl-pesquisa__vazio + .tl-pesquisa__titulo { margin-top: var(--tl-space-4); }
.tl-pesquisa__uni.is-ajuda { flex-direction: column; gap: 0; }
.tl-pesquisa__uni.is-ajuda small { font-size: 12px; }

/* ── 4. Menu (computador): Noite, como o header; os submenus continuam brancos ── */
.tl-nav { border-top: 1px solid var(--tl-color-noite-2); background: var(--tl-color-noite); color: var(--tl-color-paper); }
.tl-menu { display: flex; margin: 0 calc(-1 * var(--tl-space-3)); padding: 0; list-style: none; }
.tl-menu__item { position: static; }
.tl-menu__item.is-promo, .tl-menu__item.is-gift { margin-left: auto; }
.tl-menu__item.is-promo + .is-gift { margin-left: 0; } /* Promoções e Gift Card juntos, à direita */
.tl-menu__icone { width: 22px; height: 22px; margin-right: 2px; }
.tl-menu__link { display: flex; align-items: center; gap: var(--tl-space-1); height: 48px; padding: 0 var(--tl-space-3); font-weight: 700; font-size: 14.5px; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.tl-nav .tl-menu__link { color: var(--tl-color-paper); }
.tl-menu__item:hover > .tl-menu__link, .tl-menu__item.is-open > .tl-menu__link, .tl-menu__item.is-current > .tl-menu__link { border-bottom-color: var(--tl-color-brand); }
.tl-nav .is-promo .tl-menu__link { color: var(--tl-color-promo-escuro); }
.tl-menu__chev { width: 14px; height: 14px; }
.tl-badge-novo { padding: 2px 5px; border-radius: var(--tl-radius-sm); background: var(--tl-color-highlight); color: var(--tl-color-noite); font-size: 11px; font-weight: 800; line-height: 1.2; text-transform: uppercase; letter-spacing: .04em; } /* 11px: a 12px em maiúsculas ficava da altura do texto do menu e competia com ele */
.tl-menu__link .tl-badge-novo { margin-left: var(--tl-space-1); } /* 8px do texto no total (4px do gap + 4px) */

.tl-estrela-natal { flex: 0 0 16px; overflow: visible; pointer-events: none; }
.tl-estrela-natal__corpo { fill: #ffd76f; }
.tl-gaveta .tl-estrela-natal__corpo { fill: #9a5700; }
.tl-estrela-natal__flocos path { fill: #d3f5ff; opacity: 0; }
.tl-gaveta .tl-estrela-natal__flocos path { fill: #157995; }

@media (prefers-reduced-motion: no-preference) {
	a:focus-visible > .tl-estrela-natal { --tl-estrela-corpo: tl-estrela-natal-desfaz; --tl-estrela-flocos: tl-estrela-natal-dispersao; }
	@media (hover: hover) {
		a:hover > .tl-estrela-natal { --tl-estrela-corpo: tl-estrela-natal-desfaz; --tl-estrela-flocos: tl-estrela-natal-dispersao; }
	}
	.tl-estrela-natal__corpo {
		transform-origin: center;
		animation: var(--tl-estrela-corpo, none) .75s ease-out;
	}
	.tl-estrela-natal__flocos path { animation: var(--tl-estrela-flocos, none) .58s ease-out .07s; }
	.tl-estrela-natal__flocos path:nth-child(1) { --tl-floco-x: 0px; --tl-floco-y: -12px; }
	.tl-estrela-natal__flocos path:nth-child(2) { --tl-floco-x: 11px; --tl-floco-y: -9px; }
	.tl-estrela-natal__flocos path:nth-child(3) { --tl-floco-x: 13px; --tl-floco-y: 1px; }
	.tl-estrela-natal__flocos path:nth-child(4) { --tl-floco-x: 7px; --tl-floco-y: 10px; }
	.tl-estrela-natal__flocos path:nth-child(5) { --tl-floco-x: -6px; --tl-floco-y: 9px; }
	.tl-estrela-natal__flocos path:nth-child(6) { --tl-floco-x: -12px; --tl-floco-y: 2px; }
	.tl-estrela-natal__flocos path:nth-child(7) { --tl-floco-x: -9px; --tl-floco-y: -7px; }
}
@keyframes tl-estrela-natal-desfaz {
	0% { transform: scale(1); }
	12% { transform: scale(1.13); }
	30%, 64% { opacity: 0; transform: scale(.62); }
	100% { opacity: 1; transform: scale(1); }
}
@keyframes tl-estrela-natal-dispersao {
	0% { opacity: 0; }
	22% { opacity: 1; }
	100% { opacity: 0; transform: translate(var(--tl-floco-x), var(--tl-floco-y)); }
}

.tl-nav .tl-container { position: relative; }
.tl-mega { position: absolute; left: 0; right: 0; top: 100%; z-index: 110; background: var(--tl-color-paper); color: var(--tl-color-ink); border-top: 1px solid var(--tl-color-line); border-bottom: 1px solid var(--tl-color-line); box-shadow: 0 18px 40px color-mix(in srgb, var(--tl-color-noite) 12%, transparent); visibility: hidden; opacity: 0; transition: opacity .15s, visibility 0s linear .15s; }
.tl-menu__item.is-open > .tl-mega { visibility: visible; opacity: 1; transition: opacity .15s; }
@media (hover: hover) { .tl-menu__item:hover > .tl-mega { visibility: visible; opacity: 1; transition: opacity .15s .08s; } }
.tl-mega__inner { padding-block: var(--tl-space-6) var(--tl-space-8); }
.tl-mega__inner--grupos { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--tl-space-6); }
.tl-mega--cartoes .tl-mega__inner { display: grid; grid-template-columns: repeat(4, minmax(0, 220px)); gap: var(--tl-space-4); }
.tl-mega__cartao { display: block; padding: 14px; border-radius: var(--tl-radius-lg); background: var(--tl-color-paper-alt); text-decoration: none; }
.tl-mega__cartao small { display: block; color: var(--tl-color-ink-soft); }
.tl-mega__titulo { margin: 0 0 10px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.tl-mega__titulo a { text-decoration: none; }
.tl-mega__grupo ul { margin: 0; padding: 0; list-style: none; }
.tl-mega__grupo li a { display: block; padding: var(--tl-space-1) 0; color: var(--tl-color-ink-soft); font-size: 14px; text-decoration: none; }
@media (hover: hover) { .tl-mega__grupo li a:hover, .tl-mega__titulo a:hover { color: var(--tl-color-brand-text); } } /* hover = mudança de cor, sem sublinhado (pedido de 14/11/2026) */
.tl-mega a.tl-mega__todos { color: var(--tl-color-brand-text); font-weight: 700; }
.tl-mega__rodape { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: var(--tl-space-4); padding-top: var(--tl-space-4); border-top: 1px solid var(--tl-color-line); font-size: 14px; color: var(--tl-color-ink-soft); }
.tl-mega__rodape a { text-decoration: none; }

/* ── 5. Gaveta (telemóvel) ── */
.tl-gaveta { position: fixed; inset: 0; z-index: 200; }
.tl-gaveta[hidden] { display: none; }
/* Transições interrompíveis, como o carrinho (main.js: painelAbrir/painelFechar põem .is-aberto). */
.tl-gaveta__fundo { position: absolute; inset: 0; background: color-mix(in srgb, var(--tl-color-noite) 50%, transparent); opacity: 0; transition: opacity var(--tl-dur-sai) ease-out; }
.tl-gaveta__painel { position: absolute; inset: 0 auto 0 0; z-index: 1; width: min(380px, 88vw); overflow-y: auto; background: var(--tl-color-paper); display: flex; flex-direction: column; transform: translateX(-100%); transition: transform var(--tl-dur-sai) ease-out; }
.tl-gaveta.is-aberto .tl-gaveta__fundo { opacity: 1; transition-duration: .2s; }
.tl-gaveta.is-aberto .tl-gaveta__painel { transform: none; transition: transform .26s var(--tl-ease-gaveta); }
/* Movimento reduzido: a gaveta aparece e desaparece em fade, sem deslizar; o contador não pulsa; as setas não rodam. */
@media (prefers-reduced-motion: reduce) {
	.tl-gaveta__painel { transform: none; opacity: 0; transition: opacity var(--tl-dur-sai) ease-out; }
	.tl-gaveta.is-aberto .tl-gaveta__painel { opacity: 1; transition: opacity .2s ease-out; }
	.tl-header__count.is-mais { animation: none; }
	.tl-gaveta__item summary .tl-icon { transition: none; }
}
.tl-gaveta__topo { display: flex; align-items: center; justify-content: space-between; padding: var(--tl-space-3) var(--tl-space-4); border-bottom: 1px solid var(--tl-color-line); }
.tl-gaveta__logo { height: 22px; width: auto; }
.tl-gaveta__fechar { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; }
.tl-gaveta__lista { margin: 0; padding: 0; list-style: none; }
.tl-gaveta__item { border-bottom: 1px solid var(--tl-color-line); }
.tl-gaveta__item > a, .tl-gaveta__item summary { display: flex; align-items: center; gap: var(--tl-space-2); padding: 14px var(--tl-space-4); font-weight: 700; text-decoration: none; list-style: none; cursor: pointer; }
.tl-gaveta__item summary::-webkit-details-marker { display: none; }
.tl-gaveta__item summary .tl-icon { margin-left: auto; width: 18px; height: 18px; transition: transform var(--tl-dur-hover) var(--tl-ease-suave); }
.tl-gaveta__item details[open] summary { background: var(--tl-color-paper-alt); }
.tl-gaveta__item details[open] summary .tl-icon { transform: rotate(180deg); }
.tl-gaveta__item.is-promo a { color: var(--tl-color-accent); }
.tl-gaveta__item .tl-menu__icone { width: 22px; height: 22px; }
.tl-gaveta__sub { margin: 0; padding: var(--tl-space-1) var(--tl-space-4) var(--tl-space-3) var(--tl-space-8); list-style: none; }
.tl-gaveta__sub a { display: block; padding: var(--tl-space-2) 0; color: var(--tl-color-ink-soft); text-decoration: none; }
.tl-gaveta__sub strong { color: var(--tl-color-ink); }
.tl-gaveta__rodape { margin-top: auto; display: grid; gap: var(--tl-space-3); padding: var(--tl-space-4); font-size: var(--tl-text-sm); }
.tl-gaveta__rodape a { display: flex; align-items: center; gap: var(--tl-space-2); color: var(--tl-color-ink-soft); text-decoration: none; }
.tl-gaveta__rodape .tl-icon { width: 18px; height: 18px; }
body.tl-nav-open { overflow: hidden; }

/* ── 6. Ecrãs médios: menos rótulos ── */
@media (max-width: 1279px) {
	.tl-menu__link { padding: 0 8px; font-size: 13.5px; }
	.tl-nota-google__txt { display: none; } /* fica "estrelas 4,8" */
	.tl-pesquisa { flex-basis: 420px; }
	/* Rede de segurança: se uma coleção sazonal (Natal...) não couber, o menu desliza em vez de alargar a página.
	   Os mega menus não ficam cortados: posicionam-se pelo .tl-container, fora da lista. */
	.tl-menu { overflow-x: auto; scrollbar-width: none; }
	.tl-menu::-webkit-scrollbar { display: none; }
}
@media (max-width: 1199px) {
	.tl-nav .tl-badge-novo { display: none; }
	.tl-header__conta { padding-inline: var(--tl-space-2); }
}
@media (max-width: 1099px) {
	/* Gift Card só com o ícone (o nome continua lá para leitores de ecrã) */
	.tl-nav .is-gift .tl-menu__texto { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ── 7. Telemóvel e tablet ── */
@media (max-width: 991px) {
	.tl-topo__inner { grid-template-columns: 1fr; min-height: 28px; }
	.tl-topo__lado, .tl-topo__links, .tl-nav { display: none; }
	.tl-topo__promessas li { font-size: 12.5px; }

	.tl-header__inner { flex-wrap: wrap; gap: 0 var(--tl-space-2); min-height: 0; padding-top: 6px; padding-bottom: 10px; }
	.tl-header__toggle { display: grid; order: 1; }
	.tl-header__brand { order: 2; flex: 1; display: flex; justify-content: center; }
	.tl-header__actions { flex: 0 0 auto; }
	/* "Entrar" volta a ser só o ícone (o texto fica para leitores de ecrã). */
	.tl-header__actions { --tl-h-acao: 40px; }
	.tl-header__conta { width: var(--tl-h-acao); padding: 0; }
	.tl-header__conta .tl-header__texto { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.tl-header__brand img { height: 22px; }
	.tl-header__actions { order: 3; gap: var(--tl-space-1); margin-left: 0; }
	.tl-pesquisa { order: 4; flex: 0 0 100%; max-width: none; margin-top: 6px; display: flex; align-items: center; gap: var(--tl-space-2); }
	.tl-pesquisa__form { flex: 1; min-width: 0; }
	/* "Cancelar" ao lado da caixa enquanto as sugestões estão abertas (padrão do iPhone e do Android) */
	.tl-pesquisa__cancelar { display: inline-flex; align-items: center; flex: none; min-height: 44px; padding: 0 var(--tl-space-2); border: 0; background: none; color: var(--tl-color-paper); font-weight: 600; }
	.tl-pesquisa__cancelar[hidden] { display: none; }
	.tl-pesquisa__form { height: 44px; } /* a pesquisa fica numa linha própria: mantém os 44px de toque */
	.tl-pesquisa__lista { position: fixed; left: 0; right: 0; width: auto; top: var(--tl-pesquisa-topo, 120px); bottom: 0; grid-template-columns: 1fr; border-radius: 0; border-width: 1px 0 0; box-shadow: none; overflow-y: auto; align-content: start; }
	.tl-pesquisa__col + .tl-pesquisa__col { border-left: 0; border-top: 1px solid var(--tl-color-line); }

	/* Checkout (header simples): logo à esquerda, "Pagamento seguro" à direita, "Voltar ao carrinho" por baixo.
	   Sem isto, a regra do logo ao centro empurrava-o para a ponta direita. */
	.tl-header--simples .tl-header__inner { padding-block: var(--tl-space-3); }
	.tl-header--simples .tl-header__brand { order: 0; flex: 0 0 auto; justify-content: flex-start; }
	.tl-header--simples .tl-header__seguro { order: 1; }
	.tl-header--simples .tl-header__voltar { order: 2; flex: 0 0 100%; margin-top: var(--tl-space-1); }
}

/* Frase do Natal à cabeça da barra do topo (main.js, initEntrega) */
.tl-topo__promessas li.tl-topo__natal { white-space: normal; text-wrap: balance; line-height: 1.25; }

/* ── 8. Centro de ajuda: botão "Ajuda" ao lado do "Entrar" (como o "Help Center" do Games2Egypt; main.js, initAjuda) ──
   Botão em ciano muito claro: discreto, mas percebe-se que está ali. Painel em Noite (como o deles), com os
   atalhos (título e descrição) e, no fundo, os botões de ligar e WhatsApp. */
.tl-ajuda { position: relative; }
.tl-header .tl-ajuda__botao {
	--tl-ajuda-ciano: color-mix(in srgb, var(--tl-color-brand) 55%, var(--tl-color-paper));
	gap: var(--tl-space-2); padding: 0 var(--tl-space-4) 0 var(--tl-space-3);
	color: var(--tl-ajuda-ciano); font-weight: 700;
}
.tl-header .tl-ajuda__botao .tl-icon { width: 20px; height: 20px; color: var(--tl-ajuda-ciano); }
.tl-ajuda__painel {
	position: absolute; right: 0; top: calc(100% + var(--tl-space-2)); z-index: 130;
	width: 340px; padding: var(--tl-space-2); border-radius: var(--tl-radius-lg);
	background: var(--tl-color-noite); color: var(--tl-color-paper);
	box-shadow: inset 0 0 0 1px var(--tl-color-noite-2), 0 18px 40px color-mix(in srgb, var(--tl-color-noite) 45%, transparent);
	transform-origin: top right; transition: opacity .16s ease-out, transform .16s ease-out;
}
.tl-ajuda__painel[hidden] { display: none; }
@starting-style { .tl-ajuda__painel { opacity: 0; transform: translateY(-4px) scale(.98); } }
.tl-ajuda__lista { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.tl-ajuda__item { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--tl-space-3); padding: var(--tl-space-3); border-radius: var(--tl-radius); text-decoration: none; transition: background-color var(--tl-dur-hover) var(--tl-ease-suave); }
.tl-ajuda__lista--simples .tl-ajuda__item { grid-template-columns: minmax(0, 1fr); }
.tl-ajuda__item span { display: grid; gap: 2px; min-width: 0; }
.tl-ajuda__item strong { font-size: var(--tl-text-sm); font-weight: 700; }
.tl-ajuda__item small { font-size: var(--tl-text-xs); }
.tl-ajuda__item .tl-icon { width: 20px; height: 20px; color: var(--tl-color-brand-text); }
/* No painel (Noite): títulos brancos, descrições lavanda; linha com fundo Noite-2 ao passar o rato */
.tl-header .tl-ajuda__painel a { color: var(--tl-color-paper); }
.tl-ajuda__painel .tl-ajuda__item small { color: var(--tl-color-lavanda); }
@media (hover: hover) { .tl-ajuda__painel .tl-ajuda__item:hover { background: var(--tl-color-noite-2); } }
.tl-ajuda__contactos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tl-space-2); margin-top: var(--tl-space-2); padding: var(--tl-space-1); }
.tl-ajuda__contacto { display: inline-flex; align-items: center; justify-content: center; gap: var(--tl-space-2); min-height: 48px; padding: 0 var(--tl-space-3); border-radius: var(--tl-radius); background: var(--tl-color-noite-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tl-color-lavanda) 18%, transparent); font-size: var(--tl-text-sm); font-weight: 700; text-decoration: none; white-space: nowrap; transition: box-shadow var(--tl-dur-hover) var(--tl-ease-suave); }
@media (hover: hover) { .tl-ajuda__contacto:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tl-color-brand) 60%, transparent); } }
.tl-ajuda__contacto .tl-icon { width: 18px; height: 18px; color: color-mix(in srgb, var(--tl-color-brand) 55%, var(--tl-color-paper)); }
.tl-ajuda__contacto .tl-icon--whatsapp { color: var(--tl-color-whatsapp-escuro); }
/* Gaveta (telemóvel, fundo branco): a mesma lista, com ícones e sempre aberta; no header do telemóvel o botão não aparece */
.tl-gaveta__titulo { margin: 0; font-size: var(--tl-text-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--tl-color-ink-soft); }
.tl-gaveta__rodape .tl-ajuda__lista { margin: 0 calc(-1 * var(--tl-space-3)); }
.tl-gaveta__rodape .tl-ajuda__item { display: grid; padding-block: var(--tl-space-2); color: var(--tl-color-ink); } /* ganha à regra genérica dos links da gaveta */
.tl-gaveta__rodape .tl-ajuda__item small { color: var(--tl-color-ink-soft); }
@media (hover: hover) { .tl-gaveta__rodape .tl-ajuda__item:hover { background: var(--tl-color-paper-alt); } }
@media (max-width: 991px) { .tl-header .tl-ajuda { display: none; } }
@media (prefers-reduced-motion: reduce) {
	.tl-ajuda__painel { transition-property: opacity; }
	@starting-style { .tl-ajuda__painel { transform: none; } }
}

/* ── 9. Barra lavanda: hover com mudança de cor subtil (em vez de sublinhado) ──
   Os links ficam um pouco mais suaves e escurecem até ao Noite ao passar o rato (ambos acima de 4,5:1). */
.tl-topo__links a, .tl-nota-google { color: color-mix(in srgb, var(--tl-color-noite) 78%, var(--tl-color-lavanda)); transition: color var(--tl-dur-hover) var(--tl-ease-suave); }
@media (hover: hover) {
	.tl-topo__links a:hover, .tl-nota-google:hover { color: var(--tl-color-noite); text-decoration: none; }
	.tl-nota-google:hover .tl-nota-google__txt { text-decoration: none; }
}

/* ── 10. Gift Card no menu: ícone da prenda em linha, em ciano (como os outros ícones, mas na cor da marca) ── */
.tl-nav .is-gift .tl-menu__icone { color: var(--tl-color-brand); }
.tl-gaveta__item.is-gift .tl-menu__icone { color: var(--tl-color-brand-text); } /* em fundo branco o ciano não chega aos 3:1 */

/* ── 11. Interruptor de idioma PT | EN (como o da moeda no Games2Egypt) ──
   Pista com as duas línguas; o botão Noite fica por baixo da ativa e desliza para a outra ao clicar. */
.tl-idioma { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 2px; border-radius: var(--tl-radius-lg); background: color-mix(in srgb, var(--tl-color-noite) 12%, transparent); color: var(--tl-color-noite); font-size: 12px; font-weight: 700; letter-spacing: .04em; line-height: 1; text-decoration: none; transition: background-color var(--tl-dur-hover) var(--tl-ease-suave); }
.tl-idioma__botao { position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px); border-radius: var(--tl-radius); background: var(--tl-color-noite); transition: transform var(--tl-dur-sai) var(--tl-ease); }
.tl-idioma.is-segundo .tl-idioma__botao { transform: translateX(100%); }
.tl-idioma__opcao { position: relative; padding: 5px 9px; text-align: center; color: color-mix(in srgb, var(--tl-color-noite) 70%, transparent); transition: color var(--tl-dur-sai) var(--tl-ease); }
.tl-idioma__opcao.is-atual { color: var(--tl-color-lavanda); }
@media (hover: hover) { .tl-idioma:hover { background: color-mix(in srgb, var(--tl-color-noite) 20%, transparent); } }
.tl-topo__links a.tl-idioma { font-weight: 700; transition: color var(--tl-dur-hover) var(--tl-ease-suave), background-color var(--tl-dur-hover) var(--tl-ease-suave); } /* a regra geral dos links do topo pede 600 */
/* Na gaveta (fundo claro): linha "Idioma" com o interruptor à direita */
.tl-gaveta__idioma { display: flex; align-items: center; justify-content: space-between; gap: var(--tl-space-3); margin: 0; color: var(--tl-color-ink-soft); }
.tl-gaveta__rodape a.tl-idioma { display: inline-grid; gap: 0; color: var(--tl-color-ink); background: var(--tl-color-paper-alt); font-size: var(--tl-text-sm); }
.tl-idioma--gaveta .tl-idioma__opcao { padding: 8px 14px; color: var(--tl-color-ink-soft); }
.tl-idioma--gaveta .tl-idioma__opcao.is-atual { color: var(--tl-color-paper); }
@media (prefers-reduced-motion: reduce) { .tl-idioma__botao, .tl-idioma__opcao { transition: none; } }

/* ── 10. Menu de conta, com sessão iniciada (inc/conta.php, tl_conta_perfil_html; main.js, initAjuda) ──
   Como o do Games2Egypt: avatar com as iniciais, primeiro nome e seta; o painel (Noite, como o da ajuda)
   tem o cartão do cliente com pontos e encomendas, "Abrir a minha conta" e as secções. No telemóvel fica só o avatar. */
.tl-perfil { position: relative; }
.tl-header .tl-perfil__botao { display: inline-flex; gap: var(--tl-space-2); width: auto; padding: 0 var(--tl-space-3) 0 var(--tl-space-2); font-size: 14px; font-weight: 700; white-space: nowrap; }
/* O avatar é redondo (convenção de pessoa); o botão à volta segue a regra única. 28px deixa 8px de ar por cima e por baixo. */
.tl-perfil__avatar { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--tl-color-brand); color: var(--tl-color-noite); font-size: 12px; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.tl-perfil__nome { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; }
.tl-header .tl-perfil__seta { width: 16px; height: 16px; color: var(--tl-color-lavanda); transition: transform var(--tl-dur-hover) var(--tl-ease-suave); }
.tl-perfil__botao[aria-expanded="true"] .tl-perfil__seta { transform: rotate(180deg); }
.tl-perfil__painel {
	position: absolute; right: 0; top: calc(100% + var(--tl-space-2)); z-index: 130;
	width: 300px; max-width: calc(100vw - 2 * var(--tl-space-4)); padding: var(--tl-space-2); border-radius: var(--tl-radius-lg);
	background: var(--tl-color-noite); color: var(--tl-color-paper);
	box-shadow: inset 0 0 0 1px var(--tl-color-noite-2), 0 18px 40px color-mix(in srgb, var(--tl-color-noite) 45%, transparent);
	transform-origin: top right; transition: opacity .16s ease-out, transform .16s ease-out;
}
.tl-perfil__painel[hidden] { display: none; }
@starting-style { .tl-perfil__painel { opacity: 0; transform: translateY(-4px) scale(.98); } }
/* Popover (main.js, initPainelHeader): o painel vai para o top layer, por isso deixa de ser absolute dentro do botão
   e passa a fixed na posição calculada a partir do botão. Tira os estilos de origem do popover (borda, margem, inset). */
:is(.tl-ajuda__painel, .tl-perfil__painel)[popover] {
	position: fixed; inset: auto; margin: 0; border: 0; overflow: visible;
	top: var(--tl-painel-topo, 72px); right: var(--tl-painel-direita, 16px); left: auto;
}
@media (max-width: 991px) {
	.tl-perfil__painel[popover] { left: var(--tl-space-4); right: var(--tl-space-4); margin-left: auto; }
}
.tl-header .tl-perfil__painel a { color: var(--tl-color-paper); text-decoration: none; }
.tl-perfil__cartao { display: flex; align-items: center; gap: var(--tl-space-3); padding: var(--tl-space-4); border-radius: var(--tl-radius); background: linear-gradient(135deg, var(--tl-color-noite-2), color-mix(in srgb, var(--tl-color-brand) 14%, var(--tl-color-noite-2))); }
.tl-perfil__cartao .tl-perfil__avatar { width: 44px; height: 44px; font-size: 15px; }
.tl-perfil__cartao > span:last-child { display: grid; gap: 2px; min-width: 0; }
.tl-perfil__cartao strong { overflow: hidden; font-size: var(--tl-text-md); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.tl-perfil__cartao small { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tl-space-1) var(--tl-space-2); color: var(--tl-color-lavanda); font-size: var(--tl-text-xs); }
.tl-perfil__cartao-nome { min-width: 0; overflow: hidden; }
.tl-perfil__teerium { display: inline-flex; align-items: center; gap: var(--tl-space-1); }
.tl-perfil__teerium .tl-icon { width: 14px; height: 14px; }
.tl-header .tl-perfil__painel .tl-perfil__teerium-ajuda { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 2px; border: 1px solid currentColor; border-radius: 50%; color: var(--tl-color-lavanda); font-size: 10px; font-weight: 800; line-height: 1; transition: color var(--tl-dur-hover) var(--tl-ease-suave); }
@media (hover: hover) { .tl-header .tl-perfil__painel .tl-perfil__teerium-ajuda:hover { color: var(--tl-color-brand); } }
.tl-perfil__teerium-ajuda:focus-visible { outline: 2px solid var(--tl-color-brand); outline-offset: 2px; }
.tl-header .tl-perfil__abrir { display: flex; align-items: center; gap: var(--tl-space-2); min-height: 44px; margin: var(--tl-space-1) 0; padding: 0 var(--tl-space-4); border-bottom: 1px solid var(--tl-color-noite-2); color: color-mix(in srgb, var(--tl-color-brand) 55%, var(--tl-color-paper)); font-size: var(--tl-text-sm); font-weight: 800; }
.tl-perfil__abrir .tl-icon { width: 16px; height: 16px; transition: transform var(--tl-dur-hover) var(--tl-ease-suave); }
@media (hover: hover) { .tl-perfil__abrir:hover .tl-icon { transform: translateX(3px); } }
.tl-perfil__lista { display: grid; gap: 2px; margin: 0; padding: var(--tl-space-1) 0 0; list-style: none; }
.tl-perfil__lista a { display: flex; align-items: center; gap: var(--tl-space-3); min-height: 44px; padding: 0 var(--tl-space-4); border-radius: var(--tl-radius); font-size: var(--tl-text-sm); font-weight: 600; transition: background-color var(--tl-dur-hover) var(--tl-ease-suave); }
.tl-perfil__lista .tl-icon { width: 18px; height: 18px; color: var(--tl-color-lavanda); }
@media (hover: hover) { .tl-perfil__lista a:hover { background: var(--tl-color-noite-2); } }
.tl-perfil__item--customer-logout { margin-top: var(--tl-space-1); padding-top: var(--tl-space-1); border-top: 1px solid var(--tl-color-noite-2); }
@media (max-width: 1199px) { .tl-perfil__nome { max-width: 8ch; } }
@media (max-width: 991px) {
	.tl-header .tl-perfil__botao { width: var(--tl-h-acao); padding: 0; justify-content: center; }
	.tl-header .tl-perfil__botao .tl-perfil__avatar { width: 26px; height: 26px; font-size: 11px; }
	.tl-perfil__nome, .tl-header .tl-perfil__seta { display: none; }
	/* O avatar não está na ponta (vêm a seguir favoritos e carrinho): o painel ancora no header, com a margem da página */
	.tl-header__inner { position: relative; }
	.tl-perfil { position: static; }
	.tl-perfil__painel { left: var(--tl-space-4); right: var(--tl-space-4); width: auto; max-width: 420px; margin-left: auto; top: calc(100% - var(--tl-space-1)); }
}
@media (prefers-reduced-motion: reduce) {
	.tl-perfil__painel { transition-property: opacity; }
	@starting-style { .tl-perfil__painel { transform: none; } }
	.tl-perfil__seta, .tl-perfil__abrir .tl-icon { transition: none; }
}
