/*
 * Imobiliator Demo Studio — aparência do painel.
 * Visual PRÓPRIO e fixo (tokens --imbds-*): o painel nunca usa as variáveis do Imobiliator, então não muda de
 * cor quando o visitante troca a cor do site. Escopado em .imbds; botões e campos têm reset explícito porque
 * temas (Hello Elementor etc.) estilizam button/input com especificidade que vence uma classe solta.
 */
.imbds,
.imbds *,
.imbds *::before,
.imbds *::after {
	box-sizing: border-box;
}

.imbds {
	--imbds-ink: #0f172a;
	--imbds-muted: #475569;
	--imbds-line: #e2e8f0;
	--imbds-fundo: #fff;
	--imbds-foco: #2563eb;
	font: 400 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	color: var(--imbds-ink);
}

/* ---- aba (fechado) ---- */
.imbds button.imbds__aba {
	all: unset;
	box-sizing: border-box;
	position: fixed;
	z-index: 2147483000;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 14px 10px;
	background: var(--imbds-ink);
	color: #fff;
	border-radius: 12px 0 0 12px;
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.28);
	cursor: pointer;
	font: 600 13px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	transition: padding 0.15s ease;
}

.imbds button.imbds__aba span {
	writing-mode: vertical-rl;
	letter-spacing: 0.02em;
}

.imbds button.imbds__aba:hover,
.imbds button.imbds__aba:focus {
	background: var(--imbds-ink);
	color: #fff;
	padding-right: 14px;
}

.imbds.is-open button.imbds__aba {
	display: none;
}

/* ---- painel ---- */
.imbds .imbds__painel {
	position: fixed;
	z-index: 2147483000;
	right: 16px;
	top: 50%;
	width: 320px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 16px;
	background: var(--imbds-fundo);
	color: var(--imbds-ink);
	border-radius: 16px;
	box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.06);
	opacity: 0;
	visibility: hidden;
	transform: translate(24px, -50%);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

.imbds.is-open .imbds__painel {
	opacity: 1;
	visibility: visible;
	transform: translate(0, -50%);
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.imbds .imbds__cabecalho {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.imbds h2.imbds__titulo {
	margin: 0;
	padding: 0;
	font: 700 16px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--imbds-ink);
	letter-spacing: normal;
	text-transform: none;
}

.imbds button.imbds__fechar {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	color: var(--imbds-muted);
	cursor: pointer;
}

.imbds button.imbds__fechar:hover,
.imbds button.imbds__fechar:focus {
	background: var(--imbds-line);
	color: var(--imbds-ink);
}

.imbds p.imbds__intro {
	margin: 4px 0 14px;
	padding: 0;
	color: var(--imbds-muted);
	font-size: 13px;
}

.imbds .imbds__grupo {
	padding: 14px 0;
	border-top: 1px solid var(--imbds-line);
}

.imbds .imbds__rotulo {
	font-weight: 600;
	font-size: 14px;
}

.imbds .imbds__dica {
	margin: 2px 0 10px;
	color: var(--imbds-muted);
	font-size: 12px;
}

.imbds .imbds__amostras {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}

.imbds button.imbds__amostra {
	all: unset;
	box-sizing: border-box;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--c);
	box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
	cursor: pointer;
	transition: transform 0.12s ease;
}

.imbds button.imbds__amostra:hover,
.imbds button.imbds__amostra:focus {
	background: var(--c);
	transform: scale(1.1);
}

.imbds button.imbds__amostra[aria-pressed="true"] {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--imbds-ink);
}

/* bolinha "Acompanhar" (pino do mapa): mostra a cor que ele está seguindo, com um anel tracejado */
.imbds button.imbds__amostra--auto {
	box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3.5px rgba(15, 23, 42, 0.7);
}

.imbds button.imbds__amostra--auto[aria-pressed="true"] {
	box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3.5px rgba(15, 23, 42, 0.7), 0 0 0 2px #fff, 0 0 0 4px var(--imbds-ink);
}

.imbds .imbds__linha {
	display: flex;
	align-items: center;
	gap: 10px;
}

.imbds input.imbds__cor {
	appearance: none;
	-webkit-appearance: none;
	width: 40px;
	height: 36px;
	margin: 0;
	padding: 2px;
	background: #fff;
	border: 1px solid var(--imbds-line);
	border-radius: 8px;
	cursor: pointer;
}

.imbds input.imbds__cor::-webkit-color-swatch-wrapper {
	padding: 0;
}

.imbds input.imbds__cor::-webkit-color-swatch {
	border: 0;
	border-radius: 5px;
}

.imbds input.imbds__cor::-moz-color-swatch {
	border: 0;
	border-radius: 5px;
}

.imbds input.imbds__hex {
	appearance: none;
	-webkit-appearance: none;
	width: 100px;
	height: 36px;
	margin: 0;
	padding: 0 10px;
	background: #fff;
	color: var(--imbds-ink);
	border: 1px solid var(--imbds-line);
	border-radius: 8px;
	box-shadow: none;
	font: 500 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	text-transform: uppercase;
}

.imbds input.imbds__hex[aria-invalid="true"] {
	border-color: #dc2626;
}

/* aviso de contraste (cor de texto clara demais sobre o branco) */
.imbds .imbds__aviso {
	margin: 8px 0 0;
	color: #b91c1c;
	font-size: 12px;
	line-height: 1.4;
}

.imbds .imbds__aviso[hidden] {
	display: none;
}

/* ---- cantos arredondados: controle segmentado ---- */
.imbds .imbds__sub {
	margin: 12px 0 6px;
	font-weight: 600;
	font-size: 12px;
	color: var(--imbds-muted);
}

/* ---- estilos prontos: cada botão mostra o par principal + ação ---- */
.imbds .imbds__estilos {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}

.imbds button.imbds__estilo {
	all: unset;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	padding: 9px 10px;
	border: 1px solid var(--imbds-line);
	border-radius: 10px;
	background: #fff;
	color: var(--imbds-ink);
	font: 600 13px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	cursor: pointer;
}

/* número ímpar de estilos: o último ocupa a linha toda em vez de ficar sozinho num canto */
.imbds button.imbds__estilo:last-child:nth-child(odd) {
	grid-column: 1 / -1;
}

.imbds button.imbds__estilo:hover,
.imbds button.imbds__estilo:focus {
	background: #f1f5f9;
	color: var(--imbds-ink);
}

.imbds button.imbds__estilo[aria-pressed="true"],
.imbds button.imbds__estilo[aria-pressed="true"]:hover,
.imbds button.imbds__estilo[aria-pressed="true"]:focus {
	background: var(--imbds-ink);
	border-color: var(--imbds-ink);
	color: #fff;
}

/* duas bolinhas sobrepostas: a principal atrás, a ação na frente */
.imbds .imbds__pontos {
	position: relative;
	flex: 0 0 auto;
	width: 30px;
	height: 20px;
}

.imbds .imbds__ponto {
	position: absolute;
	top: 0;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	box-shadow: 0 0 0 2px #fff, inset 0 0 0 1px rgba(15, 23, 42, 0.2);
}

.imbds .imbds__ponto--a {
	left: 0;
	background: var(--a);
}

.imbds .imbds__ponto--b {
	left: 10px;
	background: var(--b);
}

.imbds .imbds__estilo-nome {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.imbds .imbds__opcoes {
	display: flex;
	gap: 6px;
}

.imbds button.imbds__opcao {
	all: unset;
	box-sizing: border-box;
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 8px 2px 7px;
	border: 1px solid var(--imbds-line);
	border-radius: 8px;
	background: #fff;
	color: var(--imbds-ink);
	font: 600 11px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	text-align: center;
	cursor: pointer;
}

.imbds button.imbds__opcao:hover,
.imbds button.imbds__opcao:focus {
	background: #f1f5f9;
	color: var(--imbds-ink);
}

.imbds button.imbds__opcao[aria-pressed="true"],
.imbds button.imbds__opcao[aria-pressed="true"]:hover,
.imbds button.imbds__opcao[aria-pressed="true"]:focus {
	background: var(--imbds-ink);
	border-color: var(--imbds-ink);
	color: #fff;
}

/* o desenho de cada opção é o próprio canto: um quadrado com o raio da opção (pílula vira círculo) */
.imbds .imbds__canto {
	display: block;
	width: 20px;
	height: 20px;
	border: 2px solid currentColor;
	border-radius: min(var(--r), 10px);
}

/* Rodapé fixo no fim do painel (que rola): "Quero assim" sempre à vista. As margens negativas cancelam o padding de 16px do painel. */
.imbds .imbds__rodape {
	position: sticky;
	bottom: -16px;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0 -16px -16px;
	padding: 12px 16px 16px;
	background: var(--imbds-fundo);
	border-top: 1px solid var(--imbds-line);
	box-shadow: 0 -8px 12px -8px rgba(15, 23, 42, 0.12);
}

.imbds .imbds__rodape-linha {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

/* o "Quero assim" é um link para o WhatsApp: verde reconhecível, texto escuro (8:1) */
.imbds a.imbds__quero {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 16px;
	border-radius: 10px;
	background: #25d366;
	color: #0f172a;
	font: 700 15px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	text-decoration: none;
	box-shadow: none;
	cursor: pointer;
}

.imbds a.imbds__quero:hover,
.imbds a.imbds__quero:focus {
	background: #1ebe58;
	color: #0f172a;
	text-decoration: none;
}

.imbds a.imbds__quero svg {
	flex: 0 0 auto;
}

/* texto só para leitor de tela */
.imbds .imbds__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.imbds button.imbds__restaurar {
	all: unset;
	box-sizing: border-box;
	padding: 8px 12px;
	border: 1px solid var(--imbds-line);
	border-radius: 8px;
	background: #fff;
	color: var(--imbds-ink);
	font: 600 13px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	cursor: pointer;
	white-space: nowrap;
}

.imbds button.imbds__restaurar:hover,
.imbds button.imbds__restaurar:focus {
	background: var(--imbds-line);
	color: var(--imbds-ink);
}

.imbds button.imbds__restaurar:disabled {
	opacity: 0.45;
	cursor: default;
	background: #fff;
}

.imbds .imbds__nota {
	color: var(--imbds-muted);
	font-size: 11px;
	text-align: right;
}

/* ---- foco visível em tudo que é do painel ---- */
.imbds button:focus-visible,
.imbds a:focus-visible,
.imbds input:focus-visible {
	outline: 2px solid var(--imbds-foco);
	outline-offset: 2px;
}

/* ---- celular: aba vira pílula no canto e o painel sobe como gaveta ---- */
@media (max-width: 640px) {
	.imbds button.imbds__aba {
		right: auto;
		left: 12px;
		top: auto;
		bottom: var(--imbds-base, 12px);
		transform: none;
		flex-direction: row;
		padding: 12px 16px;
		border-radius: 999px;
	}

	.imbds button.imbds__aba span {
		writing-mode: horizontal-tb;
	}

	.imbds button.imbds__aba:hover,
	.imbds button.imbds__aba:focus {
		padding: 12px 16px;
	}

	.imbds .imbds__painel {
		left: 0;
		right: 0;
		top: auto;
		bottom: 0;
		width: 100%;
		max-height: 52vh; /* deixa o site visível acima da gaveta: o visitante precisa ver a mudança acontecendo */
		border-radius: 16px 16px 0 0;
		transform: translateY(24px);
	}

	.imbds.is-open .imbds__painel {
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.imbds .imbds__painel,
	.imbds.is-open .imbds__painel,
	.imbds button.imbds__aba,
	.imbds button.imbds__amostra {
		transition: none;
	}
}
