/* Shopea v2 — mismo lenguaje visual que la App 2.0 (Lexend, azul PSC, claro/oscuro automatico).
   Compartido por la app del cliente (/miapp/Shopea/) y el portal de sucursal (/Shopea/). */

@font-face { font-family: 'Lexend Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/Shopea/assets/fonts/lexend-latin-ext.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Lexend Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/Shopea/assets/fonts/lexend-latin.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light dark;
  --azul: #0446F1; --cielo: #0495F1; --celeste: #82CCFA; --negro: #070B0E; --pizarra: #2E3A44; --gris: #EFF3F6;
  --tint: var(--azul); --tint-soft: rgba(4,70,241,.11);
  --bg: var(--gris); --card: #fff; --fill: rgba(46,58,68,.09); --fill-2: rgba(46,58,68,.17); --sep: rgba(46,58,68,.14);
  --label: var(--negro); --label-2: rgba(46,58,68,.78); --label-3: rgba(46,58,68,.46); --bar: rgba(239,243,246,.82);
  --ok: #1FA84F; --warn: #E08A00; --danger: #E5352B;
  --ok-soft: rgba(31,168,79,.14); --warn-soft: rgba(224,138,0,.15); --danger-soft: rgba(229,53,43,.13);
  --shadow: 0 1px 2px rgba(7,11,14,.05), 0 10px 28px -14px rgba(7,11,14,.2);
  --font: 'Lexend Variable', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --tint: var(--cielo); --tint-soft: rgba(4,149,241,.2);
    --bg: var(--negro); --card: #0F171D; --fill: rgba(130,160,185,.14); --fill-2: rgba(130,160,185,.26); --sep: rgba(130,160,185,.16);
    --label: #F3F6F8; --label-2: #9DB0C0; --label-3: #5F7487; --bar: rgba(7,11,14,.82);
    --ok: #30D158; --warn: #FF9F0A; --danger: #FF453A;
    --ok-soft: rgba(48,209,88,.2); --warn-soft: rgba(255,159,10,.2); --danger-soft: rgba(255,69,58,.2);
    --shadow: 0 0 0 .5px rgba(255,255,255,.05), 0 12px 30px -16px rgba(0,0,0,.75); }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--label); font-size: 15px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
body.sin-tabbar { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.app { max-width: 520px; margin: 0 auto; padding: 0 16px; }
.app.ancha { max-width: 760px; }

/* Barra superior */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bar); backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: .5px solid var(--sep); padding-top: env(safe-area-inset-top); }
.topbar .fila { max-width: 520px; margin: 0 auto; min-height: 52px; padding: 8px 16px; display: flex; align-items: center; gap: 10px; }
.ancha-bar .fila { max-width: 760px; }
.topbar h1 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icono-btn { width: 36px; height: 36px; border-radius: 12px; border: 0; background: var(--fill); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.icono-btn:active { background: var(--fill-2); }
.icono-btn svg, .btn svg { width: 18px; height: 18px; }

/* Barra inferior */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bar); backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); border-top: .5px solid var(--sep); padding-bottom: env(safe-area-inset-bottom); }
.tabbar nav { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; font-weight: 500; color: var(--label-3); position: relative; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.activa { color: var(--tint); font-weight: 600; }
.punto { position: absolute; top: 6px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }

/* Tarjetas y listas */
.card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 16px; }
.card + .card, .pila > * + * { margin-top: 12px; }
.seccion { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--label-3); margin: 22px 4px 8px; }
.muted { color: var(--label-2); } .tenue { color: var(--label-3); } .pequeno { font-size: 12px; }
.negrita { font-weight: 600; } .centro { text-align: center; }
.fila-flex { display: flex; align-items: center; gap: 10px; } .fila-flex.entre { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.truncar { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font-weight: 600; font-size: 15px;
  padding: 13px 18px; border-radius: 14px; background: var(--tint); color: #fff; width: 100%; transition: transform .12s, opacity .12s; }
.btn:active { transform: scale(.98); opacity: .9; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.suave { background: var(--tint-soft); color: var(--tint); }
.btn.gris { background: var(--fill); color: var(--label); }
.btn.peligro { background: var(--danger-soft); color: var(--danger); }
.btn.ok { background: var(--ok); }
.btn.chico { padding: 9px 14px; font-size: 13px; border-radius: 12px; width: auto; }
.btns { display: flex; gap: 10px; } .btns > * { flex: 1; }

/* Formularios */
.campo { display: block; } .campo + .campo { margin-top: 14px; }
.campo > span { display: block; font-size: 13px; font-weight: 500; color: var(--label-2); margin: 0 0 6px 2px; }
.input, select.input, textarea.input { width: 100%; border: 0; background: var(--fill); border-radius: 14px; padding: 13px 14px; font-size: 16px; outline: 2px solid transparent; outline-offset: -2px; }
.input:focus { outline-color: var(--tint); background: var(--card); box-shadow: var(--shadow); }
textarea.input { min-height: 96px; resize: vertical; }
.buscador { position: relative; } .buscador svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--label-3); }
.buscador .input { padding-left: 40px; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Control segmentado y chips */
.seg { display: flex; background: var(--fill); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--label-2); cursor: pointer; position: relative; white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--label); box-shadow: var(--shadow); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; margin: 0 -16px; padding: 2px 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 0; background: var(--fill); color: var(--label-2); padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--tint); color: #fff; }
.etiqueta { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--fill); color: var(--label-2); }
.etiqueta.ok { background: var(--ok-soft); color: var(--ok); } .etiqueta.warn { background: var(--warn-soft); color: var(--warn); }
.etiqueta.mal { background: var(--danger-soft); color: var(--danger); } .etiqueta.azul { background: var(--tint-soft); color: var(--tint); }

/* Catalogo */
.rejilla { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.prod { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; display: block; }
.prod .foto { aspect-ratio: 1; background: var(--fill); width: 100%; object-fit: cover; }
.prod .info { padding: 10px 12px 12px; }
.prod .precio { font-size: 17px; font-weight: 700; }
.prod .titulo { font-size: 13px; color: var(--label-2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod .lugar { font-size: 11px; color: var(--label-3); margin-top: 6px; }

/* Articulo */
.galeria { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; background: var(--fill); }
.galeria::-webkit-scrollbar { display: none; }
.galeria img { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 1; object-fit: cover; max-height: 70vh; }
.puntos { display: flex; justify-content: center; gap: 6px; margin: 10px 0 2px; }
.puntos i { width: 6px; height: 6px; border-radius: 50%; background: var(--fill-2); } .puntos i.on { background: var(--tint); }
.precio-grande { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.barra-accion { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bar); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: .5px solid var(--sep); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.barra-accion .btns { max-width: 520px; margin: 0 auto; }

/* Avance de pedido */
.pasos { display: flex; gap: 6px; margin-top: 12px; }
.pasos i { flex: 1; height: 4px; border-radius: 2px; background: var(--fill-2); } .pasos i.on { background: var(--tint); } .pasos i.fin { background: var(--ok); }

/* Hoja inferior (modal) */
.velo { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.velo.abierta { opacity: 1; pointer-events: auto; }
.hoja { background: var(--card); width: 100%; max-width: 520px; border-radius: 24px 24px 0 0; padding: 12px 18px calc(22px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.velo.abierta .hoja { transform: none; }
.hoja::before { content: ''; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 0 auto 14px; }
.hoja h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.qr-caja { background: #fff; border-radius: 18px; padding: 16px; display: grid; place-items: center; margin: 14px auto; width: 230px; }
.qr-caja img { width: 198px; height: 198px; }
.codigo { font-family: ui-monospace, Menlo, monospace; font-size: 14px; letter-spacing: .08em; font-weight: 600; }

/* Avisos y estados vacios */
.toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -140%); z-index: 60; background: var(--label); color: var(--bg);
  padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 500; max-width: calc(100% - 32px); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow); }
.toast.on { transform: translate(-50%, 0); } .toast.mal { background: var(--danger); color: #fff; } .toast.bien { background: var(--ok); color: #fff; }
.vacio { text-align: center; padding: 44px 20px; color: var(--label-2); } .vacio svg { width: 40px; height: 40px; color: var(--label-3); margin: 0 auto 10px; }
.vacio h3 { font-size: 16px; font-weight: 600; color: var(--label); margin-bottom: 4px; }
.cargando { height: 3px; background: linear-gradient(90deg, transparent, var(--tint), transparent); background-size: 200% 100%; animation: corre 1.1s linear infinite; border-radius: 2px; margin: 18px 0; }
@keyframes corre { to { background-position: -200% 0; } }
.esq { background: var(--fill); border-radius: 18px; aspect-ratio: .82; animation: palpita 1.2s ease-in-out infinite; }
@keyframes palpita { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Resumen (portal) */
.cifras { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cifra b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; } .cifra span { font-size: 12px; color: var(--label-2); }

/* Etiqueta imprimible del portal */
.imprimir-solo { display: none; }
@media print {
  body > *:not(.imprimir-solo) { display: none !important; }
  .imprimir-solo { display: block !important; color: #000; background: #fff; padding: 8px; }
  @page { margin: 6mm; }
}

/* Explicacion "Asi funciona Shopea" */
.pasos-lista { margin: 14px 0 10px; }
.paso { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; }
.paso + .paso { border-top: .5px solid var(--sep); }
.paso .n { width: 38px; height: 38px; border-radius: 12px; background: var(--tint-soft); color: var(--tint); display: grid; place-items: center; flex-shrink: 0; }
.paso .n svg { width: 20px; height: 20px; }
.paso b { display: block; font-size: 15px; font-weight: 600; }
.paso span { display: block; font-size: 13px; color: var(--label-2); margin-top: 1px; }
.nota-sel { background: var(--ok-soft); color: var(--ok); border-radius: 14px; padding: 10px 14px; font-weight: 600; font-size: 14px; margin: 12px 0 2px; }

/* Opciones tipo lista (radio) */
.opcion { display: flex; gap: 12px; align-items: center; padding: 13px 14px; background: var(--fill); border-radius: 14px; cursor: pointer; font-size: 14px; }
.opcion + .opcion { margin-top: 8px; }
.opcion input { accent-color: var(--tint); width: 18px; height: 18px; flex-shrink: 0; margin: 0; }
.opcion .etiqueta { flex-shrink: 0; }
