/* ==========================================================================
   ESTILOS PERSONALIZADOS - LANDING ELECTRICIDAD & HERRERÍA (2026 EDITION)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  --color-primary: #ef4444;
  --color-primary-glow: rgba(239, 68, 68, 0.45);
  --color-secondary: #eab308;
  --color-secondary-glow: rgba(234, 179, 8, 0.4);
  --color-dark-bg: #000000; /* True OLED Black */
  --color-card-bg: rgba(12, 14, 20, 0.78);
  --color-card-border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: #000000;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--color-dark-bg);
  color: #f1f5f9;
  overflow-x: hidden;
  line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Glassmorphism 2026 */
.glass-panel {
  background: var(--color-card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-card-border);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}

.glass-panel-interactive {
  background: var(--color-card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-card-border);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel-interactive:hover {
  transform: translateY(-4px);
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 20px 40px -15px rgba(239, 68, 68, 0.25);
}

.glass-panel-amber:hover {
  border-color: rgba(234, 179, 8, 0.45);
  box-shadow: 0 20px 40px -15px rgba(234, 179, 8, 0.25);
}

/* ==========================================================================
   CANVAS HERO FULL SCREEN & SCROLL INTERACTIVE
   ========================================================================== */
.hero-scroll-wrapper {
  position: relative;
  height: 260vh;
  width: 100%;
}

.hero-sticky-container {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000;
}

/* Ambient glow background */
.hero-ambient-glow {
  position: absolute;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.18) 0%, rgba(234, 179, 8, 0.08) 50%, transparent 70%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 1;
}

/* Canvas Wrapper - Ocupa 100% de la pantalla */
.hero-canvas-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#hero-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Viñeta y degradado OLED */
.hero-overlay-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 65%, rgba(0, 0, 0, 0.98) 100%),
              linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, transparent 18%, transparent 75%, rgba(0, 0, 0, 1) 100%);
}

/* Indicador HUD de Etapas en Mobile */
.hero-hud-indicator {
  position: absolute;
  top: 5.5rem;
  left: 0;
  right: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  pointer-events: none;
}

.hud-step-pill {
  width: 8px;
  height: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-step-pill.active {
  width: 24px;
  background: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.9);
}

/* Contenedor Flotante de Textos */
.hero-text-overlay {
  position: absolute;
  bottom: 1.5rem;
  left: 1rem;
  right: 1rem;
  max-width: 540px;
  margin: 0 auto;
  z-index: 10;
  pointer-events: none;
  min-height: 190px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 768px) {
  .hero-text-overlay {
    bottom: 2rem;
    max-width: 580px;
    min-height: 200px;
  }
}

/* Tarjeta individual de cada etapa (Fondo translúcido de cristal 2026) */
.hero-text-stage {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  text-align: center;
  padding: 1.1rem 1.35rem;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 1.5rem;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7), 0 0 25px -5px rgba(239, 68, 68, 0.15);
}

.hero-text-stage.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Glow & Shimmer Effects */
.glow-electric {
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.7), 0 0 40px rgba(220, 38, 38, 0.4);
}

.glow-spark {
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.7), 0 0 40px rgba(249, 115, 22, 0.4);
}

@keyframes shimmer-text {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.shimmer-gradient {
  background: linear-gradient(90deg, #ef4444 0%, #ff6b6b 50%, #ef4444 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer-text 6s linear infinite;
}

/* Pulse animation for CTA */
@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 15px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.pulse-whatsapp {
  animation: pulse-ring 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

/* Preloader styles */
#preloader {
  position: fixed;
  inset: 0;
  background-color: #000000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Scroll progress bar (Rojo Eléctrico y Carmesí) */
#scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #991b1b, #dc2626, #ef4444, #f87171);
  z-index: 100;
  width: 0%;
  transition: width 0.1s linear;
}

/* ==========================================================================
   ANIMACIONES DE ENTRADA AL SCROLLEAR (STAGGER REVEAL)
   ========================================================================== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 { transition-delay: 0.08s; }
.stagger-2 { transition-delay: 0.16s; }
.stagger-3 { transition-delay: 0.24s; }
.stagger-4 { transition-delay: 0.32s; }

/* ==========================================================================
   CARRUSEL HORIZONTAL TÁCTIL EN MOBILE (SCROLL SNAP)
   ========================================================================== */
@media (max-width: 767px) {
  .mobile-scroll-snap {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 1rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    scrollbar-width: none;
  }
  .mobile-scroll-snap::-webkit-scrollbar {
    display: none;
  }
  .mobile-scroll-snap > * {
    flex: 0 0 85%;
    scroll-snap-align: center;
  }
}

/* ==========================================================================
   BARRA FLOTANTE INFERIOR MÓVIL (MOBILE BOTTOM ACTION DOCK)
   ========================================================================== */
#mobile-bottom-dock {
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

/* FAQ Accordion Transitions */
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
}

.faq-item.open .faq-content {
  max-height: 350px;
  opacity: 1;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #000000;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* ==========================================================================
   GALERÍA DE TRABAJOS & LIGHTBOX
   ========================================================================== */
.gallery-item {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, box-shadow 0.35s ease;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 30px rgba(239, 68, 68, 0.2);
}

.gallery-item.hidden-item {
  display: none !important;
}

#gallery-lightbox.active {
  display: flex !important;
  opacity: 1 !important;
}

/* Canvas de Descarga Eléctrica y Chispas al Tocar / Cliquear */
#electric-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Soporte para reducción de movimiento (Accesibilidad WCAG 2.1 AA) */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
