/**
 * header.css — Componente de Header global do FBB Theme.
 *
 * Usa os tokens definidos em assets/css/base/_variables.css. Depende
 * dela via ordem de enqueue (ver inc/enqueue.php) — este arquivo não
 * declara @import para não duplicar requisições HTTP.
 *
 * Breakpoints oficiais do projeto (DESIGN.md): 375 / 768 / 1024 / 1440 / 1920px.
 */

/* =============================================================
 * Topbar
 * ============================================================= */
.fbb-topbar {
	display: block;
	background-color: var( --fbb-color-white );
	color: var( --fbb-color-black );
	border-bottom: 1px solid #e2e2e2;
}

.fbb-topbar__container {
	max-width: var( --fbb-container-max-width );
	margin-inline: auto;
	padding-inline: var( --fbb-container-padding-inline );
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 30px;
}

.fbb-topbar__info {
	display: flex;
	align-items: center;
	gap: 24px;
	font-family: var( --fbb-font-family );
	font-weight: var( --fbb-font-weight-medium );
	font-size: 11px;
	line-height: 1.4;
	flex-wrap: wrap;
}

.fbb-topbar__phone {
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
}

.fbb-topbar__phone:hover,
.fbb-topbar__phone:focus-visible {
	text-decoration: underline;
}

.fbb-topbar__social {
	display: flex;
	align-items: center;
	gap: 14px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.fbb-topbar__social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	color: var( --fbb-color-navy );
	transition: opacity 0.2s ease;
}

.fbb-topbar__social-link:hover,
.fbb-topbar__social-link:focus-visible {
	opacity: 0.7; /* SUGESTÃO de hover — não extraído do Figma (estático), ver DESIGN.md Seção 6. */
}

.fbb-topbar__social-link svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

/* =============================================================
 * Header / Nav principal
 * ============================================================= */
.fbb-header {
	position: sticky;
	top: 0;
	z-index: var( --fbb-z-header );
	width: 100%;
}

.fbb-header__nav {
	background-color: var( --fbb-color-offwhite );
	transition: box-shadow 0.25s ease;
}

/* Sombra sutil aplicada via JS (data-fbb-scrolled) quando a página rola —
 * ver assets/js/components/header.js. */
.fbb-header.is-scrolled .fbb-header__nav {
	box-shadow: 0 2px 12px rgba( 0, 0, 0, 0.08 );
}

.fbb-header__container {
	max-width: 1712px;
	margin-inline: auto;
	padding-inline: var( --fbb-container-padding-inline );
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	min-height: 152px;
}

.fbb-header__logo {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

.fbb-header__logo-img {
	display: block;
	height: 68px;
	width: auto;
}

.fbb-header__logo .custom-logo-link {
	display: inline-flex;
}

.fbb-header__logo .custom-logo {
	display: block;
	width: auto;
	height: 100px;
}

.fbb-header__nav-wrapper {
	flex: 1;
	display: flex;
	justify-content: center;
}

.fbb-header__menu {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 58px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.fbb-header__menu > .menu-item {
	position: relative;
	margin: 0;
}

.fbb-header__menu > .menu-item > a {
	position: relative;
	display: inline-flex;
	align-items: center;
	font-family: var( --fbb-font-family );
	font-weight: var( --fbb-font-weight-medium );
	font-size: 16px;
	color: var( --fbb-color-navy );
	text-decoration: none;
	white-space: nowrap;
	padding-block: 12px;
	transition: color 0.2s ease;
}

.fbb-header__menu > .menu-item > a::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 5px;
	height: 2px;
	background-color: var( --fbb-color-red );
	transform: scaleX( 0 );
	transform-origin: right center;
	transition: transform 0.25s ease;
}

.fbb-header__menu > .menu-item > a:hover,
.fbb-header__menu > .menu-item > a:focus-visible,
.fbb-header__menu > .current-menu-item > a,
.fbb-header__menu > .current-menu-ancestor > a {
	color: var( --fbb-color-red );
}

.fbb-header__menu > .menu-item > a:hover::after,
.fbb-header__menu > .menu-item > a:focus-visible::after,
.fbb-header__menu > .current-menu-item > a::after,
.fbb-header__menu > .current-menu-ancestor > a::after {
	transform: scaleX( 1 );
	transform-origin: left center;
}

.fbb-header__menu > .menu-item > a:focus-visible {
	outline: 2px solid var( --fbb-color-red );
	outline-offset: 5px;
}

/* =============================================================
 * CTA "DOE AGORA" — base do botão pill vive em components/buttons.css
 * (carregado antes deste arquivo, ver inc/enqueue.php). Aqui só o ajuste
 * de layout específico do header.
 * ============================================================= */
.fbb-header__cta.fbb-btn--pill {
	flex-shrink: 0;
	padding: 22px 34px;
	font-size: 16px;
}

/* =============================================================
 * Hamburger (mobile)
 * ============================================================= */
.fbb-header__hamburger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 32px;
	height: 32px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
}

.fbb-header__hamburger-line {
	display: block;
	width: 100%;
	height: 2px;
	background-color: var( --fbb-color-navy );
	transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Estado aberto do hamburger — classe alternada via JS. */
.fbb-header__hamburger[aria-expanded="true"] .fbb-header__hamburger-line:nth-child(1) {
	transform: translateY( 7px ) rotate( 45deg );
}

.fbb-header__hamburger[aria-expanded="true"] .fbb-header__hamburger-line:nth-child(2) {
	opacity: 0;
}

.fbb-header__hamburger[aria-expanded="true"] .fbb-header__hamburger-line:nth-child(3) {
	transform: translateY( -7px ) rotate( -45deg );
}

/* =============================================================
 * Responsivo
 * ============================================================= */

/* Tablet e abaixo (≤1023px) — reduz o gap do menu para caber os 7 itens + CTA. */
@media ( max-width: 1023px ) {
	.fbb-header__menu {
		gap: 20px;
	}

	.fbb-header__menu > .menu-item > a {
		font-size: 15px;
	}

	.fbb-btn--pill {
		padding: 16px 24px;
	}
}

/* Mobile (≤767px) — colapsa para hamburger. */
@media ( max-width: 767px ) {
	.fbb-topbar__info {
		font-size: 12px;
		gap: 12px;
	}

	.fbb-topbar__address {
		display: none; /* endereço completo não cabe em telas pequenas — mantém telefone visível. */
	}

	.fbb-header__container {
		min-height: 72px;
	}

	.fbb-header__logo-img {
		height: 48px;
	}

	.fbb-header__hamburger {
		display: flex;
	}

	.fbb-header__nav-wrapper {
		position: fixed;
		inset: 72px 0 0 0;
		background-color: var( --fbb-color-white );
		flex-direction: column;
		justify-content: flex-start;
		padding: 32px var( --fbb-container-padding-inline );
		transform: translateX( 100% );
		visibility: hidden;
		transition: transform 0.3s ease, visibility 0.3s ease;
		z-index: var( --fbb-z-mobile-nav );
		overflow-y: auto;
	}

	/* Estado aberto — classe alternada via JS (header.js), animada com GSAP. */
	.fbb-header__nav-wrapper.is-open {
		visibility: visible;
		transform: translateX( 0 );
	}

	.fbb-header__menu {
		flex-direction: column;
		align-items: flex-start;
		gap: 24px;
		width: 100%;
	}

	.fbb-header__menu > .menu-item {
		width: 100%;
	}

	.fbb-header__menu > .menu-item > a {
		font-size: 20px;
		width: 100%;
		padding-block: 10px;
	}

	.fbb-header__cta.fbb-btn--pill {
		display: none; /* CTA mobile é reapresentado dentro do menu aberto, ver header.js/markup futuro. */
	}
}

/* Mobile (375px) */
@media ( max-width: 375px ) {
	.fbb-header__container {
		padding-inline: 20px;
	}

	.fbb-topbar__container {
		padding-inline: 20px;
	}
}

/* Desktop grande (1920px) — permite respiro extra no container. */
@media ( min-width: 1920px ) {
	.fbb-header__container,
	.fbb-topbar__container {
		max-width: 1712px;
	}
}

/* Grid canônico do site: 1440px úteis. */
.fbb-header__container,
.fbb-topbar__container {
	width: 100%;
	max-width: var( --fbb-container-max-width );
	padding-inline: var( --fbb-container-padding-inline );
}

.fbb-header__container {
	min-height: 134px;
	gap: 28px;
}

.fbb-header__logo .custom-logo,
.fbb-header__logo-img {
	height: 88px;
}

.fbb-header__menu {
	gap: clamp( 28px, 2.6vw, 50px );
}

.fbb-header__menu > .menu-item > a {
	font-size: 15px;
}

.fbb-header__cta.fbb-btn--pill {
	padding: 19px 30px;
	font-size: 15px;
}

@media ( max-width: 1023px ) {
	.fbb-header__container,
	.fbb-topbar__container {
		padding-inline: var( --fbb-container-padding-tablet );
	}
}

@media ( max-width: 767px ) {
	.fbb-header__container,
	.fbb-topbar__container {
		padding-inline: var( --fbb-container-padding-mobile );
	}

	.fbb-header__container {
		min-height: 72px;
	}

	.fbb-header__logo .custom-logo,
	.fbb-header__logo-img {
		height: 48px;
	}
}

/* Notebook: escala compacta sem alterar a estrutura do header. */
@media ( min-width: 1024px ) and ( max-width: 1439px ) {
	.fbb-header__container,
	.fbb-topbar__container {
		padding-inline: var( --fbb-page-gutter );
	}

	.fbb-topbar__container {
		min-height: 28px;
	}

	.fbb-header__container {
		min-height: 110px;
		gap: 22px;
	}

	.fbb-header__logo .custom-logo,
	.fbb-header__logo-img {
		height: 72px;
	}

	.fbb-header__menu {
		gap: clamp( 20px, 2vw, 30px );
	}

	.fbb-header__menu > .menu-item > a,
	.fbb-header__cta.fbb-btn--pill {
		font-size: 13px;
	}

	.fbb-header__cta.fbb-btn--pill {
		padding: 15px 23px;
	}
}
.has-open-menu {
	overflow: hidden;
}

.fbb-header__logo-placeholder {
	display: block;
	width: 188px;
	height: 72px;
	background: #d9d9d9;
}
