/* Elementor inner-pages compatibility
 * Applies to: Servicios, Trabaja con Nosotros, Por que 23KY.
 * Goal: keep original visual CSS while preventing Elementor boxed wrappers
 * from injecting unwanted margins/paddings during editing.
 */

body.ky-elementor-layout-fix .elementor,
body.ky-elementor-layout-fix .elementor-location-single {
  width: 100%;
  max-width: 100%;
}

/* Container engine (e-con): remove top-level boxed narrowing only. */
body.ky-elementor-layout-fix .elementor > .elementor-element.e-con {
  --content-width: 100%;
  --container-max-width: 100%;
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: 0 !important;
  padding-inline: 0 !important;
}

body.ky-elementor-layout-fix .elementor > .elementor-element.e-con > .e-con-inner {
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: 0 !important;
  padding-inline: 0 !important;
}

/* Legacy section engine compatibility. */
body.ky-elementor-layout-fix .elementor > .elementor-top-section > .elementor-container,
body.ky-elementor-layout-fix .elementor > .elementor-section > .elementor-container {
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: 0 !important;
}

/* Preserve existing theme layout inside HTML/Text widgets. */
body.ky-elementor-layout-fix .elementor .elementor-widget-text-editor .container,
body.ky-elementor-layout-fix .elementor .elementor-widget-html .container {
  width: min(100%, 1920px);
  max-width: 1920px;
  margin-inline: auto;
  padding-inline: clamp(16px, 2.5vw, 48px);
}

/* Avoid extra blank spacing created by empty wpautop paragraphs. */
body.ky-elementor-layout-fix .elementor .elementor-widget-text-editor .elementor-widget-container > p:empty {
  display: none;
  margin: 0;
  padding: 0;
}

/* Editor-only spacing normalization for legacy section widgets. */
body.ky-elementor-layout-fix-editor .elementor .elementor-widget-text-editor.elementor-widget:not(:last-child),
body.ky-elementor-layout-fix-editor .elementor .elementor-widget-html.elementor-widget:not(:last-child) {
  margin-bottom: 0 !important;
}

body.ky-elementor-layout-fix-editor .elementor-column-gap-default > .elementor-row > .elementor-column > .elementor-element-populated {
  padding: 0 !important;
}
