/* ============================================================
   hero.css — HeroSection: fondo negro, logo, alebrijes flotantes
   Ilios Vounó — tema neón multicolor
   ============================================================ */

/* ── Section ── */
.hero {
  position: relative;
  min-height: 100vh;   /* fallback navegadores antiguos */
  min-height: 100dvh;  /* iOS Safari 15.4+ y Chrome 108+: adapta a barra del browser */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 var(--gutter);
  text-align: center;
  
  background:
    linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.85)),
    url('../../assets/images/smoke_bg_test.jpg');
  background-size: cover;
  background-position: center;
}

@supports not (-webkit-touch-callout: none) {
  .hero {
    background-attachment: fixed;
  }
}

/* Noise texture overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 30%, rgba(0,240,255,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(255,0,200,0.03) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 20%, rgba(170,255,0,0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1; /* Encima del spline-viewer (z-index: 0) */
}

/* Gradient de negro al fondo para suavizar transición a Historia */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 25vh;
  background: linear-gradient(to bottom, transparent, var(--color-black));
  pointer-events: none;
  z-index: 1; /* Encima del spline-viewer */
}

/* ── Spline background viewer ── */
.hero__spline-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none; /* No interfiere con scroll ni clicks del hero */
  display: block;
}

/* ── Hero inner content ── */
.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-16); /* Aumentado para eliminar sensación de amontonamiento */
  max-width: 900px;
  width: 100%;
}

/* ── Logo ── */
.hero__logo-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  perspective: 1000px; /* Habilita el efecto 3D */
}

/* ── Foco / Retroiluminación ELIMINADO para usar el brillo de la montaña ── */
.hero__logo-wrap::before {
  display: none;
}

.hero__mountain-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130%;
  max-width: 800px;
  pointer-events: none;
  z-index: 0;
  
  /* Común: misma base 3D para que se muevan juntas
     (sin translateZ para evitar bugs de rendering en Safari iOS) */
  transform: translate(-50%, -50%) rotateX(10deg);
  animation: breathe-mountain 12s ease-in-out infinite alternate;
}

/* Capa 1: SOLIDEZ (Nítida y Definida) */
.hero__mountain-solid {
  opacity: 0.92;
  filter: none;
}

/* Capa 2: RESPLANDOR (Brillo expansivo por detrás) */
.hero__mountain-glow {
  opacity: 0.45;
  z-index: -1;
  filter:
    drop-shadow(0 0 15px rgba(255,255,255,1))
    drop-shadow(0 0 40px rgba(255,255,255,0.7))
    drop-shadow(0 0 90px rgba(255,255,255,0.4))
    drop-shadow(0 0 160px rgba(255,255,255,0.25));
}

@keyframes breathe-mountain {
  /* Sin translateZ: evita GPU compositing bugs en Safari iOS */
  0% {
    transform: translate(-50%, -50%) rotateX(10deg) scale(1);
  }
  100% {
    transform: translate(-50%, -50%) rotateX(12deg) scale(1.06);
    filter: drop-shadow(0 0 40px rgba(255,255,255,0.8));
  }
}

.hero__logo {
  width: auto;
  max-width: 540px;
  height: auto;
  max-height: 160px;
  object-fit: contain;
  /* Drop shadow to make it pop on dark bg */
  filter: drop-shadow(0 0 30px rgba(0,240,255,0.15))
          drop-shadow(0 0 60px rgba(255,0,200,0.1));
}

/* Fallback si no hay imagen */
.hero__logo-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.hero__logo-mezcal {
  font-family: 'Brush Script MT', 'Dancing Script', cursive;
  font-size: var(--text-xl);
  color: var(--color-white);
  letter-spacing: 0.1em;
}

/* ── Nombre 3D Metálico / Chrome ── */
.hero__logo-name {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 9vw, 7rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  
  /* El volumen / extrusión 3D */
  text-shadow:
    0px 1px 1px #d1d9e6,
    0px 2px 1px #b8c1d1,
    0px 3px 1px #a2acbd,
    0px 4px 1px #8f9ba9,
    0px 5px 1px #7b8896,
    0px 6px 1px #647382,
    0px 7px 1px #52606e,
    0px 15px 10px rgba(0, 0, 0, 0.6),
    0px 25px 20px rgba(0, 0, 0, 0.4);

  /* Cara frontal con gradiente metálico (Movido de ::after para soportar spans internos) */
  background: linear-gradient(
    to bottom,
    #ffffff 0%,
    #e1e8ed 30%,
    #aab6c2 48%,
    #657786 50%,
    #aab6c2 65%,
    #e1e8ed 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__logo-name .initial {
  font-size: 1.25em;
  display: inline-block;
  vertical-align: baseline;
}

/* Pseudo-elemento eliminado para permitir diferentes tamaños de letra */
.hero__logo-name::after {
  display: none;
}

/* ── Tagline ── */
.hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-style: italic;
  font-weight: 400;
  color: var(--color-gray-400);
  max-width: 55ch;
  line-height: var(--leading-loose);
  letter-spacing: 0.01em;
}

/* ── Divider neón ── */
.hero__divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  max-width: 400px;
}

.hero__divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(0,240,255,0.4), transparent);
}

.hero__divider-dot {
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-cyan-400);
  box-shadow: var(--glow-cyan-sm);
}

/* ── Stats ── */
.hero__stats {
  display: flex;
  gap: var(--space-12);
  justify-content: center;
}

.hero__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.hero__stat-number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1;
}

.hero__stat-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-gray-600);
}

/* ── Alebrijes flotantes en hero ── */
.hero__alebrijes {
  position: relative;
  width: 100%;
  height: 320px;
  margin-top: var(--space-6);
}

.hero__alebrije {
  position: absolute;
  cursor: pointer;
  transition:
    transform var(--duration-normal) var(--ease-spring),
    filter var(--duration-normal) var(--ease-out-quart);
}

/* Posiciones horizontales alineadas al fondo para los 5 alebrijes */
.hero__alebrije:nth-child(1) { /* Tobalá */
  left: 5%; bottom: 12%;
  width: 150px;
  animation: hero-float 7s ease-in-out infinite;
}
.hero__alebrije:nth-child(2) { /* Espadín */
  left: 25%; bottom: 12%;
  width: 150px;
  animation: hero-float 8s ease-in-out infinite 1s;
}
.hero__alebrije:nth-child(3) { /* Cuishe */
  left: 50%; bottom: 12%;
  transform: translateX(-50%);
  width: 150px;
  animation: hero-float 6s ease-in-out infinite 0.5s;
}
.hero__alebrije:nth-child(4) { /* Sierra Negra */
  right: 25%; bottom: 12%;
  width: 150px;
  animation: hero-float 9s ease-in-out infinite 1.5s;
}
.hero__alebrije:nth-child(5) { /* Coyote */
  right: 5%; bottom: 12%;
  width: 150px;
  animation: hero-float 7.5s ease-in-out infinite 0.8s;
}

.hero__alebrije img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.5));
  transition:
    filter var(--duration-normal) var(--ease-out-quart),
    transform var(--duration-normal) var(--ease-spring);
}

/* Hover en alebrije */
.hero__alebrije:hover {
  z-index: 10;
}

.hero__alebrije:hover img {
  transform: scale(1.12);
}

/* Glow dinámico por color de cada alebrije */
.hero__alebrije[data-product="tobala"]:hover img {
  filter: drop-shadow(0 0 20px rgba(155,89,182,0.7)) drop-shadow(0 8px 20px rgba(0,0,0,0.5));
}
.hero__alebrije[data-product="espadin"]:hover img {
  filter: drop-shadow(0 0 20px rgba(0,188,212,0.7)) drop-shadow(0 8px 20px rgba(0,0,0,0.5));
}
.hero__alebrije[data-product="cuishe"]:hover img {
  filter: drop-shadow(0 0 20px rgba(255,128,171,0.7)) drop-shadow(0 8px 20px rgba(0,0,0,0.5));
}
.hero__alebrije[data-product="sierra_negra"]:hover img {
  filter: drop-shadow(0 0 20px rgba(149,165,166,0.6)) drop-shadow(0 8px 20px rgba(0,0,0,0.5));
}
.hero__alebrije[data-product="coyote"]:hover img {
  filter: drop-shadow(0 0 20px rgba(0,230,118,0.7)) drop-shadow(0 8px 20px rgba(0,0,0,0.5));
}

/* ── Label de nombre al hover ── */
.hero__alebrije-label {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-white);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--duration-normal);
  pointer-events: none;
}

.hero__alebrije:hover .hero__alebrije-label { opacity: 1; }

/* ── CTA Buttons ── */
.hero__ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Primary: Liquid Glass Solid */
.btn--primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-black);
  
  /* Apple Liquid Glass Effect */
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out-quart);
}
.btn--primary:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}
.btn--primary:active { transform: translateY(0); }

/* Ghost / Liquid Glass Translucent */
.btn--ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-white);
  
  /* Apple Liquid Glass Translucent Effect */
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out-quart);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* ── Scroll hint ── */
.hero__scroll-hint {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-gray-600);
}

.hero__scroll-text {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.8));
  animation: bounce-subtle 2s ease-in-out infinite;
}

/* ── Keyframe flotante hero ── */
@keyframes hero-float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-14px) rotate(1deg); }
  66%       { transform: translateY(-6px) rotate(-0.5deg); }
}

/* Para el elemento centrado que tiene translateX */
.hero__alebrije:nth-child(3) {
  animation: hero-float-center 6s ease-in-out infinite 0.5s;
}

@keyframes hero-float-center {
  0%, 100% { transform: translateX(-50%) translateY(0px); }
  50%       { transform: translateX(-50%) translateY(-14px); }
}

/* ── Fade bottom ── */
.hero__fade-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 160px;
  background: linear-gradient(to bottom, transparent, var(--bg-primary));
  pointer-events: none;
  z-index: 1;
}
/* ── Mobile Optimizations (Max Width 768px) ── */
@media (max-width: 768px) {

  /* Logo Familia (Top-left) */
  .hero img[src*="familia"] {
    width: 60px !important;
    top: 15px !important;
    left: 15px !important;
  }

  /* ── Mezcal Logo: centrado por flexbox (sin left/margin hack) ── */
  .hero__logo-wrap img[alt="Mezcal"] {
    width: 130px !important;
    transform: translateX(0) translateY(-5px) !important;
    margin-bottom: 5px !important;
    position: static !important;
    align-self: center !important;
  }

  /* Main Title Scaling */
  .hero__logo-name {
    font-size: clamp(2.1rem, 12vw, 3.8rem) !important;
    white-space: nowrap !important;
  }

  /* Mountain Logo Scaling */
  .hero__mountain-bg {
    width: 90vw !important;
    max-width: 450px !important;
  }

  /* Bottom Design (Agaves & Tagline) */
  .hero__bottom-stage {
    bottom: 20px !important;
  }

  .hero__tagline-reveal {
    flex-direction: column !important;
    gap: var(--space-4) !important;
    justify-content: center !important;
  }

  .hero__tagline-reveal img {
    width: 60px !important;
    opacity: 0.3 !important;
  }

  .hero__tagline {
    font-size: 12px !important;
    letter-spacing: 0.3em !important;
    order: 2;
  }

  .hero__tagline-reveal img:first-child { 
    order: 1; 
    margin-bottom: -10px !important; 
    transform: scale(0.8) !important;
  }
  .hero__tagline-reveal img:last-child { 
    order: 3; 
    margin-top: -10px !important; 
    transform: scaleX(-1) scale(0.8) !important;
  }

  .hero__center-stage {
    top: 45% !important;
  }

  /* ── Floritura / Maguey de abajo: más grande en móvil ── */
  .hero__bottom-stage > img.reveal-fade-up {
    width: 220px !important;
    margin-top: 18px !important;
  }

  /* ── Alebrijes en hero: manejados por responsive.css sin !important ── */

  /* Murciélagos: manejados directamente en el footer con posición absoluta */
}

