/**
 * Layout de produtos importados do catálogo AGF (estilo Santiago & Cintra).
 * Tipografia: Blocksy Customizer — sem regras para h1/h2/p aqui.
 */

/* --- Vídeo de topo --- */

.single-product .agf-catalog-header-video {
	position: relative;
	z-index: 1;
	display: grid;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	margin-bottom: 0;
	min-height: min(42vh, 480px);
	aspect-ratio: 16 / 9;
	max-height: min(70vh, 720px);
	overflow: hidden;
	background: #111;
}

.single-product .agf-catalog-header-video__el,
.single-product .agf-catalog-header-video__scrim,
.single-product .agf-catalog-header-video__caption {
	grid-area: 1 / 1;
}

.single-product .agf-catalog-header-video__el {
	display: block;
	width: 100%;
	height: 100%;
	min-height: inherit;
	object-fit: cover;
	z-index: 0;
}

.single-product .agf-catalog-header-video__scrim {
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.15) 0%,
		rgba(0, 0, 0, 0.35) 45%,
		rgba(0, 0, 0, 0.72) 100%
	);
}

.single-product .agf-catalog-header-video__caption {
	z-index: 2;
	align-self: end;
	justify-self: stretch;
	box-sizing: border-box;
	width: 100%;
	max-width: var(--theme-normal-container-max-width, 1200px);
	margin-inline: auto;
	padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem) clamp(1.25rem, 5vw, 3rem);
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.single-product .agf-catalog-header-video__category {
	margin: 0 0 clamp(0.35rem, 1vw, 0.65rem);
	font-size: clamp(0.75rem, 1.6vw, 0.9375rem);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.92;
}

.single-product .agf-catalog-header-video__title {
	margin: 0;
	max-width: 18ch;
	font-size: clamp(1.5rem, 3.8vw, 2.75rem);
	font-weight: 700;
	line-height: 1.12;
	color: inherit;
}

/* Evita H1 duplicado quando o título está no banner */
.single-product.product.agf-has-header-video-overlay .summary .product_title,
.single-product.product.agf-has-header-video-overlay .entry-summary-items > .entry-title {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Produto importado: esconde galeria Woo (conteúdo rico já traz imagens) */

.product.agf-has-rich-import .woocommerce-product-gallery {
	display: none !important;
}

.product.agf-has-rich-import .product-entry-wrapper {
	display: block;
}

.product.agf-has-rich-import .summary.entry-summary {
	width: 100%;
	max-width: 100%;
	padding-block: clamp(1rem, 2vw, 1.5rem);
}

/* --- Corpo importado (full width) --- */

.agf-catalog-product-body {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	margin-top: 0;
	margin-bottom: clamp(2rem, 4vw, 4rem);
	padding-inline: clamp(1rem, 3vw, 2rem);
	box-sizing: border-box;
}

.agf-imported-content {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--theme-normal-container-max-width, 1200px);
	margin-inline: auto;
	overflow-x: clip;
	word-wrap: break-word;
}

.agf-imported-content .agf-sync-section {
	margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.agf-imported-content .agf-sync-section:last-child {
	margin-bottom: 0;
}

.agf-imported-content .container {
	width: 100%;
	max-width: 100%;
	margin-inline: auto;
}

.agf-imported-content img,
.agf-imported-content .agf-imported-img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* --- Padrão Santiago: .wrapper com .img + .texto --- */

.agf-imported-content .agf-sync-section .wrapper {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: clamp(1.25rem, 3vw, 2.5rem);
}

.agf-imported-content .agf-sync-section .wrapper > .img,
.agf-imported-content .agf-sync-section .wrapper > .texto {
	flex: 1 1 calc(50% - 1.25rem);
	min-width: min(100%, 280px);
	max-width: 100%;
}

.agf-imported-content .agf-sync-section .wrapper > .img img,
.agf-imported-content .agf-sync-section .wrapper > .img video {
	width: 100%;
	height: auto;
}

.agf-imported-content .agf-sync-section .img.video-container video {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 4px;
	background: #111;
}

/* CTA: .left-section + .right-section */

.agf-imported-content .agf-sync-section .wrapper:has(.left-section) {
	align-items: stretch;
}

.agf-imported-content .agf-sync-section .left-section,
.agf-imported-content .agf-sync-section .right-section {
	flex: 1 1 calc(50% - 1.25rem);
	min-width: min(100%, 280px);
}

/* --- Grades de ícones (.linha / .seis colunas) --- */

.agf-imported-content .texto-editavel > .linha,
.agf-imported-content .linha.desktop-seis {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(1rem, 2vw, 1.5rem);
	justify-content: center;
	width: 100%;
}

.agf-imported-content .desktop-seis.colunas,
.agf-imported-content .seis.colunas {
	flex: 1 1 calc(50% - 1rem);
	min-width: min(100%, 200px);
	max-width: 100%;
	text-align: center;
}

.agf-imported-content .seis.colunas img,
.agf-imported-content .seis.colunas .agf-imported-img {
	margin-inline: auto;
	max-height: 64px;
	width: auto;
}

/* --- el-t002 (após re-sync com classes da origem) --- */

.agf-imported-content .agf-sync-section.el-t002 {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: clamp(1.25rem, 3vw, 2.5rem);
}

.agf-imported-content .agf-sync-section.el-t002.imagem-right {
	flex-direction: row-reverse;
}

.agf-imported-content .agf-sync-section.el-t002.imagem-right .wrapper {
	flex-direction: row-reverse;
}

.agf-imported-content .agf-sync-section.el-t001 {
	padding-block: clamp(1.5rem, 4vw, 3rem);
	text-align: center;
}

.agf-imported-content .agf-sync-section.el-bloco-cta {
	padding: clamp(1.5rem, 4vw, 2.5rem);
	text-align: center;
	background: rgba(0, 0, 0, 0.04);
	border-radius: 4px;
}

/* --- Conteúdo em blocos Gutenberg --- */

.agf-catalog-product-body .wp-block-media-text,
.agf-catalog-product-body .wp-block-group,
.agf-catalog-product-body .wp-block-columns {
	margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.agf-catalog-product-body .wp-block-media-text {
	gap: clamp(1.25rem, 3vw, 2.5rem);
}

.agf-catalog-product-body .wp-block-media-text__media img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.agf-catalog-product-body .wp-block-group.agf-section-centered {
	text-align: center;
	padding-block: clamp(1.5rem, 4vw, 3rem);
}

.agf-catalog-product-body .wp-block-columns.agf-icon-grid {
	gap: clamp(1rem, 2vw, 1.5rem);
}

.agf-catalog-product-body .wp-block-columns.agf-icon-grid .wp-block-image img {
	margin-inline: auto;
	max-height: 64px;
	width: auto;
}

.agf-catalog-product-body .agf-quote-cta-block.el-bloco-cta {
	padding: clamp(1.5rem, 4vw, 2.5rem);
	background: rgba(0, 0, 0, 0.04);
	border-radius: 4px;
}

.agf-catalog-product-body .agf-quote-cta-block .wrapper {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: clamp(1.25rem, 3vw, 2rem);
}

.agf-catalog-product-body .agf-quote-cta-block .left-section,
.agf-catalog-product-body .agf-quote-cta-block .right-section {
	flex: 1 1 calc(50% - 1.25rem);
	min-width: min(100%, 280px);
}

.agf-catalog-product-body .agf-quote-cta-block__button {
	display: inline-block;
}

/* --- Mobile --- */

@media (max-width: 768px) {
	.single-product .agf-catalog-header-video {
		min-height: 220px;
		aspect-ratio: 4 / 3;
		max-height: 50vh;
	}

	.single-product .agf-catalog-header-video__caption {
		padding-bottom: clamp(1rem, 4vw, 1.75rem);
	}

	.single-product .agf-catalog-header-video__title {
		max-width: none;
		font-size: clamp(1.25rem, 6vw, 1.75rem);
	}

	.single-product .agf-catalog-header-video__category {
		font-size: clamp(0.6875rem, 2.8vw, 0.8125rem);
		letter-spacing: 0.06em;
	}

	.agf-imported-content .agf-sync-section .wrapper,
	.agf-imported-content .agf-sync-section.el-t002,
	.agf-imported-content .agf-sync-section.el-t002.imagem-right,
	.agf-imported-content .agf-sync-section.el-t002.imagem-right .wrapper {
		flex-direction: column;
	}

	.agf-imported-content .agf-sync-section .wrapper > .img,
	.agf-imported-content .agf-sync-section .wrapper > .texto,
	.agf-imported-content .agf-sync-section .left-section,
	.agf-imported-content .agf-sync-section .right-section,
	.agf-imported-content .desktop-seis.colunas,
	.agf-imported-content .seis.colunas {
		flex-basis: 100%;
		min-width: 100%;
	}

	.agf-catalog-product-body .wp-block-media-text {
		grid-template-columns: 100% !important;
	}

	.agf-catalog-product-body .wp-block-media-text.has-media-on-the-right .wp-block-media-text__media,
	.agf-catalog-product-body .wp-block-media-text .wp-block-media-text__media {
		grid-column: 1;
		grid-row: 1;
	}

	.agf-catalog-product-body .wp-block-media-text .wp-block-media-text__content {
		grid-column: 1;
		grid-row: 2;
	}

	.agf-catalog-product-body .agf-quote-cta-block .wrapper {
		flex-direction: column;
		text-align: center;
	}

	.agf-catalog-product-body .agf-quote-cta-block .left-section,
	.agf-catalog-product-body .agf-quote-cta-block .right-section {
		flex-basis: 100%;
		min-width: 100%;
	}
}

/* --- CPT locacao (mesmo layout visual) --- */

.single-locacao .agf-catalog-header-video {
	position: relative;
	z-index: 1;
	display: grid;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	margin-bottom: 0;
	min-height: min(42vh, 480px);
	aspect-ratio: 16 / 9;
	max-height: min(70vh, 720px);
	overflow: hidden;
	background: #111;
}

.single-locacao .agf-catalog-header-video__el,
.single-locacao .agf-catalog-header-video__scrim,
.single-locacao .agf-catalog-header-video__caption {
	grid-area: 1 / 1;
}

.single-locacao .agf-catalog-header-video__el {
	display: block;
	width: 100%;
	height: 100%;
	min-height: inherit;
	object-fit: cover;
	z-index: 0;
}

.single-locacao .agf-catalog-header-video__scrim {
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.15) 0%,
		rgba(0, 0, 0, 0.35) 45%,
		rgba(0, 0, 0, 0.72) 100%
	);
}

.single-locacao .agf-catalog-header-video__caption {
	z-index: 2;
	align-self: end;
	justify-self: stretch;
	box-sizing: border-box;
	width: 100%;
	max-width: var(--theme-normal-container-max-width, 1200px);
	margin-inline: auto;
	padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem) clamp(1.25rem, 5vw, 3rem);
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.single-locacao .agf-catalog-header-video__category {
	margin: 0 0 clamp(0.35rem, 1vw, 0.65rem);
	font-size: clamp(0.75rem, 1.6vw, 0.9375rem);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.92;
}

.single-locacao .agf-catalog-header-video__title {
	margin: 0;
	max-width: 18ch;
	font-size: clamp(1.5rem, 3.8vw, 2.75rem);
	font-weight: 700;
	line-height: 1.12;
	color: inherit;
}

.single-locacao.agf-has-header-video-overlay .agf-locacao-single__header {
	display: none;
}

.single-locacao .agf-locacao-single__hero {
	padding-block: clamp(1rem, 2vw, 2rem);
	max-width: var(--theme-normal-container-max-width, 1200px);
	margin-inline: auto;
}

.single-locacao .agf-locacao-single__cta {
	margin-top: 1.25rem;
}

@media (max-width: 768px) {
	.single-locacao .agf-catalog-header-video {
		min-height: 220px;
		aspect-ratio: 4 / 3;
		max-height: 50vh;
	}

	.single-locacao .agf-catalog-header-video__caption {
		padding-bottom: clamp(1rem, 4vw, 1.75rem);
	}

	.single-locacao .agf-catalog-header-video__title {
		max-width: none;
		font-size: clamp(1.25rem, 6vw, 1.75rem);
	}

	.single-locacao .agf-catalog-header-video__category {
		font-size: clamp(0.6875rem, 2.8vw, 0.8125rem);
		letter-spacing: 0.06em;
	}
}
