/* ==========================================================================
   SEGUROS — Figma node 3124:2384
   ========================================================================== */

.sg-hero {
  /* Unidad de escala del banner: 1 = 1px del diseño (lienzo 1440 x 940).
     Hace que el título y su caja crezcan y encojan JUNTO con el banner. Antes
     el banner pasaba de 752px a 940px al alejar el zoom mientras el título
     seguía clavado en 44px, y la composición perdía la proporción. */
  --u: min(1px, 0.06944vw, 0.10638svh);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100vh;
  min-height: 560px;
  max-height: 940px;
  padding: clamp(60px, 8vw, 120px) var(--grid-margin);
  background-color: var(--color-blanco);
  box-sizing: border-box;
}
.sg-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.sg-hero__bg picture {
  display: block;
  width: 100%;
  height: 100%;
}
.sg-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.sg-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  box-sizing: border-box;
}
.sg-hero__title {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: calc(var(--u) * 44);
  color: var(--color-primario);
  line-height: var(--lh-base);
  width: 100%;
  max-width: calc(var(--u) * 549);
  text-align: left;
  margin: 0;
}
.sg-hero__title em { font-style: normal; font-weight: 300; display: block; }

/* ------------------------------ PASOS (3124:2395) ------------------------
   Intro y cierre ocupan las 12 columnas; los 5 pasos van dentro de las
   columnas 2-11 (1076px) con una subretícula de 10 columnas:
     impares -> texto en 1-5,  icono en 9-10
     pares   -> icono en 1-2,  texto en 6-10                                */
.sg-pasos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(40px, 5vw, 64px);
  width: 100%;
  padding: clamp(60px, 8vw, 160px) var(--grid-margin);
  background: var(--color-blanco);
  box-sizing: border-box;
}

.sg-pasos__intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: var(--container-max);
  text-align: center;
}
.sg-pasos__intro h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: clamp(24px, 3.5vw, var(--fs-h3));
  color: var(--color-primario);
}
.sg-pasos__intro p {
  font-family: var(--font-heading);
  font-size: clamp(15px, 1.4vw, var(--fs-body));
  color: var(--color-gris-oscuro);
  max-width: 800px;
  margin: 0 auto;
}

.sg-paso {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: clamp(24px, 4vw, 60px);
  width: 100%;
  max-width: var(--w-10col);
  box-sizing: border-box;
}

.sg-paso--reverse {
  flex-direction: row-reverse;
}

.sg-paso--reverse .sg-paso__txt {
  justify-content: flex-end;
}

.sg-paso__txt {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(16px, 2.5vw, 32px);
  flex: 1 1 0;
  min-width: 0;
}

.sg-paso__num {
  flex-shrink: 0;
  width: auto;
  height: clamp(80px, 10vw, 160px);
  align-self: center;
  display: block;
}
.sg-paso__body {
  min-width: 0;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.sg-paso__body h3 {
  font-family: var(--font-heading);
  font-weight: var(--fw-heavy);
  font-size: clamp(18px, 2.2vw, var(--fs-h4));
  color: var(--color-secundario);
  margin: 0 0 12px;
}
.sg-paso__body p {
  font-family: var(--font-heading);
  font-size: clamp(15px, 1.4vw, var(--fs-body));
  line-height: 1.45;
  color: var(--color-primario);
  margin: 0;
}

.sg-paso__icon {
  flex-shrink: 0;
  width: clamp(100px, 13vw, 180px);
  height: clamp(100px, 13vw, 180px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--color-secundario);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.sg-paso__icon img { width: 70%; height: 70%; object-fit: contain; }
/* Variante cuyo SVG ya trae el círculo rosa dibujado */
.sg-paso__icon--solo {
  background: none;
  border-radius: 0;
}
.sg-paso__icon--solo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sg-pasos__cierre {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: var(--container-max);
  text-align: center;
  margin-top: 20px;
}
.sg-pasos__cierre p:first-child {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: clamp(20px, 2.5vw, var(--fs-h3));
  color: var(--color-secundario);
}
.sg-pasos__cierre p:last-child {
  font-family: var(--font-heading);
  font-size: clamp(15px, 1.4vw, var(--fs-body));
  line-height: 1.45;
  color: var(--color-gris-oscuro);
}

/* ------------------------------ VIDALUZ (3124:2477) ----------------------
   Imagen a sangre; el bloque de texto son 4 columnas empezando en la col 2
   (de ahí el padding de 182px), no pegado al margen de la página.          */
.sg-vidaluz {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 911px;
  padding: 240px var(--grid-margin);
  background-image: url('../images/desktop/seguros/vidaluz-bg.webp');
  background-size: cover;
  background-position: center;
}
.sg-vidaluz__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
  width: 100%;
  max-width: var(--w-10col);
}
.sg-vidaluz__title {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: clamp(24px, 3vw, var(--fs-h2));
  color: var(--color-primario);
  line-height: var(--lh-base);
  width: var(--w-4col);
  max-width: 100%;
}
.sg-vidaluz__title em { font-style: normal; font-weight: 300; }
.sg-vidaluz__content > p {
  font-family: var(--font-heading);
  font-size: var(--fs-body-lg);
  color: var(--color-primario);
}
.sg-vidaluz__logo { width: 235px; height: auto; }

@media (max-width: 1023px) {
  .sg-hero {
    height: auto;
    min-height: 560px;
    padding: 160px var(--grid-margin) 100px;
  }
  .sg-hero__title {
    font-size: clamp(22px, 3.2vw, 32px);
    max-width: 440px;
  }

  .sg-pasos { padding: 100px var(--grid-margin); gap: 48px; }
  .sg-paso { gap: 32px; max-width: 100%; }
  .sg-paso__num { height: clamp(70px, 9vw, 110px); }
  .sg-paso__icon { width: clamp(90px, 12vw, 130px); height: clamp(90px, 12vw, 130px); }

  .sg-vidaluz { min-height: 560px; padding: 140px var(--grid-margin); }
  .sg-vidaluz__title { font-size: clamp(24px, 3.6vw, 40px); }
  .sg-vidaluz__content { max-width: 460px; }
}

@media (max-width: 767px) {
  .sg-hero {
    padding: calc(var(--header-h) + 16px) var(--grid-margin) clamp(220px, 58vw, 300px);
    min-height: 100svh;
    box-sizing: border-box;
  }
  .sg-hero__bg img {
    object-position: center bottom;
  }
  .sg-hero__content {
    align-items: flex-end;
    gap: 14px;
  }
  .sg-hero__title {
    font-size: clamp(16px, 4.5vw, 21px);
    line-height: 1.2;
    max-width: 320px;
  }
  .sg-pasos { padding: 64px var(--grid-margin); gap: 40px; }
  .sg-paso,
  .sg-paso--reverse {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }
  .sg-paso__txt,
  .sg-paso--reverse .sg-paso__txt {
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }
  .sg-paso__num {
    height: 70px;
    margin-bottom: 4px;
  }
  .sg-paso__body {
    align-items: center;
    text-align: center;
    width: 100%;
  }
  .sg-paso__body h3 {
    text-align: center;
  }
  .sg-paso__icon,
  .sg-paso--reverse .sg-paso__icon {
    width: 110px;
    height: 110px;
    order: -1;
  }
  .sg-vidaluz {
    min-height: 100svh;
    padding: 32px var(--grid-margin) 40px;
    background-image: url('../images/responsive/Responsive%20Seguros/BannerResponsive_PagWeb_Contigo_Seguros_1.webp');
    background-position: center bottom;
    background-size: cover;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
}

/* ==========================================================================
   TABLET EN VERTICAL — ALTO COMPLETO DEL HERO

   A partir de 768px el <picture> sirve el banner VERTICAL (1440 x 2480,
   proporcion 0.58) porque la pantalla esta en retrato. Pero el bloque de
   tablet deja el hero en `height: auto; min-height: 560px`: una caja de
   768x560 (proporcion 1.37) contra una imagen de 0.58 obliga a `cover` a
   recortar mas del 50% de la foto, y la composicion se pierde (se veia un
   primer plano gigante).

   Con el alto completo de pantalla la caja queda en 0.75 y solo se recorta
   unbuen 23%. Solo aplica en retrato: la tablet apaisada sigue recibiendo el
   banner de escritorio y conserva su alto de 560px.
   ========================================================================== */
@media (max-width: 1023px) and (max-aspect-ratio: 1/1) {
  .sg-hero {
    height: auto;
    min-height: 100svh;
    box-sizing: border-box;
    /* Los banners verticales dejan el aire arriba y colocan a las personas en
       la mitad inferior. Centrado en vertical, el texto (y sobre todo el
       boton rosa) caia justo encima de la foto y dejaba de leerse. Anclado
       arriba cae sobre la zona limpia, que es para lo que se diseno. */
    align-items: flex-start;
  }
}
