/* Tienda pública (ESPEC-04: pantallas de cuenta). Usa los colores y controles de ../styles.css. */
body.tienda { padding-bottom: 0; display: flex; flex-direction: column; }
.tienda main { flex: 1; width: 100%; }
.tienda .brand { color: inherit; text-decoration: none; }
.t-nav { display: flex; gap: 8px; flex: none; }
.t-nav-btn { min-height: 38px; padding: 8px 14px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 20px; }

.t-vista { display: flex; flex-direction: column; gap: 16px; }
.t-vista h1, .t-titulo { margin: 0; font: 800 1.7rem/1.1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.t-hero { padding: 18px 0 4px; }
.t-hero p { margin: 8px 0 0; color: var(--muted); }

.t-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 14px; margin: 0; }
.t-form h2 { margin: 0; font: 800 1.15rem var(--f-display); text-transform: uppercase; letter-spacing: .04em; }
.t-form p { margin: 0; }
.t-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .t-fila { grid-template-columns: 1fr; } }
.t-msg { margin: 0; color: var(--danger); font-size: .9rem; }
.t-msg:empty { display: none; }
.t-msg.ok { color: var(--ok); }
.t-links { color: var(--muted); font-size: .9rem; }
.t-links a, .check a, .t-pie a { color: var(--accent); }
.t-pronto h2 + p { margin-bottom: 6px; }
.t-acciones { display: flex; flex-direction: column; gap: 10px; }
.t-peligro { color: var(--danger); border-color: var(--danger); background: transparent; }
.t-sinbase { color: var(--muted); text-align: center; }
.t-pie { padding: 20px var(--gutter-r) calc(20px + env(safe-area-inset-bottom, 0px)) var(--gutter-l); display: flex; flex-direction: column; gap: 4px; align-items: center; color: var(--muted); font-size: .8rem; text-align: center; }

/* ---------- Catálogo (ESPEC-05) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tienda main { max-width: 1100px; }
.t-nav-deseos { min-width: 44px; padding: 8px 12px; text-align: center; font-size: 1.05rem; }
.t-catalogo { display: flex; flex-direction: column; gap: 12px; }
.t-buscar { width: 100%; }
.t-filtros { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l)); padding: 2px var(--gutter-r) 6px var(--gutter-l); scrollbar-width: none; }
.t-filtros::-webkit-scrollbar { display: none; }
.t-sel { position: relative; flex: none; }
.t-sel select {
  appearance: none; -webkit-appearance: none; min-height: 38px; max-width: 62vw; padding: 0 30px 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 600 .88rem var(--f-body); text-overflow: ellipsis; cursor: pointer;
}
.t-sel::after { content: ""; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; color: var(--muted); }
.t-sel.is-on select { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.t-sel.is-on::after { color: var(--bg); }
.t-orden select { background: transparent; }
.t-barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: .9rem; min-height: 24px; }
.t-enlace { background: none; border: 0; padding: 4px 0; color: var(--accent); font: 600 .9rem var(--f-body); cursor: pointer; }
.t-cargando { color: var(--muted); text-align: center; padding: 24px 0; margin: 0; }
.t-vacio { text-align: center; color: var(--muted); padding: 24px 0; }
.t-vacio p { margin: 0 0 12px; }

.t-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 600px) { .t-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 860px) { .t-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1060px) { .t-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.t-carta { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: inherit; text-decoration: none; }
.t-carta:active { transform: translateY(1px); }
.t-carta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.t-carta-img { display: block; aspect-ratio: 160 / 223; background: var(--surface-2); padding: 8px 8px 0; }
.t-carta-img img, .t-ficha-img img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 5px; }
img.sin-imagen { visibility: hidden; }
.t-carta-info { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 10px; flex: 1; }
.t-carta-nombre { font-weight: 600; font-size: .9rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t-carta-sub { color: var(--muted); font: 500 .72rem var(--f-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-carta-precio { margin-top: auto; padding-top: 4px; font: 700 1rem var(--f-mono); }
.t-carta-precio small { font: 500 .7rem var(--f-body); color: var(--muted); }
.t-etiquetas { display: flex; gap: 4px; flex-wrap: wrap; }
.t-bulk, .t-poco { font: 600 .68rem var(--f-body); padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.t-bulk { background: var(--surface-2); color: var(--muted); }
.t-poco { background: var(--accent-soft); color: var(--fg); }

/* ---------- Ficha ---------- */
.t-volver { color: var(--accent); text-decoration: none; font-weight: 600; padding-top: 6px; align-self: flex-start; }
.t-ficha { display: grid; gap: 18px; }
@media (min-width: 720px) { .t-ficha { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; align-items: start; } }
.t-ficha-img { background: var(--surface-2); border-radius: var(--r); padding: 14px; aspect-ratio: 480 / 670; max-width: 420px; width: 100%; justify-self: center; }
.t-ficha-info { display: flex; flex-direction: column; gap: 12px; }
.t-ficha-info > p { margin: 0; }
.t-ficha-cod { font: 700 .85rem var(--f-mono); color: var(--muted); }
.t-ficha-var { color: var(--muted); }
.t-ficha-var:empty { display: none; }
.t-ficha-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0; }
.t-ficha-datos dt { color: var(--muted); font-size: .78rem; }
.t-ficha-datos dd { margin: 0; font-weight: 600; font-size: .92rem; }
#fVenta { display: flex; flex-direction: column; gap: 10px; }
#fVenta[hidden] { display: none; }
.t-ficha-k { margin: 0; font-weight: 600; font-size: .9rem; }
.t-ofertas { display: flex; flex-direction: column; gap: 8px; }
.t-oferta { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.t-oferta:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.t-oferta input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; flex: none; }
.t-oferta span { flex: 1; font-size: .9rem; }
.t-oferta small { display: block; color: var(--muted); }
.t-oferta b { font-family: var(--f-mono); }
.t-ficha-precio { font: 700 1.6rem var(--f-mono); }
.t-ficha-precio:empty { display: none; }
.t-agotada { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); padding: 12px; }
.t-agotada p { margin: 0; }
.t-ficha-acc { display: flex; gap: 10px; }
.t-ficha-acc .btn { flex: 1; }
#fDeseo.is-on { border-color: var(--accent); color: var(--accent); }

/* ---------- Lista de deseos ---------- */
.t-deseos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.t-deseo { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.t-deseo-link { display: flex; align-items: center; gap: 12px; padding: 8px 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.t-deseo-link img { width: 56px; height: 78px; object-fit: contain; flex: none; border-radius: 4px; background: var(--surface-2); }
.t-deseo-link > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t-deseo-link small { color: var(--muted); font: 500 .75rem var(--f-mono); }
.t-ok { color: var(--ok); font-weight: 600; font-size: .88rem; }
.t-agotado { color: var(--muted); font-weight: 600; font-size: .88rem; }
.t-quitar { background: none; border: 0; color: var(--muted); font-size: 1.1rem; min-width: 48px; min-height: 48px; cursor: pointer; }
@media (max-width: 599px) {
  #v-inicio .t-hero { padding-top: 8px; }
  #v-inicio .t-hero h1 { font-size: 1.35rem; }
  #v-inicio .t-hero p { font-size: .88rem; margin-top: 4px; }
}

/* ---------- Carrito, checkout y pedidos (ESPEC-06) ---------- */
.t-nav-btn.t-nav-carrito { position: relative; overflow: visible; min-width: 44px; padding: 8px 11px; display: inline-flex; align-items: center; justify-content: center; }
/* Con carrito, ♡ y cuenta en el encabezado, la marca se achica en celulares para no ocupar tres líneas */
@media (max-width: 480px) {
  .tienda .brand-name { font-size: 1.15rem; }
  .tienda .t-nav { gap: 6px; }
  .tienda .t-nav-btn { padding-left: 10px; padding-right: 10px; }
}
.t-nav-carrito svg { display: block; }
.t-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--bg); font: 700 .72rem/20px var(--f-mono); text-align: center; }
.t-badge[hidden] { display: none; }
.t-ir-carrito { align-self: center; text-decoration: none; }
.t-ir-carrito[hidden] { display: none; }
.t-centro { align-self: center; text-decoration: none; }

.t-avisos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.t-avisos:empty { display: none; }
.t-avisos li, .t-aviso { margin: 0; background: var(--accent-soft); border-radius: var(--r); padding: 10px 12px; font-size: .9rem; }
.t-aviso[hidden] { display: none; }

.t-lineas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.t-linea { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 0 10px 10px; }
.t-linea.is-agotada { opacity: .75; border-style: dashed; }
.t-linea-img img { width: 56px; height: 78px; object-fit: contain; border-radius: 4px; background: var(--surface-2); display: block; }
.t-linea-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.t-linea-info a { color: inherit; text-decoration: none; }
.t-linea-info small { color: var(--muted); font-size: .78rem; }
.t-linea-cant { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.t-linea-cant span { min-width: 28px; text-align: center; font: 700 .95rem var(--f-mono); }
.t-linea-cant b { margin-left: auto; font-family: var(--f-mono); }
.t-paso { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); font-size: 1.1rem; cursor: pointer; }
.t-paso:disabled { opacity: .4; cursor: default; }
.t-linea .t-quitar { align-self: flex-start; margin-top: -6px; }

.t-resumen { display: flex; flex-direction: column; gap: 12px; }
.t-resumen[hidden] { display: none; }
.t-totales { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.t-totales div { display: flex; justify-content: space-between; gap: 12px; }
.t-totales dt { color: var(--muted); }
.t-totales dd { margin: 0; font-family: var(--f-mono); font-weight: 600; }
.t-totales .t-total { border-top: 1px solid var(--line); padding-top: 8px; font-size: 1.1rem; }
.t-totales .t-total dt { color: var(--fg); font-weight: 600; }
.t-pend { color: var(--muted); font-family: var(--f-body) !important; font-weight: 500 !important; }
.btn.is-off { opacity: .5; }

.t-fila-doc { grid-template-columns: 2fr 3fr; }
@media (max-width: 380px) { .t-fila-doc { grid-template-columns: 1fr; } }
.t-form select.input { appearance: auto; }
.field small { color: var(--muted); font-weight: 400; }
.t-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.t-mini li { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.t-mini small { display: block; color: var(--muted); font: 500 .74rem var(--f-mono); }
.t-mini b { font-family: var(--f-mono); white-space: nowrap; }

.t-pedidos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.t-pedido-fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: inherit; text-decoration: none; }
.t-pedido-fila > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.t-pedido-fila strong { font-family: var(--f-mono); }
.t-pedido-fila small { color: var(--muted); font-size: .8rem; }
.t-pedido-der { align-items: flex-end; }
.t-pedido-der b { font-family: var(--f-mono); }
.t-estado { display: inline-block; font: 600 .72rem var(--f-body); padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.t-estado-espera { background: var(--accent-soft); color: var(--fg); }
.t-estado-ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.t-estado-fin { background: var(--fg); color: var(--bg); }
.t-pedido { display: flex; flex-direction: column; gap: 12px; }
.t-pedido[hidden] { display: none; }
.t-pedido > p { margin: 0; }
.t-pedido-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.t-pago p { margin: 0; }
.t-historial { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.t-historial li { display: flex; flex-direction: column; gap: 2px; position: relative; }
.t-historial li::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.t-historial li:first-child::before { background: var(--accent); }
.t-historial span { font-weight: 600; }
.t-historial small { color: var(--muted); font-size: .8rem; }
.t-pago strong { white-space: nowrap; }
.t-metodos { display: flex; flex-direction: column; gap: 8px; }
.t-direccion { display: flex; flex-direction: column; gap: 14px; }
.t-direccion[hidden] { display: none; }
