/* Tienda pública /shop y ficha /shop/p/<producto> — lote tienda-inventario-20261203.
   Solo variables de tokens.css (sirve igual en claro y oscuro). Móvil primero.
   Movimiento mínimo; los botones de comprar y WhatsApp nunca se mueven ni se tapan
   (DISENO_MAESTRO). Prefijo tda- para no chocar con nada del sitio. */

.tda-store main section { padding-block: 0; }
.tda-main { padding-top: 96px; padding-bottom: 96px; min-height: 70vh; }
.tda-ico { width: 20px; height: 20px; flex: none; }
.tda-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tda-store .tda-main :is(h1, h2, h3) { letter-spacing: -.03em; }

/* Migas */
.tda-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); margin: 0 0 22px; }
.tda-crumbs a { color: var(--body-c); text-decoration: none; }
.tda-crumbs a:hover { color: var(--red-ink); text-decoration: underline; }

/* Cabecera */
.tda-hero { display: grid; gap: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.tda-kicker { color: var(--red-ink); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 12px; }
.tda-store .tda-hero h1 { font-size: clamp(34px, 6vw, 64px); line-height: 1.02; margin: 0 0 14px; color: var(--text); font-weight: 700; }
.tda-lead { font-size: 17px; line-height: 1.55; color: var(--body-c); margin: 0; max-width: 56ch; }
.tda-lead b { color: var(--text); }
.tda-pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: paso; }
.tda-pasos li { display: flex; gap: 14px; align-items: center; padding: 13px 16px; border: 1px solid var(--line);
  border-radius: 16px; background: var(--card); }
.tda-pasos .tda-ico { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--red-soft); color: var(--red-ink); }
.tda-pasos strong { display: block; color: var(--text); font-size: 15px; }
.tda-pasos span { font-size: 13.5px; color: var(--body-c); }
/* Celular: los 3 pasos en una fila compacta que se desliza, para llegar antes a los productos. */
@media (max-width: 899px) {
  .tda-store .tda-hero h1 { font-size: clamp(30px, 9vw, 40px); }
  .tda-lead { font-size: 16px; }
  .tda-pasos { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; gap: 8px; }
  .tda-pasos::-webkit-scrollbar { display: none; }
  .tda-pasos li { flex: none; padding: 9px 13px 9px 9px; gap: 9px; border-radius: 999px; }
  .tda-pasos li > div > span { display: none; }
  .tda-pasos strong { font-size: 13px; white-space: nowrap; }
  .tda-pasos .tda-ico { width: 28px; height: 28px; padding: 6px; border-radius: 50%; }
  .tda-hero { gap: 18px; padding-bottom: 20px; }
}
@media (min-width: 900px) {
  .tda-hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: end; gap: 48px; padding-bottom: 36px; }
}

/* Barra: buscar + filtros + carrito */
.tda-barra { position: sticky; top: 64px; z-index: 30; margin: 0 -16px; padding: 12px 16px;
  background: var(--header-bg-scroll); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line); }
.tda-barra-fila { display: flex; gap: 10px; align-items: center; }
.tda-buscar { position: relative; flex: 1 1 auto; min-width: 0; }
.tda-buscar .tda-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.tda-buscar input { width: 100%; min-height: 46px; padding: 10px 14px 10px 44px; font: inherit; font-size: 16px;
  color: var(--input-text); background: var(--input-bg); border: 1px solid var(--input-line); border-radius: 999px; }
.tda-buscar input::placeholder { color: var(--input-ph); }
.tda-store :is(input, select):focus-visible { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 4px var(--input-focus-ring); }
.tda-carrito { position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px;
  border-radius: 999px; background: var(--text); color: var(--bg); text-decoration: none; font-weight: 600; font-size: 14px; }
.tda-carrito:hover { background: var(--red); color: var(--text-on-accent); }
.tda-badge { display: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red);
  color: var(--text-on-accent); font-size: 11.5px; font-weight: 800; align-items: center; justify-content: center; }
.tda-badge.on { display: inline-flex; }
.tda-carrito:hover .tda-badge { background: var(--bg); color: var(--red-ink); }
.tda-carrito-txt { display: none; }
@media (min-width: 640px) { .tda-carrito-txt { display: inline; } }

.tda-filtros { margin-top: 10px; }
.tda-filtros > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 40px;
  padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; color: var(--text); background: var(--card); }
.tda-filtros > summary::-webkit-details-marker { display: none; }
.tda-filtros > summary b { background: var(--red); color: var(--text-on-accent); border-radius: 10px; font-size: 11px; padding: 1px 7px; }
.tda-filtros-cuerpo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; }
.tda-campo { display: grid; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.tda-campo select, .tda-campo input { width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; font-size: 15px; font-weight: 400;
  color: var(--input-text); background: var(--input-bg); border: 1px solid var(--input-line); border-radius: 12px; }
.tda-campo-precio { grid-column: 1 / -1; }
.tda-precio-par { display: flex; gap: 8px; align-items: center; }
.tda-precio-par span { color: var(--muted); }
.tda-aplicar { grid-column: 1 / -1; }
.tda-aplicar button { width: 100%; }
@media (min-width: 900px) {
  .tda-js .tda-filtros > summary { display: none; }
  .tda-filtros-cuerpo { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr) minmax(0, 1fr); padding-top: 12px; align-items: end; }
  .tda-campo-precio { grid-column: auto; }
  .tda-aplicar { grid-column: auto; }
  .tda-js .tda-aplicar { display: none; }
  .tda-js .tda-filtros-cuerpo { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr); }
}
.tda-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 22px;
  border-radius: 999px; border: 1px solid var(--red); background: var(--red); color: var(--text-on-accent);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; }
.tda-btn:hover { background: var(--red-ink); border-color: var(--red-ink); }
.tda-btn:disabled { opacity: .5; cursor: not-allowed; }
.tda-btn-sec { background: transparent; color: var(--text); border-color: var(--line-2); }
.tda-btn-sec:hover { background: var(--card-2); color: var(--red-ink); border-color: var(--red-edge); }
.tda-btn-wa { background: var(--wa); border-color: var(--wa); color: var(--text-on-accent); }
.tda-btn-wa:hover { background: var(--wa-dark); border-color: var(--wa-dark); }

/* Categorías */
.tda-cats { display: flex; gap: 8px; overflow-x: auto; padding: 18px 0 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.tda-cats::-webkit-scrollbar { display: none; }
.tda-chip { flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text); background: var(--card); font-size: 14px; text-decoration: none; white-space: nowrap; }
.tda-chip b { font-weight: 600; color: var(--muted); font-size: 12px; }
.tda-chip:hover { border-color: var(--red-edge); background: var(--red-soft); }
.tda-chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.tda-chip.on b { color: inherit; opacity: .7; }

.tda-activos { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 0; }
.tda-quitar { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--red-soft);
  color: var(--red-ink); font-size: 13px; text-decoration: none; border: 1px solid var(--red-edge); }
.tda-quitar svg { width: 12px; height: 12px; }
.tda-conteo { font-size: 13px; color: var(--muted); margin: 12px 0 18px; }

/* Cuadrícula de productos */
.tda-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 720px) { .tda-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1100px) { .tda-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }

.tda-card { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 22px; background: var(--card);
  border: 1px solid var(--line); overflow: hidden; transition: border-color .2s ease, box-shadow .25s ease; }
.tda-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
.tda-foto { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--surface-sunk, var(--card-2)); overflow: hidden; }
.tda-foto img { width: 100%; height: 100%; object-fit: contain; padding: 8%; transition: transform .45s ease; }
/* Las fotos del proveedor vienen con fondo blanco: en tema claro se funden con el
   fondo gris de la tarjeta (solo fotos de producto; el logo nunca lleva esto). */
html:not([data-theme="dark"]) .tda-foto img, html:not([data-theme="dark"]) .tda-visor img { mix-blend-mode: multiply; }
@media (hover: hover) { .tda-card:hover .tda-foto img { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .tda-foto img, .tda-card { transition: none; } .tda-card:hover .tda-foto img { transform: none; } }
.tda-sinfoto { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; padding: 14%;
  color: var(--muted); text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, var(--red-soft) 0%, transparent 60%), var(--card-2); }
.tda-sinfoto svg { width: 38%; max-width: 92px; height: auto; color: var(--red-ink); opacity: .85; }
.tda-sinfoto span { font-size: 12.5px; font-weight: 600; color: var(--body-c); line-height: 1.3; }
.tda-etq { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; z-index: 2; }
.tda-etq span { padding: 4px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.3; }
.tda-etq .oferta { background: var(--red); color: var(--text-on-accent); }
.tda-etq .pocas { background: var(--card); color: var(--text); border: 1px solid var(--line-2); }
.tda-etq .agotado { background: var(--text); color: var(--bg); }

.tda-info { display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 16px; flex: 1; }
.tda-cat { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tda-store .tda-nombre { font-size: 14.5px; line-height: 1.35; font-weight: 600; margin: 0; color: var(--text); letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tda-nombre a { color: inherit; text-decoration: none; }
.tda-nombre a::after { content: ""; position: absolute; inset: 0; z-index: 1; }   /* toda la tarjeta abre la ficha */
.tda-precio { margin: auto 0 0; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.tda-precio strong { font-size: 19px; color: var(--text); font-weight: 750; letter-spacing: -.02em; }
.tda-precio.oferta strong { color: var(--red-ink); }
.tda-precio s { font-size: 13px; color: var(--muted); }
.tda-add { position: relative; z-index: 2; margin-top: 8px; min-height: 42px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tda-add:hover { background: var(--red); border-color: var(--red); color: var(--text-on-accent); }
.tda-add.ok { background: var(--ok); border-color: var(--ok); color: var(--text-on-accent); }
.tda-add svg { width: 16px; height: 16px; }
@media (min-width: 720px) { .tda-info { padding: 16px 18px 18px; } .tda-store .tda-nombre { font-size: 15.5px; } }

.tda-vacio { text-align: center; padding: 70px 20px; border: 1px dashed var(--line-2); border-radius: 22px; color: var(--body-c); }
.tda-vacio h2 { font-size: 22px; margin: 10px 0 8px; color: var(--text); }
.tda-vacio .tda-ico { width: 44px; height: 44px; color: var(--muted); }

/* Aviso y carrito flotante (celular) */
.tda-toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%) translateY(10px); z-index: 80; padding: 12px 18px;
  border-radius: 14px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; display: flex; gap: 12px; align-items: center; }
.tda-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.tda-toast a { color: inherit; text-decoration: underline; }

/* Ficha de producto */
.tda-ficha { display: grid; gap: 28px; }
@media (min-width: 900px) { .tda-ficha { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: start; } }
.tda-galeria { position: relative; }
@media (min-width: 900px) { .tda-galeria { position: sticky; top: 88px; } }
.tda-visor { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 28px; overflow: hidden; border: 1px solid var(--line);
  background: var(--card-2); cursor: zoom-in; padding: 0; }
.tda-visor img { width: 100%; height: 100%; object-fit: contain; padding: 7%; }
.tda-visor .tda-sinfoto { border-radius: inherit; cursor: default; }
.tda-visor .tda-lupa { position: absolute; right: 14px; bottom: 14px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); color: var(--text); border: 1px solid var(--line-2); }
.tda-visor .tda-lupa svg { width: 18px; height: 18px; }
.tda-minis { display: flex; gap: 10px; margin-top: 12px; }
.tda-minis button { width: 72px; height: 72px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); padding: 4px; cursor: pointer; }
.tda-minis button[aria-current="true"] { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.tda-minis img { width: 100%; height: 100%; object-fit: contain; }

.tda-datos { display: grid; gap: 18px; }
.tda-store .tda-datos h1 { font-size: clamp(26px, 3.6vw, 40px); line-height: 1.1; margin: 0; color: var(--text); font-weight: 700; }
.tda-precio-grande { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.tda-precio-grande strong { font-size: clamp(30px, 4vw, 40px); font-weight: 750; letter-spacing: -.03em; color: var(--text); }
.tda-precio-grande.oferta strong { color: var(--red-ink); }
.tda-precio-grande s { color: var(--muted); font-size: 17px; }
.tda-ahorro { font-size: 13px; font-weight: 700; color: var(--red-ink); background: var(--red-soft); padding: 4px 10px; border-radius: 999px; }
.tda-estado { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14.5px; color: var(--body-c); margin: 0; }
.tda-punto { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.tda-punto::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.tda-punto.no::before { background: var(--muted); box-shadow: none; }
.tda-punto.pocas::before { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.tda-compat { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; font-size: 14px; color: var(--body-c); }
.tda-compat span { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text); background: var(--card); font-size: 13px; }
.tda-compra { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.tda-cant { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; min-height: 50px; overflow: hidden; background: var(--card); }
.tda-cant button { width: 44px; height: 48px; border: 0; background: transparent; color: var(--text); font-size: 20px; cursor: pointer; }
.tda-cant button:hover { color: var(--red-ink); }
.tda-cant input { width: 42px; border: 0; background: transparent; text-align: center; font: inherit; font-size: 16px; font-weight: 700; color: var(--text);
  -moz-appearance: textfield; }
.tda-cant input::-webkit-inner-spin-button, .tda-cant input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tda-compra .tda-btn { min-height: 50px; }
.tda-compra .tda-btn-wa, .tda-compra .tda-ver { grid-column: 1 / -1; }
.tda-caja { border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; background: var(--card); }
.tda-store .tda-caja h2 { font-size: 15px; margin: 0 0 12px; color: var(--text); letter-spacing: 0; font-weight: 700; }
.tda-caja ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: p; }
.tda-caja ol li { counter-increment: p; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 14px; color: var(--body-c); line-height: 1.45; }
.tda-caja ol li::before { content: counter(p); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--red-soft); color: var(--red-ink); font-weight: 700; font-size: 12.5px; }
.tda-caja dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.tda-caja dt { color: var(--muted); }
.tda-caja dd { margin: 0; color: var(--text); }
.tda-desc { font-size: 15px; line-height: 1.65; color: var(--body-c); white-space: pre-line; margin: 0; }

.tda-rel { margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--line); }
.tda-store .tda-rel h2 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 22px; color: var(--text); }

/* Barra fija de compra en el celular (ficha) */
.tda-fija { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--header-bg-scroll); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line); transform: translateY(110%); transition: transform .25s ease; }
.tda-fija.on { transform: none; }
.tda-fija strong { font-size: 18px; color: var(--text); }
.tda-fija small { display: block; font-size: 12px; color: var(--muted); max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 900px) { .tda-fija { display: none; } }
.tda-ficha-pagina .wa-float { bottom: 84px !important; }
@media (min-width: 900px) { .tda-ficha-pagina .wa-float { bottom: 1.2rem !important; } }

/* Visor a pantalla completa (tocar para ampliar) */
.tda-lightbox { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: none; }
.tda-lightbox.on { display: block; }
.tda-lightbox-lienzo { position: absolute; inset: 0; overflow: auto; display: grid; place-items: center; touch-action: pan-x pan-y pinch-zoom; }
.tda-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; transition: transform .2s ease; }
.tda-lightbox img.zoom { max-width: none; max-height: none; width: 200%; cursor: zoom-out; }
.tda-lightbox-cerrar { position: absolute; top: 16px; right: 16px; z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--card); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.tda-lightbox-cerrar svg { width: 20px; height: 20px; }
