:root {
  --pared: #946f62;
  --crema: #f6ece2;
  --crema-suave: rgb(246 236 226 / 0.72);
  --tinta: #2a1613;
  --brillo: #ff7a35;           /* color con que se enciende la repisa */
  --brillo-suave: rgb(255 122 53 / 0.5);
  --fuente: "Helvetica Neue", Helvetica, "Segoe UI", Arial, system-ui, sans-serif;
  --cab: 70px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #6f5148; }
body { font-family: var(--fuente); color: var(--crema); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--crema); outline-offset: 3px; }

/* ───────── La pared y su cámara ───────── */
.vista { position: fixed; inset: 0; overflow: hidden; background: var(--pared); touch-action: none; cursor: default; }
.escena { position: absolute; left: 0; top: 0; transform-origin: 0 0; --px: 0; --py: 0; }
/* La pared es una capa del tamaño de la PANTALLA, no un bloque gigante dentro de la escena: en iPhone un bloque de 12 000 × 8 200 px con
   mezcla de capas agotaba la memoria y la página no cargaba. Las fibras siguen a la cámara por variables (--wx, --wy, --ws). */
.pared { position: absolute; inset: 0; background: var(--pared); }
.pared::before { content: ""; position: absolute; inset: 0; background: url(assets/fibras.png) var(--wx, 0px) var(--wy, 0px) / var(--ws, 512px); mix-blend-mode: soft-light; opacity: 0.8; }
.pared::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 80% at 28% 18%, rgb(255 233 208 / 0.17), transparent 70%); }   /* luz de ventana arriba a la izquierda */

.repisa { position: absolute; box-shadow: 0 46px 64px -14px rgb(38 14 10 / 0.5); transform: translate3d(calc(var(--px) * 6px), calc(var(--py) * 3px), 0); }
.repisa i { position: absolute; left: 0; right: 0; display: block; pointer-events: none; }
.repisa .sup { top: 0; height: var(--sup); background: linear-gradient(180deg, #ece3e3 0%, #d6cbc9 100%); box-shadow: inset 0 3px 0 #f8f3f5; }
.repisa .fr  { top: var(--sup); height: var(--fr); background: linear-gradient(180deg, #c3b9ba 0%, #aca3a8 82%, #8e868e 100%); }
/* tira de luz bajo la repisa: apagada hasta que el mouse pasa por el calzado */
.repisa .led { top: calc(var(--sup) + var(--fr) * 0.74); height: 11px; border-radius: 6px;
  background: linear-gradient(180deg, #fff1e0, var(--brillo)); opacity: 0; transition: opacity 0.35s ease;
  box-shadow: 0 0 22px 8px var(--brillo-suave), 0 0 90px 34px rgb(255 100 40 / 0.32); }
.repisa .resplandor { top: calc(var(--sup) + var(--fr)); height: 620px; opacity: 0; transition: opacity 0.5s ease;
  background: radial-gradient(ellipse 980px 560px at var(--cx) 0, rgb(255 120 55 / 0.55), rgb(255 120 55 / 0.16) 48%, transparent 100%); }
.repisa .luz-sup { top: 0; height: var(--sup); opacity: 0; transition: opacity 0.45s ease;
  background: radial-gradient(ellipse 520px 60px at var(--cx) 60%, rgb(255 138 70 / 0.65), transparent 100%); }
.repisa.lit .led, .repisa.lit .resplandor, .repisa.lit .luz-sup { opacity: 1; }

.sombra-suela { position: absolute; height: 30px; pointer-events: none; background: radial-gradient(ellipse 50% 50% at 50% 50%, rgb(36 16 12 / 0.6), transparent 72%); transition: opacity 0.4s, transform 0.4s; }
.zapato { position: absolute; display: block; cursor: pointer; border-radius: 4px; transform: translate3d(calc(var(--px) * 14px), calc(var(--py) * 7px), 0); }
.zapato img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; pointer-events: none;
  filter: drop-shadow(34px -10px 22px rgb(45 22 18 / 0.3)); transition: transform 0.45s cubic-bezier(.2,.7,.2,1); }
.zapato.lit img { transform: translateY(-9px); }
.zapato.lit + .sombra-suela, .sombra-suela.lit { opacity: 0.55; transform: scale(0.94); }
.zapato:focus-visible { outline-offset: 10px; }

.etiqueta { position: absolute; transform: translateX(-50%) translateY(10px); text-align: center; white-space: nowrap; pointer-events: none; opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease; font-size: 30px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--crema); text-shadow: 0 2px 18px rgb(40 12 8 / 0.7); }
.etiqueta b { display: block; font-weight: 600; }
.etiqueta span { display: block; margin-top: 6px; font-size: 24px; letter-spacing: 0.1em; color: #ffc9a3; }
.etiqueta.lit { opacity: 1; transform: translateX(-50%) translateY(0); }
body[data-vista="detalle"] .etiqueta { opacity: 0 !important; }

/* profundidad de campo: en el acercamiento lo que no es el calzado elegido se apaga y se desenfoca */
.repisa, .zapato img, .sombra-suela { transition: filter 0.9s ease, opacity 0.9s ease, transform 0.45s cubic-bezier(.2,.7,.2,1); }
body[data-vista="detalle"] .repisa:not(.actual) { filter: blur(3px) brightness(0.78); }
body[data-vista="detalle"] .zapato:not(.actual) img { filter: blur(3px) brightness(0.78) drop-shadow(34px -10px 22px rgb(45 22 18 / 0.3)); }
body[data-vista="detalle"] .sombra-suela:not(.actual) { opacity: 0.2; }
.ficha::before { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease 0.4s;
  background: linear-gradient(270deg, rgb(40 16 12 / 0.38), transparent 32%), linear-gradient(180deg, rgb(40 16 12 / 0.28), transparent 38%); }
body[data-vista="detalle"] .ficha::before { opacity: 1; }

/* ───────── Atmósfera: viñeta, desenfoque de movimiento, grano ───────── */
.atmosfera { position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 45%, transparent 52%, rgb(34 14 10 / 0.42) 100%),
    linear-gradient(180deg, rgb(34 14 10 / 0.42), transparent 18%); }
.desenfoque { position: fixed; inset: 0; z-index: 3; pointer-events: none; backdrop-filter: blur(var(--b, 0px)); -webkit-backdrop-filter: blur(var(--b, 0px)); display: none; }
.grano { position: fixed; inset: -50px; z-index: 40; pointer-events: none; background: url(assets/grano.png) 0 0 / 190px; mix-blend-mode: overlay; opacity: 0.30; animation: grano 0.9s steps(1) infinite; }
@keyframes grano { 0% { transform: translate(0, 0) } 17% { transform: translate(-31px, 18px) } 33% { transform: translate(22px, -27px) } 50% { transform: translate(-14px, -9px) } 67% { transform: translate(35px, 25px) } 83% { transform: translate(-26px, 31px) } }

/* ───────── Cabecera y textos de la colección ───────── */
.cabecera { position: fixed; z-index: 10; left: 0; right: 0; top: 0; height: var(--cab); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 clamp(16px, 2.4vw, 36px); }
.marca { display: inline-flex; align-items: center; gap: 12px; color: var(--crema); text-decoration: none; justify-self: start; }
.marca img { height: 38px; width: auto; display: block; }
.marca span { display: block; line-height: 1.1; }
.marca b { display: block; font-weight: 600; font-size: 15px; letter-spacing: 0.34em; }
.marca i { display: block; font-style: normal; font-size: 10.5px; letter-spacing: 0.16em; color: var(--crema-suave); margin-top: 4px; }
.menu { display: flex; gap: clamp(18px, 3vw, 44px); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; }
.menu a { color: var(--crema-suave); text-decoration: none; padding: 8px 2px; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.menu a[aria-current] { color: var(--crema); border-color: var(--crema); }
.menu a:not(.apagado):hover { color: var(--crema); }
.menu .apagado { opacity: 0.5; cursor: default; }
.bolsa { justify-self: end; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; padding: 10px 2px; border-bottom: 1px solid transparent; }
.bolsa:hover { border-color: var(--crema); }
.bolsa.salta { animation: salta 0.5s ease; }
@keyframes salta { 40% { transform: translateY(-4px) } }

.lema { position: fixed; z-index: 6; left: calc(50% + 30px); top: calc(var(--cab) + 26px); font-size: clamp(15px, 1.5vw, 21px); font-weight: 300; letter-spacing: 0.02em; color: var(--crema); pointer-events: none; transition: opacity 0.5s ease 0.4s; }
.lema em { font-style: italic; color: var(--crema-suave); }
.pista { position: fixed; z-index: 6; left: 0; right: 0; bottom: 22px; text-align: center; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--crema-suave); pointer-events: none; transition: opacity 0.5s; }
.pista-tactil { display: none; }
@media (hover: none) { .pista-mouse { display: none; } .pista-tactil { display: inline; } }
body[data-vista="detalle"] .lema, body[data-vista="detalle"] .pista, body.visto .pista { opacity: 0; transition-delay: 0s; transition-duration: 0.25s; }

/* ───────── Ficha (vista de acercamiento) ───────── */
.ficha { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
.ficha > * { opacity: 0; transform: translateY(14px); transition: opacity 0.35s ease, transform 0.35s ease; }
body[data-vista="detalle"] .ficha > * { opacity: 1; transform: none; pointer-events: auto; transition: opacity 0.7s ease 0.55s, transform 0.7s cubic-bezier(.2,.7,.2,1) 0.55s; }
body[data-vista="detalle"] .ficha > .ficha-compra { transition-delay: 0.7s; }
body[data-vista="detalle"] .ficha > .ficha-nav { transition-delay: 0.85s; }
.ficha.cambia > .ficha-titulo, .ficha.cambia > .ficha-compra { opacity: 0 !important; transform: translateY(10px) !important; transition-duration: 0.2s !important; transition-delay: 0s !important; }

.ficha-titulo { position: absolute; left: clamp(16px, 2.4vw, 36px); top: calc(var(--cab) + 26px); max-width: min(46vw, 640px); }
.ficha-piso { font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--crema-suave); }
.ficha-titulo h1 { margin-top: 10px; font-size: clamp(34px, 5vw, 82px); font-weight: 600; line-height: 0.95; letter-spacing: -0.035em; text-transform: uppercase; text-shadow: 0 2px 30px rgb(40 12 8 / 0.35); }
.ficha-desc { margin-top: 14px; max-width: 34ch; font-size: 14px; line-height: 1.5; color: var(--crema-suave); }

.ficha-compra { position: absolute; right: clamp(16px, 2.4vw, 36px); top: calc(var(--cab) + 26px); width: min(320px, 28vw); min-width: 270px; }
.fila { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid rgb(246 236 226 / 0.28); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }
.fila > span:first-child { color: var(--crema-suave); }
.fila em { font-style: normal; display: inline-flex; align-items: center; gap: 8px; text-align: right; letter-spacing: 0.08em; text-transform: none; font-size: 13px; }
.muestra { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgb(246 236 226 / 0.6); flex: none; }
.fila-precio strong { font-size: 30px; font-weight: 500; letter-spacing: -0.01em; text-transform: none; }
.fila-talla { display: block; padding-bottom: 12px; }
.fila-talla > span { display: block; margin-bottom: 10px; }
.selector { position: relative; }
.selector-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-radius: 999px; background: rgb(246 236 226 / 0.1); border: 1px solid rgb(246 236 226 / 0.34); font-size: 13px; letter-spacing: 0.06em; text-transform: none; backdrop-filter: blur(6px); transition: background 0.2s, border-color 0.2s; }
.selector-btn:hover, .selector-btn[aria-expanded="true"] { background: rgb(246 236 226 / 0.18); border-color: rgb(246 236 226 / 0.6); }
.selector-btn svg { transition: transform 0.25s; }
.selector-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.selector-lista { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 8px); list-style: none; padding: 6px; border-radius: 18px; background: rgb(44 22 18 / 0.94); border: 1px solid rgb(246 236 226 / 0.2); box-shadow: 0 24px 50px rgb(20 8 6 / 0.5); backdrop-filter: blur(12px); }
.selector-lista li { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; font-size: 13px; letter-spacing: 0.06em; text-transform: none; cursor: pointer; }
.selector-lista li:hover, .selector-lista li[aria-selected="true"] { background: rgb(246 236 226 / 0.14); }
.selector-lista li small { color: var(--crema-suave); font-size: 11px; letter-spacing: 0.1em; }
.agregar { width: 100%; margin-top: 12px; display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-radius: 999px; background: var(--crema); color: var(--tinta); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 600; transition: transform 0.2s, opacity 0.2s, background 0.2s; }
.agregar:not(:disabled):hover { transform: translateY(-2px); background: #fff; }
.agregar:disabled { opacity: 0.45; cursor: not-allowed; }
.nota { margin-top: 12px; font-size: 11px; letter-spacing: 0.1em; color: var(--crema-suave); text-align: center; min-height: 1.4em; }

.ficha-nav { position: absolute; left: clamp(16px, 2.4vw, 36px); right: clamp(16px, 2.4vw, 36px); bottom: 26px; display: flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; }
.volver { display: inline-flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid transparent; margin-right: auto; }
.volver:hover { border-color: var(--crema); }
.cuenta { color: var(--crema-suave); letter-spacing: 0.24em; margin-right: 6px; }
.flecha { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgb(246 236 226 / 0.4); background: rgb(246 236 226 / 0.08); transition: background 0.2s, border-color 0.2s; }
.flecha:hover { background: rgb(246 236 226 / 0.2); border-color: var(--crema); }

.aviso { position: fixed; z-index: 30; left: 50%; bottom: 84px; transform: translate(-50%, 16px); padding: 12px 22px; border-radius: 999px; background: rgb(246 236 226 / 0.96); color: var(--tinta); font-size: 12px; letter-spacing: 0.1em; opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s; box-shadow: 0 16px 40px rgb(30 10 8 / 0.4); white-space: nowrap; }
.aviso.visible { opacity: 1; transform: translate(-50%, 0); }

/* ───────── Arranque ───────── */
.escena .muro, .escena .repisa, .escena .zapato, .escena .sombra-suela { transition: opacity 0.9s ease; }
body:not(.listo) .escena .muro { opacity: 0; }
body:not(.listo) .escena .repisa, body:not(.listo) .escena .zapato, body:not(.listo) .escena .sombra-suela { opacity: 0; }
body:not(.listo) .cabecera, body:not(.listo) .lema, body:not(.listo) .pista { opacity: 0; }
.cabecera, .lema, .pista { transition: opacity 0.8s ease 0.6s; }
body.listo .zapato { animation: entra 1s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(0.25s + var(--i) * 0.14s); }
@keyframes entra { from { opacity: 0; margin-top: 34px; } to { opacity: 1; margin-top: 0; } }
body.arranque .repisa .led { animation: enciende 1.5s ease both; animation-delay: calc(0.5s + var(--i) * 0.2s); }
@keyframes enciende { 0% { opacity: 0 } 35% { opacity: 0.85 } 100% { opacity: 0 } }
.repisa.lit .led { animation: none !important; opacity: 1; }

/* ───────── Pantallas angostas / verticales ───────── */
@media (max-aspect-ratio: 9/10), (max-width: 760px) {
  .menu { display: none; }
  .cabecera { grid-template-columns: 1fr auto; }
  .marca i { display: none; }
  .ficha-titulo { max-width: 90vw; top: calc(var(--cab) + 6px); }
  .ficha-titulo h1 { font-size: clamp(30px, 11vw, 52px); }
  .ficha-desc { display: none; }
  .ficha-compra { left: 16px; right: 16px; width: auto; min-width: 0; top: auto; bottom: 74px; padding: 14px 16px 16px; border-radius: 22px; background: rgb(52 28 22 / 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .fila { padding: 9px 0; }
  .fila-precio strong { font-size: 24px; }
  .nota { display: none; }
  .agregar { margin-top: 8px; padding: 13px 18px; }
  .ficha-nav { bottom: 18px; gap: 8px; }
  .volver { font-size: 0; gap: 0; } .volver svg { width: 20px; height: 20px; }
  .selector-lista { top: auto; bottom: calc(100% + 8px); }
  .etiqueta { font-size: 40px; }
  .lema { display: none; }
}
/* teléfonos de pantalla corta: la hoja de compra pierde la fila de color para dejar ver el calzado */
@media (max-aspect-ratio: 9/10) and (max-height: 760px), (max-width: 760px) and (max-height: 760px) { .ficha-compra .fila:nth-child(2) { display: none; } .ficha-compra { padding: 10px 14px 12px; } .selector-btn { padding: 11px 16px; } }
@media (prefers-reduced-motion: reduce) {
  .grano { animation: none; }
  body.listo .zapato, body.arranque .repisa .led { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ───────── Demostración automática: cursor dibujado ───────── */
#cursor { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; opacity: 0; transform: translate(-100px, -100px); filter: drop-shadow(0 4px 8px rgb(30 10 8 / 0.45)); }
#cursor svg { display: block; transform-origin: 3px 2px; transition: transform 0.15s; }
#cursor.presionado svg { transform: scale(0.86); }
.onda { position: fixed; z-index: 69; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 2px solid rgb(246 236 226 / 0.9); pointer-events: none; animation: onda 0.75s ease-out forwards; }
@keyframes onda { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
body.grabando .pista { display: none; }
