/* ════════════════════════════════════════════════════════════
   PREMIUM ADDITIONS — GGRL HOME IMPROVEMENT
   The Showcase Stage: hero slider editorial premium
   Firma: barrido de "rodillo de pintura" siguiendo la cortina
   Tokens de marca: #134866 / #ff4f5a / #ff6600 · Fraunces + Montserrat
   ════════════════════════════════════════════════════════════ */

/* ── El escenario ── */
.hero-stage {
  position: relative;
  width: 100%;
  height: 70vh;
  height: 70dvh;
  min-height: 440px;
  max-height: 800px;
  overflow: hidden;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 24px 60px rgba(9, 30, 44, 0.28);
  background: #0e1b24;
  isolation: isolate;
  margin-bottom: 3rem;
}

@media (min-width: 1200px) {
  .hero-stage { height: 62vh; height: 62dvh; }
}

/* ── Slides: cortina cinematográfica ── */
.stage-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  clip-path: inset(0 100% 0 0);
  transition:
    opacity   0.05s linear 0s,
    clip-path 1.1s  cubic-bezier(0.77, 0, 0.175, 1) 0s;
  will-change: clip-path, opacity;
}

.stage-slide.active {
  opacity: 1;
  visibility: visible;
  clip-path: inset(0 0% 0 0);
  z-index: 2;
}

.stage-slide.leaving {
  opacity: 1;
  visibility: visible;
  clip-path: inset(0 0 0 0);
  animation: stageExit 1.1s cubic-bezier(0.77, 0, 0.175, 1) forwards;
  z-index: 1;
}

@keyframes stageExit {
  from { clip-path: inset(0 0 0 0%); }
  to   { clip-path: inset(0 0 0 100%); }
}

/* ── FIRMA: pasada de rodillo — línea de luz que sigue la cortina ── */
.stage-slide::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -6px;
  width: 4px;
  background: linear-gradient(180deg, var(--secondary), var(--accent), var(--secondary));
  box-shadow:
    0 0 18px 3px rgba(255, 102, 0, 0.55),
    0 0 42px 8px rgba(255, 79, 90, 0.28);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.stage-slide.active::after {
  animation: rollerSweep 1.1s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes rollerSweep {
  0%   { left: 0%;   opacity: 1; }
  88%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* ── Imagen: Ken Burns diagonal lento ── */
.stage-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.08) translate(1%, 1%);
  transition: transform 0.1s linear;
  filter: contrast(1.05) saturate(1.1);
}

.stage-slide.active img {
  transform: scale(1.0) translate(-1%, -1%);
  transition: transform 8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Scrim editorial: profundidad abajo-izquierda ── */
.stage-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(9, 22, 32, 0.82) 0%, rgba(9, 22, 32, 0.35) 34%, transparent 62%),
    linear-gradient(105deg, rgba(9, 22, 32, 0.55) 0%, transparent 48%);
  pointer-events: none;
}

/* ── Contenido: anclado abajo-izquierda, editorial ── */
.stage-content {
  position: absolute;
  /* left offset clears the fixed social bar (~80px wide) so it never covers the copy */
  left: clamp(6rem, 8vw, 7.5rem);
  right: clamp(1.4rem, 5vw, 4.5rem);
  bottom: clamp(6.2rem, 13vh, 8.5rem);
  max-width: 640px;
  color: #fff;
}

.stage-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.6px;
  color: #ffd9c4;
  background: rgba(255, 102, 0, 0.16);
  border: 1px solid rgba(255, 148, 77, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.42rem 1rem;
  border-radius: 50px;
  margin-bottom: 1.1rem;
}

.stage-tag i { font-size: 0.78rem; color: var(--secondary); }

/* Titular display: Fraunces — el salto tipográfico */
.stage-content h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.1rem, 1.2rem + 3.4vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.5px;
  margin: 0 0 0.9rem;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.45);
  text-wrap: balance;
}

.stage-content h2 em {
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(115deg, #ffb36b 10%, var(--accent) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.stage-content p {
  font-size: clamp(0.95rem, 0.86rem + 0.35vw, 1.08rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  max-width: 480px;
  margin: 0 0 1.6rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  text-wrap: pretty;
}

.stage-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  text-decoration: none;
  padding: 0.95rem 2.2rem;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(255, 79, 90, 0.45);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, background 0.3s ease;
}

.stage-cta i { transition: transform 0.3s ease; }

.stage-cta:hover {
  background: #e63946;
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(255, 79, 90, 0.58);
}

.stage-cta:hover i { transform: translateX(4px); }

/* ── Texto cinético: entra escalonado con el slide activo ── */
.stage-content > * {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
}

.stage-slide.active .stage-content > * {
  animation: stageTextIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stage-slide.active .stage-content .stage-tag   { animation-delay: 0.45s; }
.stage-slide.active .stage-content h2           { animation-delay: 0.58s; }
.stage-slide.active .stage-content p            { animation-delay: 0.72s; }
.stage-slide.active .stage-content .stage-cta   { animation-delay: 0.86s; }

@keyframes stageTextIn {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ── Barra inferior: tabs con nombre + progreso de autoplay ── */
.stage-bar {
  position: absolute;
  left: clamp(1.4rem, 5vw, 4.5rem);
  right: clamp(1.4rem, 5vw, 4.5rem);
  bottom: clamp(1.2rem, 3vh, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  z-index: 6;
}

.stage-tabs {
  display: flex;
  gap: 0.6rem;
  flex: 1;
  max-width: 560px;
}

.stage-tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 0.7rem 1rem 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.stage-tab:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.stage-tab.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 148, 77, 0.5);
  color: #fff;
}

/* Riel + relleno de progreso del autoplay */
.tab-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.tab-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
}

.stage-tab.active .tab-fill {
  animation: tabFill var(--stage-interval, 6.5s) linear forwards;
}

.hero-stage.paused .stage-tab.active .tab-fill {
  animation-play-state: paused;
}

@keyframes tabFill {
  to { transform: scaleX(1); }
}

/* ── Flechas: mínimas, glass ── */
.stage-arrows {
  display: flex;
  gap: 0.6rem;
}

.stage-arrow {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.stage-arrow:hover {
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  border-color: transparent;
  transform: scale(1.08);
}

/* ── Accesibilidad ── */
.stage-tab:focus-visible,
.stage-arrow:focus-visible,
.stage-cta:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ── Responsive ── */
@media (max-width: 992px) {
  .stage-content { bottom: clamp(6.4rem, 15vh, 8rem); }
}

@media (max-width: 768px) {
  .hero-stage {
    height: 62vh;
    height: 62dvh;
    min-height: 480px;
    border-radius: 0 0 18px 18px;
  }

  .stage-content {
    left: 5%;
    right: 5%;
    bottom: 7.2rem;
  }

  .stage-content p { display: none; }  /* móvil: titular + CTA, sin párrafo — jerarquía limpia */

  .stage-bar {
    left: 5%;
    right: 5%;
    bottom: 1.1rem;
    gap: 0.8rem;
  }

  .stage-arrows { display: none; }  /* móvil: swipe + tabs bastan */

  .stage-tabs { max-width: none; gap: 0.45rem; }

  .stage-tab {
    font-size: 0.62rem;
    letter-spacing: 0.9px;
    padding: 0.55rem 0.6rem 0.7rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .stage-tag { font-size: 0.62rem; letter-spacing: 2px; padding: 0.36rem 0.8rem; }
  .stage-cta { padding: 0.85rem 1.8rem; font-size: 0.84rem; }
}

/* ── Movimiento reducido: experiencia estática digna ── */
@media (prefers-reduced-motion: reduce) {
  .stage-slide {
    clip-path: none;
    transition: opacity 0.4s ease;
  }
  .stage-slide.leaving { animation: none; opacity: 0; }
  .stage-slide.active::after { animation: none; opacity: 0; }
  .stage-slide img,
  .stage-slide.active img { transform: none; transition: none; }
  .stage-content > * {
    opacity: 1; transform: none; filter: none; animation: none !important;
  }
  .stage-tab.active .tab-fill { animation: none; transform: scaleX(1); }
}
