/**
 * Shell global — header, footer, busca, botão primário
 * Figma: nav 2322:1041 · footer 2305:788
 */

body.gl-shell {
	background: var(--color-neutral-01);
	font-family: var(--font-family-base);
	/* Mantém o footer no fundo da viewport durante o carregamento */
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
}

body.gl-shell > main {
	flex: 1 0 auto;
}

/* ---- Header — Figma 2322:1041 ---- */
.gl-header {
	width: 100%;
	max-width: none;
	margin: 0;
	background: var(--color-white);
	--tainacan-interface--link-color: var(--color-black);
}

.gl-header__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 16px 24px;
	background: var(--color-white);
	border-bottom: 1px solid var(--color-neutral-04);
	min-height: 72px;
	box-sizing: border-box;
}

.gl-header__nav-left,
.gl-header__nav-right,
.gl-header__nav-links {
	display: flex;
	align-items: center;
}

.gl-header__nav-left {
	gap: 16px;
	min-width: 0;
	flex: 1;
}

.gl-header__nav-links {
	gap: 24px;
}

.gl-header__nav-right {
	gap: 24px;
	flex-shrink: 0;
}

.gl-header__brand {
	display: inline-flex;
	align-items: baseline;
	gap: 0;
	font-family: var(--font-family-base);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.45;
	text-decoration: none;
	white-space: nowrap;
}

.gl-header__brand:hover,
.gl-header__brand:focus {
	text-decoration: none;
}

.gl-header__brand-sigla {
	color: var(--color-brand);
	font-weight: 700;
}

.gl-header__brand-name {
	color: var(--color-black);
	font-weight: 700;
	margin-left: 0.25em;
}

.gl-header__nav-divider {
	display: block;
	width: 1px;
	height: 20px;
	background: var(--color-neutral-02);
	flex-shrink: 0;
}

.gl-header__nav-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-family-base);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--color-black) !important;
	text-decoration: none;
	line-height: 1.15;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
}

.gl-header__nav-link:hover,
.gl-header__nav-link:focus,
.gl-header__nav-link.is-active {
	color: var(--color-text-link) !important;
	text-decoration: none;
}

.gl-header__chevron,
.gl-header__logout-icon {
	flex-shrink: 0;
	width: 14px;
	height: 14px;
	display: block;
}

.gl-header__chevron {
	transition: transform 0.15s ease;
}

.gl-header__dropdown {
	position: relative;
}

.gl-header__dropdown.is-open .gl-header__chevron {
	transform: rotate(180deg);
}

.gl-header__dropdown-menu {
	position: absolute;
	top: calc(100% + 12px);
	left: 0;
	z-index: 1000;
	min-width: 260px;
	max-width: min(360px, 90vw);
	max-height: 60vh;
	overflow: auto;
	margin: 0;
	padding: var(--spacing-sm) 0;
	list-style: none;
	background: var(--color-white);
	border: 1px solid var(--color-border-light);
	border-radius: var(--border-radius-md);
	box-shadow: var(--shadow-card);
}

.gl-header__dropdown-item {
	display: block;
	padding: 10px var(--spacing-md);
	font-family: var(--font-family-base);
	font-size: var(--font-size-sm);
	font-weight: var(--font-weight-medium);
	color: var(--color-black) !important;
	text-decoration: none;
	text-transform: none;
	letter-spacing: 0;
}

.gl-header__dropdown-item:hover,
.gl-header__dropdown-item:focus {
	background: var(--color-neutral-01);
	color: var(--color-text-link) !important;
	text-decoration: none;
}

.gl-header__dropdown-empty {
	display: block;
	padding: 10px var(--spacing-md);
	font-size: var(--font-size-sm);
	color: var(--color-text-muted);
}

.gl-header__ia-btn {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px !important;
	height: 40px;
	min-height: 40px;
	padding: 8px 24px !important;
	border-radius: 1000px;
	text-transform: uppercase;
	white-space: nowrap;
	font-size: 14px !important;
	font-weight: 600;
	letter-spacing: 0.5px;
	line-height: 1.15;
}

a.gl-header__ia-btn,
a.gl-header__ia-btn:hover,
a.gl-header__ia-btn:focus,
a.gl-header__ia-btn:visited,
button.gl-header__ia-btn {
	color: var(--color-white) !important;
	text-decoration: none;
}

.gl-header__ia-btn-text {
	line-height: 1.15;
	color: inherit;
}

.gl-header__ia-btn-icon {
	display: block;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

/* ---- Botão primário ---- */
.gl-btn-primary,
.gl-btn-primary:hover,
.gl-btn-primary:focus,
.gl-btn-primary:visited {
	color: var(--color-white);
	text-decoration: none;
}

.gl-btn-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--color-brand);
	font-family: var(--font-family-base);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	line-height: 1.15;
	padding: 8px 24px;
	border-radius: 1000px;
	border: none;
	cursor: pointer;
	text-decoration: none;
}

.gl-btn-primary:hover {
	background: #007a74;
}

/* ---- Search bar — Figma 2321:7377 / 2322:1092 ---- */
.gl-search-bar {
	position: relative;
	width: 100%;
	background: var(--color-neutral-01);
	border-bottom: 1px solid var(--color-neutral-02);
	overflow: visible;
}

.gl-search-bar__grafismo {
	position: absolute;
	inset: 0;
	background-image: url("../images/header-grafismo.svg");
	background-repeat: no-repeat;
	/* Altura extra cobre o deslocamento do parallax (±bleed) sem revelar falhas */
	background-position: center center;
	background-size: auto calc(100% + 64px);
	opacity: 1;
	pointer-events: none;
	overflow: hidden;
}

.gl-search-bar__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	padding: 24px 32px 16px;
	box-sizing: border-box;
}

.gl-search-bar__stack {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 5px;
	max-width: 1302px;
	margin: 0 auto;
	width: 100%;
}

.gl-search-bar__form {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	height: 44px;
	padding: 12px 16px;
	background: var(--color-white);
	border: 2px solid var(--color-neutral-03);
	border-radius: 0;
	box-sizing: border-box;
}

.gl-search-bar__input {
	flex: 1;
	min-width: 0;
	border: none;
	background: transparent;
	font-family: var(--font-family-base);
	font-size: 14px;
	font-weight: 400;
	color: var(--color-text);
	line-height: 1.45;
	padding: 0;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.gl-search-bar__input::placeholder {
	color: var(--color-neutral-04);
	opacity: 1;
}

/* X nativo do type=search — visual alinhado ao shell */
.gl-search-bar__input::-webkit-search-decoration,
.gl-search-bar__input::-webkit-search-results-button,
.gl-search-bar__input::-webkit-search-results-decoration {
	-webkit-appearance: none;
	appearance: none;
	display: none;
}

.gl-search-bar__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 16px;
	height: 16px;
	margin: 0 4px 0 0;
	padding: 0;
	cursor: pointer;
	background: center / 12px 12px no-repeat
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 2.5l7 7M9.5 2.5l-7 7' stroke='%239a9790' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
	opacity: 1;
}

.gl-search-bar__input::-webkit-search-cancel-button:hover {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 2.5l7 7M9.5 2.5l-7 7' stroke='%2346272d' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

.gl-search-bar__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	flex-shrink: 0;
	line-height: 0;
}

.gl-search-bar__submit img {
	display: block;
	width: 16px;
	height: 16px;
}

.gl-search-bar__advanced {
	display: block;
	width: 100%;
	font-family: var(--font-family-base);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.45;
	color: var(--color-text-link) !important;
	text-align: right;
	text-decoration: underline;
	text-decoration-color: currentColor;
	text-underline-position: from-font;
	text-decoration-thickness: from-font;
}

.gl-search-bar__advanced:hover,
.gl-search-bar__advanced:focus {
	color: var(--color-brand) !important;
	text-decoration: underline;
	text-decoration-color: currentColor;
}

.gl-search-bar__advanced.is-open {
	font-weight: 600;
}

/* ---- Term suggest (autocomplete) ---- */
.gl-search-suggest {
	position: relative;
	width: 100%;
	z-index: 5;
}

.gl-search-suggest.is-open {
	z-index: 40;
}

.gl-home-hero:has(.gl-search-suggest.is-open),
.gl-search-bar:has(.gl-search-suggest.is-open) {
	position: relative;
	z-index: 30;
}

.gl-search-suggest__panel {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	max-height: min(320px, 50vh);
	overflow: auto;
	background: var(--color-white, #fff);
	border: 1px solid var(--color-neutral-02, #dedcd7);
	box-shadow: 0 8px 24px rgba(70, 39, 45, 0.12);
	box-sizing: border-box;
}

.gl-search-suggest__label,
.gl-search-suggest__empty,
.gl-search-suggest__hint {
	margin: 0;
	padding: 10px 14px;
	font-family: var(--font-family-base);
	font-size: 12px;
	line-height: 1.4;
	color: var(--color-neutral-05, #565656);
}

.gl-search-suggest__label {
	font-weight: 600;
	border-bottom: 1px solid var(--color-neutral-02, #dedcd7);
	background: var(--color-neutral-01, #f6f5f2);
}

.gl-search-suggest__list {
	list-style: none;
	margin: 0;
	padding: 4px 0;
}

.gl-search-suggest__option {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 10px 14px;
	border: none;
	background: transparent;
	text-align: left;
	cursor: pointer;
	font-family: var(--font-family-base);
	color: var(--color-text, #46272d);
	box-sizing: border-box;
}

.gl-search-suggest__option:hover,
.gl-search-suggest__option.is-active,
.gl-search-suggest__option:focus-visible {
	background: var(--color-neutral-01, #f6f5f2);
	outline: none;
}

.gl-search-suggest__name {
	flex: 1;
	min-width: 0;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
}

.gl-search-suggest__meta {
	flex-shrink: 0;
	font-size: 12px;
	font-weight: 400;
	color: var(--color-neutral-05, #565656);
	line-height: 1.35;
}

.gl-search-suggest__hint {
	border-top: 1px solid var(--color-neutral-02, #dedcd7);
	color: var(--color-neutral-04, #9a9790);
}

/* ---- Footer ---- */
.gl-footer {
	margin-top: auto;
	width: 100%;
	max-width: none;
	flex-shrink: 0;
}

.gl-footer__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--spacing-md);
	padding: var(--spacing-xl);
	background: var(--color-black);
	color: var(--color-white);
}

.gl-footer__title {
	margin: 0;
	font-size: var(--font-size-lg);
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-tight);
	color: var(--color-white);
	display: flex;
	align-items: center;
	gap: 8px;
}

.gl-footer__sigla {
	color: var(--color-footer-sigla);
}

.gl-footer__sep {
	color: var(--color-white);
	font-weight: var(--font-weight-regular);
}

.gl-footer__partner {
	display: inline-flex;
	align-items: center;
	line-height: 0;
	text-decoration: none;
	opacity: 1;
	transition: opacity 0.15s ease;
}

.gl-footer__partner:hover,
.gl-footer__partner:focus {
	opacity: 0.85;
	text-decoration: none;
}

.gl-footer__partner-logo {
	display: block;
	width: 78px;
	height: 10px;
	object-fit: contain;
	flex-shrink: 0;
}

/* ---- Chat placeholder (legado; modal é o fluxo principal) ---- */
.gl-chat-placeholder {
	max-width: 720px;
	margin: 0 auto;
	padding: var(--spacing-3xl) var(--spacing-lg);
	text-align: center;
}

.gl-chat-placeholder__title {
	font-family: var(--font-family-base);
	font-size: var(--font-size-xl);
	font-weight: var(--font-weight-bold);
	color: var(--color-black);
	margin: 0 0 var(--spacing-md);
}

.gl-chat-placeholder__text {
	font-size: var(--font-size-base);
	color: var(--color-text-muted);
	margin: 0 0 var(--spacing-xl);
	line-height: var(--line-height-body);
}

/* ---- Responsivo shell ---- */
@media (max-width: 900px) {
	.gl-header__nav {
		flex-wrap: wrap;
		min-height: 0;
		padding: var(--spacing-md);
	}

	.gl-header__nav-left {
		width: 100%;
		flex-wrap: wrap;
	}

	.gl-header__nav-right {
		width: 100%;
		justify-content: space-between;
	}

	.gl-header__ia-btn {
		flex: 1;
	}
}

@media (max-width: 600px) {
	.gl-header__nav-divider {
		display: none;
	}

	.gl-header__nav-links {
		width: 100%;
		flex-wrap: wrap;
		gap: var(--spacing-md);
	}

	.gl-footer__bar {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--spacing-md);
	}
}

/* ---- Loader comum (spinner brand) ---- */
.gl-loader {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 24px;
	box-sizing: border-box;
}

.gl-loader__spinner {
	width: 48px;
	height: 48px;
	border: 4px solid rgba(0, 150, 143, 0.18);
	border-top-color: var(--color-brand, #00968f);
	border-radius: 50%;
	animation: gl-spin 0.8s linear infinite;
	flex-shrink: 0;
}

.gl-loader__label {
	margin: 0;
	font-family: var(--font-family-base);
	font-size: var(--font-size-sm, 14px);
	font-weight: 400;
	line-height: 1.45;
	color: var(--color-neutral-05, #565656);
	text-align: center;
}

.gl-loader--on-dark .gl-loader__spinner {
	border-color: rgba(255, 255, 255, 0.2);
	border-top-color: var(--color-brand, #00968f);
}

.gl-loader--on-dark .gl-loader__label {
	color: #fff;
}

@keyframes gl-spin {
	to {
		transform: rotate(360deg);
	}
}
