/* Alforja · carteras de cuero — demo "Lo que entra" */
:root {
  --fondo: #f1ebdf; --texto: #2a1d14; --texto-2: #6a5444; --linea: #ddd1bd; --superficie: #e9e0cf;
  --acento: #8a4f26; --acento-texto: #fff; --oliva: #56602f; --oliva-claro: #e1e2c6;
  --mesa: #e6dbc6; --luz: rgba(255, 250, 240, .75); --forro: #d9d1b0; --forro-s: #c6bd98; --trazo: #23170f;
  --fieltro: #e3d9c4; --error: #9b2f1f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #18110c; --texto: #efe4d2; --texto-2: #bca994; --linea: #3a2c20; --superficie: #241a12;
    --acento: #d99460; --acento-texto: #1a110b; --oliva: #b4bf85; --oliva-claro: #2c2e1c;
    --mesa: #2a1f16; --luz: rgba(255, 228, 196, .16); --forro: #cfc5a2; --forro-s: #b4aa86; --trazo: #1a110b;
    --fieltro: #2c2118; --error: #ff9c86;
  }
}
body { background: var(--fondo); }

/* Cabecera */
.cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 10px; }
.marca { text-decoration: none; display: grid; gap: 1px; }
.marca-nombre { font-weight: 700; font-size: 22px; letter-spacing: .34em; text-transform: uppercase; color: var(--acento); line-height: 1; }
.marca-sub { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--texto-2); }
.btn-ped { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--linea); background: var(--superficie); display: grid; place-items: center; color: var(--texto); }
.ped-n { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--acento); color: var(--acento-texto); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.ped-n[hidden] { display: none; }

/* Intro */
.intro { padding-top: 6px; padding-bottom: 14px; }
.kicker { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--oliva); font-weight: 700; }
.intro h1 { font-size: clamp(30px, 8.6vw, 54px); letter-spacing: -.02em; margin-top: 6px; }
.bajada { color: var(--texto-2); margin-top: 6px; font-size: 15px; max-width: 46ch; }

/* Taller: mobile primero */
.taller { display: grid; gap: 14px; padding-bottom: 36px; }
.taller > * { min-width: 0; }
.modelos { margin: 0 -16px; }
.modelos-lista { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
.modelos-lista::-webkit-scrollbar { display: none; }
.modelo { flex: none; scroll-snap-align: start; display: grid; justify-items: center; gap: 4px; width: 84px; padding: 8px 4px 7px; border: 1px solid var(--linea); border-radius: 14px; background: transparent; color: var(--texto); text-align: center; transition: border-color .2s, background-color .2s; }
.modelo[aria-pressed="true"] { border-color: var(--acento); background: var(--superficie); box-shadow: inset 0 0 0 1px var(--acento); }
.modelo-fig { width: 56px; height: 40px; display: grid; place-items: center; }
.modelo-fig svg { width: 100%; height: 100%; }
.modelo-tx b { display: block; font-size: 13px; line-height: 1.2; }
.modelo-tx small { display: block; font-size: 10.5px; color: var(--texto-2); line-height: 1.2; }

.escena { position: sticky; top: var(--demo-h); z-index: 5; background: var(--fondo); padding-top: 4px; padding-bottom: 6px; }
.pestanas { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--superficie); width: max-content; margin-bottom: 8px; }
.pestanas button { border: 0; background: transparent; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--texto-2); }
.pestanas button[aria-selected="true"] { background: var(--fondo); color: var(--texto); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

.escenario { position: relative; height: clamp(240px, 42svh, 400px); border-radius: 20px; background: radial-gradient(ellipse 60% 55% at 50% 50%, var(--luz), transparent 70%), var(--mesa); overflow: hidden; touch-action: manipulation; transition: box-shadow .2s; }
.escenario.sobre { box-shadow: inset 0 0 0 2px var(--acento); }
.lienzo { width: 100%; height: 100%; padding: 10px 12px 6px; overflow: visible; }
.esc-vos .lienzo { padding: 8px 10px 0; }

.btn-abrir { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--linea); background: var(--fondo); color: var(--texto); font-weight: 700; font-size: 13px; }
.btn-abrir .ico { width: 18px; height: 18px; }
.globo { position: absolute; left: 50%; top: 10px; transform: translate(-50%, 0); max-width: calc(100% - 20px); width: max-content; text-align: center; padding: 7px 12px; border-radius: 999px; background: var(--texto); color: var(--fondo); font-size: 13px; font-weight: 700; pointer-events: none; transition: opacity .25s, transform .25s; }
.globo:not(.ver) { opacity: .92; }
.globo.mal { background: var(--error); color: #fff; }
@media (prefers-color-scheme: dark) { .globo.mal { color: #1a110b; } }
.escena.usada .globo:not(.ver) { opacity: 0; transform: translate(-50%, -8px); }

.capacidad { display: grid; grid-template-columns: 1fr 88px auto; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--texto-2); }
.medida { font-variant-numeric: tabular-nums; }
.barra { height: 8px; border-radius: 4px; background: var(--superficie); overflow: hidden; box-shadow: inset 0 0 0 1px var(--linea); }
.barra i { display: block; height: 100%; background: var(--oliva); transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.3, .8, .3, 1); }
.barra i.lleno { background: var(--acento); }
.capacidad b { color: var(--texto); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }

/* Ilustración de la cartera (unidades = cm) */
.tz:not([fill]):not(.c-cuero):not(.c-sombra):not(.herraje) { fill: none; }
.tz { stroke: var(--trazo); stroke-width: 1.3; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.c-cuero { fill: var(--cuero); }
.c-sombra { fill: var(--cuero-s); }
.c-fondo { fill: var(--cuero-s); }
.forro { fill: var(--forro); }
.costura { fill: none; stroke: var(--costura); stroke-width: .16; stroke-dasharray: .7 .5; opacity: .85; }
.correa { fill: none; stroke: var(--cuero); stroke-linecap: round; stroke-linejoin: round; }
.correa-b { fill: none; stroke: var(--trazo); stroke-linecap: round; stroke-linejoin: round; }
.aro { fill: none; stroke: var(--herraje); stroke-width: .45; }
.herraje { fill: var(--herraje); }
.hebilla { fill: none; stroke: var(--herraje); stroke-width: .5; }
.cierre { fill: none; stroke: var(--herraje); stroke-width: .45; stroke-dasharray: .25 .25; }
.cordon { fill: none; stroke: var(--cuero-s); stroke-width: .6; stroke-linecap: round; }
.regla path { fill: none; stroke: var(--texto-2); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.regla text { fill: var(--texto-2); font: 700 1.25px var(--f); letter-spacing: .05px; }

.frente, .tapa { transition: opacity .45s ease, transform .55s cubic-bezier(.3, .9, .3, 1); }
.tapa.solapa { transform-box: fill-box; transform-origin: 50% 0; }
.tapa.solapa .c-cuero { transition: fill .4s; }
.escena.abierta #lienzo .frente { opacity: 0; }
.escena.abierta #lienzo .tapa.solapa { transform: scaleY(-.32); }
.escena.abierta #lienzo .tapa.solapa .c-cuero { fill: var(--cuero-s); }
.escena.abierta #lienzo .tapa.cierre-t { opacity: 0; }
.obj.nuevo { animation: cae .45s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes cae { from { transform: translateY(-14px); opacity: 0; } }
.rebota { animation: rebota .85s ease-in both; }
@keyframes rebota { 0% { transform: translateY(-6px); opacity: 0; } 25% { transform: translateY(5px); opacity: 1; } 45% { transform: translateY(1px); } 100% { transform: translate(22px, -26px) rotate(25deg); opacity: 0; } }

/* Apertura atada al scroll (si el navegador puede); si no, botón "Abrir" o tocar */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    main { timeline-scope: --intro; }
    .intro { view-timeline: --intro block; }
    .escena:not(.manual) #lienzo .frente { animation: frente-abre linear both; animation-timeline: --intro; animation-range: exit 0% exit 100%; }
    .escena:not(.manual) #lienzo .tapa.solapa { animation: solapa-abre linear both; animation-timeline: --intro; animation-range: exit 0% exit 100%; }
    .escena:not(.manual) #lienzo .tapa.cierre-t { animation: frente-abre linear both; animation-timeline: --intro; animation-range: exit 0% exit 70%; }
    @keyframes frente-abre { 0%, 35% { opacity: 1; } to { opacity: 0; } }
    @keyframes solapa-abre { 0%, 20% { transform: none; } to { transform: scaleY(-.32); } }
  }
}

/* Junto a vos */
.vos-pie { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; margin-top: 8px; }
.altura { font-size: 12px; color: var(--texto-2); }
.altura output { color: var(--texto); font-weight: 700; font-size: 15px; margin-left: 4px; font-variant-numeric: tabular-nums; }
#altura { width: 100%; accent-color: var(--acento); min-height: 32px; }
.vos-txt { grid-column: 1 / -1; font-size: 12px; color: var(--texto-2); }
.persona { fill: var(--oliva-claro); stroke: var(--oliva); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
@media (prefers-color-scheme: dark) { .persona { fill: #2e3020; } }
.escala path { stroke: var(--texto-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.escala .piso { stroke: var(--linea); }
.escala text, .cota text { fill: var(--texto-2); font: 700 5.4px var(--f); }
.cota path { fill: none; stroke: var(--acento); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.cota text { fill: var(--acento); }
.de-espaldas { opacity: .94; }

/* Bandeja de cosas */
.cosas-cab { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cosas-cab h2 { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; }
.cosas-cab p { font-size: 12px; color: var(--texto-2); flex: 1; }
.vaciar { border: 0; background: transparent; color: var(--acento); font-weight: 700; font-size: 13px; min-height: 36px; padding: 0 4px; text-decoration: underline; text-underline-offset: 3px; }
.bandeja { display: flex; gap: 8px; overflow-x: auto; margin: 6px -16px 0; padding: 4px 16px 10px; scrollbar-width: none; align-items: stretch; }
.bandeja::-webkit-scrollbar { display: none; }
.cosa { position: relative; flex: none; min-width: 78px; display: grid; grid-template-rows: 82px auto auto; justify-items: center; gap: 2px; padding: 8px 8px 8px; border-radius: 14px; border: 1px solid var(--linea); background: var(--fieltro); color: var(--texto); touch-action: pan-x; user-select: none; -webkit-user-select: none; transition: opacity .2s, border-color .2s; }
.cosa-fig { display: grid; place-items: end center; height: 82px; }
.cosa-svg { width: calc(var(--w) * 1px); height: auto; max-height: 82px; }
.cosa-n { font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center; max-width: 92px; }
.cosa-m { font-size: 10.5px; color: var(--texto-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cosa-ok { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--oliva); opacity: 0; transform: scale(.5); transition: opacity .2s, transform .2s; }
.cosa-ok::after { content: ""; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px; border: solid var(--fondo); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cosa.dentro { border-color: var(--oliva); }
.cosa.dentro .cosa-fig { opacity: .35; }
.cosa.dentro .cosa-ok { opacity: 1; transform: none; }
.cosa.levantada .cosa-fig { opacity: .25; }
.cosa.no { animation: no .4s; }
@keyframes no { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.fantasma { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .3)); }
.fantasma.vuelve { transition: transform .3s ease-in; opacity: .7; }

/* Ficha */
.ficha { display: grid; gap: 10px; padding: 16px; border-radius: 20px; background: var(--superficie); }
.f-tipo { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--oliva); font-weight: 700; }
.f-nombre { font-size: 28px; letter-spacing: -.01em; margin-top: -6px; }
.f-desc { font-size: 14px; color: var(--texto-2); }
.ops { display: flex; gap: 18px; flex-wrap: wrap; }
.op { border: 0; margin: 0; padding: 0; min-width: 0; }
.op legend { padding: 0; font-size: 12px; color: var(--texto-2); margin-bottom: 6px; }
.op legend span { color: var(--texto); font-weight: 700; }
.muestras, .herrajes { display: flex; gap: 8px; }
.muestra { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--fondo); background: var(--m); box-shadow: 0 0 0 1px var(--linea); }
.muestra[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--acento); }
.herr { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 8px; border-radius: 999px; border: 1px solid var(--linea); background: var(--fondo); font-size: 13px; font-weight: 700; color: var(--texto); }
.herr i { width: 18px; height: 18px; border-radius: 50%; background: var(--m); box-shadow: inset 0 -3px 4px rgba(0, 0, 0, .25), inset 0 2px 3px rgba(255, 255, 255, .5); }
.herr[aria-pressed="true"] { border-color: var(--acento); box-shadow: inset 0 0 0 1px var(--acento); }
.precio { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.precio b { font-size: 26px; font-variant-numeric: tabular-nums; }
.precio span { font-size: 14px; color: var(--oliva); font-weight: 700; }
.precio small { flex-basis: 100%; font-size: 12px; color: var(--texto-2); }
.sumar { width: 100%; }

/* Oficio */
.oficio { display: grid; gap: 18px; padding-top: 30px; padding-bottom: 34px; border-top: 1px solid var(--linea); }
.oficio-item { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.ico-of { width: 44px; height: 44px; fill: none; stroke: var(--acento); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.oficio-item b { display: block; font-size: 15px; }
.oficio-item p { font-size: 13px; color: var(--texto-2); }
.pie-marca { font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--acento); }

/* Pedido */
.hoja-form { display: flex; flex-direction: column; min-height: 0; flex: 1; gap: 0; }
.hoja-form .hoja-cuerpo { flex: 1; }
.ped-item .ped-img svg { width: 48px; height: 40px; }
.check a { color: var(--texto); }

/* PC */
@media (min-width: 960px) {
  .cab { padding-top: 22px; }
  .intro { padding-bottom: 22px; display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 4px 40px; }
  .intro .kicker { grid-column: 1 / -1; }
  .intro h1 { margin: 0; }
  .bajada { margin: 0 0 6px; }
  .taller { grid-template-columns: 200px minmax(0, 1fr) 300px; grid-template-areas: "mod esc cosas" "mod ficha cosas"; gap: 18px 24px; align-items: start; }
  .modelos { grid-area: mod; margin: 0; position: sticky; top: calc(var(--demo-h) + 12px); }
  .modelos-lista { flex-direction: column; overflow: visible; padding: 0; }
  .modelo { width: 100%; grid-template-columns: 64px 1fr; justify-items: start; align-items: center; text-align: left; gap: 10px; padding: 8px 10px; }
  .modelo-fig { width: 64px; height: 44px; }
  .escena { grid-area: esc; position: relative; top: auto; padding-top: 0; }
  .escenario { height: min(62vh, 560px); }
  .ficha { grid-area: ficha; grid-template-columns: 1fr auto; align-items: center; gap: 10px 24px; padding: 20px 22px; }
  .ficha > .f-tipo, .ficha > .f-nombre, .ficha > .f-desc, .ficha > .ops { grid-column: 1; }
  .ficha .precio { grid-column: 2; grid-row: 1 / 4; flex-direction: column; align-items: flex-end; text-align: right; gap: 2px; }
  .ficha .sumar { grid-column: 2; grid-row: 4; width: auto; min-width: 220px; }
  .cosas { grid-area: cosas; }
  .cosa { grid-template-rows: 112px auto auto; }
  .cosa-fig { height: 112px; }
  .cosa-svg { width: calc(var(--w) * 1.38px); max-height: 112px; }
  .bandeja { flex-wrap: wrap; overflow: visible; margin: 8px 0 0; padding: 0; }
  .cosa { min-width: 0; width: calc(50% - 4px); }
  .cosa-n { max-width: none; }
  .oficio { grid-template-columns: repeat(3, 1fr); gap: 32px; }
}
@media (min-width: 1280px) { .taller { grid-template-columns: 220px minmax(0, 1fr) 330px; } }
