/* ÁMBARA — Compatibilidad con Elementor.
 *
 * Elementor envuelve cada widget en varias cajas (plantilla > contenedor > widget > contenido),
 * con padding, gap y ancho máximo propios. En el HTML original cada sección es hija directa
 * de <main>/<body>: a sangre, sin espacios entre secciones y con el header "sticky" respecto a
 * toda la página. Estas reglas devuelven ese comportamiento sin tocar el CSS de marca.
 *
 * Regla práctica: pon los widgets ÁMBARA en contenedores propios (sin otros widgets al lado).
 */

/* 1. Frontend: los envoltorios no generan caja (display: contents). Las secciones quedan como
 *    en el HTML: a sangre, sin gaps y el header se pega arriba durante todo el scroll. */
body:not(.elementor-editor-active) :is(
	.elementor-location-header:has(.elementor-widget[data-widget_type^="ambara_"]),
	.elementor-location-footer:has(.elementor-widget[data-widget_type^="ambara_"]),
	[data-elementor-type]:has(> .e-con .elementor-widget[data-widget_type^="ambara_"]),
	.e-con:has(.elementor-widget[data-widget_type^="ambara_"]),
	.e-con-inner:has(.elementor-widget[data-widget_type^="ambara_"]),
	.elementor-section:has(.elementor-widget[data-widget_type^="ambara_"]),
	.elementor-section:has(.elementor-widget[data-widget_type^="ambara_"]) > .elementor-container,
	.elementor-column:has(.elementor-widget[data-widget_type^="ambara_"]),
	.elementor-widget-wrap:has(.elementor-widget[data-widget_type^="ambara_"]),
	.elementor-widget[data-widget_type^="ambara_"],
	.elementor-widget[data-widget_type^="ambara_"] > .elementor-widget-container
) {
	display: contents;
}

/* 2. Editor: se conservan las cajas (para seleccionar y arrastrar), pero sin padding, gap ni
 *    ancho máximo, para que la vista previa coincida con la página publicada. */
.elementor-editor-active .e-con:has(.elementor-widget[data-widget_type^="ambara_"]) {
	--padding-top: 0px;
	--padding-right: 0px;
	--padding-bottom: 0px;
	--padding-left: 0px;
	--gap: 0px;
	--row-gap: 0px;
	--column-gap: 0px;
	--content-width: 100%;
	--width: 100%;
	padding: 0;
	gap: 0;
	max-width: none;
}

.elementor-editor-active .e-con-inner:has(.elementor-widget[data-widget_type^="ambara_"]) {
	max-width: none;
	padding: 0;
	gap: 0;
}

.elementor-editor-active .elementor-section:has(.elementor-widget[data-widget_type^="ambara_"]) > .elementor-container {
	max-width: none;
}

.elementor-editor-active .elementor-widget-wrap:has(.elementor-widget[data-widget_type^="ambara_"]) {
	padding: 0 !important;
}

.elementor-widget[data-widget_type^="ambara_"] {
	width: 100%;
	max-width: 100%;
	margin: 0 !important;
}

/* 3. Barra de administración (solo usuarios con sesión iniciada): el header sticky queda debajo de ella. */
@media screen and (min-width: 601px) {
	.admin-bar .site-header.cid-isef26zo { top: var(--wp-admin--admin-bar--height, 32px); }
}

/* 4. Formulario de Elementor Pro dentro de ÁMBARA · Para negocios (.lead-embed).
 *    Reproduce el formulario del diseño: etiquetas mono, campos con línea inferior, casilla de
 *    autorización y botón primario con flecha. En desktop: título en 3 columnas + campos en 3. */
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 { margin-top: var(--space-l); }
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-form-fields-wrapper {
	display: grid;
	gap: 1.5rem;
	margin: 0 !important;
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-field-group {
	width: 100% !important;
	max-width: none;
	margin: 0 !important;
	padding: 0 !important;
	display: block;
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-field-group > label,
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-field-label {
	display: block;
	margin: 0;
	padding: 0;
	color: var(--surface-muted);
	font-family: var(--font-mono);
	font-size: var(--text-mono);
	font-weight: 500;
	letter-spacing: .12em;
	line-height: 1.3;
	text-transform: uppercase;
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-field-group .elementor-field-textual {
	width: 100%;
	min-height: 3.25rem;
	padding: .5rem 0;
	border: 0;
	border-bottom: 1px solid var(--color-hierro);
	border-radius: 0;
	background: 0 0;
	box-shadow: none;
	color: inherit;
	font: inherit;
	font-size: 1.125rem;
	transition: border-color .3s var(--ease-editorial);
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-field-group .elementor-field-textual:focus {
	border-bottom: 2px solid var(--color-hierro);
	box-shadow: 0 2px 0 var(--color-ambar);
	outline: none;
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-field-type-acceptance .elementor-field-option {
	display: flex;
	align-items: flex-start;
	gap: .75rem;
	min-height: var(--touch);
	padding-block: .25rem;
	font-size: var(--text-small);
	line-height: 1.45;
	cursor: pointer;
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-field-type-acceptance .elementor-field-option label {
	color: inherit;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-acceptance-field {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	margin-top: .1rem;
	accent-color: var(--color-hierro);
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-field-type-acceptance {
	margin-top: calc(var(--space-l) - 1.5rem) !important;
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-field-type-submit {
	display: flex;
	justify-content: flex-start;
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .875rem;
	width: auto;
	min-height: 3.25rem;
	padding: 0 1.625rem;
	border: 0;
	border-radius: var(--radius-pill);
	background: var(--cta-bg);
	color: var(--cta-fg);
	font-family: var(--font-mono);
	font-size: .8125rem;
	font-weight: 500;
	letter-spacing: .12em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .35s var(--ease-editorial), color .35s var(--ease-editorial);
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-button:hover {
	background: var(--cta-bg-hover);
	color: var(--cta-fg-hover);
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-button-content-wrapper {
	display: inline-flex;
	align-items: center;
	gap: .875rem;
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-button-content-wrapper::after {
	content: "→" / "";
	display: inline-block;
	transition: transform .45s var(--ease-out-soft);
}
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-button:hover .elementor-button-content-wrapper::after { transform: translate(4px); }
.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-message { margin-top: 1rem; font-weight: 500; }

@media (width >= 64rem) {
	.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-button { min-height: 3.5rem; padding: 0 2rem; }
	.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 { grid-column: 4 / -1; margin-top: 0; }
	.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-form-fields-wrapper {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		column-gap: var(--gutter);
	}
	.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-field-type-acceptance { grid-column: 1 / 3; }
	.b2b.cid-aztvsft2 .lead-embed.cid-aztvsft2 .elementor-field-type-submit { grid-column: 3; justify-content: flex-end; margin-top: calc(var(--space-l) - 1.5rem) !important; }
}
