/* La tienda que ve el cliente. Todo sale de tokens.css (var(--t-…)): nada de colores, fuentes
   o radios a mano (DESIGN.md). Portado del tema de la versión de WordPress, sin lo que era
   de WooCommerce y Storefront. */

/* ---------------------------------------------------------------- base */
/* El lienzo de app: una columna centrada. Lo de afuera, en una computadora, es fondo neutro a propósito. */
body.tnd-store { margin: 0; background: var(--t-soft); color: var(--t-ink); font-family: var(--t-font); font-size: var(--t-size-body); line-height: 1.45; }
body.tnd-store.tnd-noscroll { overflow: hidden; }
.tnd-store h1, .tnd-store h2, .tnd-store h3 { font-family: var(--t-font-display); color: var(--t-ink); font-weight: 700; letter-spacing: -0.015em; }
.tnd-store a { color: var(--t-brand-ink); }
.tnd-store a:focus-visible, .tnd-store button:focus-visible { outline: 2px solid var(--t-brand); outline-offset: 2px; }
.tnd-store h1, .tnd-store h2, .tnd-store h3 { margin: 0; }
.tnd-canvas { display: flow-root; max-width: var(--t-canvas); min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--t-bg); }
.tnd-wrap { padding: 0 var(--t-gutter) calc(var(--t-nav-h) + var(--t-space-24) + env(safe-area-inset-bottom)); }
.tnd-flow-page .tnd-wrap { padding-bottom: 48px; }
.tnd-store .page-title { font-size: var(--t-size-title); line-height: 1.1; margin: 20px 0 16px; }
/* Sin barra arriba, el título es lo primero de la pantalla. */
.tnd-no-top .page-title { margin-top: var(--t-space-40); }
.tnd-skip { position: absolute; left: -9999px; }
.tnd-skip:focus { left: 12px; top: 12px; z-index: 200; padding: 10px 14px; border-radius: var(--t-r-ctl); background: var(--t-bg); }
.tnd-store [hidden] { display: none !important; }
.tnd-i { display: block; flex-shrink: 0; }

/* ---------------------------------------------------------------- botones */
.tnd-sbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: var(--t-btn-h); padding: 0 20px; box-sizing: border-box; border-radius: var(--t-r-pill); border: 0; font-family: var(--t-font); font-size: 16px; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer; }
.tnd-sbtn:hover { opacity: .92; }
.tnd-store .tnd-sbtn--primary, .tnd-store .tnd-sbtn--primary:hover, .tnd-store .tnd-sbtn--primary:visited { background: var(--t-brand); color: var(--t-bg); }
.tnd-store .tnd-sbtn--secondary, .tnd-store .tnd-sbtn--secondary:hover, .tnd-store .tnd-sbtn--secondary:visited { background: var(--t-bg); color: var(--t-ink); border: var(--t-border); font-weight: 600; min-height: 48px; }
.tnd-store a.tnd-sbtn { text-decoration: none !important; }
.tnd-store .tnd-sbtn--quiet, .tnd-store .tnd-sbtn--quiet:hover, .tnd-store .tnd-sbtn--quiet:visited { background: var(--t-soft); color: var(--t-ink); font-weight: 600; }
.tnd-store .tnd-sbtn--wa, .tnd-store .tnd-sbtn--wa:hover, .tnd-store .tnd-sbtn--wa:visited { background: var(--t-wa); color: var(--t-bg); }
.tnd-sbtn[disabled] { opacity: .5; cursor: default; }
.tnd-iconbtn { position: relative; width: var(--t-touch); height: var(--t-touch); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--t-r-pill); border: var(--t-border); background: var(--t-bg); padding: 0; cursor: pointer; text-decoration: none; }
.tnd-store .tnd-iconbtn, .tnd-store .tnd-iconbtn:hover, .tnd-store .tnd-iconbtn:visited { color: var(--t-ink); background: var(--t-bg); }
.tnd-iconbtn b { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: var(--t-r-pill); background: var(--t-brand); color: var(--t-bg); font-size: 11px; display: flex; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------- barra de arriba */
.tnd-top { position: sticky; top: 0; z-index: 50; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 10px var(--t-gutter); background: var(--t-bg); border-bottom: var(--t-border); }
.tnd-top__name { flex: 1; min-width: 0; text-align: center; font-family: var(--t-font); font-size: 16px; font-weight: 700; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tnd-store .tnd-top__name, .tnd-store .tnd-top__name:visited { color: var(--t-ink); }
.tnd-top__spacer { width: var(--t-touch); flex-shrink: 0; }

/* ---------------------------------------------------------------- inicio
   Empieza con el comercio: portada, logo montado, nombre. Es contenido, no un encabezado: se va con
   el scroll. Después los filtros (si hay más de una categoría) y las fotos, que son el catálogo. */
.tnd-hero { margin: 0 calc(var(--t-gutter) * -1); }
.tnd-hero__cover { aspect-ratio: 16 / 9; background: var(--t-soft); overflow: hidden; }
.tnd-hero__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tnd-hero__logo { position: relative; display: flex; align-items: center; justify-content: center; width: var(--t-avatar); height: var(--t-avatar); margin: calc(var(--t-avatar) / -2) 0 0 var(--t-gutter); border: var(--t-space-4) solid var(--t-bg); border-radius: var(--t-r-pill); background: var(--t-bg); overflow: hidden; }
.tnd-hero__logo img { width: 100%; height: 100%; object-fit: cover; }
.tnd-hero__logo span { font-family: var(--t-font-display); font-size: var(--t-type-display); font-weight: 700; }
.tnd-hero h1 { margin: var(--t-space-12) var(--t-gutter) 0; font-size: var(--t-type-display); line-height: 1.1; }
.tnd-hero__slogan { margin: var(--t-space-4) var(--t-gutter) 0; font-size: var(--t-type-meta); color: var(--t-muted); }

/* El catálogo. Al escoger un filtro la página vuelve a cargar y cae aquí, no en la portada. */
.tnd-catalog { margin-top: var(--t-space-24); scroll-margin-top: var(--t-space-12); }
.tnd-chips { display: flex; gap: var(--t-space-8); margin: 0 calc(var(--t-gutter) * -1) var(--t-space-24); padding: 0 var(--t-gutter); overflow-x: auto; scrollbar-width: none; }
.tnd-chips::-webkit-scrollbar { display: none; }
.tnd-store .tnd-chips .tnd-chip { flex-shrink: 0; display: inline-flex; align-items: center; box-sizing: border-box; min-height: var(--t-touch); padding: 0 var(--t-space-16); border: var(--t-border); border-radius: var(--t-r-pill); background: var(--t-bg); color: var(--t-ink); font-size: var(--t-type-control); font-weight: 600; text-decoration: none; white-space: nowrap; }
.tnd-store .tnd-chips .tnd-chip.is-on { border-color: var(--t-brand); background: var(--t-brand-soft); color: var(--t-brand-ink); }

/* La foto es la interfaz; el nombre y el precio son su pie. Dos columnas siempre. */
.tnd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--t-space-24) var(--t-space-12); }
.tnd-store .tnd-pcard { display: flex; flex-direction: column; gap: var(--t-space-4); color: var(--t-ink); font-size: var(--t-type-content); line-height: 1.3; text-decoration: none; }
.tnd-pcard__photo { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; margin-bottom: var(--t-space-4); border-radius: var(--t-r-img); background: var(--t-soft); color: var(--t-muted); overflow: hidden; }
.tnd-pcard__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tnd-pcard__name { font-weight: 600; }
.tnd-pcard__price { font-weight: 700; }
/* No se puede pedir: la foto atenuada y la palabra. */
.tnd-pcard.is-out .tnd-pcard__photo { opacity: .5; }
.tnd-pcard__state { font-size: var(--t-type-meta); color: var(--t-muted); }
.tnd-empty { padding: var(--t-space-40) 0; color: var(--t-muted); text-align: center; }

/* ---------------------------------------------------------------- navegación inferior
   El armazón del modo tienda: tres destinos, del ancho del lienzo, la única barra fija. */
.tnd-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; box-sizing: border-box; max-width: var(--t-canvas); margin: 0 auto; padding: 0 var(--t-space-8) env(safe-area-inset-bottom); border-top: var(--t-border); background: var(--t-bg); }
.tnd-store .tnd-dock a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--t-space-4); min-height: var(--t-nav-h); color: var(--t-muted); font-size: var(--t-type-nav); font-weight: 600; text-decoration: none; }
.tnd-store .tnd-dock a.is-active { color: var(--t-brand-ink); font-weight: 700; }
.tnd-dock__icon { position: relative; display: flex; }
.tnd-dock__count { position: absolute; top: calc(var(--t-space-8) * -1); left: 100%; display: flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: calc(var(--t-space-16) + var(--t-space-4)); height: calc(var(--t-space-16) + var(--t-space-4)); margin-left: calc(var(--t-space-8) * -1); padding: 0 var(--t-space-4); border-radius: var(--t-r-pill); background: var(--t-brand); color: var(--t-bg); font-size: var(--t-type-nav); font-weight: 700; line-height: 1; }

/* Barra de compra fija */
.tnd-buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; max-width: var(--t-canvas); margin: 0 auto; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 12px var(--t-gutter) calc(14px + env(safe-area-inset-bottom)); background: var(--t-bg); border-top: var(--t-border); }
.tnd-has-buybar .tnd-dock { display: none; }
.tnd-stepper { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tnd-store .tnd-stepper__btn { width: var(--t-touch); height: var(--t-touch); min-height: 0; border-radius: var(--t-r-pill); border: var(--t-border); background: var(--t-bg); color: var(--t-ink); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.tnd-stepper__btn[disabled] { opacity: .35; cursor: default; }
.tnd-stepper__n { min-width: 18px; text-align: center; font-size: 16px; font-weight: 700; }
.tnd-store .tnd-buybar__go { flex: 1; width: auto; }
.tnd-store .tnd-buybar__go[disabled] { background: var(--t-soft); color: var(--t-muted); opacity: 1; }

/* ---------------------------------------------------------------- carrito y pagar (propios)
   Los arma assets/checkout.js con el carrito guardado en el teléfono. */
.tnd-lines { display: flex; flex-direction: column; }
/* Renglones iguales en serie: los separa una línea. Sin caja por artículo. */
.tnd-line { display: flex; gap: var(--t-space-12); padding: var(--t-space-16) 0; border-bottom: var(--t-border); }
.tnd-line:first-child { padding-top: 0; }
.tnd-line__photo { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: var(--t-thumb); height: var(--t-thumb); border-radius: var(--t-r-thumb); background: var(--t-soft); color: var(--t-muted); overflow: hidden; }
.tnd-line__photo img { width: 100%; height: 100%; object-fit: cover; }
.tnd-line__body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--t-space-4); font-size: var(--t-type-content); line-height: 1.3; }
.tnd-line__name { font-weight: 600; }
.tnd-line small { color: var(--t-muted); font-size: var(--t-type-meta); }
.tnd-line__price { font-weight: 700; }
.tnd-line .tnd-stepper { margin-top: var(--t-space-8); }
.tnd-totalrow { display: flex; justify-content: space-between; padding: var(--t-space-24) 0 var(--t-space-16); font-size: var(--t-type-content); font-weight: 700; }
.tnd-note { color: var(--t-muted); font-size: var(--t-size-small); margin: 0 0 16px; }
.tnd-store .tnd-note a { color: var(--t-muted); text-decoration: underline; text-underline-offset: 3px; }
/* Vacío: un solo bloque, sin caja. La frase manda; no llena la pantalla. */
.tnd-emptycart { display: flex; flex-direction: column; align-items: center; gap: var(--t-space-8); padding: calc(var(--t-space-40) * 2) 0 0; text-align: center; }
.tnd-emptycart__icon { margin-bottom: var(--t-space-8); color: var(--t-muted); }
.tnd-store .tnd-emptycart h1, .tnd-store .tnd-emptycart h2 { font-size: var(--t-type-display); line-height: 1.1; }
.tnd-emptycart p { margin: 0 0 var(--t-space-16); color: var(--t-muted); font-size: var(--t-type-content); }

/* Pagar. Cinco bloques que se reconocen sin leer: datos, cómo lo recibe, nota, resumen y pago. Los
   separa el espacio (mucho entre bloques, poco dentro), y una sola línea marca el paso de escribir
   a comprobar. */
.tnd-flow__back { margin-top: var(--t-space-16); }
.tnd-store .tnd-flow__back + .page-title { margin-top: var(--t-space-16); }
.tnd-checkout > section { margin: 0 0 var(--t-space-40); }
.tnd-store .tnd-checkout h2 { margin: 0 0 var(--t-space-12); font-family: var(--t-font); font-size: var(--t-type-content); font-weight: 700; letter-spacing: 0; }
.tnd-field { margin: 0 0 var(--t-space-16); }
.tnd-field label { display: block; margin: 0 0 var(--t-space-4); font-size: var(--t-type-meta); font-weight: 600; color: var(--t-ink); }
.tnd-store .tnd-field input, .tnd-store .tnd-field select, .tnd-store .tnd-checkout textarea { display: block; width: 100%; box-sizing: border-box; min-height: var(--t-btn-h); padding: var(--t-space-12) var(--t-space-16); border: var(--t-border); border-radius: var(--t-r-ctl); background: var(--t-bg); color: var(--t-ink); font-family: var(--t-font); font-size: var(--t-type-content); box-shadow: none; }
.tnd-store .tnd-field input:focus, .tnd-store .tnd-field select:focus, .tnd-store .tnd-checkout textarea:focus { outline: 2px solid var(--t-brand); outline-offset: -1px; border-color: transparent; background: var(--t-bg); }
.tnd-store .tnd-field [aria-invalid="true"] { border-color: var(--t-danger); }
.tnd-field__err, .tnd-opt__err { margin: 6px 0 0; color: var(--t-danger); font-size: var(--t-size-small); font-weight: 600; }
/* Varias formas de recibirlo: cada una es un control que se toca entero, por eso lleva borde. */
.tnd-choices { display: flex; flex-direction: column; gap: var(--t-space-8); }
.tnd-choice { display: flex; align-items: flex-start; gap: var(--t-space-12); box-sizing: border-box; min-height: var(--t-btn-h); margin: 0; padding: var(--t-space-12) var(--t-space-16); border: var(--t-border); border-radius: var(--t-r-ctl); font-size: var(--t-type-content); line-height: 1.3; cursor: pointer; }
.tnd-choice.is-on { background: var(--t-brand-soft); border-color: var(--t-brand); }
.tnd-choice input, .tnd-check input { flex-shrink: 0; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--t-brand); }
.tnd-choice__body { flex: 1; min-width: 0; }
.tnd-choice__body b { display: block; font-weight: 600; }
.tnd-choice__body small, .tnd-recv small { display: block; margin-top: var(--t-space-4); color: var(--t-muted); font-size: var(--t-type-meta); }
.tnd-choice__price { flex-shrink: 0; font-weight: 700; }
/* Una sola forma: es un dato, no una elección. */
.tnd-recv { font-size: var(--t-type-content); line-height: 1.3; }
.tnd-recv__head { display: flex; justify-content: space-between; gap: var(--t-space-12); }
.tnd-recv__head b { font-weight: 700; }
.tnd-recv__needs { margin-top: var(--t-space-24); }
.tnd-check { display: flex; align-items: center; gap: var(--t-space-12); min-height: var(--t-touch); margin: 0 0 var(--t-space-16); font-size: var(--t-type-content); cursor: pointer; }
.tnd-check input { margin: 0; }
.tnd-store .tnd-more { display: flex; align-items: center; gap: var(--t-space-8); min-height: var(--t-touch); padding: 0; border: 0; background: none; color: var(--t-ink); font-family: var(--t-font); font-size: var(--t-type-control); font-weight: 600; cursor: pointer; }
.tnd-checkout__note .tnd-field { margin: 0; }
.tnd-store .tnd-checkout textarea { min-height: 88px; resize: vertical; }
/* El resumen: aquí se deja de escribir y se comprueba. Más aire y la única línea entre bloques. */
.tnd-checkout > .tnd-sum { padding-top: var(--t-space-40); border-top: var(--t-border); }
.tnd-sum__row { display: flex; justify-content: space-between; gap: var(--t-space-12); padding: var(--t-space-8) 0; font-size: var(--t-type-content); line-height: 1.3; }
.tnd-sum__row > div { min-width: 0; }
.tnd-sum__row > span { flex-shrink: 0; }
.tnd-sum__row small { display: block; margin-top: var(--t-space-4); color: var(--t-muted); font-size: var(--t-type-meta); }
.tnd-sum__total { margin-top: var(--t-space-8); padding-top: var(--t-space-16); border-top: var(--t-border); font-weight: 700; }
.tnd-sum .tnd-note { margin: var(--t-space-4) 0 0; }
.tnd-checkout__legal { margin: var(--t-space-12) 0 0; text-align: center; }
.tnd-alert { margin: 0 0 12px; padding: 12px 14px; border-radius: var(--t-r-ctl); background: var(--t-danger-soft); color: var(--t-danger); font-size: 15px; }
.tnd-store .tnd-alert a { color: var(--t-danger); font-weight: 700; }
.tnd-store .tnd-sbtn[disabled] { opacity: .6; cursor: default; }

/* El cajero en su estación, cobrando (pay-scene.js), y la misma escena ya sin él en el recibo.
   Manda él y lo que dice su nube; el detalle va debajo, pequeño. Los colores del dibujo son los
   del personaje (docs/brand/CHARACTER-SPEC.md), no los de la tienda.

   Las medidas salen de tres números (en px, sin unidad para poder dividirlos). El cajero mide
   casi lo que tú, un poco menos: se nota por su detalle, su color y cómo se mueve, no por ser
   más grande que la gente. Encima de él queda el sitio de su nube. */
.tnd-qs {
	--tnd-qs-person: 116;                                    /* tu alto, en el mostrador */
	--tnd-qs-cashier: calc(var(--tnd-qs-person) * .94);      /* el cajero: 94% de eso */
	--tnd-qs-floor: 214;                                     /* dónde queda el piso de la estación */
	--tnd-qs-green: #1F4D3A;
	display: flex; flex-direction: column; align-items: center; text-align: center;
}
.tnd-qs__stage { position: relative; width: 100%; }
/* Medidas fijas: la misma escena a 375 px, a 430 px y en una computadora. */
.tnd-qs .cashier-scene__art { position: relative; width: 280px; height: calc((var(--tnd-qs-floor) + 22) * 1px); margin: 0 auto; }
.tnd-qs__station { position: absolute; left: 0; top: calc((var(--tnd-qs-floor) - 151) * 1px); width: 280px; height: 162px; fill: none; stroke: var(--tnd-qs-green); stroke-opacity: .18; stroke-width: 3; stroke-linecap: round; }
.tnd-qs__station .tnd-qs__floor { stroke-opacity: .12; stroke-width: 2; }
.tnd-qs__station .tnd-qs__ledge { stroke-opacity: .3; stroke-width: 8; }
.tnd-qs .cashier-scene__actor { position: absolute; left: 32px; top: calc((var(--tnd-qs-floor) - var(--tnd-qs-cashier)) * 1px); height: calc(var(--tnd-qs-cashier) * 1px); }
/* Su nube: la letra de los títulos de la tienda, gruesa. Es lo primero que se lee. */
.tnd-qs .cashier-speech text { font-family: var(--t-font-display); letter-spacing: -.01em; }
/* Tú: de pie junto a la repisa. */
.tnd-qs__you { position: absolute; display: block; left: 186px; top: calc((var(--tnd-qs-floor) - var(--tnd-qs-person)) * 1px); width: calc(var(--tnd-qs-person) * 24px / 56); height: calc(var(--tnd-qs-person) * 1px); color: var(--tnd-qs-green); }
.tnd-qs__you svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.tnd-qs__you b { position: absolute; left: 50%; top: 100%; margin-top: 2px; transform: translateX(-50%); font-size: var(--t-type-nav); font-weight: 700; line-height: 1.2; }
.tnd-qs [hidden] { display: none; }

/* El detalle del pago: UNA superficie debajo de la escena. Arriba, con qué se paga y cuánto;
   después a dónde se mandó y el tiempo que queda; al final las acciones, que son botones. Es el
   detalle: lo principal lo dice el cajero. Mide lo mismo en una computadora. */
.tnd-paybox { box-sizing: border-box; width: 100%; margin-top: var(--t-space-16); padding: var(--t-space-16); border-radius: var(--t-r-card); background: var(--t-soft); text-align: left; }
.tnd-paybox__row { display: flex; align-items: center; justify-content: space-between; gap: var(--t-space-12); }
.tnd-paybox__logo { display: block; width: auto; height: 24px; }
.tnd-paybox__amount { font-family: var(--t-font-display); font-size: 24px; line-height: 1.1; }
.tnd-paybox__row--meta { margin-top: var(--t-space-8); color: var(--t-muted); font-size: var(--t-type-meta); min-height: 20px; }
.tnd-paybox__row--meta:not(:has(> :not([hidden]))) { display: none; }
.tnd-paybox__clock { margin-left: auto; color: var(--t-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.tnd-paybox__status { margin: var(--t-space-12) 0 0; font-size: var(--t-type-content); }
.tnd-paybox__form { margin-top: var(--t-space-16); }
.tnd-paybox__form .tnd-athpay__phone { margin-bottom: var(--t-space-8); }
.tnd-paybox__form .tnd-athpay__hint { margin: 0; }
.tnd-paybox__actions { display: flex; flex-direction: column; gap: var(--t-space-8); margin-top: var(--t-space-16); }
.tnd-paybox__actions:not(:has(> :not([hidden]))) { display: none; }
.tnd-paybox [hidden] { display: none; }
/* Pagado: el recibo aparece debajo de la misma escena cuando el cajero ya lo entregó. */
.tnd-receipt-slot { width: 100%; text-align: left; animation: tnd-receipt-in 320ms var(--t-ease) both; }
.tnd-receipt-slot[hidden] { display: none; }
.tnd-qs + .tnd-receipt, .tnd-receipt-slot > .tnd-receipt { margin-top: var(--t-space-24); }
@keyframes tnd-receipt-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .tnd-receipt-slot { animation: none; } }
/* El cajero ya se fue: queda la estación, del mismo tamaño. Nunca se encoge ni se quita. */
.cashier-scene--away .cashier-scene__actor { visibility: hidden; }
.tnd-qs__stage { overflow: hidden; }

/* El diálogo de la tienda (dialog.js): tapa la página entera hasta que el cliente resuelve. Lo
   usan el aviso de pago en curso y el de precios que cambiaron. Título, lo que hay que saber y
   las acciones; nada más. */
.tnd-dialog { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; background: var(--t-overlay); }
.tnd-dialog__box { box-sizing: border-box; display: flex; flex-direction: column; gap: var(--t-space-8); width: 100%; max-width: var(--t-canvas); max-height: 100%; overflow-y: auto; padding: var(--t-space-24) var(--t-gutter) calc(var(--t-space-16) + env(safe-area-inset-bottom)); border-radius: var(--t-r-card) var(--t-r-card) 0 0; background: var(--t-bg); text-align: center; }
.tnd-dialog__icon { display: flex; align-items: center; justify-content: center; align-self: center; width: 56px; height: 56px; border-radius: 50%; background: var(--t-warn-soft); color: var(--t-warn); }
.tnd-dialog__title { margin: 0; font-family: var(--t-font-display); font-size: 22px; line-height: 1.2; }
.tnd-dialog__lead { margin: 0 0 var(--t-space-8); font-size: var(--t-type-content); font-weight: 700; }
.tnd-dialog__text { margin: 0 0 var(--t-space-16); color: var(--t-muted); font-size: var(--t-type-content); }
.tnd-dialog__list { margin: 0 0 var(--t-space-16); padding: var(--t-space-12) var(--t-space-16); list-style: none; border-radius: var(--t-r-ctl); background: var(--t-soft); text-align: left; font-size: var(--t-type-content); }
.tnd-dialog__list li { display: flex; justify-content: space-between; gap: var(--t-space-12); padding: var(--t-space-4) 0; }
.tnd-dialog__list s { color: var(--t-muted); font-weight: 400; margin-right: var(--t-space-8); }
.tnd-dialog__list b { white-space: nowrap; }
.tnd-dialog__list--notes li { display: block; }
.tnd-dialog__box [hidden] { display: none; }
@media (min-width: 520px) { .tnd-dialog { align-items: center; } .tnd-dialog__box { border-radius: var(--t-r-card); } }
/* Una acción que cancela algo: el botón secundario de siempre, con la letra de aviso. */
.tnd-store .tnd-sbtn--danger, .tnd-store .tnd-sbtn--danger:hover, .tnd-store .tnd-sbtn--danger:visited { color: var(--t-danger); }
.tnd-sbtn:focus-visible { outline: 2px solid var(--t-brand); outline-offset: 2px; }
.tnd-sbtn:active:not([disabled]) { opacity: .8; }

/* Aviso corto al añadir al carrito. */
.tnd-toast { position: fixed; left: 50%; top: calc(78px + env(safe-area-inset-top)); z-index: 100; transform: translate(-50%, -8px); padding: 10px 18px; border-radius: var(--t-r-pill); background: var(--t-ok-soft); color: var(--t-ok); box-shadow: var(--t-float-shadow); font-size: 15px; font-weight: 700; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.tnd-no-top .tnd-toast { top: calc(14px + env(safe-area-inset-top)); }
.tnd-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .tnd-toast { transition: none; } }

/* ---------------------------------------------------------------- pedido recibido */
.tnd-thanks { padding-top: 24px; }
.tnd-thanks__check { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--t-ok-soft); color: var(--t-ok); margin-bottom: 16px; }
.tnd-thanks__check .tnd-i { stroke-width: 2.4; }
.tnd-thanks__title { font-size: var(--t-size-title); line-height: 1.1; margin: 0 0 8px; }
.tnd-thanks__lead { color: var(--t-muted); font-size: 16px; margin: 0 0 24px; }
.tnd-delivery-box, .tnd-summary { background: var(--t-soft); border-radius: var(--t-r-card); padding: 16px; margin: 0 0 var(--t-gap-card); }
.tnd-delivery-box h2, .tnd-summary h2 { font-family: var(--t-font); font-size: var(--t-size-group); font-weight: 700; margin: 0 0 8px; }
.tnd-delivery-box p { margin: 0 0 4px; font-size: 15px; }
.tnd-store a.tnd-map-btn, .tnd-store a.tnd-map-btn:hover { display: inline-flex; align-items: center; min-height: var(--t-touch); margin-top: 8px; padding: 0 18px; background: var(--t-bg); color: var(--t-ink); border: var(--t-border); border-radius: var(--t-r-pill); font-size: 15px; font-weight: 700; opacity: 1; }
.tnd-summary__row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: var(--t-border); font-size: 15px; }
.tnd-summary__row > div { min-width: 0; }
.tnd-summary__row b { font-weight: 600; }
.tnd-summary__row small { display: block; color: var(--t-muted); font-size: var(--t-size-small); margin-top: 2px; }
.tnd-summary__row small p { margin: 0; }
.tnd-summary__row span { flex-shrink: 0; font-weight: 600; }
.tnd-summary__total { border-bottom: 0; font-size: 17px; }
.tnd-summary__total b, .tnd-summary__total span { font-weight: 700; }
.tnd-summary__paid { margin: 0; color: var(--t-muted); font-size: var(--t-size-small); }
.tnd-thanks-actions { display: flex; flex-direction: column; gap: var(--t-gap); margin: 24px 0; }

/* ---------------------------------------------------------------- contacto y páginas legales */
.tnd-contact { display: flex; flex-direction: column; gap: 10px; }
.tnd-contact__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--t-gap); }
.tnd-contact h2 { font-size: 20px; margin: 22px 0 0; }
.tnd-contact p { margin: 0; color: var(--t-muted); font-size: 16px; }
.tnd-contact__place { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.tnd-contact__place svg { color: var(--t-muted); margin-top: 2px; flex-shrink: 0; }
.tnd-contact__place span { display: block; color: var(--t-muted); font-size: var(--t-size-small); margin-top: 2px; }
.tnd-contact__loc { margin-top: 14px; }
.tnd-contact__legal { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px !important; font-size: var(--t-size-small) !important; }
.tnd-store .tnd-contact__legal a { color: var(--t-muted); }
.tnd-legal h2 { font-size: 18px; margin: 24px 0 8px; }
.tnd-legal p, .tnd-legal li { font-size: 15px; color: var(--t-ink); }
.tnd-legal__meta { color: var(--t-muted); font-size: var(--t-size-small); margin-top: 24px; }

/* ---------------------------------------------------------------- producto */
.tnd-gallery { margin: 0 calc(var(--t-gutter) * -1) 18px; }
.tnd-gallery__main { aspect-ratio: 1 / 1; background: var(--t-soft); color: var(--t-muted); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tnd-gallery__main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tnd-gallery__thumbs { display: flex; gap: var(--t-gap); padding: 8px var(--t-gutter) 0; overflow-x: auto; }
.tnd-gallery__thumbs button { flex: 0 0 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: var(--t-r-thumb); background: var(--t-soft); overflow: hidden; cursor: pointer; opacity: .6; }
.tnd-gallery__thumbs button.is-on { border-color: var(--t-brand); opacity: 1; }
.tnd-gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tnd-product__title { font-size: 28px; line-height: 1.1; margin: 0 0 8px; }
.tnd-product__price { font-size: 20px; font-weight: 700; margin: 0 0 12px; }
.tnd-product__state { font-size: var(--t-size-small); font-weight: 700; color: var(--t-danger); margin: 0 0 12px; }
.tnd-product__desc { color: var(--t-muted); font-size: 16px; margin: 0 0 20px; }
.tnd-product__desc p { margin: 0 0 8px; }
.tnd-product form.cart { margin: 0; }
.tnd-has-buybar .tnd-wrap { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }

/* Preguntas y variantes del producto: chips de borde sutil, la escogida en azul suave. */
.tnd-opts { margin: 0 0 8px; width: 100%; font-family: var(--t-font); }
.tnd-opts .tnd-opt { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; background: none; }
.tnd-opt legend { font-size: var(--t-size-group); font-weight: 700; color: var(--t-ink); margin: 0 0 10px; padding: 0; }
.tnd-opt__req { color: var(--t-danger); }
.tnd-opt__hint { font-weight: 400; color: var(--t-muted); font-size: var(--t-size-small); margin: 6px 0 0; }
.tnd-opt__choices { display: flex; flex-wrap: wrap; gap: var(--t-gap); }
.tnd-chip { position: relative; display: inline-flex; cursor: pointer; margin: 0; }
.tnd-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.tnd-chip > span { display: inline-flex; align-items: center; gap: 6px; min-height: var(--t-touch); box-sizing: border-box; border: var(--t-border); border-radius: var(--t-r-pill); padding: 0 16px; background: var(--t-bg); color: var(--t-ink); font-size: 15px; font-weight: 600; }
.tnd-chip input:checked + span { border: 2px solid var(--t-brand); background: var(--t-brand-soft); color: var(--t-brand-ink); font-weight: 700; padding: 0 15px; }
.tnd-chip input:checked + span .tnd-opt__extra { color: var(--t-brand-ink); }
.tnd-chip input:focus-visible + span { outline: 2px solid var(--t-brand); outline-offset: 2px; }
.tnd-chip.is-off > span { opacity: .45; cursor: not-allowed; }
.tnd-opt__extra { color: var(--t-muted); font-size: var(--t-size-small); font-weight: 600; white-space: nowrap; }
.tnd-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; margin: 0; min-height: var(--t-touch); font-size: 15px; }
.tnd-switch input { width: 22px; height: 22px; accent-color: var(--t-brand); margin: 0; }
.tnd-opts .tnd-opt__input { width: 100%; box-sizing: border-box; min-height: 48px; border: var(--t-border); border-radius: var(--t-r-ctl); padding: 10px 14px; background: var(--t-bg); font-size: 16px; color: var(--t-ink); font-family: inherit; }
.tnd-opts .tnd-opt__input:focus { outline: 2px solid var(--t-brand); outline-offset: -1px; border-color: transparent; }
.tnd-opt__num { max-width: 120px; margin-right: 8px; }
/* Variantes (talla, color…) como chips: botones en vez de radios. */
button.tnd-chip { border: 0; padding: 0; background: none; font-family: inherit; }
.tnd-chip[aria-checked="true"] > span { border: 2px solid var(--t-brand); background: var(--t-brand-soft); color: var(--t-brand-ink); font-weight: 700; padding: 0 15px; }
.tnd-chip:focus-visible > span { outline: 2px solid var(--t-brand); outline-offset: 2px; }
.tnd-chip.is-off > span { text-decoration: line-through; }

/* El dueño, viendo su propia tienda: un botón para volver a su panel. */

/* ---------------------------------------------------------------- pago con ATH Móvil
   Todo sale de tokens.css (DESIGN.md):
   sin tarjeta con sombra, el logo de ATH Móvil solo identifica el método, el botón es el de la marca. */
.tnd-athpay {
	font-family: var(--t-font);
	color: var(--t-ink);
}
.tnd-athpay label {
	display: block;
	font-size: var(--t-size-small);
	font-weight: 600;
	color: var(--t-muted);
	margin-bottom: 6px;
}
.tnd-athpay__phone {
	display: flex;
	align-items: stretch;
	min-height: var(--t-btn-h);
	border: var(--t-border);
	border-radius: var(--t-r-ctl);
	background: var(--t-bg);
	overflow: hidden;
	margin-bottom: 12px;
}
.tnd-athpay__phone:focus-within {
	outline: 2px solid var(--t-brand);
	outline-offset: -1px;
	border-color: transparent;
}
.tnd-athpay__phone span {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0 12px;
	background: var(--t-soft);
	border-right: var(--t-border);
	font-size: var(--t-size-body);
	white-space: nowrap;
}
.tnd-athpay .tnd-athpay__phone input {
	flex: 1;
	min-width: 0;
	border: 0;
	box-shadow: none;
	background: transparent;
	padding: 0 14px;
	font-size: 17px;
	font-family: inherit;
	color: var(--t-ink);
}
.tnd-athpay .tnd-athpay__phone input:focus {
	outline: none;
	background: transparent;
}
.tnd-athpay__hint {
	font-size: var(--t-size-small);
	color: var(--t-muted);
	line-height: 1.5;
	margin: 12px 0 0;
}
.tnd-athpay__hint--error,
.tnd-athpay__feedback,
.tnd-athpay__notice {
	color: var(--t-danger);
}
.tnd-athpay__feedback,
.tnd-athpay__notice {
	font-size: var(--t-size-small);
	line-height: 1.45;
	margin: 12px 0 0;
}
.tnd-athpay__feedback--field {
	margin: -4px 0 12px;
}
.tnd-athpay__state-text {
	text-align: center;
	margin: 12px 0 24px;
}
.tnd-athpay [hidden] {
	display: none;
}
.tnd-athpay--error {
	max-width: 460px;
	margin: 32px auto;
	text-align: center;
	color: var(--t-muted);
}

/* ===== El recibo, para llevárselo: descargar y compartir, y dónde quedó guardado ===== */
.tnd-keep { margin: 0 0 var(--t-gap-card); }
.tnd-keep__actions { display: flex; gap: var(--t-gap); }
.tnd-keep__actions .tnd-sbtn { flex: 1; padding: 0 var(--t-space-12); }
.tnd-keep__note { margin: var(--t-space-8) 0 0; color: var(--t-muted); font-size: var(--t-size-small); }
.tnd-keep__note:empty { display: none; }
.tnd-keep__notice { margin: 0 0 var(--t-space-16); padding: var(--t-space-12) var(--t-space-16); border-radius: var(--t-r-ctl); background: var(--t-soft); font-size: var(--t-type-note); }
.tnd-keep__pre { white-space: pre-line; }

/* ===== "Recibos": lo pagado desde este navegador, en filas con una línea entre ellas ===== */
.tnd-receipts__list { list-style: none; margin: var(--t-space-8) 0 0; padding: 0; }
.tnd-receipts__list li { border-bottom: var(--t-border); }
.tnd-store .tnd-receipts__row { display: flex; justify-content: space-between; align-items: center; gap: var(--t-space-12); min-height: 56px; padding: var(--t-space-12) 0; color: var(--t-ink); text-decoration: none; }
.tnd-receipts__row[aria-busy="true"] { opacity: .6; }
.tnd-receipts__row > div { min-width: 0; }
.tnd-receipts__row b { display: block; font-weight: 600; }
.tnd-receipts__row small { display: block; color: var(--t-muted); font-size: var(--t-size-small); }
.tnd-receipts__row span { flex-shrink: 0; font-weight: 600; }
.tnd-receipts__why { margin: 0 0 var(--t-space-12); color: var(--t-muted); font-size: var(--t-size-small); }
/* Un nombre largo y sin espacios se parte en vez de montarse sobre el importe. */
.tnd-summary__row > div, .tnd-receipts__row > div, .tnd-delivery-box p { overflow-wrap: anywhere; }
