/* ==========================================================================
   VISIONFX - MEJORAS (se carga DESPUÉS de style.css para sobrescribirlo)
   1. Fix de overflow para que position: sticky funcione
   2. Catálogo: imagen completa 9:16 + título/descripción debajo
   3. Hero 3D con scroll
   ========================================================================== */

/* ---------- 1. OVERFLOW ----------
   "hidden" en body lo convierte en contenedor de scroll y rompe sticky.
   "clip" corta igual el scroll horizontal sin ese efecto secundario. */
html {
  overflow-x: clip !important;
}

body {
  overflow: visible !important;
  overflow-x: clip !important;
}

/* ---------- 2. CATÁLOGO ---------- */
.catalogo-container {
  max-width: 1400px;
}

.grid-catalogo {
  min-height: 0;
  align-items: start;
}

.item-catalogo {
  background: linear-gradient(180deg, #121212 0%, #0a0a0a 100%);
  border: 1px solid rgba(255, 215, 0, 0.12);
  border-radius: 16px;
  overflow: hidden;
  height: auto !important;
  transition: transform 0.4s cubic-bezier(.2, .8, .2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.item-catalogo:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 215, 0, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.15);
}

/* Caja con la proporción real de las fotos (1080x1920 = 9:16) */
.item-catalogo picture {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
  overflow: hidden;
}

.item-catalogo picture img,
.grid-catalogo .item-catalogo picture img,
.catalogo-carousel .item-catalogo picture img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center !important;
  background: #000 !important;
  transform: none !important;
}

/* Título y descripción DEBAJO de la foto, sin taparla */
.item-catalogo h3,
.grid-catalogo .item-catalogo h3 {
  position: static !important;
  background: none !important;
  margin: 0 !important;
  padding: 16px 15px 6px !important;
  font-size: 1.15em;
  font-weight: 500;
  letter-spacing: 2px;
  color: #fff;
}

.item-catalogo p,
.grid-catalogo .item-catalogo p {
  position: static !important;
  background: none !important;
  margin: 0 !important;
  padding: 0 15px 18px !important;
  color: #bdbdbd;
}

@media (max-width: 768px) {
  /* Foto completa sin pasar del alto de la pantalla */
  .catalogo-carousel .item-catalogo picture {
    max-height: 72vh;
  }

  .catalogo-carousel .item-catalogo h3 {
    display: block !important;
    padding-top: 14px !important;
  }

  .catalogo-carousel .item-catalogo p {
    margin: 0 !important;
    padding: 0 18px 20px !important;
    font-size: 1em;
  }
}

/* ---------- 3. HERO 3D ---------- */
:root {
  --gold: #FFD700;
  --gold-deep: #E0A800;
}

/* Header: degradado transparente sobre el hero, vidrio al hacer scroll */
header {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
  transition: background 0.4s ease, height 0.4s ease;
}

header.scrolled {
  height: 90px;
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255, 215, 0, 0.12);
}

.logo {
  transition: height 0.4s ease;
}

header.scrolled .logo {
  height: 360px;
}

.hero.hero-3d {
  position: relative;
  height: 200vh; /* recorrido de scroll para la animación */
  padding: 0;
  background: radial-gradient(ellipse at 50% 40%, #1a1406 0%, #000 65%);
}

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  perspective: 1400px;
  perspective-origin: 50% 40%;
}

.hero-stage {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

/* Marco de fotos: se encoge, redondea e inclina en 3D con el scroll */
.hero-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform-origin: 50% 60%;
  will-change: transform;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.8);
}

.hero-3d .carousel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.hero-3d .carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.12);
  transition: opacity 1.4s ease, transform 7s ease-out;
}

/* Ken Burns sobre la foto activa */
.hero-3d .carousel img.active {
  transform: scale(1);
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 28%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.88) 100%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55) 100%);
}

.hero-sparks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero-content {
  position: absolute;
  left: 50%;
  bottom: 12vh;
  transform: translateX(-50%);
  z-index: 5;
  width: min(1100px, 92vw);
  text-align: center;
  will-change: transform, opacity, filter;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
  opacity: 0;
  animation: heroFadeUp 1s 0.3s cubic-bezier(.2, .8, .2, 1) forwards;
}

.hero-eyebrow::before,
.hero-eyebrow::after {
  content: '';
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.hero-eyebrow::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.hero-title {
  font-size: clamp(1.8rem, 5.5vw, 4.8rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -1px;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 22px;
  perspective: 800px;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.hero-line {
  display: block;
  overflow: hidden;
  padding: 0.04em 0;
}

.hero-line-accent {
  color: var(--gold);
  text-shadow: 0 6px 30px rgba(255, 200, 0, 0.35);
}

/* Letras separadas por hero3d.js */
.hero-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(110%) rotateX(-80deg);
  transform-origin: 50% 100%;
  animation: heroCharIn 1s cubic-bezier(.2, .9, .25, 1) forwards;
}

.hero-line-accent .hero-char {
  background: linear-gradient(100deg, #fff6c9 0%, var(--gold) 35%, var(--gold-deep) 55%, #fff6c9 75%, var(--gold) 100%);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  animation: heroCharIn 1s cubic-bezier(.2, .9, .25, 1) forwards, heroShine 6s linear infinite;
}

.hero-sub {
  max-width: 620px;
  margin: 0 auto 30px;
  font-size: clamp(0.95rem, 1.3vw, 1.12rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  opacity: 0;
  animation: heroFadeUp 1s 1.3s cubic-bezier(.2, .8, .2, 1) forwards;
}

.hero-ctas {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  opacity: 0;
  animation: heroFadeUp 1s 1.55s cubic-bezier(.2, .8, .2, 1) forwards;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.35s cubic-bezier(.2, .8, .2, 1), box-shadow 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

.hero-btn-primary {
  color: #111;
  background: linear-gradient(135deg, #ffe680, var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 10px 30px rgba(255, 200, 0, 0.35);
}

.hero-btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 40px rgba(255, 200, 0, 0.5);
}

.hero-btn-ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-btn-ghost:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  color: var(--gold);
}

/* Frase que aparece en la segunda fase del scroll */
.hero-statement {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  padding: 0 6vw;
  will-change: transform, opacity;
}

.hero-statement-kicker {
  font-size: 0.8rem;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}

.hero-statement-text {
  font-size: clamp(1.2rem, 3.5vw, 2.8rem);
  font-weight: 600;
  line-height: 1.1;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 10px 50px rgba(0, 0, 0, 0.9);
}

.hero-statement-text span {
  color: var(--gold);
  padding: 0 0.15em;
}

/* HUD: contador y progreso del carrusel */
.hero-hud {
  position: absolute;
  right: 4vw;
  bottom: 6vh;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-size: 0.8rem;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0;
  animation: heroFadeIn 1s 1.9s ease forwards;
}

.hero-counter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-counter #hero-current {
  color: var(--gold);
  font-weight: 600;
}

.hero-counter-sep {
  width: 30px;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
}

.hero-progress {
  width: 120px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  border-radius: 2px;
}

.hero-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--gold);
  transform-origin: left;
  transform: scaleX(0);
}

.hero-progress span.run {
  animation: heroProgress 5s linear forwards;
}

/* Indicador de scroll */
.hero-scroll-cue {
  position: absolute;
  left: 4vw;
  bottom: 6vh;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.72rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  opacity: 0;
  animation: heroFadeIn 1s 2.1s ease forwards;
}

.hero-mouse {
  width: 22px;
  height: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  position: relative;
}

.hero-wheel {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--gold);
  animation: heroWheel 1.8s ease-in-out infinite;
}

@keyframes heroCharIn {
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroFadeIn {
  to { opacity: 1; }
}

@keyframes heroShine {
  from { background-position: 0% 0; }
  to { background-position: 400% 0; }
}

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

@keyframes heroWheel {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(12px); }
}

@media (max-width: 768px) {
  .hero.hero-3d {
    height: 160vh;
  }

  .hero-content {
    bottom: 13vh;
  }

  .hero-eyebrow {
    font-size: 0.65rem;
    letter-spacing: 4px;
  }

  .hero-eyebrow::before,
  .hero-eyebrow::after {
    width: 22px;
  }

  .hero-sub {
    font-size: 0.92rem;
    margin-bottom: 22px;
  }

  .hero-btn {
    padding: 13px 22px;
    font-size: 0.75rem;
  }

  .hero-hud {
    right: 50%;
    transform: translateX(50%);
    bottom: 4vh;
    align-items: center;
  }

  .hero-scroll-cue {
    display: none;
  }
}

/* Accesibilidad: usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .hero.hero-3d {
    height: 100vh;
  }

  .hero-char,
  .hero-eyebrow,
  .hero-sub,
  .hero-ctas,
  .hero-hud,
  .hero-scroll-cue {
    animation: none !important;
    opacity: 1 !important;
  }

  .hero-char {
    transform: none !important;
  }

  .hero-3d .carousel img,
  .hero-3d .carousel img.active {
    transform: none;
    transition: opacity 1s ease;
  }

  .hero-sparks,
  .hero-statement {
    display: none;
  }
}
