/* =============================================================
   6. Tienda e-commerce — "Manga Ink"
   ============================================================= */

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - var(--topbar-h));
  display: grid; align-items: center;
  padding: clamp(2rem, 7vh, 5rem) var(--gutter) 3.5rem;
  /* Corte limpio: ni el canvas, ni las piezas flotantes, ni sus sombras
     asoman por debajo del Hero. El límite con la sección beige es un
     borde directo fondo-oscuro → fondo-beige, SIN franja intermedia
     (antes había un border-bottom de 4px que el canvas no tapaba). */
  overflow: hidden;
  /* Fix de subpíxel en la unión Hero ↔ sección beige (franja negra en
     Firefox/Edge/Opera; Chrome redondea distinto): se fuerza una capa
     de compositing propia y un stacking context propio para que el borde
     inferior del canvas WebGL se ajuste a pixel entero y no deje residuo
     al scrollear, y se solapa 1px la sección de abajo para cerrar el hueco. */
  isolation: isolate;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  margin-bottom: -1px;
  background: var(--ink);
  color: var(--paper-2);
}
.hero__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.hero__lines {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background:
    repeating-linear-gradient(115deg, transparent 0 22px, rgba(255,255,255,.05) 22px 24px);
  mask-image: radial-gradient(120% 90% at 78% 30%, #000 10%, transparent 72%);
}
.hero__inner { position: relative; z-index: 2; max-width: 640px; }
.hero__kicker {
  display: inline-block; font-family: var(--mono); font-size: .72rem; letter-spacing: .3em;
  text-transform: uppercase; color: var(--ink-fixed); background: var(--panini);
  padding: .35rem .7rem; border: 2px solid var(--paper-2); margin-bottom: 1.1rem;
}
.hero__title {
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  line-height: .92; color: var(--paper-2);
  text-shadow: 4px 4px 0 rgba(255,212,0,.9);
  margin-bottom: 1rem;
}
.hero__title .yellow { color: var(--panini); text-shadow: 4px 4px 0 rgba(0,0,0,.6); }
.hero__lead { font-size: clamp(1rem, 2.1vw, 1.2rem); color: #d9d9de; max-width: 46ch; margin-bottom: 1.8rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; }
/* "Desliza": texto suelto sobre el canvas — NO va en un contenedor de ancho
   completo. Sin fondo, borde ni sombra; sin alto fijo. Se centra con
   position:absolute + translateX(-50%) y el Hero (overflow:hidden) lo recorta
   si el "bob" lo acercara al borde. */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 2;
  transform: translateX(-50%);
  color: var(--panini);
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  will-change: transform;
  animation: bob 1.8s var(--ease-soft) infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%,0); } 50% { transform: translate(-50%,7px); } }
@media (prefers-reduced-motion: reduce) { .hero__scroll { animation: none; } }

/* ---------- Secciones ---------- */
.section { padding: clamp(3rem, 9vh, 6rem) var(--gutter); max-width: var(--maxw); margin-inline: auto; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; border-bottom: 3px solid var(--ink); padding-bottom: .8rem; }
.section__head h2 { font-size: clamp(1.8rem, 4.5vw, 3rem); }
.section__head p { color: var(--muted); max-width: 42ch; }

/* ---------- Controles del catálogo (filtros + búsqueda) ---------- */
.catalog-controls {
  position: relative;                 /* ancla de la búsqueda flotante */
  display: flex; align-items: flex-start;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem;
  /* Hueco reservado a la derecha para la búsqueda ABIERTA: así, al desplegarse,
     nunca tapa una categoría (las de más a la derecha, p. ej. "Preventas",
     hacen wrap a otra línea si no caben). --catsearch-open-w lo fija el JS. */
  padding-right: calc(var(--catsearch-open-w, 280px) + 12px);
}
.catalog-controls .catbar { margin-bottom: 0; flex: 1 1 auto; }

/* ---------- Barra de búsqueda animada (neón brutalist) ----------
   FLOTANTE sobre la esquina superior derecha de los controles: al abrir NO
   refluye la fila (antes, al desplegarse, saltaba a otra línea y salía de
   debajo del cursor -> parpadeo abrir/cerrar). Colapsada = sólo la lupita. */
.catsearch {
  position: absolute; top: 0; right: 0; z-index: 3;
  width: 44px;                        /* colapsada: sólo la lupita */
  max-width: calc(100% - 4px);
  display: inline-flex; align-items: center; overflow: hidden;
  box-sizing: border-box;
  border: 2px solid var(--ink); background: var(--paper-2);
  box-shadow: 4px 4px 0 var(--ink);
  transition: width .35s var(--ease-out), box-shadow .18s var(--ease-out);
}
.catsearch__toggle {
  flex: 0 0 40px; height: 40px; display: grid; place-items: center;
  background: var(--ink-fixed); color: var(--panini); border: 0; cursor: pointer;
  transition: background .2s var(--ease-out), color .2s var(--ease-out);
}
.catsearch__toggle svg { width: 18px; height: 18px; display: block; }
.catsearch__input {
  flex: 1 1 auto; width: 100%; min-width: 0; padding: 0 .6rem;
  border: 0; background: transparent; color: var(--ink);
  font-family: var(--mono); font-size: .8rem; line-height: 40px; outline: 0;
}
.catsearch__input::placeholder { color: var(--muted); }
.catsearch__input::-webkit-search-cancel-button { display: none; }  /* limpiamos con la lupa */
/* Abierta: ancho = lupa + el texto del placeholder + su padding, SIN espacio
   sobrante a la derecha. Lo calcula bindSearch() midiendo el placeholder
   (--catsearch-open-w); el fallback en ch es solo por si el JS no corre. */
.catsearch.is-open {
  width: min(var(--catsearch-open-w, 280px), calc(100% - 4px));
  box-shadow: 6px 6px 0 var(--neon-cyan);
}
.catsearch.is-open .catsearch__toggle { background: var(--neon-cyan); color: var(--ink-fixed); }
@media (prefers-reduced-motion: reduce) {
  .catsearch { transition: box-shadow .18s var(--ease-out); }
}

/* ---------- Barra de categorías ---------- */
.catbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.catbar__btn {
  font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; font-size: .86rem;
  padding: .5rem .9rem; border: 2px solid var(--ink); background: var(--paper-2); color: var(--ink);
  transition: background .14s var(--ease-out), transform .12s var(--ease-out), box-shadow .14s var(--ease-out);
}
.catbar__btn:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.catbar__btn.is-active { background: var(--ink); color: var(--paper-2); }

/* ---------- Grid de productos ---------- */
.pgrid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }

.pcard {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper-2); border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
  will-change: transform;
}
.pcard:hover { box-shadow: 10px 10px 0 var(--panini-deep); }
@media (hover: none) { .pcard { transform: none !important; } }

.pcard__media {
  position: relative; aspect-ratio: 3/4; overflow: hidden;
  border-bottom: 3px solid var(--ink); background: var(--paper-3);
}
.pcard__media img { width: 100%; height: 100%; object-fit: cover; }

/* =============================================================
   FIGURAS — tarjeta "expositor": CAJA 3D DE EXHIBICIÓN VACÍA + PNG.
   La caja (marco exterior, fondo neutro-oscuro, piso en perspectiva y
   frente transparente) se dibuja con CSS y es SIEMPRE la portada de la
   grilla. El personaje (figure_png_url) va DENTRO y "despega" hacia
   arriba al hover, sin recortarse. Nunca una silueta vectorial.
   ============================================================= */
.pcard--figure { overflow: visible; }                 /* la figura sale de la tarjeta */
.pcard--figure:hover { z-index: 5; }                  /* por encima de las vecinas */

.box-card-container {
  position: relative;
  overflow: visible !important;                        /* no recorta la figura al salir */
  background: #0b0b12;
}

/* ---- La caja de exhibición VACÍA (marco + fondo + piso + paredes) ----
   Sin z-index: es el primer hijo y queda debajo de glow / tags / view /
   figure-png por orden de pintado. */
.box-3d-display {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;                                    /* recorta solo su interior */
  border: 6px solid #0c0c0e;                           /* marco exterior */
  background:
    /* reflejo tenue de "vidrio" en el frente */
    linear-gradient(122deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 26%,
                            rgba(255,255,255,0) 72%, rgba(255,255,255,.06) 100%),
    /* marca GEEKPOINT tenue en el panel trasero */
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='420'%20height='120'%3E%3Ctext%20x='210'%20y='86'%20text-anchor='middle'%20font-family='Arial%20Black,Arial,sans-serif'%20font-weight='900'%20font-size='58'%20letter-spacing='3'%20fill='%23c8c8d7'%20fill-opacity='0.13'%3EGEEKPOINT%3C/text%3E%3C/svg%3E")
      no-repeat center 30% / 64% auto,
    /* pared trasera / fondo neutro-oscuro */
    linear-gradient(180deg, #20202c 0%, #14141f 52%, #0b0b12 100%);
  box-shadow:
    inset 0 0 0 2px var(--fig-accent, #8b5bff),        /* filo de acento del expositor */
    inset 52px 0 48px -30px rgba(0,0,0,.75),           /* pared lateral izquierda */
    inset -52px 0 48px -30px rgba(0,0,0,.75),          /* pared lateral derecha */
    inset 0 30px 46px -12px rgba(0,0,0,.6),            /* techo en sombra */
    inset 0 -22px 34px -10px rgba(0,0,0,.55);          /* base en sombra */
}
/* luz cenital de acento */
.box-3d-display::before {
  content: "";
  position: absolute; left: 50%; top: -32%;
  width: 130%; height: 62%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--fig-accent, #8b5bff) 0%, rgba(0,0,0,0) 70%);
  opacity: .3;
}
/* piso en perspectiva (trapecio que se aleja) */
.box-3d-display::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 38%;
  background: linear-gradient(180deg, #2a2a38 0%, #131320 100%);
  clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.07);
}

/* ---- Personaje PNG (figure_png_url) alojado DENTRO de la caja ---- */
/* especificidad > `.pcard__media img` para ganar el width/height/object-fit */
.box-card-container .figure-png {
  position: absolute; left: 50%; bottom: 8%;
  width: 75%; height: auto; max-height: 92%;
  transform: translateX(-50%);
  object-fit: contain; z-index: 2; pointer-events: none;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .6));
  transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
  will-change: transform;
}
/* PUM: el personaje despega y sale por arriba de la caja, sin cortarse. */
.pcard--figure:hover .figure-png {
  transform: translateX(-50%) translateY(-45px) scale(1.1);
  filter: drop-shadow(0 30px 28px rgba(0, 0, 0, .5));
}
@media (hover: none) {
  .pcard--figure:hover .figure-png { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .figure-png { transition: none; }
  .pcard--figure:hover .figure-png { transform: translateX(-50%) scale(1.04); }
}
.pcard__glow {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(160px 160px at var(--mx,50%) var(--my,50%), rgba(0,229,255,.5), transparent 70%);
  mix-blend-mode: screen; transition: opacity .25s var(--ease-out);
}
.pcard:hover .pcard__glow { opacity: 1; }

.pcard__tags { position: absolute; top: .55rem; left: .55rem; display: flex; flex-direction: column; gap: .35rem; }
.ptag {
  font-family: var(--comic); font-size: .8rem; letter-spacing: .04em;
  padding: .1rem .5rem; border: 2px solid var(--ink-fixed); transform: rotate(-3deg);
  background: var(--panini); color: var(--ink-fixed);
}
.ptag--preventa { background: var(--neon-magenta); color: #fff; }
.ptag--novedad { background: var(--neon-cyan); color: var(--ink-fixed); }
.ptag--rarity {
  background: var(--ink-fixed); color: var(--neon-cyan); transform: rotate(2deg);
  font-family: var(--mono); font-size: .62rem; letter-spacing: .04em;
  box-shadow: 2px 2px 0 var(--neon-cyan);
}
/* Badges de rareza TCG — color distintivo por tipo (reusa .ptag). */
.ptag--rare {
  transform: rotate(2deg);
  font-family: var(--mono); font-size: .6rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  border-color: var(--ink-fixed); box-shadow: 2px 2px 0 var(--ink-fixed);
}
.ptag--rare-common      { background: #d9d9de; color: var(--ink-fixed); }
.ptag--rare-uncommon    { background: #7bdca0; color: var(--ink-fixed); }
.ptag--rare-rare        { background: #2f6bff; color: #fff; }
.ptag--rare-holo        { background: linear-gradient(120deg, #00e5ff, #4b7bff); color: var(--ink-fixed); box-shadow: 2px 2px 0 var(--ink-fixed), 0 0 10px rgba(0,229,255,.5); }
.ptag--rare-double      { background: #c0392b; color: #fff; }
.ptag--rare-ultra       { background: linear-gradient(120deg, #8b5bff, #ff2d95); color: #fff; box-shadow: 2px 2px 0 var(--ink-fixed), 0 0 10px rgba(139,91,255,.55); }
.ptag--rare-illustration{ background: linear-gradient(120deg, #ffd400, #00e5ff, #ff2d95); color: var(--ink-fixed); box-shadow: 2px 2px 0 var(--ink-fixed); }
.ptag--rare-special     { background: linear-gradient(120deg, #ff2d95, #8b5bff, #00e5ff); color: #fff; box-shadow: 2px 2px 0 var(--ink-fixed), 0 0 12px rgba(255,45,149,.5); }
.ptag--rare-rainbow     { background: linear-gradient(120deg, #ff004c, #ffd400, #00e5ff, #8b5bff); color: var(--ink-fixed); box-shadow: 2px 2px 0 var(--ink-fixed); }
.ptag--rare-gold        { background: linear-gradient(120deg, #f2b600, #fff1a8, #f2b600); color: var(--ink-fixed); box-shadow: 2px 2px 0 var(--ink-fixed), 0 0 10px rgba(242,182,0,.6); }
.ptag--rare-secret      { background: #0c0c0e; color: #ffd400; border-color: #ffd400; box-shadow: 2px 2px 0 #ffd400, 0 0 12px rgba(255,212,0,.5); }
.ptag--rare-amazing     { background: linear-gradient(120deg, #00e5ff, #7bdca0, #ffd400); color: var(--ink-fixed); box-shadow: 2px 2px 0 var(--ink-fixed); }
.ptag--rare-radiant     { background: linear-gradient(120deg, #ffd400, #ff8a00); color: var(--ink-fixed); box-shadow: 2px 2px 0 var(--ink-fixed), 0 0 10px rgba(255,138,0,.5); }
.ptag--rare-promo       { background: #ff8a00; color: var(--ink-fixed); }

.pcard__view {
  position: absolute; right: .55rem; bottom: .55rem;
  font-family: var(--mono); font-size: .64rem; font-weight: 700; letter-spacing: .06em;
  padding: .3rem .5rem; background: var(--ink); color: var(--paper-2);
  opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s;
}
.pcard:hover .pcard__view { opacity: 1; transform: none; }

.pcard__body { padding: .85rem .9rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.pcard__cat { font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pcard__name { font-family: var(--display); text-transform: uppercase; font-size: 1.02rem; line-height: 1.05; }
.pcard__author { font-size: .76rem; color: var(--muted); }
.pcard__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .5rem; }
.pcard__price { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; }
.pcard__add {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); text-transform: uppercase; font-size: .78rem; letter-spacing: .04em;
  line-height: 1; text-align: center;
  padding: .42rem .7rem; background: var(--panini); color: var(--ink-fixed); border: 2px solid var(--ink-fixed);
  transition: transform .16s var(--ease-bounce), box-shadow .16s var(--ease-out), filter .18s var(--ease-out);
}
.pcard__add:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink-fixed); filter: saturate(1.08) brightness(1.03); }
.pcard__stock { font-family: var(--mono); font-size: .66rem; color: var(--muted); }
.pcard__stock b { color: var(--ink); }

/* =============================================================
   CTA premium — "Agregar" · "Generar cotización" · compra del modal
   Brillo diagonal al hover · press físico :active · ripple + pop (JS)
   ============================================================= */
body:not(.in-app) .btn--panini {
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform .16s var(--ease-bounce), box-shadow .18s var(--ease-out),
              background .18s var(--ease-out), filter .18s var(--ease-out), opacity .2s;
}

/* Barrido de luz diagonal (usa ::before para no chocar con el spinner ::after) */
.pcard__add::before,
body:not(.in-app) .btn--panini::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 55%;
  pointer-events: none; z-index: 1;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: translateX(-190%) skewX(-18deg);
  transition: transform .7s var(--ease-out);
  mix-blend-mode: overlay;
}
.pcard__add:hover::before,
body:not(.in-app) .btn--panini:hover::before { transform: translateX(340%) skewX(-18deg); }
body:not(.in-app) .btn--panini:hover { filter: saturate(1.08) brightness(1.03); }

/* Press físico al mantener pulsado */
.pcard__add:active,
body:not(.in-app) .btn--panini:active {
  transform: translate(1px, 1px) scale(.955);
  box-shadow: none;
  transition-duration: .05s;
}

/* Pop elástico al soltar (clase temporal desde JS) */
.pcard__add.is-pop,
body:not(.in-app) .btn--panini.is-pop { animation: ctaPop .4s var(--ease-bounce); }
@keyframes ctaPop {
  0%   { transform: translate(1px, 1px) scale(.955); }
  40%  { transform: scale(1.055); }
  70%  { transform: scale(.985); }
  100% { transform: none; }
}

/* Onda al pulsar (nodo .cta-ripple inyectado por JS) */
.cta-ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 2;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, rgba(12,12,14,.30), rgba(12,12,14,0) 68%);
  animation: ctaRipple .52s var(--ease-out) forwards;
}
@keyframes ctaRipple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .pcard__add::before,
  body:not(.in-app) .btn--panini::before { display: none; }
  .pcard__add.is-pop,
  body:not(.in-app) .btn--panini.is-pop { animation: none; }
  .cta-ripple { display: none; }
}

/* ---------- Modal Vista Previa 3D ---------- */
.preview3d { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .preview3d { grid-template-columns: 260px 1fr; align-items: start; } }
.preview3d__col { display: flex; flex-direction: column; gap: .6rem; }
.preview3d__stage { aspect-ratio: 3/4; border: 3px solid var(--ink); background: var(--ink); position: relative; overflow: hidden; }
.preview3d__stage canvas { width: 100%; height: 100%; }

/* Galería multi-ángulo */
.preview3d__thumbs { display: flex; gap: .45rem; flex-wrap: wrap; }
.preview3d__thumb {
  width: 52px; height: 52px; flex: none; padding: 0; cursor: pointer;
  border: 2px solid var(--ink); background: var(--paper-3); overflow: hidden;
  transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out);
}
.preview3d__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview3d__thumb:hover { transform: translateY(-2px); }
.preview3d__thumb.is-active { box-shadow: 0 0 0 2px var(--neon-cyan), 3px 3px 0 var(--ink); border-color: var(--neon-cyan); }

/* Miniatura destacada "Vista 3D" (vuelve a la caja interactiva) */
.preview3d__thumb--3d {
  display: grid; place-items: center;
  font-family: var(--display); font-size: 1rem; letter-spacing: .04em;
  color: var(--paper-2); background: linear-gradient(135deg, #14141c, var(--ink));
  border-color: var(--neon-cyan);
}
.preview3d__thumb--3d span { line-height: 1; }
.preview3d__thumb--3d::after {
  content: ""; position: absolute; inset: 4px; border: 1px dashed rgba(0,229,255,.5);
}
.preview3d__thumb--3d { position: relative; }

/* Foto 2D en alta resolución (tapa el canvas al elegir una miniatura de galería) */
.preview3d__photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: var(--ink); z-index: 2;
}
.preview3d__hint { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; color: var(--paper-2); background: rgba(0,0,0,.5); padding: .3rem; }
.preview3d h3 { font-family: var(--display); text-transform: uppercase; font-size: 1.5rem; }
.preview3d__meta { font-size: .84rem; color: var(--muted); display: flex; flex-direction: column; gap: .4rem; margin: .6rem 0; }
.preview3d__syn { font-size: .86rem; line-height: 1.55; max-height: 8.5rem; overflow-y: auto; }
.preview3d__buy { display: flex; align-items: center; gap: .8rem; margin-top: 1rem; flex-wrap: wrap; }
.preview3d__price { font-family: var(--mono); font-weight: 700; font-size: 1.4rem; }

.vol-select { display: flex; flex-direction: column; gap: .35rem; margin: .2rem 0 .9rem; }
.vol-select > span { font-family: var(--mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.vol-select .select { max-width: 220px; }

.vol-stock { border: 2px solid var(--ink); padding: .7rem .8rem; margin-bottom: 1rem; }
.vol-stock__h { font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.vs-row { display: flex; justify-content: space-between; align-items: center; font-size: .86rem; padding: .28rem 0; border-top: 1px solid var(--line-soft); }
.vs-row:first-of-type { border-top: 0; }
.vs-row[hidden] { display: none; }
.vs-n { font-family: var(--mono); font-weight: 700; padding: .05rem .4rem; border: 2px solid var(--ink); }
.vs-n.vs-ok { background: var(--panini); color: var(--ink-fixed); }
.vs-n.vs-low { background: var(--neon-cyan); color: var(--ink-fixed); }
.vs-n.vs-out { background: var(--ink); color: var(--paper-2); }

/* Barra del panel de stock: título + buscador de sucursal (mismo b/n) */
.vol-stock__bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem .7rem; flex-wrap: wrap; margin-bottom: .5rem; }
.vol-stock__bar .vol-stock__h { margin-bottom: 0; }
.vs-search { display: inline-flex; align-items: center; gap: .3rem; flex: 1 1 9rem; max-width: 12.5rem;
  border: 1px solid var(--ink); background: var(--paper-2); padding: .12rem .45rem; }
.vs-search__icon { width: 13px; height: 13px; flex: none; color: var(--ink); }
.vs-search__input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: var(--mono); font-size: .72rem; color: var(--ink); padding: .15rem 0; }
.vs-search__input::placeholder { color: var(--muted); }
.vs-search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* Contenedor con scroll: alto para exactamente 3 filas (lo fija el JS) */
.vs-scroll { overflow-y: auto; overscroll-behavior: contain; }
.vs-scroll .vs-row:first-of-type { border-top: 0; }

/* Fila "Continuar" fija al pie del área con scroll */
.vs-more { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: center; gap: .35rem;
  width: 100%; padding: .32rem 0 .28rem; border: 0; border-top: 1px solid var(--line-soft);
  background: var(--paper-2); cursor: pointer;
  font-family: var(--mono); font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.vs-more:hover { color: var(--ink); }
.vs-more[hidden] { display: none; }

/* ---------- Sucursales ---------- */
.branches { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .branches { grid-template-columns: repeat(3, 1fr); } }

/* Carrusel de deslizamiento horizontal PURO (sin opacidad, sin apilado):
   el visor recorta y el riel (.branches--track) es un flex EN FILA con TODAS
   las tarjetas que se mueve con translateX. Las tarjetas conservan borde,
   sombra, tipografía y badge intactos. Sólo aplica con .is-carousel (JS). */
[data-branches-carousel].is-carousel [data-branches-viewport] {
  overflow: hidden;
  padding: 0 6px 10px;                        /* aire para la sombra 6px 6px 0 */
}
.branches--track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  transition: transform .35s ease-in-out;
  will-change: transform;
}
.branches--track > .branch {
  flex: 0 0 calc((100% - 2 * 1.1rem) / 3);    /* PC: 3 por vista, mismo gap 1.1rem */
}
/* Flechas: sólo la posición izq/der va aquí (el resto del estilo es inline en JS). */
[data-branch-nav] { left: -18px; }
[data-branch-nav="next"] { left: auto; right: -18px; }
@media (prefers-reduced-motion: reduce) {
  .branches--track { transition: none; }
}

/* Móvil: MISMO carrusel horizontal, 1 tarjeta por vista (NO lista vertical). */
@media (max-width: 768px) {
  [data-branches-carousel].is-carousel [data-branches-viewport] {
    padding: 0 24px 10px;
    touch-action: pan-y;             /* scroll vertical nativo; el swipe horizontal lo maneja el JS */
  }
  .branches--track > .branch { flex-basis: 100%; }   /* 1 tarjeta = 100% del visor */
  .branches--track.is-dragging { transition: none; user-select: none; }  /* sigue al dedo, sin animar */
  [data-branch-nav] { left: -4px; }
  [data-branch-nav="next"] { left: auto; right: -4px; }
}
.branch {
  border: 3px solid var(--ink); background: var(--paper-2); padding: 1.3rem;
  box-shadow: 6px 6px 0 var(--ink);
}
.branch__code { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; color: var(--muted); }
.branch h3 { font-family: var(--display); text-transform: uppercase; font-size: 1.35rem; margin: .2rem 0 .5rem; }
.branch__row { display: flex; gap: .5rem; font-size: .84rem; color: var(--ink-soft); margin-bottom: .3rem; }
.branch__row b { color: var(--ink); min-width: 4.2rem; font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.branch__status { margin-top: .7rem; }

/* ---------- Cart drawer ---------- */
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); z-index: var(--z-drawer);
  background: var(--paper-2); border-left: 4px solid var(--ink);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s var(--ease-out);
  box-shadow: -12px 0 0 rgba(0,0,0,.12);
}
.cart-drawer.is-open { transform: none; }
.cart-drawer__backdrop {
  position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); background: rgba(12,12,14,.55);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.cart-drawer__backdrop.is-open { opacity: 1; visibility: visible; }
.cart-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.2rem; border-bottom: 3px solid var(--ink); }
.cart-drawer__head h2 { font-family: var(--display); text-transform: uppercase; font-size: 1.3rem; }
.cart-drawer__items { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.cart-drawer__empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.dr-item { display: grid; grid-template-columns: 54px 1fr auto; gap: .7rem; align-items: center; border-bottom: 1px solid var(--line-soft); padding-bottom: .8rem; }
.dr-item__rm { transition: transform .12s var(--ease-out), color .12s var(--ease-out); }
.dr-item__rm:hover { transform: scale(1.25) rotate(90deg); }

/* Entrada escalonada de las líneas al abrir el carrito */
.cart-drawer__items.is-fresh .dr-item { animation: cartRowIn .34s var(--ease-out) backwards; }
.cart-drawer__items.is-fresh .dr-item:nth-child(1) { animation-delay: .02s; }
.cart-drawer__items.is-fresh .dr-item:nth-child(2) { animation-delay: .06s; }
.cart-drawer__items.is-fresh .dr-item:nth-child(3) { animation-delay: .10s; }
.cart-drawer__items.is-fresh .dr-item:nth-child(4) { animation-delay: .14s; }
.cart-drawer__items.is-fresh .dr-item:nth-child(5) { animation-delay: .18s; }
.cart-drawer__items.is-fresh .dr-item:nth-child(n+6) { animation-delay: .22s; }
@media (prefers-reduced-motion: reduce) {
  .cart-drawer__items.is-fresh .dr-item { animation: none; }
  .dr-item__rm:hover { transform: none; }
}
.dr-item__media { width: 54px; height: 70px; border: 2px solid var(--ink); object-fit: cover; background: var(--paper-3); }
.dr-item__name { font-family: var(--display); text-transform: uppercase; font-size: .82rem; line-height: 1.1; }
.dr-item__price { font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.dr-item__qty { display: inline-flex; align-items: center; gap: .35rem; margin-top: .3rem; }
.dr-item__qty button {
  box-sizing: border-box; width: 22px; height: 22px; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink); background: var(--paper-2);
  font-family: var(--mono); font-size: .8rem; font-weight: 700; line-height: 1;
}
.dr-item__qty .mono { display: inline-block; min-width: 1.6ch; text-align: center; line-height: 1; font-variant-numeric: tabular-nums; }
.dr-item__rm { font-size: .8rem; color: var(--muted); }
.dr-item__rm:hover { color: var(--danger); }
.cart-drawer__foot { border-top: 3px solid var(--ink); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .7rem; }
.cart-drawer__total { display: flex; justify-content: space-between; font-family: var(--mono); font-weight: 700; font-size: 1.15rem; }

/* ---------- Footer ---------- */
.foot { border-top: 4px solid var(--ink); padding: 2.4rem var(--gutter); text-align: center; background: var(--paper-2); }
.foot .brand { justify-content: center; font-size: 1.5rem; }
.foot__note { font-size: .82rem; color: var(--muted); margin-top: .4rem; }

/* ---------- Apartado: formulario + ticket con folio y código de barras ---------- */
.resv-form .field { margin-bottom: .8rem; }
.resv-grid { display: grid; gap: .8rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .resv-grid { grid-template-columns: 1fr; } }

.rk {
  border: 3px solid var(--ink); background: var(--paper-2); padding: 1.1rem 1.2rem 1.3rem;
  box-shadow: 6px 6px 0 var(--ink); text-align: center;
}
.rk__brand { font-family: var(--comic); letter-spacing: .04em; font-size: 1rem; color: var(--ink); }
.rk__brand b { color: var(--panini-deep); }
.rk__folio {
  font-family: var(--display); font-size: clamp(2rem, 9vw, 3rem); letter-spacing: .06em;
  color: var(--ink); margin: .3rem 0 .5rem; line-height: 1;
}
.rk__barcode { background: #fff; padding: .5rem; border: 2px solid var(--ink); display: inline-block; max-width: 100%; }
.rk__barcode svg { display: block; max-width: 100%; height: auto; }
.rk__meta { text-align: left; font-size: .8rem; color: var(--ink-soft); margin: .9rem 0 .6rem; display: flex; flex-direction: column; gap: .2rem; }
.rk__meta b { color: var(--ink); font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.rk__items { text-align: left; border-top: 2px dashed var(--line-soft); padding-top: .5rem; margin-top: .3rem; }
.rk-row { display: flex; justify-content: space-between; gap: .8rem; font-size: .82rem; padding: .18rem 0; }
.rk-row--total { border-top: 2px solid var(--ink); margin-top: .4rem; padding-top: .5rem; font-weight: 700; font-size: 1rem; }
.rk__hint { font-size: .74rem; color: var(--muted); margin-top: .9rem; }

/* ---------- Precios promocionales ---------- */
.promo-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .16rem .42rem; border-radius: 999px; background: var(--panini);
  color: #fff; font-family: var(--mono); font-weight: 800; line-height: 1.1;
}
.price-stack { display: inline-flex; flex-direction: column; align-items: flex-start; gap: .04rem; }
.price-stack del, .price-old, .dr-item__price del { color: var(--muted); font-size: .72em; font-weight: 500; }
.price-stack strong { color: var(--ink); font-size: 1.08em; }
.price-stack small { font-size: .58em; color: var(--muted); text-transform: uppercase; }
.dr-item__price { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.dr-item__price .promo-badge { font-size: .62rem; }

/* ---------- POS: panel de apartados ---------- */
.resv-lookup { display: flex; gap: .5rem; margin-bottom: 1rem; }
.resv-lookup .input { flex: 1; }
.resv-list { display: flex; flex-direction: column; gap: .55rem; max-height: 46vh; overflow-y: auto; }
.resv-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: .8rem .95rem; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid transparent; transition: border-color .12s var(--ease-out);
}
.resv-item:hover { border-color: var(--accent); }
.resv-item__main { min-width: 0; cursor: pointer; flex: 1; }
.resv-item__folio { font-family: var(--mono); font-weight: 700; font-size: 1rem; letter-spacing: .04em; }
.resv-item__meta { font-size: .76rem; color: var(--muted); margin-top: .1rem; }
.resv-item__prods { font-size: .74rem; color: var(--faint); margin-top: .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resv-item__side { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; flex: none; }
.resv-item__total { font-weight: 700; font-size: .95rem; }
.resv-item__side .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .resv-item { flex-direction: column; }
  .resv-item__side { align-items: stretch; width: 100%; }
  .resv-item__side .btn { width: 100%; }
}
.resv-detail { margin-top: .4rem; }
.resv-detail__items { border-top: 1px dashed var(--line-soft); margin-top: .6rem; padding-top: .5rem; display: flex; flex-direction: column; gap: .25rem; }

/* La landing estática se oculta al entrar a los módulos internos */
body.in-app [data-static-store] { display: none !important; }

/* =============================================================
   Responsive móvil — catálogo compacto
   ============================================================= */
@media (max-width: 768px) {
  .section { padding: 2.2rem var(--gutter); }
  .section__head { margin-bottom: 1.2rem; gap: .5rem; }

  .catalog-controls { gap: .7rem; margin-bottom: 1.1rem; padding-right: 0; }
  /* Móvil / ventana chica: la búsqueda NO flota ni se colapsa — barra estática
     de ancho completo bajo las categorías, input siempre visible. */
  .catsearch,
  .catsearch.is-open {
    position: static; order: 3;
    flex: 1 1 100%; width: 100%; max-width: none; min-width: 0; margin-left: 0;
  }
  .catsearch__input { flex: 1 1 auto; width: auto; font-size: .9rem; line-height: 38px; padding: 0 .7rem; }
  .catsearch__toggle { flex: 0 0 40px; }

  /* Grid: 2 columnas compactas, sin desbordes */
  .pgrid { gap: .7rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .pcard { border-width: 2px; box-shadow: 4px 4px 0 var(--ink); }
  .pcard:hover { box-shadow: 4px 4px 0 var(--panini-deep); }
  .pcard__body { padding: .55rem .6rem .7rem; gap: .22rem; }
  .pcard__cat { font-size: .56rem; letter-spacing: .1em; }
  .pcard__name { font-size: .82rem; line-height: 1.08; }
  .pcard__author { font-size: .66rem; }
  .pcard__foot { padding-top: .4rem; gap: .35rem; }
  .pcard__price { font-size: .84rem; }
  .pcard__add { font-size: .64rem; padding: .34rem .45rem; }
  .pcard__view { display: none; }
  .pcard__stock { font-size: .58rem; line-height: 1.3; }
  .ptag { font-size: .62rem; }
}

@media (max-width: 380px) {
  .pgrid { gap: .55rem; }
  .pcard__add { width: 100%; }
  .pcard__foot { flex-direction: column; align-items: stretch; }
}
