/*
 * ═══════════════════════════════════════════════════════════════════
 * futuristic.css — Sistema de diseno premium ecommerce
 * ═══════════════════════════════════════════════════════════════════
 *
 * Capa de polish visual sobre Tailwind CDN. Define design tokens, mesh
 * gradients animados, glassmorphism, tilt-on-hover, gradient text,
 * scroll reveal y micro-interacciones. NO reemplaza a Tailwind — lo
 * potencia donde Tailwind utility-first se queda corto.
 *
 * Filosofia: minimalismo premium (Apple/Tesla/Vercel). Animaciones
 * sutiles, jamas distrayentes. Respeta prefers-reduced-motion.
 */

/* ═══════════════════════════════════════════════════════════════════
   DESIGN TOKENS — variables CSS custom properties
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Marca primaria (legacy) */
  --c-mega-red:        #93000b;
  --c-mega-dark:       #6b0008;
  --c-mega-soft:       #ffdad6;
  --c-mega-cream:      #fcf2eb;
  --c-mega-ink:        #1f1b17;

  /* Acentos futuristas */
  --c-ruby:            #dc2626;
  --c-ruby-glow:       rgba(220, 38, 38, 0.45);
  --c-cyber:           #6366f1;     /* violet para destacados */
  --c-cyber-glow:      rgba(99, 102, 241, 0.35);
  --c-mint:            #10b981;
  --c-amber:           #f59e0b;

  /* Neutrales sofisticados */
  --c-deep:            #0a0a0f;     /* casi negro para hero dark */
  --c-deep-2:          #14141d;
  --c-deep-3:          #1f1f2e;
  --c-mist:            #f8fafc;     /* fondo muy claro */
  --c-cloud:           #f1f5f9;
  --c-line:            #e2e8f0;

  /* Glass overlays */
  --glass-light:       rgba(255, 255, 255, 0.65);
  --glass-light-bd:    rgba(255, 255, 255, 0.85);
  --glass-dark:        rgba(10, 10, 15, 0.55);
  --glass-border:      rgba(255, 255, 255, 0.18);

  /* Sombras multi-capa (depth premium) */
  --shadow-sm:         0 1px 2px rgba(15, 23, 42, 0.04),
                       0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md:         0 4px 6px -1px rgba(15, 23, 42, 0.08),
                       0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg:         0 10px 15px -3px rgba(15, 23, 42, 0.08),
                       0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl:         0 20px 25px -5px rgba(15, 23, 42, 0.10),
                       0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-glow-red:   0 0 0 1px rgba(147, 0, 11, 0.06),
                       0 8px 30px -6px rgba(147, 0, 11, 0.18),
                       0 4px 12px -4px rgba(147, 0, 11, 0.10);
  --shadow-glow-cyber: 0 0 0 1px rgba(99, 102, 241, 0.08),
                       0 8px 30px -6px rgba(99, 102, 241, 0.22);

  /* Easings */
  --ease-out-expo:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-smooth: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-bounce:       cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Spacing scale (alineada a Tailwind) */
  --space-section:     5rem;       /* 80px entre secciones grandes */

  /* Tipografia escalas */
  --text-display:      clamp(2.25rem, 4.5vw, 3.75rem);
  --text-hero:         clamp(1.75rem, 3vw, 2.75rem);
  --text-subhero:      clamp(1rem, 1.5vw, 1.125rem);
}

/* ═══════════════════════════════════════════════════════════════════
   BASE — body sutil + scroll behavior + focus a11y
   ═══════════════════════════════════════════════════════════════════ */

body {
  /* Fondo con gradient mesh casi imperceptible */
  background:
    radial-gradient(circle at 0% 0%, rgba(147, 0, 11, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 100% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 35%),
    #fafafa;
  background-attachment: fixed;
  min-height: 100vh;
}

html {
  scroll-behavior: smooth;
}

/* ── Focus visible global (a11y) ── */
*:focus {
  outline: none;
}
*:focus-visible {
  outline: 2px solid var(--c-ruby);
  outline-offset: 3px;
  border-radius: 4px;
  transition: outline-offset 0.15s ease-out;
}

/* Botones con focus mas elegante */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 1),
    0 0 0 5px var(--c-ruby),
    0 0 20px var(--c-ruby-glow);
}

/* Skip link para accesibilidad por teclado */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 999;
  background: var(--c-mega-red);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 800;
  text-decoration: none;
  transition: top 0.2s var(--ease-out-expo);
}
.skip-to-content:focus {
  top: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════
   MESH GRADIENT ANIMADO — fondos premium para secciones hero
   ═══════════════════════════════════════════════════════════════════ */

.mesh-bg {
  position: relative;
  background:
    radial-gradient(circle at 20% 30%, rgba(147, 0, 11, 0.85) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(107, 0, 8, 0.95) 0%, transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(220, 38, 38, 0.75) 0%, transparent 60%),
    linear-gradient(135deg, var(--c-deep) 0%, var(--c-deep-2) 100%);
  overflow: hidden;
}

.mesh-bg::before {
  content: "";
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.18) 0%, transparent 35%),
    radial-gradient(circle at 70% 60%, rgba(220, 38, 38, 0.20) 0%, transparent 35%);
  filter: blur(40px);
  animation: meshDrift 20s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes meshDrift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(5%, -3%) rotate(2deg); }
  100% { transform: translate(-3%, 4%) rotate(-1deg); }
}

/* Particulas/grid overlay sutil */
.mesh-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  mask-image: radial-gradient(circle at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 75%);
}

/* ═══════════════════════════════════════════════════════════════════
   GLASSMORPHISM — header, cards de hero, modales
   ═══════════════════════════════════════════════════════════════════ */

.glass {
  background: var(--glass-light);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--glass-border);
}

.glass-dark {
  background: var(--glass-dark);
  -webkit-backdrop-filter: saturate(150%) blur(24px);
  backdrop-filter: saturate(150%) blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.glass-header {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(200%) blur(28px);
  backdrop-filter: saturate(200%) blur(28px);
  border-bottom: 1px solid rgba(228, 190, 185, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════
   GRADIENT TEXT — para headings dramaticos
   ═══════════════════════════════════════════════════════════════════ */

.text-gradient-brand {
  background: linear-gradient(135deg, #fff 0%, #ffdad6 50%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.text-gradient-red {
  background: linear-gradient(135deg, var(--c-mega-red) 0%, var(--c-ruby) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.text-gradient-cyber {
  background: linear-gradient(135deg, var(--c-mega-red) 0%, var(--c-cyber) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ═══════════════════════════════════════════════════════════════════
   CARDS CON BORDE GLOW (ribete animado en hover)
   ═══════════════════════════════════════════════════════════════════ */

.product-grid > article {
  position: relative;
  isolation: isolate;
}

.product-grid > article::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 1.5rem;
  background: linear-gradient(
    135deg,
    transparent 0%,
    var(--c-ruby) 50%,
    transparent 100%
  );
  background-size: 200% 200%;
  opacity: 0;
  transition: opacity 350ms var(--ease-out-expo);
  z-index: -1;
  animation: gradientBorder 4s linear infinite;
}

.product-grid > article:hover::before {
  opacity: 1;
}

@keyframes gradientBorder {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ═══════════════════════════════════════════════════════════════════
   HERO BENTO — stats animados + CTA glow
   ═══════════════════════════════════════════════════════════════════ */

.hero-stat {
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.25rem;
  padding: 1rem 1.25rem;
  transition: all 300ms var(--ease-out-expo);
}

.hero-stat:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.hero-stat-value {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #ffdad6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-stat-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.375rem;
}

/* CTA principal con glow pulsante (sutil) */
.cta-primary {
  position: relative;
  background: linear-gradient(135deg, #fff 0%, #ffdad6 100%);
  color: var(--c-mega-red);
  font-weight: 900;
  letter-spacing: 0.01em;
  padding: 0.875rem 1.75rem;
  border-radius: 999px;
  box-shadow:
    0 0 0 0 rgba(255, 255, 255, 0.6),
    0 8px 24px -4px rgba(0, 0, 0, 0.2);
  transition: all 300ms var(--ease-out-expo);
}

.cta-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.4),
    0 12px 32px -4px rgba(0, 0, 0, 0.25);
}

.cta-primary:active {
  transform: translateY(0) scale(0.98);
}

/* Boton ghost (over dark backgrounds) */
.cta-ghost {
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
  padding: 0.875rem 1.5rem;
  border-radius: 999px;
  transition: all 250ms var(--ease-out-expo);
}

.cta-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════════
   QUICK CHIPS — botones rapidos en hero/bajo header
   ═══════════════════════════════════════════════════════════════════ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 250ms var(--ease-out-expo);
  white-space: nowrap;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
}

/* Chip con dot animado */
.chip-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-mint);
  box-shadow: 0 0 0 0 var(--c-mint);
  animation: livePulse 2s ease-out infinite;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  50%      { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* ═══════════════════════════════════════════════════════════════════
   SECTION HEADER — title + subtitle + decorative line
   ═══════════════════════════════════════════════════════════════════ */

.section-header {
  position: relative;
  margin-bottom: 2.5rem;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-mega-red);
  padding: 0.25rem 0.75rem;
  background: rgba(147, 0, 11, 0.08);
  border-radius: 999px;
  margin-bottom: 0.875rem;
}

.section-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-mega-red);
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--c-mega-ink);
}

.section-subtitle {
  margin-top: 0.5rem;
  color: #64748b;
  font-size: 0.9375rem;
  max-width: 50ch;
}

/* ═══════════════════════════════════════════════════════════════════
   DIVIDERS DECORATIVOS — separadores entre secciones
   ═══════════════════════════════════════════════════════════════════ */

.divider-gradient {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(147, 0, 11, 0.4) 50%,
    transparent 100%
  );
  margin: var(--space-section) auto;
  max-width: 50%;
}

/* ═══════════════════════════════════════════════════════════════════
   SCROLL REVEAL — animacion al entrar en viewport
   ═══════════════════════════════════════════════════════════════════ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms var(--ease-out-expo),
    transform 700ms var(--ease-out-expo);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger para grupos de cards */
.reveal-group > * {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 600ms var(--ease-out-expo),
    transform 600ms var(--ease-out-expo);
}

.reveal-group.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-group.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-group.is-visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-group.is-visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-group.is-visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-group.is-visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-group.is-visible > *:nth-child(6) { transition-delay: 400ms; }

/* ═══════════════════════════════════════════════════════════════════
   FILTER PANEL — refinado premium
   ═══════════════════════════════════════════════════════════════════ */

#catalogo .bg-white.border.border-slate-200.rounded-3xl {
  /* Override del panel de filtros para look premium */
  background: var(--glass-light-bd);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(228, 190, 185, 0.5);
  box-shadow: var(--shadow-md);
}

/* Inputs con look premium */
#searchInput,
#categorySelect,
#sortSelect,
#filterPriceMin,
#filterPriceMax {
  transition: all 200ms var(--ease-out-expo);
}

#searchInput:hover,
#categorySelect:hover,
#sortSelect:hover {
  border-color: rgba(147, 0, 11, 0.25);
  background: white;
}

#searchInput:focus,
#categorySelect:focus,
#sortSelect:focus,
#filterPriceMin:focus,
#filterPriceMax:focus {
  background: white;
  border-color: var(--c-ruby);
  box-shadow:
    0 0 0 4px rgba(147, 0, 11, 0.08),
    0 0 12px -2px var(--c-ruby-glow);
}

/* ═══════════════════════════════════════════════════════════════════
   PRODUCT CARDS — tilt 3D sutil + glow border refinado
   ═══════════════════════════════════════════════════════════════════ */

.product-grid > article {
  background: white;
  border: 1px solid var(--c-line);
  border-radius: 1.5rem;
  overflow: hidden;
  transition:
    transform 350ms var(--ease-out-expo),
    box-shadow 350ms var(--ease-out-expo),
    border-color 250ms ease-out;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.product-grid > article:hover {
  transform: translateY(-6px) perspective(1000px) rotateX(1deg);
  box-shadow: var(--shadow-glow-red);
  border-color: rgba(147, 0, 11, 0.18) !important;
}

/* Imagen con efecto zoom + brightness sutil al hover */
.product-grid > article img {
  transition:
    transform 700ms var(--ease-out-expo),
    filter 400ms ease-out;
}

.product-grid > article:hover img {
  transform: scale(1.08);
  filter: brightness(1.04) saturate(1.08);
}

/* ═══════════════════════════════════════════════════════════════════
   COUNTER ANIMATION (numeros que cuentan al cargar)
   ═══════════════════════════════════════════════════════════════════ */

.count-up {
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════════
   FOOTER GLOW — modern minimal con accent
   ═══════════════════════════════════════════════════════════════════ */

#contacto {
  position: relative;
  background:
    radial-gradient(circle at 0% 0%, rgba(147, 0, 11, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(99, 102, 241, 0.10) 0%, transparent 40%),
    var(--c-deep);
}

#contacto::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 1000px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(220, 38, 38, 0.5) 50%,
    transparent 100%
  );
}

/* ═══════════════════════════════════════════════════════════════════
   FLOATING ACTIONS — refresh visual
   ═══════════════════════════════════════════════════════════════════ */

#floatingActions button {
  box-shadow:
    0 0 0 0 currentColor,
    0 12px 32px -8px rgba(0, 0, 0, 0.18),
    0 4px 12px -4px rgba(0, 0, 0, 0.12);
  transition: all 250ms var(--ease-out-expo);
  position: relative;
}

#floatingActions button:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.5),
    0 16px 40px -8px rgba(0, 0, 0, 0.25);
}

/* ═══════════════════════════════════════════════════════════════════
   PREFERENCIAS DE MOVIMIENTO REDUCIDO (a11y)
   ═══════════════════════════════════════════════════════════════════ */

@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;
  }

  .mesh-bg::before,
  .mesh-bg::after,
  .chip-live::before {
    animation: none !important;
  }

  .product-grid > article:hover {
    transform: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   CONTAINER PREMIUM — max-width refinado con safe areas
   ═══════════════════════════════════════════════════════════════════ */

.container-premium {
  max-width: 1800px;
  margin: 0 auto;
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
}

@media (min-width: 640px) {
  .container-premium {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .container-premium {
    padding-left: 4rem;
    padding-right: 4rem;
  }
}
