/* Ensutex home · jerarquía, aire y encuadre · 15-nov-2026 */
html body.ensutex-home:not(.mf):not(.rx) {
  --ens-space-copy: 8px;
  --ens-space-group: 12px;
  --ens-space-card: 16px;
  --ens-space-section: 32px;
}

/* Escritorio: el encabezado y la escena parten de una misma línea de lectura.
   El sobrante queda abajo, no en un hueco entre título e imagen. */
@media (min-width: 900px) {
  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-cab {
    margin-bottom: 12px !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-cuerpo {
    margin: 16px auto 0 !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-paso[data-estado="activo"] .proceso-copia {
    align-self: center !important;
    justify-content: center !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-cab {
    margin-bottom: var(--ens-space-group) !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-cab .seo-tema {
    margin-bottom: var(--ens-space-copy) !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-cuerpo {
    margin: 0 auto !important;
    flex: 0 1 auto !important;
    height: min(58svh, 540px) !important;
    min-height: min(46svh, 420px) !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-titulo,
  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-paso[data-estado="activo"] .proceso-titulo {
    margin-bottom: var(--ens-space-group) !important;
    font-size: clamp(26px, min(2.25vw, 4.2svh), 34px) !important;
    line-height: 1.04 !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-detalle {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: var(--ens-space-group) !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-bajada {
    max-width: 44ch !important;
    font-size: clamp(16px, 1.18vw, 18px) !important;
    line-height: 1.36 !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-visual {
    margin: var(--ens-space-group) 0 0 !important;
    padding: 12px !important;
    gap: var(--ens-space-copy) !important;
  }
}

/* La estimación usa dos filas cortas; etiqueta y valor se leen de un vistazo. */
html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-visual--estimacion {
  grid-template-columns: minmax(0, 1fr) !important;
}

html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-visual--estimacion > div {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  min-height: 44px !important;
  padding: 8px 10px !important;
}

html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-visual--estimacion > div span {
  flex: 0 0 auto;
}

html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-visual--estimacion > div strong {
  max-width: 68%;
  text-align: right;
  font-size: .84rem !important;
}

/* La tarjeta de condiciones da aire dentro de cada grupo sin agrandar la sección. */
html body.ensutex-home:not(.mf):not(.rx) #proceso-condiciones header {
  margin-bottom: 16px !important;
}

html body.ensutex-home:not(.mf):not(.rx) #proceso-condiciones .proceso-condiciones__grid {
  gap: var(--ens-space-card) !important;
}

html body.ensutex-home:not(.mf):not(.rx) #proceso-condiciones .proceso-condiciones__grid article {
  gap: var(--ens-space-copy) !important;
  padding: 16px !important;
}

html body.ensutex-home:not(.mf):not(.rx) #proceso-condiciones .proceso-condiciones__grid article h3 {
  margin-bottom: 0 !important;
}

/* Otras marcas: el screenshot mostraba demasiado aire oscuro antes del título.
   Conservamos espacio entre secciones, con altura útil para ver las dos puertas. */
html body.ensutex-home:not(.mf):not(.rx) #puertas.ens-doors {
  padding-block: clamp(var(--ens-space-section), 3.5svh, 40px) !important;
}

html body.ensutex-home:not(.mf):not(.rx) #puertas .ens-doors__head {
  margin-bottom: clamp(16px, 2.2svh, 22px) !important;
}

@media (max-width: 899px) {
  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-cuerpo {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: clamp(180px, 32svh, 340px) auto !important;
    align-content: safe center !important;
    row-gap: var(--ens-space-group) !important;
    height: 100svh !important;
    min-height: 0 !important;
    padding-top: 8px !important;
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-lamina {
    height: 100% !important;
    max-height: none !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-copia {
    grid-column: 1 !important;
    grid-row: 2 !important;
    max-width: none !important;
    align-self: start !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-titulo,
  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-paso[data-estado="activo"] .proceso-titulo {
    margin: 0 0 var(--ens-space-group) !important;
    font-size: clamp(22px, 6.1vw, 28px) !important;
    line-height: 1.03 !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-detalle {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: var(--ens-space-group) !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-resumen-movil {
    max-width: 42ch !important;
    margin: 0 !important;
    font-size: clamp(14px, 3.9vw, 16px) !important;
    line-height: 1.34 !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-visual {
    margin: var(--ens-space-group) 0 0 !important;
    padding: 10px !important;
    gap: 6px !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-visual--diseno > div {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 2px !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-visual--estimacion > div {
    min-height: 40px !important;
    padding: 6px 8px !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso.proceso .proceso-visual--estimacion > div strong {
    max-width: 66%;
    font-size: .8rem !important;
  }

  html body.ensutex-home:not(.mf):not(.rx) #proceso-condiciones .proceso-condiciones__grid {
    gap: 12px !important;
  }

  html body.ensutex-home:not(.mf):not(.rx) #proceso-condiciones .proceso-condiciones__grid article {
    padding: 12px !important;
  }
}

@media (max-width: 600px) {
  html body.ensutex-home:not(.mf):not(.rx) #proceso-condiciones .proceso-condiciones__grid {
    gap: 10px !important;
  }

  html body.ensutex-home:not(.mf):not(.rx) #puertas .ens-doors__head {
    margin-bottom: 16px !important;
  }
}

/* Primera visita: reserva al proceso el alto real que ocupa el aviso. La escena
   se hace más compacta y mantiene todas sus piezas visibles por encima del aviso. */
@media (max-width: 899px) {
  html body.ensutex-home:not(.mf):not(.rx):has(#ensutex-consent) .ensutex-consent {
    padding: 10px 12px !important;
    gap: 6px !important;
    border-radius: 14px !important;
  }

  html body.ensutex-home:not(.mf):not(.rx):has(#ensutex-consent) .ensutex-consent__copy strong {
    font-size: .78rem !important;
    line-height: 1.12 !important;
  }

  html body.ensutex-home:not(.mf):not(.rx):has(#ensutex-consent) .ensutex-consent__copy p {
    margin-top: 2px !important;
    font-size: .72rem !important;
    line-height: 1.22 !important;
  }

  html body.ensutex-home:not(.mf):not(.rx):has(#ensutex-consent) .ensutex-consent__actions {
    gap: 6px !important;
  }

  html body.ensutex-home:not(.mf):not(.rx):has(#ensutex-consent) .ensutex-consent__actions button {
    min-height: 44px !important;
    padding: 6px 7px !important;
    font-size: .68rem !important;
    line-height: 1.1 !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx):has(#ensutex-consent) #proceso.proceso .proceso-cuerpo {
    height: calc(100svh - var(--ensutex-consent-offset, 0px)) !important;
    grid-template-rows: clamp(142px, 25svh, 210px) auto !important;
    align-content: safe center !important;
    padding-top: 8px !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
  }

  /* Con el aviso abierto, limita el listado expandido para conservar visible
     el botón de cotización en la misma pantalla. El listado sigue desplazable. */
  html body.ensutex-home:not(.mf):not(.rx):has(#ensutex-consent) #proceso.proceso[data-paso="4"] details.proceso-puntos-detalle[open] > .proceso-puntos {
    max-height: min(28svh, 220px) !important;
  }
}

@media (max-width: 359px) {
  html body.ensutex-home:not(.mf):not(.rx):has(#ensutex-consent) #proceso.proceso[data-paso="4"] details.proceso-puntos-detalle[open] > .proceso-puntos {
    max-height: min(13svh, 84px) !important;
  }
}

@media (min-width: 900px) and (max-height: 700px) {
  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-titulo,
  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-paso[data-estado="activo"] .proceso-titulo {
    font-size: clamp(24px, min(2.3vw, 4.2svh), 32px) !important;
  }

  html.proceso-js body.ensutex-home:not(.mf):not(.rx) #proceso .proceso-detalle {
    gap: 8px !important;
  }
}
