/* AJDF Cookies — banner, preferências, botão flutuante e avisos de conteúdo bloqueado */

.ajdf-cookies,
.ajdf-cookies-embed {
	--ajdf-cookies-primaria: #263037;
	--ajdf-cookies-fundo: #ffffff;
	--ajdf-cookies-texto: #1f2937;
	--ajdf-cookies-suave: #5b6770;
	--ajdf-cookies-linha: #dbe3e6;
	--ajdf-cookies-claro: #f1f5f6;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--ajdf-cookies-texto);
}

.ajdf-cookies [hidden],
.ajdf-cookies-embed iframe[data-src] {
	display: none !important;
}

.ajdf-cookies p {
	margin: 0 0 10px;
}

.ajdf-cookies a {
	color: inherit;
	text-decoration: underline;
}

/* ---------- Botões (reset para não herdar estilos do tema) ---------- */

.ajdf-cookies-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 10px 18px;
	border: 2px solid var(--ajdf-cookies-primaria);
	border-radius: 6px;
	box-shadow: none;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.ajdf-cookies-btn-primario {
	background: var(--ajdf-cookies-primaria);
	color: #ffffff;
}

.ajdf-cookies-btn-primario:hover {
	background: #000000;
	border-color: #000000;
	color: #ffffff;
}

.ajdf-cookies-btn-secundario {
	background: transparent;
	color: var(--ajdf-cookies-primaria);
}

.ajdf-cookies-btn-secundario:hover {
	background: var(--ajdf-cookies-claro);
	color: var(--ajdf-cookies-primaria);
}

.ajdf-cookies-btn:focus-visible,
.ajdf-cookies-fechar:focus-visible,
.ajdf-cookies-flutuante:focus-visible,
.ajdf-cookies-interruptor input:focus-visible + .ajdf-cookies-interruptor-visual {
	outline: 3px solid #1a73e8;
	outline-offset: 2px;
}

/* ---------- Banner ---------- */

.ajdf-cookies-banner {
	position: fixed;
	z-index: 100000;
	display: flex;
	gap: 16px 24px;
	background: var(--ajdf-cookies-fundo);
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
	box-sizing: border-box;
}

.ajdf-cookies-banner--barra {
	left: 0;
	right: 0;
	bottom: 0;
	align-items: center;
	padding: 20px max(24px, calc((100vw - 1200px) / 2));
	border-top: 4px solid var(--ajdf-cookies-primaria);
}

.ajdf-cookies-banner--caixa {
	left: 20px;
	bottom: 20px;
	width: 420px;
	max-width: calc(100vw - 40px);
	flex-direction: column;
	padding: 22px;
	border-radius: 12px;
	border-top: 4px solid var(--ajdf-cookies-primaria);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.ajdf-cookies-banner-texto {
	flex: 1 1 auto;
}

.ajdf-cookies-banner-texto p:last-child {
	margin-bottom: 0;
}

.ajdf-cookies-titulo {
	font-size: 17px;
	font-weight: 700;
	color: var(--ajdf-cookies-primaria);
}

.ajdf-cookies-banner-acoes {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	flex: 0 0 auto;
}

.ajdf-cookies-banner--caixa .ajdf-cookies-banner-acoes .ajdf-cookies-btn {
	flex: 1 1 auto;
}

/* ---------- Janela de preferências ---------- */

html.ajdf-cookies-modal-aberto {
	overflow: hidden;
}

.ajdf-cookies-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.ajdf-cookies-modal-fundo {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.ajdf-cookies-modal-caixa {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 640px;
	max-width: 100%;
	max-height: calc(100vh - 32px);
	background: var(--ajdf-cookies-fundo);
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

.ajdf-cookies-modal-caixa:focus {
	outline: none;
}

.ajdf-cookies-modal-cabecalho {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid var(--ajdf-cookies-linha);
}

.ajdf-cookies-modal-cabecalho h2 {
	margin: 0;
	font-size: 20px;
	line-height: 1.3;
	color: var(--ajdf-cookies-primaria);
}

.ajdf-cookies-fechar {
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--ajdf-cookies-texto);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.ajdf-cookies-fechar:hover {
	background: var(--ajdf-cookies-claro);
}

.ajdf-cookies-modal-corpo {
	padding: 18px 22px;
	overflow-y: auto;
}

.ajdf-cookies-categoria {
	margin: 0 0 12px;
	padding: 14px 16px;
	border: 1px solid var(--ajdf-cookies-linha);
	border-radius: 8px;
}

.ajdf-cookies-categoria-topo {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.ajdf-cookies-categoria-nome {
	font-weight: 700;
	font-size: 16px;
}

.ajdf-cookies-categoria-descricao {
	margin: 6px 0 0 !important;
	color: var(--ajdf-cookies-suave);
	font-size: 14px;
}

.ajdf-cookies-sempre {
	font-size: 13px;
	font-weight: 600;
	color: var(--ajdf-cookies-suave);
}

/* Interruptor (checkbox com role="switch") */
.ajdf-cookies-interruptor {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	cursor: pointer;
}

.ajdf-cookies-interruptor input {
	position: absolute;
	right: 0;
	width: 46px;
	height: 26px;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.ajdf-cookies-interruptor-visual {
	position: relative;
	flex: 0 0 auto;
	width: 46px;
	height: 26px;
	border-radius: 13px;
	background: #b6c0c5;
	transition: background 0.15s ease;
}

.ajdf-cookies-interruptor-visual::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #ffffff;
	transition: transform 0.15s ease;
}

.ajdf-cookies-interruptor input:checked + .ajdf-cookies-interruptor-visual {
	background: var(--ajdf-cookies-primaria);
}

.ajdf-cookies-interruptor input:checked + .ajdf-cookies-interruptor-visual::after {
	transform: translateX(20px);
}

.ajdf-cookies-interruptor input:disabled,
.ajdf-cookies-interruptor input:disabled + .ajdf-cookies-interruptor-visual {
	cursor: not-allowed;
	opacity: 0.55;
}

.ajdf-cookies-interruptor:has(input:disabled) {
	cursor: default;
}

.ajdf-cookies-detalhes {
	margin-top: 8px;
	font-size: 13px;
}

.ajdf-cookies-detalhes summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--ajdf-cookies-primaria);
}

.ajdf-cookies-detalhes ul {
	margin: 8px 0 0;
	padding-left: 18px;
}

.ajdf-cookies-detalhes li {
	margin-bottom: 4px;
}

.ajdf-cookies code {
	padding: 1px 4px;
	border-radius: 3px;
	background: var(--ajdf-cookies-claro);
	font-size: 12px;
	word-break: break-all;
}

.ajdf-cookies-id {
	margin-top: 14px !important;
	font-size: 12px;
	color: var(--ajdf-cookies-suave);
}

.ajdf-cookies-modal-rodape {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
	padding: 16px 22px;
	border-top: 1px solid var(--ajdf-cookies-linha);
	background: var(--ajdf-cookies-claro);
}

/* ---------- Botão flutuante (canto inferior esquerdo — o chatbot fica à direita) ---------- */

.ajdf-cookies-flutuante {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--ajdf-cookies-primaria);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	opacity: 0.85;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.ajdf-cookies-flutuante:hover {
	opacity: 1;
	transform: scale(1.05);
}

.ajdf-cookies-flutuante-icone {
	display: block;
	width: 22px;
	height: 22px;
	background-color: #ffffff;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M21.95 10.99c-1.79-.03-3.7-1.95-2.68-4.22-2.97 1-5.78-1.59-5.19-4.56C7.11.74 2 6.41 2 12c0 5.52 4.48 10 10 10 5.89 0 10.54-5.08 9.95-11.01zM8.5 15c-.83 0-1.5-.67-1.5-1.5S7.67 12 8.5 12s1.5.67 1.5 1.5S9.33 15 8.5 15zm2-5C9.67 10 9 9.33 9 8.5S9.67 7 10.5 7s1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm4.5 6c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z'/></svg>") center / contain no-repeat;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M21.95 10.99c-1.79-.03-3.7-1.95-2.68-4.22-2.97 1-5.78-1.59-5.19-4.56C7.11.74 2 6.41 2 12c0 5.52 4.48 10 10 10 5.89 0 10.54-5.08 9.95-11.01zM8.5 15c-.83 0-1.5-.67-1.5-1.5S7.67 12 8.5 12s1.5.67 1.5 1.5S9.33 15 8.5 15zm2-5C9.67 10 9 9.33 9 8.5S9.67 7 10.5 7s1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm4.5 6c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z'/></svg>") center / contain no-repeat;
}

.ajdf-cookies .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Conteúdo incorporado bloqueado (YouTube, Maps, …) ---------- */

.ajdf-cookies-embed {
	width: 100%;
}

.ajdf-cookies-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	padding: 24px;
	box-sizing: border-box;
	border: 1px dashed var(--ajdf-cookies-linha);
	border-radius: 8px;
	background: var(--ajdf-cookies-claro);
	text-align: center;
}

.ajdf-cookies-placeholder p {
	max-width: 480px;
	margin: 0 0 12px;
}

.ajdf-cookies-placeholder-acoes {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin: 0 !important;
}

.ajdf-cookies-placeholder a {
	color: var(--ajdf-cookies-primaria);
	font-size: 14px;
}

/* ---------- Shortcodes ---------- */

.ajdf-cookies-link-preferencias {
	margin: 0;
	padding: 0;
	border: none;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.ajdf-cookies-tabela {
	width: 100%;
	margin-bottom: 24px;
	border-collapse: collapse;
	font-size: 14px;
}

.ajdf-cookies-tabela th,
.ajdf-cookies-tabela td {
	padding: 8px 10px;
	border: 1px solid #dbe3e6;
	text-align: left;
	vertical-align: top;
}

.ajdf-cookies-tabela th {
	background: #f1f5f6;
}

/* ---------- Responsivo ---------- */

@media (max-width: 782px) {
	.ajdf-cookies-banner--barra {
		flex-direction: column;
		align-items: stretch;
		padding: 18px 16px;
	}

	.ajdf-cookies-banner-acoes .ajdf-cookies-btn {
		flex: 1 1 auto;
	}

	.ajdf-cookies-banner--caixa {
		left: 10px;
		bottom: 10px;
		max-width: calc(100vw - 20px);
	}

	.ajdf-cookies-modal-rodape .ajdf-cookies-btn {
		flex: 1 1 100%;
	}

	.ajdf-cookies-tabela thead {
		display: none;
	}

	.ajdf-cookies-tabela td {
		display: block;
		border-top: none;
	}

	.ajdf-cookies-tabela tr td:first-child {
		border-top: 1px solid #dbe3e6;
		background: #f1f5f6;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ajdf-cookies *,
	.ajdf-cookies-flutuante {
		transition: none !important;
	}
}
