/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps.
 */

/* ===== Landing Page Animations ===== */

/* Fade in and slide up on load */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in from left */
@keyframes fade-in-left {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade in from right */
@keyframes fade-in-right {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slow float */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* Subtle pulse glow */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.3; }
}

/* Rotate slowly */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Circuit line draw */
@keyframes draw-line {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}

/* Stagger children animation classes */
.animate-fade-in-up {
  animation: fade-in-up 0.8s ease-out both;
}

.animate-fade-in-left {
  animation: fade-in-left 0.8s ease-out both;
}

.animate-fade-in-right {
  animation: fade-in-right 0.8s ease-out both;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float 6s ease-in-out 2s infinite;
}

.animate-float-slow {
  animation: float 8s ease-in-out 1s infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 4s ease-in-out infinite;
}

.animate-spin-slow {
  animation: spin-slow 20s linear infinite;
}

.animate-draw-line {
  stroke-dasharray: 1000;
  animation: draw-line 3s ease-out forwards;
}

/* Stagger delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }

/* Scroll reveal: hidden by default, revealed by Stimulus */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Hero circuit pattern */
.hero-circuit-pattern {
  background-image:
    radial-gradient(circle at 20% 80%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-in-up,
  .animate-fade-in-left,
  .animate-fade-in-right,
  .animate-float,
  .animate-float-delayed,
  .animate-float-slow,
  .animate-pulse-glow,
  .animate-spin-slow,
  .animate-draw-line {
    animation: none;
  }

  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== Landing industrial-eléctrica ===== */

/* Marquesina infinita de categorías: el contenido va duplicado en el
   markup para que el loop de -50% sea continuo. */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.animate-marquee {
  animation: marquee 45s linear infinite;
}
.animate-marquee:hover {
  animation-play-state: paused;
}

/* Parpadeo del indicador "en línea" del hero */
@keyframes spark-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.animate-spark-blink {
  animation: spark-blink 1.6s ease-in-out infinite;
}

/* Grilla blueprint para fondos oscuros */
.bg-blueprint {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ── Sitio público de NYM ───────────────────────────────────────────
   Texto en Nunito sobre todo el layout público; el panel no lo usa. */
.nym-site {
  font-family: "Nunito", ui-rounded, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Patrón de golosinas en línea blanca (chupetín, caramelo, galletita),
   como el de la bandera de la vidriera. Se pone sobre fondos violetas;
   la opacidad la maneja el contenedor (`opacity-*`). Dibujo propio. */
.bg-candy {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='40' cy='38' r='17'/%3E%3Cpath d='M40 38m-9 0a9 9 0 1 0 9-9a5 5 0 1 1-5 5'/%3E%3Cpath d='M40 55v32'/%3E%3Cg transform='rotate(-25 128 52)'%3E%3Crect x='110' y='41' width='36' height='22' rx='11'/%3E%3Cpath d='M110 52l-12-10v20zM146 52l12-10v20z'/%3E%3C/g%3E%3Ccircle cx='120' cy='132' r='22'/%3E%3Ccircle cx='112' cy='124' r='2.5'/%3E%3Ccircle cx='127' cy='128' r='2.5'/%3E%3Ccircle cx='116' cy='141' r='2.5'/%3E%3Ccircle cx='131' cy='142' r='2.5'/%3E%3Cg transform='rotate(30 42 140)'%3E%3Crect x='30' y='133' width='24' height='14' rx='7'/%3E%3Cpath d='M30 140l-8-6v12zM54 140l8-6v12z'/%3E%3C/g%3E%3Ccircle cx='88' cy='92' r='4' fill='%23fff' stroke='none'/%3E%3Ccircle cx='160' cy='96' r='3' fill='%23fff' stroke='none'/%3E%3Ccircle cx='78' cy='168' r='3' fill='%23fff' stroke='none'/%3E%3Ccircle cx='12' cy='96' r='2.5' fill='%23fff' stroke='none'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ── Golosinas flotantes (landing) ──────────────────────────────────
   Cuatro transformaciones, cada una en su elemento para no pisarse:
   - .nym-float-layer: parallax de scroll. parallax_controller le escribe
     --py con inercia, ya multiplicado por su --depth. No sigue al mouse.
   - .nym-pop: entrada al cargar, fundido y subida corta, sin rebote.
   - .nym-drift: deriva vertical lenta.
   - .nym-float (la foto): deriva horizontal + rotación de 1° como mucho.
   Las derivas tienen duraciones distintas por foto (--dy/--dx, que no son
   múltiplos entre sí) y van en `alternate`: el recorrido combinado no se
   repite a la vista, que es lo que hacía artificial el vaivén anterior. */
.nym-float-layer {
  transform: translate3d(0, calc(var(--py, 0) * 1px), 0);
  will-change: transform;
}

.nym-drift {
  animation: nym-drift-y var(--dy, 11s) ease-in-out var(--delay, 0s) infinite alternate;
}

.nym-float {
  --r: 0deg;
  transform: rotate(var(--r));
  animation: nym-drift-x var(--dx, 15s) ease-in-out var(--delay, 0s) infinite alternate;
  filter: drop-shadow(0 28px 32px rgba(10, 8, 40, 0.45)) drop-shadow(0 6px 8px rgba(10, 8, 40, 0.25));
  user-select: none;
  pointer-events: none;
}

@keyframes nym-drift-y {
  from { transform: translate3d(0, -7px, 0); }
  to   { transform: translate3d(0, 7px, 0); }
}

@keyframes nym-drift-x {
  from { transform: translate3d(-5px, 0, 0) rotate(calc(var(--r) - 1deg)); }
  to   { transform: translate3d(5px, 0, 0) rotate(calc(var(--r) + 1deg)); }
}

.nym-pop {
  animation: nym-pop 1.4s cubic-bezier(0.16, 1, 0.3, 1) var(--pop-delay, 0s) both;
}

@keyframes nym-pop {
  from { opacity: 0; transform: translate3d(0, 28px, 0); }
  to   { opacity: 1; transform: none; }
}

/* Brillo del hero: luz violeta clara arriba a la derecha y un toque del
   naranja de la marca abajo, sobre el violeta profundo. */
.nym-hero-glow {
  background:
    radial-gradient(60% 55% at 72% 38%, rgba(140, 110, 235, 0.55) 0%, transparent 70%),
    radial-gradient(40% 40% at 90% 95%, rgba(232, 112, 63, 0.35) 0%, transparent 70%),
    radial-gradient(50% 60% at 0% 0%, rgba(90, 62, 174, 0.6) 0%, transparent 70%),
    #1b1660;
}

/* Palabra gigante en contorno detrás de los títulos. El color del trazo
   va en --outline (no en `color`, que tiene que quedar transparente). */
.nym-outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--outline, rgba(255, 255, 255, 0.18));
}

/* Marquesina de rubros: el contenido va duplicado y se corre la mitad, así
   el loop no tiene salto. */
.nym-marquee {
  display: flex;
  width: max-content;
  animation: nym-marquee 38s linear infinite;
}

@keyframes nym-marquee {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .nym-float,
  .nym-drift,
  .nym-pop,
  .nym-marquee {
    animation: none;
  }

  .nym-float-layer {
    transform: none;
  }
}

/* Logo del hero armándose por capas (shop/shared/_logo_layers). Cada capa
   entra según lo que es, con máscaras animadas y no con fundidos:
   - el disco se abre desde el centro como un iris mientras se asienta;
   - la salpicadura se derrama desde su punto de impacto (arriba a la
     izquierda) y va descubriendo las rayitas;
   - ".NYM" se descubre de izquierda a derecha, como un trazo;
   - "petit mayorista" sigue la inclinación del texto;
   - al final un reflejo cruza el logo una vez.
   El borde de cada máscara es difuso (12%) para que no se vea el corte.
   --reveal se anima gracias a @property; sin soporte la capa aparece
   entera al final de su tiempo. Sin giros ni rebotes. */
@property --reveal {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

.nym-logo-layer {
  --reveal: 0%;
  animation: 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, mask-image;
}

.nym-logo-layer--1 {
  -webkit-mask-image: radial-gradient(circle closest-side at 50% 50%, #000 calc(var(--reveal) - 14%), transparent var(--reveal));
  mask-image: radial-gradient(circle closest-side at 50% 50%, #000 calc(var(--reveal) - 14%), transparent var(--reveal));
  animation-name: nym-layer-iris;
  animation-duration: 1.3s;
  animation-delay: 0.1s;
}

.nym-logo-layer--2 {
  -webkit-mask-image: radial-gradient(circle at 24% 20%, #000 calc(var(--reveal) - 12%), transparent var(--reveal));
  mask-image: radial-gradient(circle at 24% 20%, #000 calc(var(--reveal) - 12%), transparent var(--reveal));
  transform-origin: 24% 20%;
  animation-name: nym-layer-spill;
  animation-duration: 1.4s;
  animation-delay: 0.7s;
  animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
}

.nym-logo-layer--3 {
  -webkit-mask-image: linear-gradient(100deg, #000 calc(var(--reveal) - 12%), transparent var(--reveal));
  mask-image: linear-gradient(100deg, #000 calc(var(--reveal) - 12%), transparent var(--reveal));
  animation-name: nym-layer-stroke;
  animation-duration: 1.1s;
  animation-delay: 1.05s;
  animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
}

.nym-logo-layer--4 {
  -webkit-mask-image: linear-gradient(80deg, #000 calc(var(--reveal) - 12%), transparent var(--reveal));
  mask-image: linear-gradient(80deg, #000 calc(var(--reveal) - 12%), transparent var(--reveal));
  animation-name: nym-layer-tagline;
  animation-duration: 0.9s;
  animation-delay: 1.75s;
  animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
}

@keyframes nym-layer-iris {
  from { --reveal: 0%; transform: scale(0.95); }
  to   { --reveal: 116%; transform: none; }
}

@keyframes nym-layer-spill {
  from { --reveal: 0%; transform: scale(0.96); }
  to   { --reveal: 125%; transform: none; }
}

@keyframes nym-layer-stroke {
  0%   { --reveal: 10%; transform: translateY(-1.2%); }
  100% { --reveal: 118%; transform: none; }
}

@keyframes nym-layer-tagline {
  from { --reveal: 20%; transform: translateY(1%); }
  to   { --reveal: 118%; transform: none; }
}

/* Reflejo que cruza el logo una vez, sobre el disco (recortado en círculo). */
.nym-logo-sheen {
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.16) 47%, rgba(255, 255, 255, 0.34) 50%, rgba(255, 255, 255, 0.16) 53%, transparent 60%);
  background-size: 260% 100%;
  background-position: 130% 0;
  mix-blend-mode: screen;
  animation: nym-logo-sheen 1.6s cubic-bezier(0.45, 0, 0.25, 1) 2.5s both;
  pointer-events: none;
}

@keyframes nym-logo-sheen {
  from { background-position: 130% 0; }
  to   { background-position: -30% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .nym-logo-layer {
    animation: none;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .nym-logo-sheen {
    display: none;
  }
}

/* Letras infladas, como las del logo: cada letra (.nym-puffy-char) tiene
   su propio degradé redondo (luz arriba a la izquierda, sombra suave hacia
   los bordes) y un brillo difuso. El volumen sale de una sombra corta y
   difusa (no capas duras: marcaban demasiado el borde) y otra larga que la
   despega del fondo. Es filter y no text-shadow porque con el relleno
   recortado al texto (background-clip) el text-shadow se pinta encima. */
.nym-puffy {
  --puffy-light: #ffffff;
  --puffy-mid: #f6f3ff;
  --puffy-dark: #d8cff3;
  --puffy-edge: rgba(120, 98, 196, 0.85);
  display: inline-block;
  filter:
    drop-shadow(0 3px 2px var(--puffy-edge))
    drop-shadow(0 12px 16px rgba(10, 6, 40, 0.45));
}

.nym-puffy--orange {
  --puffy-light: #ffc596;
  --puffy-mid: #f7893c;
  --puffy-dark: #dc5f1f;
  --puffy-edge: rgba(150, 56, 16, 0.85);
}

.nym-puffy-char {
  display: inline-block;
  color: transparent;
  background:
    radial-gradient(30% 16% at 34% 24%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 75%),
    radial-gradient(130% 110% at 35% 22%, var(--puffy-light) 0%, var(--puffy-mid) 55%, var(--puffy-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Inputs del formulario de consulta. */
.nym-site .field-input {
  width: 100%;
  min-height: 48px;
  border: 2px solid #ece8ff;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.9375rem;
  background: #fff;
  color: #17164f;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nym-site .field-input::placeholder {
  color: #8b88b8;
}

.nym-site .field-input:focus {
  outline: none;
  border-color: #e8703f;
  box-shadow: 0 0 0 4px rgba(232, 112, 63, 0.15);
}

/* Grano sutil para dar textura a los fondos oscuros */
.bg-noise::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}


/* ── Ticket térmico del POS ────────────────────────────────────────────
   Ancho físico del papel (80 o 58 mm) por clase en el body; @page sin
   márgenes para que la impresora térmica no deje bordes. */
.ticket-body {
  margin: 0;
  background: #fff;
  color: #000;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.35;
}

.ticket-80 .ticket { width: 72mm; }
.ticket-58 .ticket { width: 50mm; font-size: 11px; }

.ticket { margin: 0 auto; padding: 3mm 0 6mm; }
.ticket p { margin: 0; }
.ticket-center { text-align: center; }
.ticket-strong { font-weight: 700; }
.ticket-big { font-size: 1.25em; }
.ticket-muted { color: #333; font-size: 0.9em; }
.ticket-row { display: flex; justify-content: space-between; gap: 2mm; }
.ticket-rule { border-top: 1px dashed #000; margin: 2mm 0; }
.ticket-item { margin-bottom: 1.5mm; }
.ticket-qr { display: flex; justify-content: center; margin-top: 2mm; }
.ticket-qr svg { width: 30mm; height: 30mm; }
.ticket-thanks { margin-top: 3mm; }
.ticket-actions { margin-top: 6mm; text-align: center; }
.ticket-actions button { font: inherit; padding: 2mm 6mm; border: 1px solid #000; background: #fff; border-radius: 2mm; cursor: pointer; }

@media print {
  @page { margin: 0; }
  .ticket-80 { width: 80mm; }
  .ticket-58 { width: 58mm; }
  .ticket-actions { display: none; }
}
