/* ==========================================================================
   components.css
   Piezas reutilizables: botones (con rolling text), badges, etiquetas,
   mockups de monitor + celular, cursor, botón flotante, modal y lightbox.
   ========================================================================== */

/* --------------------------------------------------------------------------
   BOTONES
   .btn            → base
   .btn--primary   → naranja (CTA principal)
   .btn--ghost     → borde blanco (secundario)
   .btn--giant     → CTA final enorme
   -------------------------------------------------------------------------- */
.btn {
  --pad-y: 0.85rem; --pad-x: 1.4rem;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: var(--pad-y) var(--pad-x);
  border-radius: var(--r-full);
  font-family: var(--font-titulo); font-weight: 800; font-size: var(--fs-sm);
  letter-spacing: 0.01em; line-height: 1; white-space: nowrap;
  transition: transform var(--t-rapido) var(--ease-out), box-shadow var(--t-rapido), background-color var(--t-rapido), border-color var(--t-rapido);
  isolation: isolate;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--grad-naranja); color: var(--negro);
  box-shadow: 0 10px 30px -10px rgba(255, 107, 44, 0.7);
}
.btn--primary:hover { box-shadow: 0 14px 40px -8px rgba(255, 107, 44, 0.85); transform: translateY(-2px); }

.btn--ghost { border: 1.5px solid var(--linea-2); color: var(--blanco); }
.btn--ghost:hover { border-color: var(--blanco); }

.btn--giant {
  --pad-y: clamp(1rem, 0.9rem + 0.6vw, 1.4rem); --pad-x: clamp(1.6rem, 1.2rem + 2vw, 2.6rem);
  font-size: var(--fs-md);
}
.btn--block { width: 100%; }

/* --------------------------------------------------------------------------
   ROLLING TEXT
   JS (rolling.js) envuelve el texto así:
   <span class="roll"><span class="roll__in" data-text="Texto">Texto</span></span>
   Al hacer hover el texto sube y aparece una copia desde abajo.
   -------------------------------------------------------------------------- */
.roll { display: inline-block; overflow: hidden; vertical-align: top; line-height: 1.15; }
.roll__in {
  display: inline-block; position: relative;
  transition: transform 0.45s var(--ease-out);
}
.roll__in::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 100%;
  white-space: nowrap;
}
a:hover .roll__in, button:hover .roll__in,
a:focus-visible .roll__in, button:focus-visible .roll__in { transform: translateY(-100%); }

/* --------------------------------------------------------------------------
   BADGES Y ETIQUETAS
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.95rem; border-radius: var(--r-full);
  font-family: var(--font-titulo); font-weight: 800; font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.badge--naranja { background: var(--grad-naranja); color: var(--negro); }
.badge--pulse { animation: badgePulse 2.2s ease-in-out infinite; }
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: dotBlink 1.2s infinite; }

.tag {
  display: inline-block; padding: 0.3rem 0.75rem; border-radius: var(--r-full);
  border: 1px solid var(--linea-2); color: var(--blanco);
  font-size: var(--fs-xs); font-weight: 600;
}
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* --------------------------------------------------------------------------
   LOGOS DE REDES (los arma js/modules/redes.js en cada [data-redes])
   Cada logo flota un poquito, con un retraso distinto para que no
   se muevan todos juntos. Al pasar el mouse toma el color de la red.
   -------------------------------------------------------------------------- */
.redes { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 1.25rem; }
.red {
  --size: 48px;
  width: var(--size); height: var(--size); border-radius: 14px;
  display: grid; place-items: center;
  background: var(--negro-2); border: 1px solid var(--linea-2);
  color: var(--color-red); /* cada red define su color abajo */
  box-shadow: 0 8px 24px -12px var(--color-red);
  animation: arrowFloat 3s ease-in-out infinite;
  transition: background-color 0.3s, color 0.3s, transform 0.3s var(--ease-out);
}
.red svg { width: 45%; height: 45%; }
.red:nth-child(2) { animation-delay: -0.6s; }
.red:nth-child(3) { animation-delay: -1.2s; }
.red:nth-child(4) { animation-delay: -1.8s; }
.red:nth-child(5) { animation-delay: -2.4s; }
.red:hover { background: var(--color-red); color: #fff; }
.red--instagram { --color-red: #E4405F; }
.red--tiktok    { --color-red: #25F4EE; }
.red--whatsapp  { --color-red: #25D366; }
.red--facebook  { --color-red: #1877F2; }
.red--linkedin  { --color-red: #0A66C2; }
.red--tiktok:hover { color: #000; }
.redes--chicas { gap: 0.5rem; margin-top: 0.75rem; }
.redes--chicas .red { --size: 38px; border-radius: 11px; }

/* --------------------------------------------------------------------------
   MOCKUP: MONITOR + CELULAR
   Estructura (la arma js/modules/mockup.js):
   .mockup
     .monitor > .monitor__frame > .monitor__screen > img.scrollshot
                .monitor__stand + .monitor__base
     .phone > .phone__notch + .phone__screen > img.scrollshot
   El "scroll" de la captura se hace con transform (rendimiento).
   -------------------------------------------------------------------------- */
.mockup {
  position: relative;
  padding-right: 13%;
  padding-bottom: 4%;
  transition: transform 0.6s var(--ease-out);
}
.monitor__frame {
  background: linear-gradient(180deg, #2a2a2e, #18181b);
  border: 1px solid var(--linea-2);
  border-radius: clamp(8px, 1.4vw, 16px);
  padding: 2%;
  box-shadow: var(--sombra);
}
.monitor__screen {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: clamp(3px, 0.5vw, 6px); background: #fff;
}
.monitor__stand {
  width: 15%; aspect-ratio: 3 / 1.3; margin: 0 auto;
  background: linear-gradient(180deg, #111113, #2a2a2e);
  clip-path: polygon(22% 0, 78% 0, 90% 100%, 10% 100%);
}
.monitor__base {
  width: 32%; height: clamp(4px, 0.6vw, 8px); margin: 0 auto;
  border-radius: 8px 8px 3px 3px; background: #2a2a2e;
}
.phone {
  position: absolute; right: 0; bottom: 0;
  width: 23%; aspect-ratio: 9 / 19.5;
  background: #07090f; border: 1px solid var(--linea-2);
  border-radius: 16% / 7.5%; padding: 3.2%;
  box-shadow: -20px 20px 50px -10px rgba(0, 0, 0, 0.7);
}
.phone__screen {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  border-radius: 12% / 5.6%; background: #fff;
}
.phone__notch {
  position: absolute; z-index: 2; top: 5%; left: 50%; transform: translateX(-50%);
  width: 32%; height: 2.6%; border-radius: var(--r-full); background: #07090f;
}
/* Captura que "scrollea": JS calcula --dist (alto imagen − alto pantalla) */
.scrollshot {
  width: 100%; height: auto;
  transform: translateY(0);
  transition: transform 1s var(--ease-in-out);
  will-change: transform;
}
.is-scrolling .scrollshot {
  transform: translateY(calc(-1 * var(--dist, 0px)));
  transition-duration: var(--dur, 5s);
}
/* Variante en loop (ventana del proyecto) */
.is-looping .scrollshot { animation: shotLoop var(--dur, 8s) var(--ease-in-out) infinite alternate; }

/* Pantalla vacía: "Tu negocio puede estar acá" */
.screen-empty {
  position: absolute; inset: 0; background: var(--negro-2);
  display: grid; place-items: center; overflow: hidden;
}
.screen-empty__code {
  position: absolute; inset: 0; padding: 6%;
  font-family: var(--font-code); font-size: clamp(7px, 0.9vw, 11px); line-height: 1.8;
  color: rgba(245, 245, 247, 0.16); white-space: pre;
  animation: codeRise 14s linear infinite;
}
.screen-empty__text {
  position: relative; z-index: 1; text-align: center; padding: 0 8%;
  font-family: var(--font-titulo); font-weight: 900; font-size: clamp(0.85rem, 0.6rem + 0.6vw, 1.15rem);
  line-height: 1.1;
}
.screen-empty__text small {
  display: block; margin-top: 0.6rem; font-family: var(--font-texto); font-weight: 600;
  font-size: var(--fs-xs); color: var(--naranja);
}
.phone .screen-empty__code { font-size: 6px; }

/* --------------------------------------------------------------------------
   CURSOR PERSONALIZADO (solo desktop con mouse)
   -------------------------------------------------------------------------- */
.cursor { position: fixed; top: 0; left: 0; z-index: var(--z-cursor); pointer-events: none; display: none; }
html.has-cursor .cursor { display: block; }
.cursor__dot, .cursor__ring { position: fixed; top: 0; left: 0; border-radius: 50%; translate: -50% -50%; }
.cursor__dot { width: 6px; height: 6px; background: var(--naranja); }
.cursor__ring {
  width: 36px; height: 36px; border: 1.5px solid rgba(245, 245, 247, 0.5);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), background-color 0.3s, border-color 0.3s;
}
.cursor.is-hover .cursor__ring {
  width: 70px; height: 70px;
  background: rgba(255, 107, 44, 0.12); border-color: var(--naranja);
}
.cursor.is-hidden { opacity: 0; }

/* --------------------------------------------------------------------------
   BOTÓN FLOTANTE (foto + texto girando) → WhatsApp
   -------------------------------------------------------------------------- */
.float-wa {
  position: fixed; z-index: var(--z-flotante);
  right: clamp(12px, 2vw, 28px); bottom: clamp(12px, 2vw, 28px);
  --size: clamp(84px, 4vw + 50px, 104px);
  width: var(--size); height: var(--size);
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--negro);
  box-shadow: 0 10px 40px -8px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--linea-2);
  transition: transform 0.4s var(--ease-out);
}
.float-wa:hover { transform: scale(1.06); }
.float-wa__ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 12s linear infinite; }
.float-wa__ring text {
  font-family: var(--font-titulo); font-weight: 800; font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase; fill: var(--blanco);
}
.float-wa__photo {
  width: 56%; height: 56%; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--naranja);
}
.float-wa__icon {
  position: absolute; right: 16%; bottom: 16%;
  width: 24%; aspect-ratio: 1; border-radius: 50%;
  background: #25D366; display: grid; place-items: center;
  border: 2px solid var(--negro);
}
.float-wa__icon svg { width: 60%; height: 60%; fill: #fff; }

/* --------------------------------------------------------------------------
   MODAL (proyectos) y LIGHTBOX (certificados) — misma base
   -------------------------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center;
  padding: clamp(0.75rem, 3vw, 2.5rem);
  visibility: hidden; opacity: 0;
  transition: opacity 0.4s var(--ease-out), visibility 0s linear 0.4s;
}
.modal.is-open { visibility: visible; opacity: 1; transition: opacity 0.4s var(--ease-out); }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(8px); }
.modal__panel {
  position: relative; width: 100%; max-width: 1200px; max-height: 100%;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--negro-2); border: 1px solid var(--linea);
  border-radius: var(--r-xl);
  padding: clamp(1.25rem, 3vw, 3rem);
  transform: translateY(30px) scale(0.98);
  transition: transform 0.5s var(--ease-out);
}
.modal.is-open .modal__panel { transform: none; }
.modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--negro); border: 1px solid var(--linea-2);
  transition: transform 0.3s var(--ease-out), border-color 0.3s;
}
.modal__close:hover { transform: rotate(90deg); border-color: var(--naranja); }
.modal__close svg { width: 18px; height: 18px; }

.modal--lightbox .modal__panel { background: transparent; border: 0; padding: 0; max-width: 1100px; overflow: visible; }
.modal--lightbox img { width: 100%; height: auto; border-radius: var(--r-md); box-shadow: var(--sombra); }
.modal--lightbox .modal__close { top: -58px; right: 0; }
