/* ==========================================================================
EQUINO BIKE - SISTEMA DE ESTILOS Y ANIMACIONES (OWASP & LIGHTHOUSE)
========================================================================== */

/* Fase 32: envueltas en var(--dsn-X, valor-de-fábrica) para que respondan
   en vivo al editor de colores del panel (dsn-editor-hotspots.js pisa
   --dsn-accent/--dsn-fondo/etc. en document.documentElement mientras se
   edita, antes de guardar/publicar). El valor de fábrica de acá abajo es
   solo el fallback — el valor real configurado en Diseño Web lo pisa el
   <style> inline de main.php (se carga después de este archivo, así que
   gana en el cascade) para --bg-dark/--bg-card; --brand-orange/--brand-gold
   quedan atados a --dsn-accent/--dsn-accent2 (mismos campos que usa Tailwind
   más arriba en main.php) para que el naranja/dorado de marca de esta
   plantilla también sea editable, cosa que antes no pasaba ni publicando. */
:root {
  --bg-dark: var(--dsn-fondo, #06080A);
  --bg-card: var(--dsn-card-bg, var(--dsn-superficie, #141A24));
  --bg-border: #232C3D;
  --brand-orange: var(--dsn-accent, #FF6B00);
  --brand-orange-hover: #E05E00;
  --brand-red: #E53E3E;
  --brand-gold: var(--dsn-accent2, #D4AF37);
  --brand-green: #25D366;
  --text-main: var(--dsn-texto, #F3F4F6);
  --text-muted: #9CA3AF;
}

html {
  background-color: var(--bg-dark);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: transparent; 
  color: var(--text-main);
  overflow-x: hidden;
  position: relative;
}

/* ==========================================================================
   FONDO PREMIUM: PARALLAX CON DIRECCIÓN DE ARTE (MOBILE FIRST)
   ========================================================================== */
body::before {
  content: "";
  position: fixed;
  /* Ampliamos el canvas a 120% para absorber el nuevo zoom agresivo */
  top: -10vh;
  left: -10vw;
  width: 120vw;
  height: 120vh;

  /* IMAGEN POR DEFECTO PARA CELULARES (Vertical) */
  background-image:
    radial-gradient(ellipse at center, transparent 10%, var(--bg-dark, #06080A) 100%),
    linear-gradient(to bottom, var(--bg-dark, #06080A) 0%, rgba(var(--bg-dark-rgb, 6,8,10),0.2) 30%, rgba(var(--bg-dark-rgb, 6,8,10),0.2) 70%, var(--bg-dark, #06080A) 100%),
    url('../img/bicicleta_ruta_mobile.webp');

  background-size: cover;
  /* Anclado al fondo para asegurar que el ciclista (suelo) siempre se vea */
  background-position: center bottom;
  background-repeat: no-repeat;

  filter: brightness(0.85) contrast(1.15) saturate(1.2);
  opacity: 0.38;
  z-index: -1;
  pointer-events: none;

  /* Animación más dramática */
  animation: slowRideMotion 28s ease-in-out infinite alternate;
  will-change: transform;
  transform-origin: center center;
}

/* IMAGEN PARA TABLETS Y COMPUTADORAS (Horizontal) */
@media (min-width: 768px) {
  body::before {
    background-image:
      radial-gradient(ellipse at center, transparent 10%, var(--bg-dark, #06080A) 100%),
      linear-gradient(to bottom, var(--bg-dark, #06080A) 0%, rgba(var(--bg-dark-rgb, 6,8,10),0.2) 30%, rgba(var(--bg-dark-rgb, 6,8,10),0.2) 70%, var(--bg-dark, #06080A) 100%),
      url('../img/bicicleta_ruta_desktop.webp');
    background-position: center center;
  }
}

/* Fase 45: apaga el fondo animado de fábrica (ruta en bici) cuando el admin
   lo desactiva desde Diseño Web → Colores. La clase la pone el propio
   main.php en el <body> según colores.fondo_fabrica, y dsn-editor-hotspots.js
   la togglea en vivo dentro del iframe de preview antes de publicar. Queda
   solo el color "Fondo" de --bg-dark (definido en html{} más arriba). */
body.dsn-sin-fondo-fabrica::before {
  content: none !important;
  display: none !important;
}

/* ANIMACIÓN KEN BURNS INTENSIFICADA */
@keyframes slowRideMotion {
  0% { transform: scale(1) translate(0, 0); }
  /* Zoom al 15% (antes 7%) y traslación más amplia */
  50% { transform: scale(1.15) translate(-15px, -20px); }
  100% { transform: scale(1.05) translate(10px, -8px); }
}

.font-display { font-family: 'Oswald', sans-serif; }

/* 1. BANNER PROMOCIONAL ANIMADO (Marquee) */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  display: flex;
  align-items: center;
  /* Degradado de marca (rojo > naranja > dorado > naranja > rojo). Animado más abajo. */
  background: linear-gradient(90deg, #7f1d1d, #FF6B00, #D4AF37, #FF6B00, #7f1d1d);
  background-size: 300% 100%;
  background-position: 0% 50%;
}

.marquee-content {
  display: inline-flex;
  animation: marquee 20s linear infinite;
  will-change: transform;
}

.marquee-container:hover .marquee-content {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Cinta con degradado de marca deslizándose continuamente */
@media (prefers-reduced-motion: no-preference) {
  .marquee-container {
    animation: tickerGradientFlow 6s linear infinite;
  }
}

@keyframes tickerGradientFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* Texto con degradado arcoíris animado (para palabras/frases destacadas) */
.text-efecto-arcoiris {
  background: linear-gradient(90deg, #ff3b30, #ff9500, #ffcc00, #34c759, #00c7be, #007aff, #af52de, #ff3b30);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .text-efecto-arcoiris {
    animation: rainbowMove 5s linear infinite;
  }
}

/* Efectos alternativos de la "palabra destacada" (elegibles desde Diseño
   Web → Efectos). */
.text-efecto-solido { color: var(--pd-color, var(--brand-orange)); }
.text-efecto-degradado {
  background: linear-gradient(90deg, var(--pd-color, var(--brand-orange)), var(--pd-color2, var(--brand-gold)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-efecto-subrayado {
  color: inherit;
  background-image: linear-gradient(120deg, var(--pd-color, var(--brand-orange)) 0%, var(--pd-color, var(--brand-orange)) 100%);
  background-repeat: no-repeat;
  background-size: 100% .35em;
  background-position: 0 88%;
}
.text-efecto-contorno {
  color: var(--pd-color, var(--brand-orange));
  -webkit-text-stroke: 1.5px var(--pd-color, var(--brand-orange));
  -webkit-text-fill-color: transparent;
}

@keyframes rainbowMove {
  to { background-position: 300% center; }
}

/* Brillo animado (shine sweep) para CTAs principales */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
}

@media (prefers-reduced-motion: no-preference) {
  .btn-shine::after {
    animation: shineSweep 3.2s ease-in-out infinite;
  }
}

@keyframes shineSweep {
  0% { left: -75%; }
  25% { left: 125%; }
  100% { left: 125%; }
}

/* Pulso suave para badges/links de oferta */
@media (prefers-reduced-motion: no-preference) {
  .badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
  }
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 62, 62, .55); }
  50% { box-shadow: 0 0 0 7px rgba(229, 62, 62, 0); }
}

/* 2. HEADER Y MEGA-MENÚS ESTILO FITNET */
.nav-glass {
  background: color-mix(in srgb, var(--bg-surface, #0B0E14) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.mega-menu-content {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease-in-out;
  pointer-events: none;
}

.has-mega-menu:hover .mega-menu-content,
.group:hover .mega-menu-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* 3. COMPONENTES DE UI */
.swiper-button-next, .swiper-button-prev {
  color: var(--brand-orange) !important;
  background: rgba(11, 14, 20, 0.85);
  width: 44px !important; height: 44px !important;
  border-radius: 50%;
  border: 1px solid rgba(255, 107, 0, 0.3);
  transition: all 0.3s ease;
}

.swiper-button-next:hover, .swiper-button-prev:hover {
  background: var(--brand-orange);
  color: #ffffff !important;
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(255, 107, 0, 0.5);
}

.swiper-pagination-bullet-active {
  background: var(--brand-orange) !important;
  width: 28px !important;
  border-radius: 4px !important;
}

/* 4. SCROLLBAR ESTILO GAMING */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #06080A; }
::-webkit-scrollbar-thumb { background: #232C3D; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-orange); }

/* 5. SELECTOR DE VARIANTES (talle / color / rodado) — card de producto y modal rápido */
.pv-selector { display: flex; flex-direction: column; gap: 6px; }
.pv-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); font-weight: 700;
}
.pv-selected-label { color: var(--text-main); font-weight: 700; text-transform: none; letter-spacing: normal; }
.pv-options { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .15s, border-color .15s;
  outline: none;
}
.pv-swatch:hover { transform: scale(1.15); }
.pv-swatch.pv-active { border-color: var(--brand-orange); transform: scale(1.2); box-shadow: 0 0 0 1px var(--bg-dark); }
.pv-chip {
  padding: 3px 9px; border-radius: 6px; border: 1px solid var(--bg-border);
  background: transparent; color: var(--text-muted); font-size: 11px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  outline: none;
}
.pv-chip:hover { border-color: var(--brand-orange); color: var(--text-main); }
.pv-chip.pv-active { border-color: var(--brand-orange); background: rgba(255, 107, 0, .12); color: var(--brand-orange); }
/* ==========================================================================
   SELLO DATA FISCAL (ARCA) — tamaño configurable desde admin > Datos del negocio
   ========================================================================== */
.footer-data-fiscal img,
.footer-data-fiscal a img {
  height: var(--data-fiscal-h, 36px) !important;
  width: auto !important;
  display: block;
}

/* ══════════════════════════════════════════════════════════════════════
   Fase 82 — transiciones mezcladas del hero (pedido del usuario: que no
   todas las fotos del hero transicionen igual/lateral). Cada foto puede
   tener su propio efecto de entrada, elegido por slide desde Diseño Web
   (Productos → botón ⚙ de cada imagen del hero). 'fade' = comportamiento
   de siempre (fundido), sin cambios visibles hasta que se elija otro
   efecto. Se respeta prefers-reduced-motion: con esa preferencia activada
   en el sistema operativo del visitante, todas las fotos quedan con el
   fundido simple de siempre, sin las animaciones de zoom/deslizar/flip.
   ══════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  @keyframes heroFxZoom       { from { transform: scale(1);         } to { transform: scale(1.12); } }
  @keyframes heroFxSlideLeft  { from { transform: translateX(5%);  opacity: .35; } to { transform: translateX(0); opacity: 1; } }
  @keyframes heroFxSlideRight { from { transform: translateX(-5%); opacity: .35; } to { transform: translateX(0); opacity: 1; } }
  @keyframes heroFxFlip       { from { transform: perspective(1200px) rotateY(14deg) scale(.94); opacity: .3; } to { transform: perspective(1200px) rotateY(0) scale(1); opacity: 1; } }

  .fer-hero-slide.active[data-fx="zoom"],
  .cs-hero-slide.active[data-fx="zoom"],
  .swiper-slide-active .hero-fx-inner[data-fx="zoom"] { animation: heroFxZoom 6.5s ease-out forwards; }

  .fer-hero-slide.active[data-fx="slide-left"],
  .cs-hero-slide.active[data-fx="slide-left"],
  .swiper-slide-active .hero-fx-inner[data-fx="slide-left"] { animation: heroFxSlideLeft .9s ease-out; }

  .fer-hero-slide.active[data-fx="slide-right"],
  .cs-hero-slide.active[data-fx="slide-right"],
  .swiper-slide-active .hero-fx-inner[data-fx="slide-right"] { animation: heroFxSlideRight .9s ease-out; }

  .fer-hero-slide.active[data-fx="flip"],
  .cs-hero-slide.active[data-fx="flip"],
  .swiper-slide-active .hero-fx-inner[data-fx="flip"] { animation: heroFxFlip 1s ease-out; }

  /* Fase 85 — pedido del usuario: sumar más variedad de transiciones al
     hero además de las 5 de Fase 82. 'elastico' y 'cubo' son variantes del
     mismo transform+perspective que zoom/slide/flip; 'iris' usa clip-path
     circle() (interpola de forma nativa igual que transform/opacity).
     'cortina' usa clip-path polygon() con el MISMO número de vértices en
     los dos extremos del keyframe (8 franjas verticales, cada una como
     sub-lazo cerrado que vuelve a su propio borde superior antes de pasar
     a la siguiente franja, para que el "conector" entre franjas no
     encierre un triángulo diagonal) — es la técnica que sí funciona:
     probamos primero animar los stops de un repeating-linear-gradient()
     en mask-image, pero eso NO interpola en los navegadores probados
     (queda "todo o nada" de golpe a la mitad de la animación, sin
     transición real), por eso se descartó esa vía. 'desenfoque' anima
     filter:blur, también soportado de forma nativa. */
  @keyframes heroFxElastico   { from { transform: translateX(10%); opacity: .35; } to { transform: translateX(0); opacity: 1; } }
  @keyframes heroFxCortina    { 0% { clip-path: polygon(0.0% 0%, 0.25% 0%, 0.25% 100%, 0.0% 100%, 0.0% 0%, 12.5% 0%, 12.75% 0%, 12.75% 100%, 12.5% 100%, 12.5% 0%, 25.0% 0%, 25.25% 0%, 25.25% 100%, 25.0% 100%, 25.0% 0%, 37.5% 0%, 37.75% 0%, 37.75% 100%, 37.5% 100%, 37.5% 0%, 50.0% 0%, 50.25% 0%, 50.25% 100%, 50.0% 100%, 50.0% 0%, 62.5% 0%, 62.75% 0%, 62.75% 100%, 62.5% 100%, 62.5% 0%, 75.0% 0%, 75.25% 0%, 75.25% 100%, 75.0% 100%, 75.0% 0%, 87.5% 0%, 87.75% 0%, 87.75% 100%, 87.5% 100%, 87.5% 0%); } 100% { clip-path: polygon(0.0% 0%, 12.5% 0%, 12.5% 100%, 0.0% 100%, 0.0% 0%, 12.5% 0%, 25.0% 0%, 25.0% 100%, 12.5% 100%, 12.5% 0%, 25.0% 0%, 37.5% 0%, 37.5% 100%, 25.0% 100%, 25.0% 0%, 37.5% 0%, 50.0% 0%, 50.0% 100%, 37.5% 100%, 37.5% 0%, 50.0% 0%, 62.5% 0%, 62.5% 100%, 50.0% 100%, 50.0% 0%, 62.5% 0%, 75.0% 0%, 75.0% 100%, 62.5% 100%, 62.5% 0%, 75.0% 0%, 87.5% 0%, 87.5% 100%, 75.0% 100%, 75.0% 0%, 87.5% 0%, 100.0% 0%, 100.0% 100%, 87.5% 100%, 87.5% 0%); } }
  @keyframes heroFxIris       { from { clip-path: circle(0% at 50% 50%); opacity: .6; } to { clip-path: circle(100% at 50% 50%); opacity: 1; } }
  @keyframes heroFxDesenfoque { from { filter: blur(18px); opacity: .5; transform: scale(1.03); } to { filter: blur(0); opacity: 1; transform: scale(1); } }
  @keyframes heroFxCubo       { from { transform: perspective(1000px) rotateY(70deg); opacity: .25; } to { transform: perspective(1000px) rotateY(0deg); opacity: 1; } }

  .fer-hero-slide.active[data-fx="elastico"],
  .cs-hero-slide.active[data-fx="elastico"],
  .swiper-slide-active .hero-fx-inner[data-fx="elastico"] { animation: heroFxElastico 1.1s cubic-bezier(.34,1.56,.64,1); }

  .fer-hero-slide.active[data-fx="cortina"],
  .cs-hero-slide.active[data-fx="cortina"],
  .swiper-slide-active .hero-fx-inner[data-fx="cortina"] { animation: heroFxCortina 1.1s steps(8, end); }

  .fer-hero-slide.active[data-fx="iris"],
  .cs-hero-slide.active[data-fx="iris"],
  .swiper-slide-active .hero-fx-inner[data-fx="iris"] { animation: heroFxIris .9s ease-out; }

  .fer-hero-slide.active[data-fx="desenfoque"],
  .cs-hero-slide.active[data-fx="desenfoque"],
  .swiper-slide-active .hero-fx-inner[data-fx="desenfoque"] { animation: heroFxDesenfoque .9s ease-out; }

  .fer-hero-slide.active[data-fx="cubo"],
  .cs-hero-slide.active[data-fx="cubo"],
  .swiper-slide-active .hero-fx-inner[data-fx="cubo"] { animation: heroFxCubo 1s ease-out; transform-origin: left center; }
}
/* Envoltorio interno usado solo en las plantillas con Swiper (equinobike,
   vinoteca, la cuadra) para no pisar el transform que Swiper controla en
   el .swiper-slide — el efecto se anima acá adentro, no en el slide. */
.hero-fx-inner { position: absolute; inset: 0; background-size: cover; background-position: center; }
