/* Mi tienda (ver dueno-tienda.js): pantalla completa del celular. Mismo diseño limpio del resto de la app, con claro y oscuro. */

.tienda-entrada { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; width: calc(100% - 32px); margin: 0 16px 12px; padding: 14px 16px; border: 0; border-radius: 18px; background: var(--surface, #fff) !important; color: var(--text, #0f172a) !important; text-align: left; box-shadow: var(--shadow, 0 1px 2px rgba(15, 23, 42, .06)); cursor: pointer; }
.tienda-entrada span { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: rgba(22, 163, 74, .14); font-size: 22px; }
.tienda-entrada b { font-size: 16px; }
.tienda-entrada small { color: var(--muted, #6b7686); font-size: 12.5px; }

/* ---- capa ---- */
.tienda-capa {
    --t-bg: #f2f2f7; --t-card: #fff; --t-text: #0f172a; --t-muted: #6b7686; --t-line: rgba(60, 60, 67, .12); --t-fill: rgba(118, 118, 128, .12);
    --t-verde: #16a34a; --t-rojo: #dc2626; --t-ambar: #d97706; --t-marca: #2563ff;
    position: fixed; inset: 0; z-index: 9400; display: none; flex-direction: column; height: 100dvh; background: var(--t-bg); color: var(--t-text);
    overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: calc(40px + env(safe-area-inset-bottom));
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
:root.oscuro .tienda-capa { --t-bg: #000; --t-card: #1c1c1e; --t-text: #f5f5f7; --t-muted: #9a9aa6; --t-line: rgba(255, 255, 255, .12); --t-fill: rgba(118, 118, 128, .32); --t-verde: #4ade80; --t-rojo: #f87171; --t-ambar: #fbbf24; --t-marca: #5b8cff; }
.tienda-capa.abierta { display: flex; }
body.tienda-abierta { overflow: hidden; }
.tienda-capa *, .tienda-capa *::before, .tienda-capa *::after { box-sizing: border-box; min-width: 0; }

.tienda-cabecera { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 14px 8px; background: color-mix(in srgb, var(--t-bg) 86%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.tienda-cabecera h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--t-text); }
.tienda-icono { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--t-fill) !important; color: var(--t-text) !important; cursor: pointer; }

.tienda-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 4px 14px 10px; padding: 3px; border-radius: 13px; background: var(--t-fill); }
.tienda-seg button { padding: 9px 4px; border: 0; border-radius: 10px; background: transparent !important; color: var(--t-muted) !important; font: inherit; font-size: 14px; font-weight: 700; transition: background .2s, color .2s, box-shadow .2s; }
.tienda-seg button.activo { background: var(--t-card) !important; color: var(--t-text) !important; box-shadow: 0 1px 4px rgba(0, 0, 0, .14); }
.tienda-cuerpo { display: grid; gap: 14px; padding: 4px 14px 24px; align-content: start; }

/* ---- tarjeta principal (numero grande) ---- */
.ti-hero { display: grid; gap: 6px; padding: 20px 18px 16px; border-radius: 24px; background: var(--t-card); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.ti-etiqueta { color: var(--t-muted); font-size: 13px; font-weight: 700; }
.ti-hero-numero { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.ti-hero-numero strong { font-size: clamp(34px, 11vw, 44px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; color: var(--t-text); }
.ti-hero-nota { margin: 0; color: var(--t-muted); font-size: 13.5px; font-weight: 500; line-height: 1.4; }
.ti-delta { padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.ti-delta.sube { background: rgba(22, 163, 74, .15); color: var(--t-verde); }
.ti-delta.baja { background: rgba(220, 38, 38, .14); color: var(--t-rojo); }
.ti-hero-fila { display: grid; grid-template-columns: repeat(3, 1fr); margin: 10px -18px -4px; padding-top: 14px; border-top: 1px solid var(--t-line); }
.ti-hero-fila div { display: grid; gap: 2px; padding: 0 16px; }
.ti-hero-fila div + div { border-left: 1px solid var(--t-line); }
.ti-hero-fila small { color: var(--t-muted); font-size: 11.5px; font-weight: 600; line-height: 1.25; }
.ti-hero-fila b { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }

.verde { color: var(--t-verde); } .rojo { color: var(--t-rojo); } .ambar { color: var(--t-ambar); }
.tienda-aviso { margin: 0; padding: 12px 14px; border-radius: 14px; background: rgba(245, 158, 11, .16); color: var(--t-ambar); font-size: 13.5px; font-weight: 600; }

.tienda-tarjeta { padding: 16px 16px 14px; border-radius: 22px; background: var(--t-card); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.tienda-tarjeta h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.tienda-tarjeta p { margin: 6px 0; }
.ti-titulo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ti-titulo small { color: var(--t-muted); font-size: 12px; font-weight: 600; }

/* ---- barras de 7 dias ---- */
.tienda-barras { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 138px; margin-top: 12px; }
.tienda-barras div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 5px; }
.tienda-barras i { width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, var(--t-marca) 28%, transparent); min-height: 4px; }
.tienda-barras .hoy i { background: var(--t-marca); }
.tienda-barras em { color: var(--t-muted); font-size: 9.5px; font-style: normal; font-weight: 700; white-space: nowrap; }
.tienda-barras span { color: var(--t-muted); font-size: 11.5px; font-weight: 700; text-transform: capitalize; }
.tienda-barras .hoy span { color: var(--t-text); }

/* ---- rankings (lo que mas te deja / pierdes) ---- */
.ti-ranking { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.ti-ranking li { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; }
.ti-ranking.compacto { gap: 12px; }
.ti-fila-texto { display: grid; gap: 2px; min-width: 0; }
.ti-fila-texto b { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti-fila-texto small { color: var(--t-muted); font-size: 12px; font-weight: 500; }
.ti-barra { display: block; height: 5px; margin-top: 4px; border-radius: 3px; background: var(--t-verde); opacity: .85; }
.ti-barra.mala { background: var(--t-rojo); }
.ti-ranking strong { font-size: 15px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }

.ti-mini { display: grid; place-items: center; flex: none; width: 46px; height: 46px; overflow: hidden; border-radius: 13px; background: var(--t-fill); color: var(--t-muted); font-size: 18px; font-weight: 800; }
.ti-mini img { width: 100%; height: 100%; object-fit: cover; background: #fff; }

.tienda-nota { margin: 0; color: var(--t-muted); font-size: 13px; text-align: center; }
.tienda-vacio { margin: 0; color: var(--t-muted); text-align: center; padding: 8px 0; font-size: 14px; }
.ti-vacio-grande { display: grid; justify-items: center; gap: 6px; padding: 44px 20px; border-radius: 24px; background: var(--t-card); text-align: center; }
.ti-vacio-grande span { font-size: 42px; }
.ti-vacio-grande b { font-size: 18px; }
.ti-vacio-grande small { color: var(--t-muted); font-size: 14px; max-width: 280px; line-height: 1.4; }

/* ---- por revisar ---- */
.ti-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -14px; padding: 2px 14px; scrollbar-width: none; }
.ti-chips::-webkit-scrollbar { display: none; }
.ti-chip { flex: none; padding: 9px 14px; border: 0; border-radius: 999px; background: var(--t-card) !important; color: var(--t-text) !important; font: inherit; font-size: 13.5px; font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.ti-chip small { margin-left: 3px; color: var(--t-muted); font-weight: 700; }
.ti-chip.activo { background: var(--t-text) !important; color: var(--t-bg) !important; }
.ti-chip.activo small { color: inherit; opacity: .7; }
.ti-lotes { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ti-lotes li { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 12px; border-radius: 20px; background: var(--t-card); border-left: 5px solid var(--t-line); }
.ti-lotes li.mal { border-left-color: var(--t-rojo); }
.ti-lotes li.pronto { border-left-color: var(--t-ambar); }
.ti-lotes .ti-mini { width: 52px; height: 52px; }
.ti-lote-texto { display: grid; gap: 3px; }
.ti-lote-texto b { font-size: 15px; font-weight: 700; }
.ti-lote-texto small { color: var(--t-muted); font-size: 12.5px; }
.ti-estado { justify-self: start; padding: 2px 9px; border-radius: 999px; background: var(--t-fill); color: var(--t-muted); font-size: 12px; font-weight: 800; }
.ti-lotes li.mal .ti-estado { background: rgba(220, 38, 38, .14); color: var(--t-rojo); }
.ti-lotes li.pronto .ti-estado { background: rgba(217, 119, 6, .15); color: var(--t-ambar); }
.ti-lote-acciones { grid-column: 1 / -1; display: flex; gap: 8px; }
.ti-lote-acciones button { flex: 1; padding: 11px 10px; border: 0; border-radius: 13px; background: var(--t-fill) !important; color: var(--t-text) !important; font: inherit; font-size: 14px; font-weight: 800; }
.ti-lote-acciones .tirar { background: rgba(220, 38, 38, .13) !important; color: var(--t-rojo) !important; }
.ti-sin-resultados { padding: 22px; border-radius: 18px; background: var(--t-card); color: var(--t-muted); text-align: center; list-style: none; }

/* ---- pedido ---- */
.ti-proveedor { display: grid; gap: 14px; padding: 16px; border-radius: 24px; background: var(--t-card); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.ti-proveedor.urgente { box-shadow: inset 0 0 0 2px rgba(217, 119, 6, .55); }
.ti-prov-cab { display: flex; align-items: center; gap: 12px; }
.ti-prov-cab > div { display: grid; gap: 4px; min-width: 0; }
.ti-prov-cab b { font-size: 15.5px; font-weight: 800; line-height: 1.25; }
.ti-prov-icono { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--t-fill); font-size: 22px; }
.ti-cuando { justify-self: start; padding: 3px 10px; border-radius: 999px; background: var(--t-fill); color: var(--t-muted); font-size: 12.5px; font-weight: 800; }
.ti-cuando.pronto { background: rgba(217, 119, 6, .16); color: var(--t-ambar); }
.ti-cuando.ya { background: rgba(220, 38, 38, .14); color: var(--t-rojo); }
.ti-prov-monto { display: grid; gap: 1px; padding: 12px 14px; border-radius: 16px; background: var(--t-fill); }
.ti-prov-monto small { color: var(--t-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ti-prov-monto strong { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.ti-prov-monto span { color: var(--t-muted); font-size: 13px; font-weight: 600; }
.ti-prov-vacio { margin: 0; color: var(--t-muted); font-size: 14px; }
.ti-prov-acciones { display: flex; align-items: flex-end; gap: 10px; }
.ti-dia { display: grid; gap: 3px; flex: 1; color: var(--t-muted); font-size: 11.5px; font-weight: 700; }
.ti-dia select { width: 100%; padding: 11px 10px; border: 0; border-radius: 13px; background: var(--t-fill); color: var(--t-text); font: inherit; font-size: 14.5px; font-weight: 700; }
.ti-boton-principal { flex: none; padding: 12px 18px; border: 0; border-radius: 14px; background: var(--t-marca) !important; color: #fff !important; font: inherit; font-size: 15px; font-weight: 800; }
.ti-boton-principal[disabled] { opacity: .4; }

.tienda-volver { justify-self: start; padding: 4px 2px; border: 0; background: transparent !important; color: var(--t-marca) !important; font: inherit; font-size: 15px; font-weight: 700; }
.ti-pedido { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ti-pedido li { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 18px; background: var(--t-card); }
.ti-paso { display: flex; align-items: center; gap: 4px; }
.ti-paso button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--t-fill) !important; color: var(--t-text) !important; font-size: 20px; font-weight: 700; line-height: 1; }
.ti-paso input { width: 50px; padding: 8px 0; border: 0; border-radius: 10px; background: transparent; color: var(--t-text); font: inherit; font-size: 17px; font-weight: 800; text-align: center; }
.ti-barra-acciones { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 2; display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; padding: 10px; border-radius: 22px; background: color-mix(in srgb, var(--t-card) 88%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
.ti-barra-acciones button { padding: 13px 8px; border: 0; border-radius: 14px; background: var(--t-fill) !important; color: var(--t-text) !important; font: inherit; font-size: 14px; font-weight: 800; }
.ti-barra-acciones .whatsapp { background: rgba(22, 163, 74, .16) !important; color: var(--t-verde) !important; }
.ti-barra-acciones .ti-boton-principal { background: var(--t-marca) !important; color: #fff !important; }

/* ---- en el Inicio del celular ---- */
.tienda-inicio { display: grid; gap: 12px; margin: 14px 0; --t-card: var(--surface, #fff); --t-text: var(--text, #0f172a); --t-muted: var(--muted, #6b7686); --t-line: var(--line, rgba(60, 60, 67, .12)); --t-fill: rgba(118, 118, 128, .12); --t-verde: var(--green, #16a34a); --t-rojo: var(--red, #dc2626); }
.tienda-inicio article { padding: 16px; border-radius: 22px; background: var(--t-card); box-shadow: var(--shadow, none); color: var(--t-text); }
.tienda-inicio h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.tienda-inicio .ti-mini { background: var(--t-fill); }
.tienda-inicio .ti-fila-texto small { color: var(--t-muted); }
.tienda-inicio .ti-barra { background: var(--t-verde); }
.tienda-inicio .ti-barra.mala { background: var(--t-rojo); }
.tienda-inicio .verde { color: var(--t-verde); } .tienda-inicio .rojo { color: var(--t-rojo); }
.ti-ver-todo { padding: 12px; border: 0; border-radius: 16px; background: var(--brand-soft, #eaf0ff) !important; color: var(--brand, #2563ff) !important; font: inherit; font-size: 14.5px; font-weight: 800; }

.tienda-inicio .ti-surtir { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.tienda-inicio .ti-surtir button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 11px 14px; border: 0; border-radius: 14px; background: var(--t-fill); color: var(--t-text); font: inherit; font-size: 15px; font-weight: 700; text-align: left; }
.tienda-inicio .ti-surtir small { display: block; color: var(--t-muted); font-size: 12.5px; font-weight: 600; }
