/* =============================================================================
   ElementorPlus — Cookie Consent (Banner de Consentimento LGPD/GDPR)
   Banner fixo com título, texto e botões (Aceitar tudo / Rejeitar / Preferências)
   e um modal de preferências com categorias de cookies (toggles).
   Layout controlado por variáveis CSS (sem !important desnecessário) e escopado
   em .epcc-consent para não vazar para o resto da página.
   ============================================================================= */

.epcc-consent {
	--epcc-bg: #10141c;
	--epcc-surface-2: #171d28;
	--epcc-text: #ffffff;
	--epcc-muted: #9aa4b2;
	--epcc-accent: #2563eb;
	--epcc-accent-hover: #1d4ed8;
	--epcc-border: rgba(255, 255, 255, 0.1);
	--epcc-radius: 14px;
	--epcc-max-width: 1100px;
	--epcc-gap: 18px;
	box-sizing: border-box;
	color: var(--epcc-text);
	font-size: 15px;
	line-height: 1.5;
}

.epcc-consent *,
.epcc-consent *::before,
.epcc-consent *::after {
	box-sizing: border-box;
}

/* No editor do Elementor, o widget mostra uma prévia estática (não fixa) para
   ser possível estilizar sem o banner "fugir" ao rodapé. */
.epcc-consent--editor .epcc-bar {
	position: static;
	margin: 0 auto;
	transform: none;
	opacity: 1;
	visibility: visible;
}

/* ── Barra do banner ─────────────────────────────────────────────────────────── */
.epcc-bar {
	position: fixed;
	left: 50%;
	z-index: 99990;
	width: calc(100% - 40px);
	max-width: var(--epcc-max-width);
	padding: 20px 24px;
	background: var(--epcc-bg);
	border: 1px solid var(--epcc-border);
	border-radius: var(--epcc-radius);
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
	transform: translateX(-50%);
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

/* Posição vertical (controlável): baixo (padrão) ou topo. */
.epcc-consent--bottom .epcc-bar { bottom: 20px; }
.epcc-consent--top .epcc-bar    { top: 20px; }

/* Estado inicial escondido: some sem ocupar clique. Só aparece via .is-open. */
.epcc-consent:not(.is-open):not(.epcc-consent--editor) .epcc-bar {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}
.epcc-consent--bottom:not(.is-open):not(.epcc-consent--editor) .epcc-bar {
	transform: translateX(-50%) translateY(20px);
}
.epcc-consent--top:not(.is-open):not(.epcc-consent--editor) .epcc-bar {
	transform: translateX(-50%) translateY(-20px);
}

.epcc-bar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--epcc-gap);
	flex-wrap: wrap;
}

.epcc-bar-text {
	flex: 1 1 320px;
	min-width: 0;
}

.epcc-title {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.25;
	color: var(--epcc-text);
}

.epcc-desc {
	margin: 0;
	font-size: 14px;
	color: var(--epcc-muted);
	line-height: 1.5;
}

.epcc-desc a {
	color: var(--epcc-accent);
	text-decoration: underline;
}
.epcc-desc a:hover { color: var(--epcc-accent-hover); }

/* ── Botões ──────────────────────────────────────────────────────────────────── */
.epcc-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	flex: 0 0 auto;
}

.epcc-consent .epcc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 20px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--epcc-text);
	background: transparent;
	border: 1px solid var(--epcc-border);
	border-radius: 10px;
	cursor: pointer;
	text-decoration: none;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.epcc-consent .epcc-btn:focus-visible {
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.5);
}

/* Secundário (Rejeitar / Preferências): contorno neutro. */
.epcc-consent .epcc-btn--secondary:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.3);
	color: var(--epcc-text);
}

/* Primário (Aceitar tudo): cor de destaque preenchida. */
.epcc-consent .epcc-btn--primary {
	background: var(--epcc-accent);
	border-color: var(--epcc-accent);
	color: #fff;
}
.epcc-consent .epcc-btn--primary:hover {
	background: var(--epcc-accent-hover);
	border-color: var(--epcc-accent-hover);
	color: #fff;
}

/* Link discreto (variante de texto puro, sem moldura). */
.epcc-consent .epcc-btn--link {
	padding: 11px 8px;
	border-color: transparent;
	color: var(--epcc-muted);
}
.epcc-consent .epcc-btn--link:hover {
	color: var(--epcc-text);
	background: transparent;
}

/* ── Overlay + Modal de preferências ─────────────────────────────────────────── */
.epcc-overlay {
	position: fixed;
	inset: 0;
	z-index: 99991;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(3, 5, 9, 0.72);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}
.epcc-consent.is-prefs-open .epcc-overlay {
	opacity: 1;
	visibility: visible;
}

/* No editor, o modal não aparece por cima de tudo (evita cobrir a tela toda). */
.epcc-consent--editor .epcc-overlay { position: static; display: none; }

.epcc-modal {
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	background: var(--epcc-bg);
	border: 1px solid var(--epcc-border);
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
	transform: translateY(12px) scale(0.98);
	transition: transform 0.25s ease;
	overflow: hidden;
}
.epcc-consent.is-prefs-open .epcc-modal {
	transform: translateY(0) scale(1);
}

.epcc-modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 22px 24px 14px;
	border-bottom: 1px solid var(--epcc-border);
}

.epcc-modal-title {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.25;
	color: var(--epcc-text);
}

.epcc-modal-close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 50%;
	color: var(--epcc-muted);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color 0.18s ease, color 0.18s ease;
}
.epcc-modal-close:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--epcc-text);
}
.epcc-modal-close svg { width: 18px; height: 18px; display: block; }

.epcc-modal-body {
	padding: 18px 24px;
	overflow-y: auto;
}

.epcc-modal-intro {
	margin: 0 0 18px;
	font-size: 14px;
	color: var(--epcc-muted);
	line-height: 1.55;
}

/* ── Categorias de cookies (linhas com toggle) ───────────────────────────────── */
.epcc-cat {
	padding: 16px 0;
	border-bottom: 1px solid var(--epcc-border);
}
.epcc-cat:first-of-type { padding-top: 0; }
.epcc-cat:last-of-type { border-bottom: none; }

.epcc-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.epcc-cat-name {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--epcc-text);
	line-height: 1.3;
}

.epcc-cat-desc {
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--epcc-muted);
	line-height: 1.5;
}

/* Toggle acessível (checkbox estilizado como switch) */
.epcc-switch {
	position: relative;
	flex: 0 0 auto;
	display: inline-block;
	width: 46px;
	height: 26px;
}
.epcc-switch input {
	position: absolute;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}
.epcc-switch-track {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	transition: background-color 0.2s ease;
	pointer-events: none;
}
.epcc-switch-track::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s ease;
}
.epcc-switch input:checked + .epcc-switch-track {
	background: var(--epcc-accent);
}
.epcc-switch input:checked + .epcc-switch-track::before {
	transform: translateX(20px);
}
.epcc-switch input:focus-visible + .epcc-switch-track {
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.5);
}
/* Categoria obrigatória (Necessários): trava ligado e some o cursor de clique. */
.epcc-switch input:disabled {
	cursor: not-allowed;
}
.epcc-switch input:disabled + .epcc-switch-track {
	background: var(--epcc-accent);
	opacity: 0.55;
}

.epcc-cat-required {
	font-size: 12px;
	font-weight: 700;
	color: var(--epcc-accent);
	white-space: nowrap;
}

.epcc-modal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	flex-wrap: wrap;
	padding: 16px 24px 22px;
	border-top: 1px solid var(--epcc-border);
}

/* ── Botão flutuante para reabrir as preferências depois de decidir ──────────── */
.epcc-reopen {
	position: fixed;
	bottom: 18px;
	left: 18px;
	z-index: 99989;
	display: none; /* JS mostra depois do consentimento, se habilitado */
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	background: var(--epcc-bg);
	border: 1px solid var(--epcc-border);
	border-radius: 50%;
	color: var(--epcc-text);
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
	-webkit-appearance: none;
	appearance: none;
	transition: transform 0.15s ease, background-color 0.18s ease;
}
.epcc-reopen:hover {
	transform: scale(1.06);
	background: var(--epcc-surface-2);
}
.epcc-reopen svg { width: 22px; height: 22px; display: block; }
.epcc-consent.is-decided.epcc-consent--show-reopen .epcc-reopen {
	display: inline-flex;
}
.epcc-consent--editor .epcc-reopen { position: static; display: none; }

/* ── Modo obrigatório (só "Aceitar", banner persiste na tela) ────────────────── */
/* O banner NÃO bloqueia a página: o visitante pode navegar normalmente. A única
   diferença para o modo normal é que só há o botão "Aceitar" e o aviso continua
   visível até que ele aceite (não some ao rejeitar, pois não há rejeitar). */
.epcc-consent--force .epcc-actions {
	justify-content: flex-end;
}

/* ── Aviso (editor) ──────────────────────────────────────────────────────────── */
.epcc-notice {
	padding: 16px 20px;
	border: 1px dashed rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.03);
	color: #666;
	font-size: 14px;
}

/* ── Responsivo ──────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
	.epcc-bar {
		width: calc(100% - 20px);
		padding: 14px 16px;
	}
	.epcc-consent--bottom .epcc-bar { bottom: 10px; }
	.epcc-consent--top .epcc-bar    { top: 10px; }

	/* Banner compacto: coluna com espaçamento pequeno para ocupar o mínimo. */
	.epcc-bar-inner {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}
	/* Em coluna, o flex-basis:320px do desktop vira ALTURA base de 320px e
	   criava um vão preto enorme entre o texto e os botões. Aqui o texto volta
	   a ocupar só a altura do seu conteúdo. */
	.epcc-bar-text {
		flex: 0 0 auto;
	}
	.epcc-title {
		font-size: 15px;
		margin-bottom: 4px;
	}
	.epcc-desc {
		font-size: 13px;
		line-height: 1.4;
	}

	.epcc-actions {
		width: 100%;
		gap: 8px;
	}
	/* Botões ocupam a linha inteira e empilham no celular. */
	.epcc-consent .epcc-btn {
		flex: 1 1 100%;
		justify-content: center;
		padding: 10px 16px;
	}

	.epcc-modal-footer .epcc-btn { flex: 1 1 100%; }

	/* ---- Modal de preferências no mobile ----
	   O overlay centralizava o modal (align-items: center). Quando o modal é
	   mais curto que a tela, sobrava um vão escuro ENTRE o topo da tela e o
	   modal — era esse o "espaço vazio antes das categorias". Aqui colamos o
	   modal no topo e reduzimos os paddings para o conteúdo começar logo. */
	.epcc-overlay {
		align-items: flex-start;
		padding: 12px;
	}
	.epcc-modal {
		max-height: calc(100vh - 24px);
	}
	.epcc-modal-header {
		padding: 16px 18px 12px;
	}
	.epcc-modal-body {
		padding: 14px 18px;
	}
	.epcc-modal-intro {
		margin-bottom: 12px;
	}
	.epcc-modal-footer {
		padding: 12px 18px 16px;
	}
}

/* Acessibilidade: respeita quem prefere menos animação */
@media (prefers-reduced-motion: reduce) {
	.epcc-bar,
	.epcc-overlay,
	.epcc-modal,
	.epcc-btn,
	.epcc-switch-track,
	.epcc-switch-track::before,
	.epcc-reopen {
		transition: none;
	}
}
