/* ═══════════════════════════════════════════════
   PANELES CON SCROLL VINCULADO — mismo sistema que sobre-nosotros.html
   Cada panel: 1 vh de dwell + 1 vh de transición.
═══════════════════════════════════════════════ */
.sn-spacer {
  /* (4.8 - 1) * alto útil: el último panel queda fijo 0.8 vh más, igual que en Sobre Nosotros */
  height: calc((100vh - var(--hh, 0px)) * 3.8);
}

.sn-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}

.sn-stage.sn-hidden {
  display: none;
}

.sn-panel {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  pointer-events: auto;
}

/* Copias en flujo normal: el panel entra y sale con el scroll, sin saltos */
.sn-panel.sn-panel--static {
  position: relative !important;
  inset: auto !important;
  /* El header ya reserva su propio espacio en el flujo.  Mantener el panel
     en alto de viewport evita una franja vacía al pie de la ventana. */
  height: 100vh !important;
}

.sn-half {
  overflow: hidden;
  height: 100%;
  will-change: transform;
}

.sn-half--img picture {
  display: contents;
}

.sn-half--img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 8%;
  box-sizing: border-box;
}

.sn-half--text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 6% 10%;
  gap: 0;
  box-sizing: border-box;
  padding-top: calc(6% + 200px);
}

.sn-bg-primary {
  background: #EC690D;
}

.sn-bg-dark {
  background: #272022;
}

.sn-accent {
  display: block;
  width: 38px;
  height: 2px;
  background: #fff;
  flex-shrink: 0;
  margin-bottom: 20px;
}

.sn-title {
  font-family: 'Cocogoose', 'Poppins', sans-serif;
  font-size: clamp(28px, 3.5vw, 56px);
  font-weight: 700;
  color: #fff !important;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0;
  margin: 0 0 18px 0;
}

.sn-orange {
  color: #EC690D;
}

.sn-desc {
  font-family: 'Helvetica Neue Light', 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(17px, 1.7vw, 28px) !important;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.20 !important;
  letter-spacing: 0.03em;
  margin: 0;
}

/* Fade de imagen y texto al entrar cada panel */
.sn-panel .sn-half--img img {
  opacity: 0;
  transition: opacity 900ms ease;
}

.sn-panel .sn-half--text>* {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 800ms ease, transform 800ms ease;
}

.sn-panel .sn-half--text>*:nth-child(2) {
  transition-delay: 120ms;
}

.sn-panel .sn-half--text>*:nth-child(3) {
  transition-delay: 240ms;
}

.sn-panel.sn-in .sn-half--img img {
  opacity: 1;
}

.sn-panel.sn-in .sn-half--text>* {
  opacity: 1;
  transform: none;
}

/* El panel 0 del stage y la copia final continúan a una copia ya visible: sin fade para que no parpadee */
.sn-stage .sn-panel[data-idx="0"] .sn-half--img img,
#sn-static-last .sn-half--img img {
  opacity: 1;
  transition: none;
}

.sn-stage .sn-panel[data-idx="0"] .sn-half--text>*,
#sn-static-last .sn-half--text>* {
  opacity: 1;
  transform: none;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {

  .sn-panel .sn-half--img img,
  .sn-panel .sn-half--text>* {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Ajuste de las fotos de Impacto (solo escritorio; en móvil manda sobre-nosotros-mobile.css) */
@media (min-width: 780px) {
  .sn-panel .sn-half--img img {
    padding: 0;
  }

  #sn-static-first .sn-half--img img,
  .sn-stage .sn-panel[data-idx="0"] .sn-half--img img,
  .sn-stage .sn-panel[data-idx="2"] .sn-half--img img,
  #sn-static-last .sn-half--img img {
    transform: scale(0.85);
  }

  .sn-stage .sn-panel[data-idx="1"] .sn-half--img img {
    transform: scale(1.15);
  }
}

/* Las mitades con imagen deben tapar lo que queda debajo del stage fijo (evita ver la imagen doble) */
.sn-stage .sn-half--img,
.sn-panel--static .sn-half--img {
  background: #fff !important;
}

/* Impacto móvil: conserva el tamaño definido de la tercera foto incluso si
   el dispositivo solicita reducir las animaciones. */
@media (max-width: 779px) {
  #sn-static-last .sn-half--img img,
  #sn-stage .sn-panel[data-idx="2"] .sn-half--img img {
    transform: scale(0.55) translateY(0) !important;
    transform-origin: center center !important;
  }
}

/* Paneles: menos espacio entre título y descripción (igual que Sobre nosotros) */
.sn-panel .sn-title { margin-bottom: 6px !important; }

/* Cuando el header se oculta al bajar, el stage fijo sube con él (misma curva y duración):
   así no queda una franja arriba por donde asome la copia en flujo (efecto de "doble imagen") */
#sn-stage {
  transition: top 350ms cubic-bezier(0.4, 0, 0.2, 1);
}
body.hdr-is-off #sn-stage {
  top: 0 !important;
}
/* Mientras el stage está a la vista, la copia en flujo de arriba no se ve detrás */
body.sn-stage-on #sn-static-first .sn-half--img img {
  visibility: hidden;
}

/* Impacto: the mobile browser bars must not move the footer or the handoff. */
@media (max-width: 779px) {
  body.impacto-page #sn-static-first,
  body.impacto-page #sn-static-last {
    height: var(--im-panel-height, 100vh) !important;
    min-height: var(--im-panel-height, 100vh) !important;
    will-change: auto !important;
  }

  body.impacto-page #sn-spacer {
    height: calc(var(--im-panel-height, 100vh) * 5.8) !important;
  }

  body.impacto-page #sn-stage {
    top: 0 !important;
    height: var(--im-panel-height, 100vh) !important;
    transition: none !important;
    background: var(--im-stage-background, #ec690d);
  }

  body.impacto-page #sn-static-first > .sn-half,
  body.impacto-page #sn-static-last > .sn-half {
    will-change: auto !important;
    opacity: 1 !important;
    transition: none !important;
  }

  /* Keep the handoff geometry, but never paint duplicate photos below the
     fixed stage or Safari's translucent bottom toolbar. */
  body.impacto-page.sn-stage-on #sn-static-first,
  body.impacto-page.sn-stage-on #sn-spacer,
  body.impacto-page.sn-stage-on #sn-static-last {
    background: var(--im-stage-background, #ec690d);
  }

  body.impacto-page.sn-stage-on #sn-static-first > .sn-half,
  body.impacto-page.sn-stage-on #sn-static-last > .sn-half {
    opacity: 0 !important;
    pointer-events: none;
  }

  body.impacto-page footer.d-footer {
    position: relative;
    z-index: 40;
    background: #272022;
  }
}
