/**
 * Widget global da Calculadora de Altura Animalart.
 *
 * O namespace é independente do conteúdo editorial da página /altura-correta/
 * para que o modal possa ser aberto pelo header em qualquer rota.
 */

body.animalart-height-calculator-open {
	overflow: hidden;
}

.animalart-height-calculator[hidden] {
	display: none !important;
}

.animalart-height-calculator.animalart-height-calculator--modal {
	position: fixed;
	z-index: 10000;
	inset: 0;
	display: grid;
	box-sizing: border-box;
	width: 100%;
	height: 100dvh;
	min-height: 100dvh;
	margin: 0 !important;
	align-items: center;
	justify-items: center;
	padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	color: var(--animalart-ink, #171717);
	font-family: var(--animalart-font-body, 'Brandon Grotesque', Arial, sans-serif);
	isolation: isolate;
}

.animalart-height-calculator__backdrop {
	position: absolute;
	z-index: 0;
	inset: 0;
	width: 100%;
	height: 100%;
	background: rgba(23, 23, 23, 0.48);
	cursor: pointer;
}

.animalart-height-calculator__dialog {
	position: relative;
	z-index: 1;
	width: min(1330px, calc(100vw - 32px));
	max-height: calc(100dvh - 32px);
	overflow: auto;
	box-sizing: border-box;
	padding: clamp(1.5rem, 3vw, 2.75rem) clamp(1rem, 3.2vw, 3.5rem) clamp(1.5rem, 3vw, 2.75rem);
	background: #fff;
	border: 2px solid #171717;
	border-radius: 28px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
}

.animalart-height-calculator__header {
	position: static;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	justify-items: center;
	margin: 0;
	padding: 0 3.25rem;
	text-align: center;
}

.animalart-height-calculator__header h2 {
	grid-column: 2;
	margin: 0;
	color: var(--animalart-ink, #171717);
	font-family: var(--animalart-font-display, 'Brandon Grotesque', Arial, sans-serif);
	font-size: clamp(1.35rem, 2.4vw, 2rem);
	font-weight: 900;
	line-height: 1.1;
	text-align: center;
	text-transform: uppercase;
}

.animalart-height-calculator__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 2;
	display: inline-grid;
	width: 44px;
	height: 44px;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--animalart-ink, #171717);
	font-size: 1.8rem;
	font-weight: 300;
	line-height: 1;
	transform: none;
	cursor: pointer;
}

.animalart-height-calculator__close:hover {
	background: var(--animalart-surface-muted, #f4f4f4);
}

.animalart-height-calculator__description {
	max-width: 860px;
	margin: 1rem auto 1.5rem;
	color: var(--animalart-ink, #171717);
	font-size: 0.78rem;
	line-height: 1.45;
	text-align: center;
}

.animalart-height-calculator__columns {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1rem, 2.2vw, 2rem);
}

.animalart-height-calculator__panel {
	min-width: 0;
	text-align: center;
}

.animalart-height-calculator__panel h3 {
	margin: 0 0 0.6rem;
	color: var(--animalart-ink, #171717);
	font-family: var(--animalart-font-display, 'Brandon Grotesque', Arial, sans-serif);
	font-size: clamp(1.1rem, 1.8vw, 1.45rem);
	font-weight: 900;
	line-height: 1.1;
	text-transform: uppercase;
}

.animalart-height-calculator__illustration {
	margin: 0;
	border: 1px solid #e2e2e2;
	background: #fff;
}

.animalart-height-calculator__illustration img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1080 / 1025;
	object-fit: contain;
}

.animalart-height-calculator__field-label {
	display: block;
	margin: 0.85rem 0 0.45rem;
	color: var(--animalart-ink, #171717);
	font-family: var(--animalart-font-display, 'Brandon Grotesque', Arial, sans-serif);
	font-size: 0.62rem;
	font-weight: 900;
	line-height: 1.2;
	text-transform: uppercase;
}

.animalart-height-calculator__select,
.animalart-height-calculator__measurement {
	box-sizing: border-box;
	width: 100%;
	min-height: 40px;
	padding: 0.5rem 0.7rem;
	border: 1px solid #d8d8d8;
	border-radius: 0;
	background: #fff;
	color: var(--animalart-ink, #171717);
	font: inherit;
	font-size: 0.9rem;
}

.animalart-height-calculator__select:focus-visible,
.animalart-height-calculator__measurement:focus-visible,
.animalart-height-calculator__submit:focus-visible,
.animalart-height-calculator__close:focus-visible,
.animalart-height-calculator__result-card:focus-visible {
	outline: 3px solid var(--animalart-yellow, #ffcd00);
	outline-offset: 3px;
}

.animalart-height-calculator__panel--measurement {
	text-align: left;
}

.animalart-height-calculator__panel--measurement h3 {
	text-align: left;
}

.animalart-height-calculator__measurement-help {
	margin: 0 0 0.75rem;
	font-size: 0.72rem;
	line-height: 1.4;
}

.animalart-height-calculator__measurement-row {
	display: flex;
	align-items: stretch;
	gap: 0.75rem;
}

.animalart-height-calculator__measurement {
	max-width: 130px;
	border-radius: 16px;
	text-align: center;
}

.animalart-height-calculator__submit {
	min-width: 116px;
	min-height: 40px;
	padding: 0.5rem 0.85rem;
	border: 2px solid var(--animalart-yellow, #ffcd00);
	border-radius: 999px;
	background: var(--animalart-yellow, #ffcd00);
	color: var(--animalart-ink, #171717);
	font-family: var(--animalart-font-display, 'Brandon Grotesque', Arial, sans-serif);
	font-size: 0.72rem;
	font-weight: 900;
	letter-spacing: 0.04em;
	line-height: 1;
	text-transform: uppercase;
	cursor: pointer;
}

.animalart-height-calculator__submit:hover {
	filter: brightness(0.96);
}

.animalart-height-calculator__results {
	min-height: 210px;
	margin-top: 2rem;
	padding: 0;
	background: transparent;
}

.animalart-height-calculator__results h4 {
	margin: 0 0 0.75rem;
	font-size: 0.95rem;
	font-weight: 400;
	line-height: 1.2;
	text-transform: lowercase;
}

.animalart-height-calculator__results-placeholder,
.animalart-height-calculator__result-note,
.animalart-height-calculator__result-message {
	margin: 0;
	color: var(--animalart-muted, #666);
	font-size: 0.78rem;
	line-height: 1.45;
}

.animalart-height-calculator__result-message.is-error {
	color: #8b1e1e;
	font-weight: 700;
}

.animalart-height-calculator__results-placeholder[hidden] {
	display: none;
}

.animalart-height-calculator__results-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.75rem;
}

.animalart-height-calculator__result-card {
	display: grid;
	justify-items: center;
	gap: 0;
	grid-template-columns: 94px minmax(0, 1fr);
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 0.8rem;
	padding: 0.65rem;
	border: 1px solid #e4e4e4;
	border-radius: 18px;
	background: #fff;
	color: var(--animalart-ink, #171717);
	text-decoration: none;
}

.animalart-height-calculator__result-card:hover {
	border-color: var(--animalart-yellow, #ffcd00);
}

.animalart-height-calculator__result-card img {
	grid-row: 1 / span 2;
	display: block;
	width: 94px;
	height: 94px;
	aspect-ratio: auto;
	object-fit: contain;
}

.animalart-height-calculator__result-card strong {
	align-self: center;
	font-family: var(--animalart-font-display, 'Brandon Grotesque', Arial, sans-serif);
	font-size: 0.78rem;
	font-weight: 900;
	line-height: 1.2;
	text-align: center;
	text-transform: uppercase;
}

.animalart-height-calculator__result-card span {
	align-self: center;
	justify-self: center;
	display: inline-flex;
	justify-content: center;
	width: fit-content;
	margin-top: 0.35rem;
	padding: 0.45rem 0.7rem;
	border-radius: 999px;
	background: var(--animalart-yellow, #ffcd00);
	color: var(--animalart-ink, #171717);
	font-family: var(--animalart-font-display, 'Brandon Grotesque', Arial, sans-serif);
	font-size: 0.62rem;
	font-weight: 900;
	line-height: 1;
	text-transform: uppercase;
}

.animalart-height-calculator__result-note {
	margin-top: 0.75rem;
}

.animalart-height-calculator__sr-only,
.animalart-height-calculator__sr-only:not(:focus):not(:active) {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	padding: 0;
	border: 0;
	margin: -1px;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

@media (max-width: 900px) {
	.animalart-height-calculator__dialog {
		width: min(680px, calc(100vw - 24px));
		max-height: calc(100dvh - 24px);
	}

	.animalart-height-calculator__columns {
		grid-template-columns: 1fr;
	}

	.animalart-height-calculator__panel--measurement h3 {
		text-align: center;
	}

	.animalart-height-calculator__panel--measurement {
		text-align: center;
	}

	.animalart-height-calculator__measurement-row {
		justify-content: center;
	}

	.animalart-height-calculator__results {
		max-width: 460px;
		margin-inline: auto;
	}
}

@media (max-width: 520px) {
	.animalart-height-calculator.animalart-height-calculator--modal {
		padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
	}

	.animalart-height-calculator__dialog {
		width: calc(100vw - 16px);
		max-height: calc(100dvh - 16px);
		padding: 1.25rem 0.9rem 1.5rem;
		border-radius: 20px;
	}

	.animalart-height-calculator__header {
		padding: 0 2.5rem;
	}

	.animalart-height-calculator__header h2 {
		font-size: 1.25rem;
	}

	.animalart-height-calculator__close {
		top: 0.5rem;
		right: 0.5rem;
	}

	.animalart-height-calculator__description {
		font-size: 0.72rem;
	}

	.animalart-height-calculator__measurement-row {
		flex-direction: column;
	}

	.animalart-height-calculator__measurement,
	.animalart-height-calculator__submit {
		width: 100%;
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.animalart-height-calculator__backdrop,
	.animalart-height-calculator__result-card,
	.animalart-height-calculator__submit {
		transition: none;
	}
}
