/* ─────────────────────────────────────────────────────────────
   AZZURRY · Portal de Inventario
   Identidad: índigo eléctrico → azul cielo, tipografía condensada
   ───────────────────────────────────────────────────────────── */
:root {
  --indigo: #2a00b0;
  --violet: #3c10d8;
  --blue: #0a6cff;
  --sky: #00b4ff;
  --ink: #0e0b2b;
  --ink-2: #3a3760;
  --muted: #6c6f8c;
  --bg: #f2f3fa;
  --card: #ffffff;
  --line: #e3e5f1;
  --ok: #10b26a;
  --warn: #ff9a1a;
  --bad: #ff3358;
  --grad: linear-gradient(180deg, #2c00b4 0%, #2a28d8 45%, #0a8cff 85%, #00b4ff 100%);
  --grad-x: linear-gradient(100deg, #2a00b0 0%, #3c10d8 40%, #0a6cff 80%, #00b4ff 100%);
  --r: 18px;
  --shadow: 0 1px 2px rgba(14, 11, 43, .06), 0 8px 24px -8px rgba(42, 0, 176, .18);
  --shadow-lg: 0 24px 60px -20px rgba(42, 0, 176, .45);
  --nav-h: 68px;
  --display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --body: 'Barlow', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ── NAV auto-ocultable ── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: rgba(32, 0, 150, .92);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  color: #fff;
  transform: translateY(0);
  transition: transform .45s cubic-bezier(.2, .9, .25, 1), box-shadow .3s;
  box-shadow: 0 10px 30px -12px rgba(20, 0, 90, .6);
}
.nav.hidden { transform: translateY(calc(-100% - 6px)); box-shadow: none; }
.nav-inner {
  height: var(--nav-h); max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; gap: 24px; padding: 0 24px;
}
.brand img { height: 34px; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.tabs { display: flex; gap: 6px; margin-left: 12px; }
.tabs a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  color: rgba(255,255,255,.78); text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .06em; text-transform: uppercase;
  transition: background .2s, color .2s;
}
.tabs a svg { width: 20px; height: 20px; }
.tabs a { white-space: nowrap; }
.tabs .short { display: none; }
@media (max-width: 1000px) { .tabs .long { display: none; } .tabs .short { display: inline; } }
.tabs a:hover { color: #fff; background: rgba(255,255,255,.1); }
.tabs a.active { background: #fff; color: var(--indigo); box-shadow: 0 6px 18px -6px rgba(0,0,0,.4); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.mode-badge {
  font-family: var(--display); font-weight: 800; letter-spacing: .12em; font-size: 13px;
  padding: 4px 10px; border-radius: 6px; background: #ffd21f; color: var(--ink);
}
.user-btn {
  display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08); color: #fff; padding: 5px 12px 5px 5px; border-radius: 999px;
}
.user-btn svg { width: 18px; height: 18px; opacity: .8; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--sky), #fff); color: var(--indigo); font-weight: 800;
}
.nav-stripe { height: 3px; background: linear-gradient(90deg, transparent, var(--sky), #fff, var(--sky), transparent); opacity: .7; }
.nav-pull {
  position: fixed; top: 0; left: 50%; z-index: 49; transform: translate(-50%, -100%);
  width: 88px; height: 22px; border: 0; border-radius: 0 0 14px 14px;
  background: var(--grad-x); box-shadow: var(--shadow-lg);
  transition: transform .35s cubic-bezier(.2, .9, .25, 1);
  display: grid; place-items: center;
}
.nav-pull span { width: 28px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.85); }
.nav.hidden ~ .nav-pull { transform: translate(-50%, 0); }

.view { padding-top: var(--nav-h); min-height: 100vh; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 28px 24px 80px; }

/* ── HERO con la imagen de marca ── */
.hero {
  position: relative; color: #fff;
  background: var(--grad);
  padding: 46px 24px 120px;
}
/* La franja NO recorta (para que la lista de sugerencias pueda salir de ella);
   los adornos se recortan en su propia capa */
.hero-deco { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.hero::before { /* grano */
  content: ''; position: absolute; inset: 0; z-index: 0; opacity: .22; 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'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero .speed { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero .speed i {
  position: absolute; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  animation: speed 3.2s linear infinite; opacity: 0;
}
@keyframes speed { 0% { transform: translateX(-30vw); opacity: 0 } 15% { opacity: .9 } 100% { transform: translateX(120vw); opacity: 0 } }
.hero-inner { max-width: 1100px; margin: 0 auto; position: relative; }
.hero .watermark {
  position: absolute; right: max(-40px, calc(50% - 590px)); top: 16px; width: 360px; opacity: .1; transform: rotate(-8deg); pointer-events: none;
}
.eyebrow {
  font-family: var(--display); font-weight: 700; letter-spacing: .28em; text-transform: uppercase; font-size: 14px;
  opacity: .85; display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ''; width: 28px; height: 3px; background: var(--sky); border-radius: 3px; }
.hero h1 {
  font-family: var(--display); font-weight: 800; font-style: italic; text-transform: uppercase;
  font-size: clamp(44px, 7vw, 92px); line-height: .9; margin: 12px 0 26px; letter-spacing: -.01em;
  text-shadow: 0 6px 30px rgba(10, 0, 80, .35);
}
.hero h1 em { font-style: italic; color: transparent; -webkit-text-stroke: 2px #fff; }

/* ── buscador ── */
.search { position: relative; max-width: 860px; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: #fff; color: var(--ink); border-radius: 20px; padding: 8px 8px 8px 22px;
  box-shadow: 0 24px 60px -18px rgba(10, 0, 80, .6), 0 0 0 6px rgba(255,255,255,.14);
}
.search-box > svg { width: 26px; height: 26px; color: var(--indigo); flex: none; }
.search-box input {
  flex: 1; border: 0; outline: 0; font-size: 21px; font-weight: 500; padding: 14px 4px; min-width: 0; background: transparent;
}
.search-box input::placeholder { color: #a3a6bf; }
.icon-btn {
  width: 52px; height: 52px; border-radius: 14px; border: 0; flex: none;
  display: grid; place-items: center; background: var(--bg); color: var(--indigo);
  transition: transform .15s, background .2s;
}
.icon-btn:hover { background: #e6e7f6; }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.primary { background: var(--grad-x); color: #fff; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 60;
  background: #fff; color: var(--ink); border-radius: 18px; box-shadow: var(--shadow-lg);
  max-height: 60vh; overflow: auto; padding: 8px;
}
.sug {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; cursor: pointer;
}
.sug.on, .sug:hover { background: #f0f0fb; }
.sug .thumb { width: 52px; height: 52px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; flex: none; overflow: hidden; }
.sug .thumb svg, .sug .thumb img { width: 46px; height: 46px; object-fit: contain; }
.sug b { display: block; font-weight: 700; }
.sug small { color: var(--muted); }
.sug .ref { margin-left: auto; font-family: var(--display); font-weight: 700; color: var(--indigo); font-size: 18px; letter-spacing: .04em; white-space: nowrap; }
.recent { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; align-items: center; }
.recent span { opacity: .75; font-size: 14px; margin-right: 4px; }
.chip {
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: #fff;
  padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  transition: background .2s;
}
.chip:hover { background: rgba(255,255,255,.22); }

/* ── estado vacío consulta ── */
.lift { margin-top: -84px; position: relative; z-index: 2; }
.lift.home { margin-top: 0; padding-top: 56px; z-index: 1; }
.hero.home { padding-bottom: 72px; }
.empty-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.tip-card {
  background: var(--card); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow);
  display: flex; gap: 16px; align-items: flex-start;
}
.tip-card .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--grad-x); color: #fff; display: grid; place-items: center; flex: none; }
.tip-card .ic svg { width: 24px; height: 24px; }
.tip-card h4 { margin: 2px 0 4px; font-family: var(--display); font-size: 20px; text-transform: uppercase; letter-spacing: .03em; }
.tip-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }

/* ── ficha de producto ── */
.product { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 22px; align-items: start; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.p-visual { overflow: hidden; position: sticky; top: 16px; }
.stage {
  aspect-ratio: 1 / 1; position: relative; display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 42%, rgba(255,255,255,.9), rgba(255,255,255,0)),
    linear-gradient(160deg, #eef0ff, #dfe8ff 60%, #d3f1ff);
}
.stage::after {
  content: ''; position: absolute; inset: auto -10% -30% -10%; height: 55%;
  background: repeating-linear-gradient(115deg, rgba(42,0,176,.06) 0 14px, transparent 14px 30px);
}
.stage .pic { width: 78%; height: 78%; position: relative; z-index: 1; display: grid; place-items: center; transition: transform .5s cubic-bezier(.2,.9,.25,1); }
.stage .pic img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 20px 24px rgba(14,11,43,.25)); }
.stage .pic svg { width: 100%; height: 100%; filter: drop-shadow(0 18px 22px rgba(14,11,43,.22)); }
.stage .pic.swap { animation: pop .5s cubic-bezier(.2,.9,.25,1); }
@keyframes pop { 0% { transform: scale(.9) rotate(-4deg); opacity: .4 } 100% { transform: none; opacity: 1 } }
.stage .ref-tag {
  position: absolute; left: 16px; top: 16px; z-index: 2;
  font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: .1em;
  background: var(--ink); color: #fff; padding: 5px 10px; border-radius: 8px;
}
.stage .brand-tag {
  position: absolute; right: 16px; top: 16px; z-index: 2; font-family: var(--display); font-weight: 800;
  font-style: italic; font-size: 22px; color: var(--indigo); letter-spacing: .02em;
}
.p-info { padding: 20px 22px 22px; }
.p-info .grp { color: var(--blue); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.p-info h2 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 34px; line-height: .98; margin: 6px 0 12px; }
.price { font-family: var(--display); font-weight: 800; font-size: 32px; color: var(--indigo); }
.price small { font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.sw {
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px;
  border: 2px solid var(--line); background: #fff; font-weight: 600; font-size: 13.5px; transition: border-color .2s, transform .15s;
}
.sw i { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); }
.sw.on { border-color: var(--indigo); transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(42,0,176,.6); }
.sw em { font-style: normal; color: var(--muted); font-weight: 500; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .lbl { font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kpi .val { font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; margin-top: 6px; }
.kpi .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kpi.hero-kpi { background: var(--grad-x); color: #fff; }
.kpi.hero-kpi .lbl, .kpi.hero-kpi .sub { color: rgba(255,255,255,.8); }
.kpi.hero-kpi::after {
  content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%;
  border: 18px solid rgba(255,255,255,.12);
}

.section-h { display: flex; align-items: center; gap: 12px; margin: 26px 0 12px; flex-wrap: wrap; }
.section-h h3 { margin: 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 22px; letter-spacing: .04em; }
.section-h .spacer { flex: 1; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 999px;
  font-weight: 600; font-size: 14px; color: var(--ink-2); display: flex; gap: 8px; align-items: center;
}
.seg button b { font-family: var(--display); font-size: 16px; color: var(--indigo); }
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg button.on b { color: var(--sky); }
.seg button.zero { opacity: .55; }

/* matriz talla × color */
.matrix-wrap { overflow-x: auto; padding: 6px; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.matrix { border-collapse: separate; border-spacing: 6px; min-width: 100%; }
.matrix th { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--muted); padding: 4px 6px; letter-spacing: .04em; }
.matrix thead th { text-align: center; }
.matrix thead th.size { color: var(--ink); font-size: 19px; }
.matrix td.color { white-space: nowrap; padding-right: 8px; }
.matrix td.color .cn { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.matrix td.color i { width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); flex: none; }
.cell {
  min-width: 58px; height: 54px; border-radius: 12px; border: 0; width: 100%;
  font-family: var(--display); font-weight: 800; font-size: 22px;
  background: #f4f5fb; color: #c3c6d8; transition: transform .15s, box-shadow .2s;
  position: relative;
}
.cell:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -8px rgba(42,0,176,.5); }
.cell.has { color: var(--ink); }
.cell .cm { position: absolute; right: 6px; top: 4px; font-size: 10px; font-family: var(--body); font-weight: 700; opacity: .75; }
.matrix td.tot, .matrix th.tot { font-family: var(--display); font-weight: 800; font-size: 20px; text-align: center; color: var(--indigo); }
.matrix tfoot td { font-family: var(--display); font-weight: 800; font-size: 18px; text-align: center; color: var(--ink-2); padding-top: 4px; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 0 12px 14px; }
.legend .bar { width: 140px; height: 8px; border-radius: 8px; background: linear-gradient(90deg, #e8f6ff, #7fd3ff, #0a6cff, #2a00b0); }

/* distribución por bodega */
.dist { padding: 10px 20px 20px; display: grid; gap: 12px; }
.dist-row { display: grid; grid-template-columns: 170px 1fr 64px; gap: 14px; align-items: center; }
.dist-row .wn { font-weight: 700; font-size: 14.5px; }
.dist-row .wn small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.dist-row .track { height: 16px; border-radius: 10px; background: #f0f1f8; display: flex; overflow: hidden; }
.dist-row .track i { box-shadow: inset 0 0 0 1px rgba(14,11,43,.14); height: 100%; transition: width .8s cubic-bezier(.2,.9,.25,1); width: 0; }
.dist-row .n { font-family: var(--display); font-weight: 800; font-size: 22px; text-align: right; }

/* ── botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 14px; padding: 13px 22px; font-weight: 700; font-size: 15.5px;
  background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line);
  transition: transform .15s, box-shadow .2s, filter .2s; text-decoration: none; white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad-x); color: #fff; box-shadow: 0 12px 26px -12px rgba(42,0,176,.8); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.dark { background: var(--ink); color: #fff; box-shadow: none; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
.btn.danger { color: var(--bad); }
.btn.big { padding: 16px 26px; font-size: 17px; border-radius: 16px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ── TOMA FÍSICA ── */
.page-head {
  background: var(--grad); color: #fff; padding: 34px 24px 90px; position: relative; overflow: hidden; isolation: isolate;
}
.page-head .hero-inner { max-width: 1440px; display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: clamp(38px, 5vw, 64px); line-height: .9; margin: 10px 0 0; }
.page-head p { margin: 10px 0 0; opacity: .85; max-width: 560px; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; }
.sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.session { padding: 20px; display: flex; gap: 18px; align-items: center; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.session:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ring { width: 76px; height: 76px; flex: none; position: relative; }
.ring svg { width: 76px; height: 76px; transform: rotate(-90deg); }
.ring circle { stroke-width: 8; fill: none; }
.ring .bg { stroke: #eceef7; }
.ring .fg { stroke: url(#ringGrad); transition: stroke-dashoffset 1s cubic-bezier(.2,.9,.25,1); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 20px; }
.session h4 { margin: 0 0 4px; font-family: var(--display); font-size: 21px; text-transform: uppercase; line-height: 1.05; }
.session .meta { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; }
.pill.open { background: #e6f7ff; color: #0072c6; }
.pill.sent { background: #e5f8ee; color: #0a8a50; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 64px; height: 64px; color: #c3c6d8; }

/* formulario nuevo conteo */
.form-grid { display: grid; gap: 22px; }
.field > label { display: block; font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.wh-opt {
  border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 14px; text-align: left;
  transition: border-color .2s, background .2s;
}
.wh-opt b { display: block; font-family: var(--display); font-size: 19px; text-transform: uppercase; }
.wh-opt small { color: var(--muted); font-weight: 600; letter-spacing: .06em; }
.wh-opt.on { border-color: var(--indigo); background: #f3f0ff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tog {
  border: 1.5px solid var(--line); background: #fff; padding: 9px 15px; border-radius: 999px; font-weight: 600; font-size: 14px;
}
.tog.on { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; font-size: 16px; background: #fff; outline: 0;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(10,108,255,.12); }
.switch { display: flex; gap: 14px; align-items: center; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .knob { width: 50px; height: 30px; border-radius: 30px; background: #d9dbea; position: relative; transition: background .2s; flex: none; }
.switch .knob::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .25s; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.switch input:checked + .knob { background: var(--indigo); }
.switch input:checked + .knob::after { transform: translateX(20px); }
.switch b { display: block; }
.switch small { color: var(--muted); }

/* pantalla de conteo */
.count-bar {
  position: sticky; top: 0; z-index: 30; background: rgba(242,243,250,.92); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); transition: top .45s cubic-bezier(.2,.9,.25,1);
}
body.nav-visible .count-bar { top: var(--nav-h); }
.count-bar .wrap { padding: 14px 24px; display: grid; gap: 12px; }
.cb-top { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cb-title { min-width: 0; }
.cb-title h2 { margin: 0; font-family: var(--display); font-size: 26px; text-transform: uppercase; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-title small { color: var(--muted); font-weight: 600; }
.scan {
  flex: 1; min-width: 260px; display: flex; align-items: center; gap: 8px; background: #fff;
  border-radius: 14px; padding: 5px 5px 5px 14px; box-shadow: inset 0 0 0 2px var(--indigo);
}
.scan svg.bc { width: 26px; height: 26px; color: var(--indigo); flex: none; }
.scan input { flex: 1; border: 0; outline: 0; font-size: 17px; padding: 10px 4px; min-width: 0; font-weight: 600; letter-spacing: .04em; }
.scan .icon-btn { width: 44px; height: 44px; }
.scan .mult { font-family: var(--display); font-weight: 800; font-size: 17px; width: 50px; }
.progress { display: flex; align-items: center; gap: 14px; }
.progress .track { flex: 1; height: 10px; border-radius: 10px; background: #e3e5f1; overflow: hidden; }
.progress .track i { display: block; height: 100%; background: var(--grad-x); border-radius: 10px; transition: width .5s; }
.progress b { font-family: var(--display); font-size: 20px; min-width: 52px; text-align: right; }
.progress small { color: var(--muted); font-weight: 600; white-space: nowrap; }
.save-state { font-size: 12.5px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.save-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.save-state.busy i { background: var(--warn); animation: blink .8s infinite; }
.save-state.err i { background: var(--bad); }
@keyframes blink { 50% { opacity: .2 } }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .input { width: 220px; padding: 9px 12px; font-size: 14.5px; }

.ref-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ref-card { padding: 16px 18px 18px; transition: box-shadow .3s; }
.ref-card.flash { box-shadow: 0 0 0 3px var(--sky), var(--shadow-lg); }
.ref-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.ref-head .thumb { width: 58px; height: 58px; border-radius: 14px; background: linear-gradient(160deg, #eef0ff, #d3f1ff); display: grid; place-items: center; flex: none; overflow: hidden; }
.ref-head .thumb svg, .ref-head .thumb img { width: 50px; height: 50px; object-fit: contain; }
.ref-head h4 { margin: 0; font-family: var(--display); font-size: 21px; text-transform: uppercase; line-height: 1.05; }
.ref-head small { color: var(--muted); font-weight: 600; }
.ref-head .rs { margin-left: auto; text-align: right; font-family: var(--display); font-weight: 800; font-size: 22px; }
.ref-head .rs small { display: block; font-family: var(--body); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; }

.ccell {
  min-width: 62px; height: 62px; width: 100%; border-radius: 13px; border: 2px dashed #d5d8e8; background: #fafbff;
  display: grid; place-items: center; position: relative; padding: 0;
  transition: transform .12s, background .2s, border-color .2s;
}
.ccell:active { transform: scale(.94); }
.ccell .q { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1; color: #b5b8cc; }
.ccell .s { position: absolute; bottom: 3px; left: 0; right: 0; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.ccell.done { border-style: solid; }
.ccell.done .q { color: var(--ink); }
.ccell.ok { background: #e8f9f0; border-color: #8fe0b7; }
.ccell.over { background: #eaf3ff; border-color: #87b8ff; }
.ccell.under { background: #fff2e8; border-color: #ffbe85; }
.ccell.blind.done { background: #f1eeff; border-color: #b9a6ff; }
.ccell.bump { animation: bump .45s; }
@keyframes bump { 30% { transform: scale(1.14); background: #d6f2ff; } }
.ccell .d { position: absolute; top: 3px; right: 5px; font-size: 11px; font-weight: 800; }
.ccell.over .d { color: var(--blue); }
.ccell.under .d { color: #e06a00; }
.na { color: #d0d2e0; text-align: center; font-weight: 700; }

/* hoja inferior (teclado de conteo) */
.sheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(14,11,43,.45); animation: fade .2s; }
@keyframes fade { from { opacity: 0 } }
.sheet-panel {
  width: min(520px, 100%); background: #fff; border-radius: 26px 26px 0 0; padding: 14px 22px 22px;
  max-height: 100vh; overflow: auto;
  animation: up .35s cubic-bezier(.2,.9,.25,1); box-shadow: var(--shadow-lg);
  padding-bottom: calc(26px + env(safe-area-inset-bottom));
}
@keyframes up { from { transform: translateY(100%) } }
.sheet-grip { width: 44px; height: 5px; border-radius: 5px; background: #d6d8e6; margin: 0 auto 14px; }
.kp-head { display: flex; gap: 14px; align-items: center; }
.kp-head .thumb { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(160deg, #eef0ff, #d3f1ff); display: grid; place-items: center; flex: none; }
.kp-head .thumb svg { width: 56px; height: 56px; }
.kp-head h4 { margin: 0; font-family: var(--display); font-size: 21px; text-transform: uppercase; line-height: 1.05; }
.kp-head small { color: var(--muted); font-weight: 600; display: block; margin-top: 2px; }
.kp-display { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 10px; }
.kp-display .num {
  flex: 1; text-align: center; font-family: var(--display); font-weight: 800; font-size: 60px; line-height: 1;
  background: var(--bg); border-radius: 18px; padding: 8px 0; color: var(--indigo);
}
.kp-display .num.fresh { color: #b5b8cc; }
.kp-display .step { width: 72px; height: 72px; border-radius: 18px; font-family: var(--display); font-weight: 800; font-size: 32px; border: 0; background: var(--ink); color: #fff; }
.kp-display .step.plus { background: var(--grad-x); }
.kp-sys { text-align: center; color: var(--muted); font-weight: 600; margin-bottom: 12px; font-size: 14px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { height: 52px; border-radius: 14px; border: 0; background: var(--bg); font-family: var(--display); font-weight: 700; font-size: 26px; }
.keypad button:active { background: #e1e3f2; }
.keypad .wide { grid-column: span 3; }
.kp-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 12px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(14,11,43,.55); animation: fade .2s; overflow: auto; }
.modal-panel { width: min(860px, 100%); background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg); animation: zoom .3s cubic-bezier(.2,.9,.25,1); overflow: hidden; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
@keyframes zoom { from { transform: scale(.94); opacity: 0 } }
.modal-head { background: var(--grad-x); color: #fff; padding: 20px 24px; display: flex; align-items: center; gap: 12px; }
.modal-head h3 { margin: 0; font-family: var(--display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 30px; }
.modal-head .icon-btn { margin-left: auto; background: rgba(255,255,255,.15); color: #fff; width: 44px; height: 44px; }
.modal-body { padding: 22px 24px; overflow: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

.var-ws { display: grid; gap: 10px; margin-top: 8px; }

/* resumen */
.sum-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.sum-kpis .kpi { background: var(--bg); border-radius: 14px; padding: 14px 16px; }
.sum-kpis .kpi .val { font-size: 34px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); position: sticky; top: 0; background: #fff; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.tbl td.n { text-align: right; font-family: var(--display); font-weight: 800; font-size: 17px; }
.tbl .pos { color: var(--blue); }
.tbl .neg { color: #e06a00; }

/* cámara */
.cam { position: relative; background: #000; border-radius: 18px; overflow: hidden; aspect-ratio: 4/3; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam .laser { position: absolute; left: 10%; right: 10%; top: 50%; height: 3px; background: #ff3358; box-shadow: 0 0 18px #ff3358; animation: laser 1.6s ease-in-out infinite alternate; }
@keyframes laser { from { transform: translateY(-60px) } to { transform: translateY(60px) } }
.cam .frame { position: absolute; inset: 18% 10%; border: 3px solid rgba(255,255,255,.8); border-radius: 18px; }

/* login */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg);
}
.login-art { background: var(--grad); color: #fff; position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: center; padding: 60px; }
.login-art img.logo { width: min(460px, 90%); filter: drop-shadow(0 10px 30px rgba(0,0,0,.3)); }
.login-art .since { font-family: var(--display); font-weight: 800; font-size: clamp(60px, 9vw, 130px); line-height: .85; margin-top: 30px; font-style: italic; }
.login-art .since span { color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,.85); }
.login-art p { max-width: 420px; opacity: .85; font-size: 17px; line-height: 1.5; }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-form form { width: min(380px, 100%); display: grid; gap: 14px; }
.login-form h2 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 40px; margin: 0; line-height: .95; }
.login-form .hint { background: #fff8db; border-radius: 12px; padding: 12px 14px; font-size: 14px; color: #6d5600; }
.login-form .err { color: var(--bad); font-weight: 600; min-height: 1.2em; }

/* toasts */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; padding: 13px 16px; border-radius: 14px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 12px; animation: tin .3s cubic-bezier(.2,.9,.25,1); font-weight: 600;
}
.toast i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--sky); }
.toast.ok i { background: var(--ok); }
.toast.bad i { background: var(--bad); }
.toast small { display: block; opacity: .7; font-weight: 500; }
.toast.out { animation: tout .3s forwards; }
@keyframes tin { from { transform: translateY(20px); opacity: 0 } }
@keyframes tout { to { transform: translateY(20px); opacity: 0 } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 120; }

.skeleton { background: linear-gradient(90deg, #eceef7 25%, #f6f7fc 50%, #eceef7 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 14px; }
@keyframes shimmer { to { background-position: -200% 0 } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
.spinner.dark { border-color: #e1e3f0; border-top-color: var(--indigo); }
@keyframes spin { to { transform: rotate(360deg) } }

/* ── responsive (tablet / móvil) ── */
@media (max-width: 1080px) {
  .product { grid-template-columns: minmax(0, 1fr); }
  .p-visual { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 40px 32px; min-height: 300px; }
}
@media (max-width: 760px) {
  :root { --nav-h: 60px; }
  .nav-inner { gap: 10px; padding: 0 12px; }
  .brand img { height: 24px; }
  .tabs { margin-left: 0; }
  .tabs a { padding: 9px 12px; }
  .tabs a span, .tabs a .short { display: none !important; }
  #userName { display: none; }
  .p-visual { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 40px 24px; min-height: 280px; }
  .sum-kpis { grid-template-columns: repeat(2, 1fr); }
  .dist-row { grid-template-columns: 110px 1fr 48px; }
  .hero { padding-bottom: 110px; }
  .search-box input { font-size: 17px; }
  .wrap { padding: 20px 14px 80px; }
  .page-head .actions { margin-left: 0; }
}

/* ── ajustes responsive: evitar que tablas anchas estiren la página ── */
html, body { max-width: 100%; overflow-x: clip; }
.product > *, .ref-list > *, .card, .count-bar .wrap > *, .cb-top > * { min-width: 0; }
.matrix td.color { position: sticky; left: 0; z-index: 1; background: var(--card); }
.matrix thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); }

@media (max-width: 760px) {
  .matrix { border-spacing: 4px; }
  .matrix thead th.size { font-size: 16px; }
  .matrix td.color .cn { font-size: 12.5px; gap: 6px; }
  .matrix td.color i { width: 16px; height: 16px; border-radius: 5px; }
  .cell { min-width: 44px; height: 46px; font-size: 18px; border-radius: 10px; }
  .matrix td.tot, .matrix th.tot { font-size: 17px; }
  .matrix tfoot td { font-size: 15px; }
  .ccell { min-width: 52px; }
  .ccell .q { font-size: 20px; }
  .ref-card { padding: 12px 10px 14px; }
  .count-bar .wrap { padding: 10px 12px; gap: 8px; }
  .cb-title h2 { font-size: 20px; }
  .scan { min-width: 100%; }
  .filters .input { width: 100%; }
  .seg { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .seg > * { flex: none; }
}

/* ══ Toma física sobre el recuento de SAP ══ */
.pill.sap { background: #f1eeff; color: var(--indigo); margin-left: 4px; }

/* ¿dónde estoy contando? exhibición / bodega */
.loc-seg { display: flex; background: #fff; border-radius: 14px; padding: 4px; box-shadow: inset 0 0 0 2px var(--line); flex: none; }
.loc-seg button { border: 0; background: transparent; padding: 10px 14px; border-radius: 10px; font-family: var(--display); font-weight: 800; font-size: 16px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.loc-seg button.on { background: var(--ink); color: #fff; }

/* celda: exhibición·bodega arriba a la izquierda, marca de observación */
.ccell .eb { position: absolute; top: 3px; left: 5px; font-size: 9.5px; font-weight: 800; color: var(--muted); letter-spacing: .02em; }
.ccell.has-obs::after { content: ''; position: absolute; right: 4px; bottom: 4px; width: 7px; height: 7px; border-radius: 50%; background: #ffb020; }
.ccell .s { bottom: 2px; }
.ccell { min-width: 70px; }

/* teclado: dos ubicaciones */
.kp-locs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.kp-locs button { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 8px 12px; text-align: left; }
.kp-locs button small { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kp-locs button b { font-family: var(--display); font-size: 26px; }
.kp-locs button.on { border-color: var(--indigo); background: #f3f0ff; }
.kp-locs button.on small { color: var(--indigo); }
.kp-obs { margin-top: 10px; width: 100%; }

/* asignación de líneas */
.asg { display: grid; gap: 10px; }
.asg-row { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--bg); }
.asg-l b { display: block; font-family: var(--display); font-size: 20px; text-transform: uppercase; line-height: 1.05; }
.asg-l small { color: var(--muted); font-weight: 600; }

/* resultados */
.res-wrap { padding-top: 22px; }
.res-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.res-head .cb-title h2 { font-size: 28px; white-space: normal; }
.res-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1.4fr); gap: 10px; margin-bottom: 12px; }
.res-filters .input { padding: 10px 12px; font-size: 14.5px; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.res-tbl { min-width: 860px; }
.res-tbl th.r { text-align: right; }
.res-tbl td.n small { font-family: var(--body); font-weight: 600; font-size: 12px; color: var(--muted); }
.res-tbl tr.click { cursor: pointer; }
.res-tbl tr.click:hover td { background: #f6f5ff; }
.res-tbl tr.sel td { background: #efeaff; }
.res-tbl tfoot td { font-weight: 800; border-top: 2px solid var(--line); border-bottom: 0; }
.res-tbl tr.subtot td { background: #f4f5fb; border-bottom: 2px solid var(--line); }
.res-tbl tr.subtot small { color: var(--muted); font-weight: 600; margin-left: 6px; }
.res-tbl .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; white-space: nowrap; }
.res-tbl .obs { color: #9a5b00; font-size: 13px; max-width: 220px; }
.res-tbl .who { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.res-tbl .fs { color: var(--muted); font-weight: 600; }
.chip-s { display: inline-block; background: var(--bg); border-radius: 999px; padding: 2px 9px; font-size: 12.5px; font-weight: 700; margin: 1px 4px 1px 0; }
.rp { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.rp.ok { background: #e5f8ee; color: #0a8a50; }
.rp.falta { background: #fff0e3; color: #c25700; }
.rp.sobra { background: #e6f0ff; color: #0a52c6; }
.rp.pend { background: #eef0f6; color: var(--muted); }
.rp.curso { background: #f1eeff; color: var(--indigo); }
.rp.cruce { background: #fff6d6; color: #8a6300; }

@media (max-width: 1080px) {
  .res-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .res-filters #fq { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .loc-seg { width: 100%; }
  .loc-seg button { flex: 1; }
  .asg-row { grid-template-columns: 1fr; gap: 8px; }
  .res-filters { grid-template-columns: 1fr; }
  .res-head .cb-title h2 { font-size: 22px; }
  .ccell { min-width: 60px; }
}

/* ══ Línea + grupo ══ */
/* asignación: bloque por línea con sus grupos */
.asg-linea { border-radius: 16px; background: var(--bg); overflow: hidden; }
.asg-linea .asg-row { background: transparent; border-radius: 0; }
.asg-linea .asg-row.grp { background: #fff; margin: 0 8px; border-top: 1px solid var(--line); padding-left: 26px; }
.asg-linea .asg-row.grp:last-child { margin-bottom: 8px; border-radius: 0 0 12px 12px; }
.asg-linea .asg-row.grp .asg-l b { font-size: 16px; }
.asg-more { margin-top: 6px; border: 0; background: #fff; color: var(--indigo); font-weight: 800; font-size: 12.5px; padding: 5px 10px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.asg-linea.open .asg-more { background: var(--indigo); color: #fff; box-shadow: none; }
.tog.part { background: #efeaff; color: var(--indigo); border-color: #c9bbff; border-style: dashed; }

/* conteo: fila de grupos debajo de las líneas */
.filters .seg-grp { flex-basis: 100%; order: 1; }
.seg-lbl { align-self: center; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.seg-grp button { padding: 6px 12px; font-size: 13px; }

/* resultados: filas de línea desplegables con sus grupos */
.res-tbl tr.lin td { background: #fafaff; }
.res-tbl tr.lin td:first-child { white-space: nowrap; }
.res-tbl tr.grp td { font-size: 13.5px; }
.res-tbl tr.grp td.gname { padding-left: 34px; color: var(--ink-2); font-weight: 600; }
.res-tbl tr.grp td.n { font-size: 15px; }
.res-tbl tr.sel td { background: #efeaff; }
.caret { display: inline-block; width: 16px; color: var(--muted); transition: transform .2s; }
.caret.open { transform: rotate(90deg); color: var(--indigo); }

/* colección (hombre, dama, niño…) */
.col-tag { color: var(--indigo); font-weight: 800; }

/* ══ Tablet (761–1080 px) ══ */
@media (min-width: 761px) and (max-width: 1080px) {
  /* ficha: foto más pequeña junto al nombre y precio, sin espacio sobrante */
  .p-visual { grid-template-columns: 300px minmax(0, 1fr); align-items: center; }
  .p-visual .stage { aspect-ratio: 1 / 1; }
  .p-info { padding: 22px 26px; }
  /* debajo de la foto: existencias por talla y color, luego los indicadores y la distribución */
  .p-data { display: flex; flex-direction: column; }
  .p-data > .section-h:first-of-type { margin-top: 4px; }
  .p-data > .kpis { order: 1; margin-top: 18px; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .p-data > .p-dist-h { order: 2; }
  .p-data > .p-dist { order: 3; }
  .kpi { padding: 14px 16px; }
  .kpi .val { font-size: 36px; }
}
/* tablet: cuando el menú se oculta arriba de la página, el contenido sube en lugar de dejar un hueco */
body.tablet .view { transition: padding-top .45s cubic-bezier(.2,.9,.25,1); }
body.tablet.nav-collapsed .view { padding-top: 0; }

/* ══ Familia: un color = una referencia, con foto y precio ══ */
.swatches.fam { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.swc { display: flex; gap: 8px; align-items: center; text-align: left; padding: 6px; border-radius: 14px; border: 2px solid var(--line); background: #fff; transition: border-color .2s, transform .15s, box-shadow .2s; min-width: 0; }
.swc .th { width: 50px; height: 50px; border-radius: 10px; background: linear-gradient(160deg, #eef0ff, #d3f1ff); display: grid; place-items: center; flex: none; overflow: hidden; }
.swc .th img, .swc .th svg { width: 46px; height: 46px; object-fit: contain; }
.swc .tx { display: grid; min-width: 0; line-height: 1.15; }
.swc b { font-size: 12.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swc small { font-size: 11px; color: var(--muted); font-weight: 600; }
.swc .pr { font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--indigo); margin-top: 2px; }
.swc .pr { white-space: nowrap; }
.swc .pr em { display: block; font-family: var(--body); font-style: normal; font-weight: 600; font-size: 11px; color: var(--muted); margin-top: 1px; }
.swc.on { border-color: var(--indigo); box-shadow: 0 6px 16px -8px rgba(42,0,176,.6); transform: translateY(-1px); }
/* fila de color en la matriz: botón con color, referencia y precio */
.matrix td.color .cn { border: 0; background: transparent; padding: 4px 6px; border-radius: 10px; text-align: left; cursor: pointer; }
.matrix td.color .cn span { display: grid; line-height: 1.1; }
.matrix td.color .cn small { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.matrix tr.sel td.color .cn { background: #efeaff; }
.matrix tr.sel td.color .cn span { color: var(--indigo); }
@media (max-width: 760px) {
  .swatches.fam { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matrix td.color .cn small { font-size: 10px; }
}

/* ══ Galería de fotos del color ══ */
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.92); box-shadow: 0 6px 18px -6px rgba(14,11,43,.35); display: grid; place-items: center; color: var(--indigo); }
.gal-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gal-nav.prev { left: 10px; } .gal-nav.next { right: 10px; }
.gal-nav:active { transform: translateY(-50%) scale(.92); }
.gal-count { position: absolute; right: 14px; bottom: 12px; z-index: 3; background: rgba(14,11,43,.75); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.gal { display: flex; gap: 8px; padding: 10px 12px; overflow-x: auto; background: #fafbff; border-top: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.gal-th { flex: none; width: 58px; height: 58px; border-radius: 12px; border: 2px solid var(--line); background: #fff; padding: 3px; display: grid; place-items: center; }
.gal-th img { width: 100%; height: 100%; object-fit: contain; }
.gal-th.on { border-color: var(--indigo); box-shadow: 0 4px 12px -6px rgba(42,0,176,.7); }
@media (min-width: 761px) and (max-width: 1080px) {
  .p-media { align-self: stretch; display: flex; flex-direction: column; }
  .gal-th { width: 50px; height: 50px; }
}

/* toma física: el código (referencia · línea · grupo · colección) arriba y destacado; el nombre debajo, normal */
.ref-head .rh-code { font-family: var(--display); font-weight: 800; font-size: 23px; line-height: 1.05; text-transform: uppercase; color: var(--ink); letter-spacing: .01em; }
.ref-head .rh-code .col-tag { color: var(--indigo); }
.ref-head .rh-name { display: block; margin-top: 3px; font-family: var(--body); font-weight: 400; font-size: 13.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
@media (max-width: 760px) { .ref-head .rh-code { font-size: 18px; } .ref-head .rh-name { font-size: 12.5px; } }
