/*
 * GTW LGPD — aviso de cookies.
 * Tudo dentro de .gtw-lgpd, com seletores fortes o bastante para o CSS do tema
 * (que costuma estilizar button, h2, label e input) não desmontar o aviso.
 * "Aceitar" e "Rejeitar" têm o mesmo peso visual: o Guia da ANPD condena dar
 * destaque só ao aceite.
 */
.gtw-lgpd {
	--gtw-lgpd-cor: #1f2937;
	--gtw-lgpd-cor-texto: #ffffff;
	--gtw-lgpd-fundo: #ffffff;
	--gtw-lgpd-texto: #1f2937;
	--gtw-lgpd-suave: #4b5563;
	--gtw-lgpd-borda: #e5e7eb;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--gtw-lgpd-texto);
}
.gtw-lgpd [hidden] { display: none !important; }
.gtw-lgpd *, .gtw-lgpd *::before, .gtw-lgpd *::after { box-sizing: border-box; }

/* ---------- aviso (primeiro nível) ---------- */
.gtw-lgpd .gtw-lgpd__aviso {
	position: fixed;
	z-index: 2147483000;
	bottom: 16px;
	left: 16px;
	width: 380px;
	max-width: calc(100vw - 32px);
	margin: 0;
	padding: 18px 18px 16px;
	background: var(--gtw-lgpd-fundo);
	color: var(--gtw-lgpd-texto);
	border: 1px solid var(--gtw-lgpd-borda);
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
	animation: gtw-lgpd-entra .25s ease-out;
}
.gtw-lgpd--direita .gtw-lgpd__aviso { left: auto; right: 16px; }
.gtw-lgpd--barra .gtw-lgpd__aviso {
	left: 0; right: 0; bottom: 0; width: auto; max-width: none;
	border-radius: 0; border-width: 1px 0 0;
	display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
	padding: 14px max(16px, calc((100vw - 1200px) / 2));
}
.gtw-lgpd--barra .gtw-lgpd__titulo { display: none; }
.gtw-lgpd--barra .gtw-lgpd__texto { flex: 1 1 420px; margin: 0; }
.gtw-lgpd--barra .gtw-lgpd__botoes { flex: 0 0 auto; margin: 0; }

@keyframes gtw-lgpd-entra { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gtw-lgpd .gtw-lgpd__aviso { animation: none; } }

.gtw-lgpd p.gtw-lgpd__titulo {
	margin: 0 0 6px; padding: 0;
	font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--gtw-lgpd-texto);
}
.gtw-lgpd p.gtw-lgpd__texto { margin: 0 0 14px; padding: 0; font-size: 13.5px; color: var(--gtw-lgpd-suave); }
.gtw-lgpd a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.gtw-lgpd a:hover { color: var(--gtw-lgpd-texto); }

/* ---------- botões ---------- */
.gtw-lgpd .gtw-lgpd__botoes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.gtw-lgpd .gtw-lgpd__aviso .gtw-lgpd__botoes > .gtw-lgpd__btn:not(.gtw-lgpd__btn--linha) { flex: 1 1 0; }
.gtw-lgpd--barra .gtw-lgpd__aviso .gtw-lgpd__botoes > .gtw-lgpd__btn:not(.gtw-lgpd__btn--linha) { flex: 0 0 auto; }
.gtw-lgpd .gtw-lgpd__aviso .gtw-lgpd__btn--linha { flex: 1 1 100%; }
.gtw-lgpd--barra .gtw-lgpd__aviso .gtw-lgpd__btn--linha { flex: 0 0 auto; }

.gtw-lgpd button.gtw-lgpd__btn {
	all: unset;
	box-sizing: border-box;
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid var(--gtw-lgpd-cor);
	border-radius: 8px;
	background: var(--gtw-lgpd-cor);
	color: var(--gtw-lgpd-cor-texto);
	font: 600 14px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	text-align: center;
	cursor: pointer;
	transition: filter .15s;
}
.gtw-lgpd button.gtw-lgpd__btn:hover { filter: brightness(1.15); }
.gtw-lgpd button.gtw-lgpd__btn--linha { background: transparent; color: var(--gtw-lgpd-texto); border-color: #9ca3af; }
.gtw-lgpd button.gtw-lgpd__btn--linha:hover { filter: none; background: #f3f4f6; }
.gtw-lgpd button:focus-visible,
.gtw-lgpd a:focus-visible,
.gtw-lgpd input:focus-visible + span {
	outline: 3px solid #2563eb;
	outline-offset: 2px;
}

/* ---------- janela de preferências (segundo nível) ---------- */
.gtw-lgpd .gtw-lgpd__fundo {
	position: fixed; inset: 0; z-index: 2147483001;
	background: rgba(17, 24, 39, .55);
}
.gtw-lgpd .gtw-lgpd__janela {
	position: fixed; z-index: 2147483002;
	top: 50%; left: 50%; transform: translate(-50%, -50%);
	width: 560px; max-width: calc(100vw - 24px);
	max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
	display: flex; flex-direction: column;
	background: var(--gtw-lgpd-fundo);
	border-radius: 14px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
	outline: none;
}
.gtw-lgpd .gtw-lgpd__janela-topo {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 16px 20px; border-bottom: 1px solid var(--gtw-lgpd-borda);
}
.gtw-lgpd h2.gtw-lgpd__janela-titulo {
	margin: 0; padding: 0; font-size: 18px; font-weight: 700; line-height: 1.3;
	color: var(--gtw-lgpd-texto); font-family: inherit; text-transform: none; letter-spacing: 0;
}
.gtw-lgpd button.gtw-lgpd__fechar {
	all: unset; cursor: pointer; width: 36px; height: 36px; border-radius: 8px;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 26px; line-height: 1; color: var(--gtw-lgpd-suave);
}
.gtw-lgpd button.gtw-lgpd__fechar:hover { background: #f3f4f6; }
.gtw-lgpd .gtw-lgpd__janela-corpo { padding: 16px 20px; overflow-y: auto; }
.gtw-lgpd .gtw-lgpd__janela-corpo > p { margin: 0 0 14px; color: var(--gtw-lgpd-suave); }
.gtw-lgpd .gtw-lgpd__categoria { padding: 12px 0; border-top: 1px solid var(--gtw-lgpd-borda); }
.gtw-lgpd .gtw-lgpd__categoria-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gtw-lgpd label.gtw-lgpd__categoria-nome { margin: 0; font-weight: 700; font-size: 15px; color: var(--gtw-lgpd-texto); cursor: pointer; }
.gtw-lgpd p.gtw-lgpd__categoria-desc { margin: 4px 0 0; font-size: 13.5px; color: var(--gtw-lgpd-suave); }
.gtw-lgpd .gtw-lgpd__sempre { font-size: 12.5px; font-weight: 600; color: #047857; }
.gtw-lgpd p.gtw-lgpd__links-janela { margin: 8px 0 0; padding-top: 12px; border-top: 1px solid var(--gtw-lgpd-borda); font-size: 13px; color: var(--gtw-lgpd-suave); }
.gtw-lgpd .gtw-lgpd__codigo { font-size: 11.5px; word-break: break-all; }
.gtw-lgpd .gtw-lgpd__botoes--janela { padding: 14px 20px; border-top: 1px solid var(--gtw-lgpd-borda); }
.gtw-lgpd .gtw-lgpd__botoes--janela > .gtw-lgpd__btn { flex: 1 1 150px; }

/* chave liga/desliga */
.gtw-lgpd .gtw-lgpd__chave { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.gtw-lgpd .gtw-lgpd__chave input {
	position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1;
}
.gtw-lgpd .gtw-lgpd__chave span {
	position: absolute; inset: 0; border-radius: 24px; background: #9ca3af; transition: background .15s;
}
.gtw-lgpd .gtw-lgpd__chave span::after {
	content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
	border-radius: 50%; background: #fff; transition: transform .15s;
}
.gtw-lgpd .gtw-lgpd__chave input:checked + span { background: var(--gtw-lgpd-cor); }
.gtw-lgpd .gtw-lgpd__chave input:checked + span::after { transform: translateX(20px); }

/* ---------- botão flutuante (mudar a escolha depois) ---------- */
.gtw-lgpd button.gtw-lgpd__flutuante {
	all: unset; box-sizing: border-box;
	position: fixed; z-index: 2147482999; bottom: 16px; left: 16px;
	width: 44px; height: 44px; border-radius: 50%;
	display: none; align-items: center; justify-content: center;
	background: var(--gtw-lgpd-fundo); color: var(--gtw-lgpd-cor);
	border: 1px solid var(--gtw-lgpd-borda);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
	cursor: pointer; opacity: .85; transition: opacity .15s, transform .15s;
}
.gtw-lgpd--direita button.gtw-lgpd__flutuante { left: auto; right: 16px; }
.gtw-lgpd button.gtw-lgpd__flutuante:hover { opacity: 1; transform: scale(1.06); }
html.gtw-lgpd-escolheu .gtw-lgpd button.gtw-lgpd__flutuante { display: inline-flex; }

/* ---------- celular ---------- */
@media (max-width: 600px) {
	.gtw-lgpd .gtw-lgpd__aviso { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; padding: 16px; }
	.gtw-lgpd--barra .gtw-lgpd__aviso { left: 0; right: 0; bottom: 0; padding: 14px 16px; }
	.gtw-lgpd--barra .gtw-lgpd__texto { flex-basis: 100%; }
	.gtw-lgpd--barra .gtw-lgpd__botoes { flex: 1 1 100%; }
	.gtw-lgpd--barra .gtw-lgpd__aviso .gtw-lgpd__botoes > .gtw-lgpd__btn { flex: 1 1 0; }
	.gtw-lgpd .gtw-lgpd__janela { top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-width: none; border-radius: 14px 14px 0 0; }
	.gtw-lgpd button.gtw-lgpd__flutuante { width: 40px; height: 40px; bottom: 12px; left: 12px; }
}

html.gtw-lgpd-janela-aberta { overflow: hidden; }

/* ---------- fora do aviso ---------- */
.gtw-lgpd-rodape { padding: 12px 16px; text-align: center; font-size: 13px; }
.gtw-lgpd-rodape a { color: inherit; }
p.gtw-lgpd-aviso-form { font-size: .85em; opacity: .85; margin: .5em 0; }

@media print { .gtw-lgpd { display: none !important; } }
