/* ==========================================================================
   Marusía Surf · base: tokens, estructura (barra flotante, vistas), botones,
   avisos, carrito lateral, paleta Ctrl+K, cursor propio y guía.
   Tema oscuro siempre: es la identidad de la marca (noche, mar, neón).
   Cada pantalla tiene su CSS aparte (inicio.css, configurador.css…).
   ========================================================================== */

:root {
  --noche: #05080d;
  --fondo: #070b11;
  --capa: #0d141d;
  --capa-2: #121c28;
  --linea: rgb(255 255 255 / .09);
  --linea-fuerte: rgb(255 255 255 / .18);
  --tinta: #eef3f6;
  --tinta-2: #a6b3bf;
  --tinta-3: #6d7b89;
  --aqua: #2de2c8;
  --coral: #ff5a3c;
  --arena: #f4e9d8;
  --sol: #ffd166;
  --ok: #4ade80;
  --peligro: #ff6b6b;
  --radio: 18px;
  --radio-sm: 12px;
  --sombra: 0 20px 60px rgb(0 0 0 / .45);
  --fuente: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --fuente-display: "Arial Black", "Helvetica Neue", "Segoe UI Black", Impact, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body { margin: 0; background: var(--fondo); color: var(--tinta); font: 16px/1.55 var(--fuente); overflow-x: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.05; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--aqua); color: var(--noche); }
.icono { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.display { font-family: var(--fuente-display); font-weight: 900; letter-spacing: -.035em; text-transform: uppercase; }
.etiqueta { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--aqua); font-weight: 700; }
.suave { color: var(--tinta-2); }
.num { font-variant-numeric: tabular-nums; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Grano de película por encima de todo: da textura al negro */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 90; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Barra flotante (cristal) ---------- */
.barra {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 40;
  width: min(1100px, calc(100vw - 24px)); display: flex; align-items: center; gap: 6px;
  padding: 7px 7px 7px 16px; border-radius: 99px; border: 1px solid var(--linea);
  background: rgb(10 16 24 / .62); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.marca { display: flex; align-items: center; gap: 9px; text-decoration: none; margin-right: auto; font-family: var(--fuente-display); font-weight: 900; letter-spacing: -.02em; font-size: 1.05rem; }
.marca-signo { width: 28px; height: 28px; border-radius: 50%; background: conic-gradient(from 200deg, var(--aqua), #2b7de9, var(--coral), var(--sol), var(--aqua)); display: grid; place-items: center; color: var(--noche); font-size: .85rem; }
.nav { display: flex; gap: 2px; }
.nav a { text-decoration: none; padding: 8px 13px; border-radius: 99px; color: var(--tinta-2); font-size: .9rem; font-weight: 600; transition: color .2s, background .2s; }
.nav a:hover { color: var(--tinta); }
.nav a[aria-current="page"] { color: var(--noche); background: var(--tinta); }
.boton-barra { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--linea); background: rgb(255 255 255 / .04); cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--tinta-2); }
.boton-barra:hover { color: var(--tinta); border-color: var(--linea-fuerte); }
.boton-barra kbd { font: 600 .72rem var(--fuente); border: 1px solid var(--linea-fuerte); border-radius: 6px; padding: 1px 5px; }
.contador-carrito { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 99px; background: var(--coral); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.contador-carrito.salta { animation: salta .5s var(--ease); }
@keyframes salta { 30% { transform: scale(1.5); } }
@media (max-width: 760px) {
  .barra { top: auto; bottom: 12px; padding: 6px; }
  .marca { display: none; }
  .nav { flex: 1; justify-content: space-around; min-width: 0; }
  .nav a { padding: 8px 7px; font-size: .76rem; white-space: nowrap; }
  .boton-barra kbd, .boton-barra .texto { display: none; }
  /* En el móvil el buscador Ctrl+K sobra (no hay teclado) y deja sitio al menú */
  [data-abrir-paleta] { display: none; }
}

/* Barra de progreso de lectura (arriba del todo) */
.progreso-scroll { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 45; background: linear-gradient(90deg, var(--aqua), var(--coral)); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Vistas ---------- */
#vista { min-height: 100vh; }
.pagina { max-width: 1180px; margin: 0 auto; padding: 110px 20px 140px; }
@media (max-width: 760px) { .pagina { padding: 34px 16px 120px; } }
.cabecera-pagina { margin-bottom: 28px; display: grid; gap: 10px; }
.cabecera-pagina h1 { font-family: var(--fuente-display); font-size: clamp(2.2rem, 6vw, 4rem); text-transform: uppercase; letter-spacing: -.035em; }
.cabecera-pagina p { color: var(--tinta-2); max-width: 620px; }

/* Transición entre pantallas (View Transitions API; si no existe, no pasa nada) */
::view-transition-old(root) { animation: .28s var(--ease) both salir; }
::view-transition-new(root) { animation: .38s var(--ease) both entrar; }
@keyframes salir { to { opacity: 0; transform: translateY(-14px) scale(.985); filter: blur(4px); } }
@keyframes entrar { from { opacity: 0; transform: translateY(18px) scale(.985); filter: blur(4px); } }

/* ---------- Botones ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 99px; border: 1px solid var(--linea-fuerte);
  background: transparent; color: var(--tinta); font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .25s var(--ease);
}
.btn:hover { border-color: var(--tinta); }
.btn-principal { background: var(--aqua); border-color: var(--aqua); color: var(--noche); }
.btn-principal:hover { background: #5cf0da; }
.btn-coral { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn-pequeno { min-height: 36px; padding: 0 14px; font-size: .85rem; }
.btn-icono { width: 40px; padding: 0; min-height: 40px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* Botón imán: lo mueve el JS con --mx/--my */
.iman { transform: translate(var(--mx, 0), var(--my, 0)); }

.tarjeta { background: var(--capa); border: 1px solid var(--linea); border-radius: var(--radio); padding: 22px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: rgb(255 255 255 / .07); color: var(--tinta-2); white-space: nowrap; }
.campo { display: grid; gap: 6px; }
.campo > span { font-size: .8rem; color: var(--tinta-2); font-weight: 600; }
.entrada { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radio-sm); border: 1px solid var(--linea-fuerte); background: rgb(255 255 255 / .03); }
.entrada:focus, .btn:focus-visible, .boton-barra:focus-visible, .nav a:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; }

/* ---------- Avisos ---------- */
.avisos { position: fixed; left: 50%; transform: translateX(-50%); top: 76px; z-index: 80; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
@media (max-width: 760px) { .avisos { top: 14px; } }
.aviso { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--tinta); color: var(--noche); font-weight: 600; font-size: .9rem; box-shadow: var(--sombra); animation: aparece .35s var(--ease); }
.aviso button { border: 0; background: none; color: #0a7d6f; font-weight: 800; cursor: pointer; }
@keyframes aparece { from { opacity: 0; transform: translateY(-10px) scale(.96); } }

/* ---------- Carrito lateral ---------- */
.velo { position: fixed; inset: 0; z-index: 60; background: rgb(0 0 0 / .55); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s; }
.velo.abierto { opacity: 1; pointer-events: auto; }
.carrito { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(420px, 100vw); background: var(--capa); border-left: 1px solid var(--linea); display: flex; flex-direction: column; transform: translateX(105%); transition: transform .45s var(--ease); }
.carrito.abierto { transform: none; }
.carrito-cab { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 12px; }
.carrito-cab h2 { font-family: var(--fuente-display); text-transform: uppercase; letter-spacing: -.02em; font-size: 1.4rem; }
.carrito-lista { flex: 1; overflow-y: auto; padding: 0 18px; display: grid; gap: 12px; align-content: start; }
.linea-carrito { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: var(--capa-2); }
.linea-carrito img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: #0a1118; }
.linea-carrito strong { display: block; font-size: .95rem; }
.linea-carrito span { font-size: .8rem; color: var(--tinta-2); }
.carrito-pie { padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); display: grid; gap: 12px; }
.carrito-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; }
.carrito-total strong { font-family: var(--fuente-display); font-size: 1.6rem; }
.carrito-vacio { text-align: center; color: var(--tinta-3); padding: 40px 10px; display: grid; gap: 14px; justify-items: center; }

/* Miniatura que "vuela" al carrito */
.volando { position: fixed; z-index: 85; pointer-events: none; border-radius: 14px; box-shadow: var(--sombra); object-fit: cover; }

/* ---------- Paleta de comandos (Ctrl+K) ---------- */
.paleta { border: 1px solid var(--linea-fuerte); border-radius: 20px; padding: 0; width: min(600px, calc(100vw - 24px)); background: rgb(13 20 29 / .96); color: var(--tinta); box-shadow: var(--sombra); margin-top: 12vh; }
.paleta::backdrop { background: rgb(0 0 0 / .5); backdrop-filter: blur(4px); }
.paleta[open] { animation: aparece .25s var(--ease); }
.paleta-buscar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--linea); }
.paleta-buscar input { flex: 1; border: 0; background: none; outline: none; font-size: 1.05rem; }
.paleta-lista { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.paleta-lista li { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; cursor: pointer; }
.paleta-lista li[aria-selected="true"] { background: rgb(45 226 200 / .12); color: var(--aqua); }
.paleta-lista small { margin-left: auto; color: var(--tinta-3); font-size: .75rem; }
.paleta-pie { padding: 9px 16px; border-top: 1px solid var(--linea); font-size: .75rem; color: var(--tinta-3); display: flex; gap: 14px; }

/* ---------- Cursor propio (solo con ratón) ---------- */
.cursor, .cursor-punto { position: fixed; top: 0; left: 0; z-index: 95; pointer-events: none; border-radius: 50%; }
.cursor { width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1.5px solid rgb(255 255 255 / .55); transition: width .25s var(--ease), height .25s var(--ease), margin .25s var(--ease), background .25s, border-color .25s; mix-blend-mode: difference; }
.cursor-punto { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--tinta); mix-blend-mode: difference; }
.cursor.sobre { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgb(255 255 255 / .9); border-color: transparent; }
body.con-cursor, body.con-cursor a, body.con-cursor button { cursor: none; }
body.con-cursor input, body.con-cursor .entrada { cursor: text; }

/* ---------- Guía "Prueba esto" ---------- */
.guia { position: fixed; right: 18px; bottom: 18px; z-index: 50; }
@media (max-width: 760px) { .guia { right: 12px; bottom: 84px; } }
.guia[data-abierta="true"] { width: min(340px, calc(100vw - 24px)); max-height: calc(100vh - 120px); overflow-y: auto; background: rgb(13 20 29 / .96); border: 1px solid var(--linea-fuerte); border-radius: var(--radio); padding: 14px; box-shadow: var(--sombra); backdrop-filter: blur(12px); }
.guia-cab { display: flex; align-items: center; gap: 8px; }
.guia-cab .btn-icono { margin-left: auto; min-height: 32px; width: 32px; border: 0; }
.guia-cuenta { font-size: .75rem; font-weight: 800; color: var(--noche); background: var(--aqua); border-radius: 99px; padding: 1px 8px; }
.guia-intro { margin: 6px 0 10px; font-size: .85rem; color: var(--tinta-2); }
.guia-pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.guia-pasos button { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; border-radius: 12px; padding: 8px; cursor: pointer; }
.guia-pasos button:hover { background: rgb(255 255 255 / .05); }
.guia-pasos strong { display: block; font-size: .9rem; }
.guia-pasos span span { display: block; font-size: .8rem; color: var(--tinta-2); }
.guia-check { flex: none; width: 18px; height: 18px; margin-top: 2px; border: 2px solid var(--linea-fuerte); border-radius: 50%; }
.guia-pasos [data-visto="true"] .guia-check { background: var(--aqua); border-color: var(--aqua); box-shadow: inset 0 0 0 3px var(--capa); }
.guia-pasos [data-visto="true"] strong { color: var(--tinta-3); }
.guia-pastilla { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 99px; background: var(--tinta); color: var(--noche); border: 0; font-weight: 800; cursor: pointer; box-shadow: var(--sombra); }
.guia-pastilla .guia-cuenta { background: var(--noche); color: var(--aqua); }

/* Aparición al hacer scroll: el JS añade .visible (IntersectionObserver) */
.revelar { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--retraso, 0s); }
.revelar.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .revelar { opacity: 1; transform: none; } }
