/* TraiBuy Storefront — MÓVIL PRIMERO: los estilos base son los del teléfono
   (la mayoría de los clientes entra por móvil, dicho por Sam) y las media
   queries min-width agregan lo de escritorio, no al revés.

   Colores, espaciado, tipografía, radios, sombras y movimiento vienen de
   tokens.css (que a su vez copia la paleta de appsscript/brand.html — un
   solo archivo de marca, CLAUDE.md). Aquí no se redefine ningún color.

   Objetivos táctiles: 44px mínimo en todo lo que se toca (botones, chips,
   iconos, filas). Inputs a 16px para que iOS no haga zoom al enfocarlos. */

/* Un solo lugar donde [hidden] siempre gana. Ya nos mordió tres veces
   (insignias del carrito, nav y header del panel): cualquier regla con
   `display:` le gana al [hidden] del navegador. */
[hidden] { display: none !important; }

:root { --hdr-h: 65px; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--on-surface-strong); background: var(--surface);
  font-family: var(--font-ui); line-height: 1.5;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
body.tb-locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tb-wordmark { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--on-surface-strong); }
.tb-wordmark span { color: var(--accent); }
/* Logo oficial (imagen, no texto: así el traductor del navegador no lo cambia a "Trai Comprar"). */
.tb-logo { display: inline-flex; align-items: center; line-height: 0; flex-shrink: 0; }
.tb-logo img { height: 28px; width: auto; max-width: none; display: block; }
@media (min-width: 768px) { .tb-logo img { height: 40px; } }
.tb-logo-footer img { height: 48px; margin: 0 auto; }

/* ---- Franja legal (relación TraiBuy / FAMCUS CONSUMITY, S.R.L.) ---- */
.tb-strip {
  background: var(--surface-warm); color: var(--on-surface); font-size: var(--text-xs);
  text-align: center; padding: 6px var(--space-4); border-bottom: 1px solid var(--line);
  text-wrap: balance;
}

/* ---- Header: en móvil NO es pegajoso (el carrito y la búsqueda ya viven en
   la barra inferior, y cada píxel de alto cuenta); en escritorio sí. ---- */
.tb-header {
  position: relative; z-index: 45; /* por encima de la barra de categorías (35): el menú de idioma cae sobre ella */
  background: var(--glass); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.tb-header-inner {
  max-width: 1180px; margin: 0 auto; padding: var(--space-2) var(--space-4) var(--space-3);
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-4);
}
.tb-nav { display: none; }
.tb-header-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
/* Teléfonos (30/09/2026, ícono de Mi cuenta): el encabezado cabe en UNA fila. El carrito ya está en la barra inferior
   (con su contador), así que arriba se oculta; en pantallas de 360 px el globo de idioma queda sin las letras. */
@media (max-width: 480px) {
  .tb-header #cart-btn { display: none; }
  .tb-header-inner { column-gap: 6px; }
}
@media (max-width: 390px) { #lang-code { display: none; } }
.tb-search { order: 3; flex: 1 1 100%; }
.tb-search input {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: var(--radius-full);
  padding: 0 var(--space-4) 0 44px; font-size: 16px; color: var(--on-surface-strong);
  -webkit-appearance: none; appearance: none;
  background: var(--surface-warm) no-repeat 14px center / 20px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8A8A' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}
.tb-search input::placeholder { color: var(--muted); }
.tb-search input:focus { outline: 2px solid var(--accent); outline-offset: 0; background-color: var(--surface-raised); }

.tb-icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: none; background: none; font-size: 19px;
  border-radius: var(--radius-md); color: var(--on-surface-strong);
}
@media (hover: hover) { .tb-icon-btn:hover { background: var(--surface-warm); } }
.tb-badge {
  position: absolute; top: 4px; right: 2px; background: var(--tb-red); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: var(--radius-full); min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ---- Barra de categorías (pegajosa, deslizable — como Store.link) ---- */
.tb-catbar {
  position: sticky; top: 0; z-index: 35; background: var(--glass);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.tb-chips {
  display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none;
  padding: var(--space-2) var(--space-4); overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.tb-chips::-webkit-scrollbar { display: none; }
.tb-chip {
  flex: none; min-height: 40px; padding: 0 var(--space-4); border: 1px solid var(--line);
  background: var(--surface-raised); border-radius: var(--radius-full); white-space: nowrap;
  font-size: var(--text-sm); font-weight: 600; color: var(--on-surface);
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.tb-chip:active { transform: scale(0.97); }
@media (hover: hover) { .tb-chip:hover { border-color: var(--line-strong); color: var(--on-surface-strong); } }
.tb-chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---- Botones ---- */
.tb-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 0 var(--space-6); border-radius: var(--radius-full); border: none;
  font-size: var(--text-base); font-weight: 700; text-align: center;
  transition: transform var(--dur-fast) var(--ease-standard), background var(--dur) var(--ease-standard);
}
.tb-btn:active { transform: scale(0.98); }
.tb-btn:disabled { opacity: 0.6; cursor: default; }
.tb-btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 28px -10px var(--accent); }
@media (hover: hover) { .tb-btn-primary:hover { background: var(--accent-hover); } }
.tb-btn-neutral { background: var(--surface-warm); color: var(--on-surface-strong); border: 1px solid var(--line); }
@media (hover: hover) { .tb-btn-neutral:hover { background: var(--line); } }
/* Botón secundario "fantasma": borde fino, sin relleno (como ALETHY). */
.tb-btn-ghost { background: transparent; color: var(--on-surface-strong); border: 1px solid var(--line-strong); }
@media (hover: hover) { .tb-btn-ghost:hover { border-color: var(--accent); color: var(--accent); } }
.tb-btn-full { width: 100%; }
/* "Conocer la caja" (Healthy Box): en oscuro, tb-btn-neutral casi se funde con el fondo de la sección — ambos
   son gris casi negro (--surface-warm sobre --surface-raised). Se le da el acento ámbar de la propia sección
   (mismo tono que .tb-eyebrow-light) para que se distinga de un vistazo — Sam, 22/09/2026. En claro la tarjeta
   ya es blanca y el botón se ve bien, así que se deja exactamente como estaba. */
.tb-btn-xbox { background: var(--accent-warm-tint); color: var(--accent-warm); border: 1px solid var(--accent-warm); }
@media (hover: hover) { .tb-btn-xbox:hover { background: var(--accent-warm); color: var(--on-accent); } }
html[data-theme="light"] .tb-btn-xbox { background: var(--surface-warm); color: var(--on-surface-strong); border-color: var(--line); }
@media (hover: hover) { html[data-theme="light"] .tb-btn-xbox:hover { background: var(--line); color: var(--on-surface-strong); } }

/* ---- Hero: titular grande y seguro (dos tonos, como ALETHY) con un
   resplandor verde detrás. En móvil solo el botón principal — "Hablar con un
   agente" ya vive en la barra inferior — para que los productos asomen en
   la primera pantalla. ---- */
#view-home { position: relative; overflow-x: clip; }
#view-home::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 620px; pointer-events: none;
  background: radial-gradient(70% 60% at 82% 0%, var(--glow), transparent 72%);
}
#view-home > * { position: relative; }
.tb-hero { max-width: 1180px; margin: 0 auto; padding: var(--space-10) var(--space-4) var(--space-6); }
.tb-eyebrow {
  color: var(--accent); font-weight: 700; font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: var(--track-caps); margin: 0;
}
.tb-hero h1 {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 9.6vw, 2.75rem);
  line-height: 1.04; letter-spacing: var(--track-tight); margin: var(--space-3) 0 0; text-wrap: balance;
}
.tb-hero-accent { color: var(--accent); }
.tb-hero-sub { display: block; color: var(--on-surface); font-size: var(--text-base); line-height: 1.55; margin: var(--space-4) 0 0; max-width: 460px; }
.tb-hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.tb-hero-actions .tb-btn-ghost { display: none; }
.tb-hero-collage { display: none; }
.tb-hero-collage img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-xl); background: var(--photo-bg); }
.tb-hero-collage .tb-collage-tall { grid-row: span 2; }
@keyframes tb-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tb-hero .tb-eyebrow, .tb-hero-sub, .tb-hero-actions { animation: tb-rise var(--dur-slow) var(--ease-emphasized) both; }
.tb-hero-sub { animation-delay: 60ms; }
.tb-hero-actions { animation-delay: 120ms; }

/* ---- Barra de confianza: tira deslizable en móvil ---- */
.tb-trustbar {
  display: flex; gap: var(--space-3); overflow-x: auto; scrollbar-width: none;
  padding: var(--space-4); background: transparent;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.tb-trustbar::-webkit-scrollbar { display: none; }
.tb-trust-item { flex: none; min-width: 168px; display: flex; flex-direction: column; gap: 2px; }
.tb-trust-item strong { font-size: var(--text-sm); color: var(--on-surface-strong); }
.tb-trust-item span { font-size: var(--text-xs); color: var(--on-surface); }

/* ---- Filas por categoría ---- */
.tb-collections { max-width: 1180px; margin: 0 auto; padding: var(--space-2) 0 var(--space-6); scroll-margin-top: 64px; }
.tb-collection { padding-top: var(--space-5); }
.tb-collections > .tb-empty { padding: var(--space-10) var(--space-4); }
.tb-rail-more {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1);
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-raised);
  color: var(--accent); font-weight: 700; font-size: var(--text-sm); padding: var(--space-4);
  min-height: 220px; text-align: center;
}
.tb-rail-more .arrow { font-size: var(--text-2xl); line-height: 1; }
.tb-rail-more small { color: var(--muted); font-weight: 500; font-size: var(--text-xs); }

/* ---- Lista (categoría completa / resultados de búsqueda) ---- */
.tb-list { max-width: 1180px; margin: 0 auto; padding: var(--space-2) var(--space-4) var(--space-12); min-height: 60vh; }
.tb-list-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin-bottom: var(--space-4); }
.tb-back {
  min-height: 44px; background: none; border: none; color: var(--accent); font-weight: 700;
  font-size: var(--text-base); padding: 0 var(--space-2) 0 0;
}
.tb-list-head h2 { font-size: var(--text-lg); margin: 0; letter-spacing: -0.02em; flex: 1 1 auto; min-width: 0; }
.tb-list-count { color: var(--muted); font-size: var(--text-sm); }
.tb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.tb-hint { color: var(--muted); font-size: var(--text-sm); margin: 0; }
.tb-hint-pad { padding: var(--space-4) 0; }
.tb-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: var(--space-10) 0; }
.tb-loadmore { text-align: center; margin-top: var(--space-6); }
/* Subtítulos dentro de una categoría: Más comprados · Recomendados · Más productos (Sam, 10/11/2026) */
.tb-grid-head {
  grid-column: 1 / -1; margin: var(--space-4) 0 0; padding-bottom: var(--space-2); font-size: var(--text-base);
  letter-spacing: -0.01em; color: var(--on-surface-strong); border-bottom: 1px solid var(--line);
}
.tb-grid-head:first-child { margin-top: 0; }
.tb-grid-head-0::before { content: "★ "; color: #ffa41c; }
/* Categoría anterior / siguiente, al pie de la lista */
.tb-catnav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.tb-catnav[hidden] { display: none; }
.tb-catnav-btn {
  display: flex; align-items: center; gap: var(--space-3); min-height: 64px; min-width: 0; padding: var(--space-3);
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
  color: var(--on-surface-strong); font-family: var(--font-ui); cursor: pointer; text-align: left;
}
.tb-catnav-next { flex-direction: row-reverse; text-align: right; }
.tb-catnav-arrow {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); font-size: var(--text-xl); line-height: 1; font-weight: 700;
}
.tb-catnav-text { display: flex; flex-direction: column; min-width: 0; }
.tb-catnav-text small { color: var(--muted); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.tb-catnav-text strong { font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-catnav-btn:active { transform: scale(0.98); }
@media (hover: hover) { .tb-catnav-btn:hover { border-color: var(--accent); } }

/* ---- Caja Saludable — minimal, ingrediente primero. Panel elevado con un
   resplandor verde arriba: se distingue del lienzo sin romper el tema. ---- */
.tb-healthybox {
  background: radial-gradient(80% 90% at 50% 0%, var(--glow), transparent 75%), var(--surface-raised);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: var(--space-12) var(--space-4); scroll-margin-top: 64px;
}
.tb-healthybox-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.tb-eyebrow-light { color: var(--accent-warm); }
.tb-healthybox h2 { font-size: var(--text-xl); margin: var(--space-2) 0 var(--space-4); letter-spacing: var(--track-tight); }
.tb-healthybox-copy { color: var(--on-surface); font-size: var(--text-sm); margin: 0 0 var(--space-6); }
.tb-healthybox-list { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
.tb-hb-item { border: 1px solid var(--line-strong); border-radius: var(--radius-full); padding: var(--space-2) var(--space-4); font-size: var(--text-xs); color: var(--on-surface-strong); }

/* ---- Valores: hechos reales, sin testimonios inventados ---- */
.tb-section { max-width: 1180px; margin: 0 auto; padding: var(--space-10) var(--space-4); scroll-margin-top: 64px; }
.tb-section h2 { font-size: var(--text-xl); letter-spacing: var(--track-tight); margin: 0; }
.tb-values h2 { text-align: center; margin-bottom: var(--space-6); }
.tb-values-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
.tb-value-card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); }
.tb-value-card h3 { font-size: var(--text-base); margin: 0 0 var(--space-2); color: var(--on-surface-strong); }
.tb-value-card p { font-size: var(--text-sm); color: var(--on-surface); margin: 0; }
.tb-values-note { text-align: center; color: var(--muted); font-size: var(--text-sm); margin-top: var(--space-6); font-style: italic; }

/* ---- Pie: deja sitio a la barra inferior en móvil ---- */
.tb-footer {
  text-align: center; padding: var(--space-8) var(--space-4) calc(88px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); color: var(--on-surface); font-size: var(--text-sm);
}
.tb-footer p { margin: var(--space-1) 0; }
.tb-footer-link { display: inline-block; margin-top: var(--space-2); color: var(--muted); font-size: var(--text-xs); padding: var(--space-2); }
.tb-footer-track { color: var(--accent); font-size: var(--text-sm); font-weight: 600; }
.tb-footer-chat { background: none; border: none; font-family: inherit; cursor: pointer; color: var(--accent); font-size: var(--text-sm); font-weight: 600; touch-action: manipulation; }

/* Botón flotante del agente: solo escritorio (en móvil es la pestaña "Agente"). */
.tb-chat-fab { display: none; }

/* ---- Fondos oscuros de overlay + drawers (transform, nunca `right`) ---- */
.tb-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.66); z-index: 60;
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) var(--ease-standard), visibility 0s linear var(--dur);
}
.tb-overlay.open { opacity: 1; visibility: visible; transition-delay: 0s; }
.tb-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 100%; z-index: 70;
  background: var(--surface-raised); display: flex; flex-direction: column; border-left: 1px solid var(--line);
  transform: translateX(100%); visibility: hidden;
  transition: transform var(--dur) var(--ease-emphasized), visibility 0s linear var(--dur);
}
.tb-drawer.open { transform: none; visibility: visible; transition-delay: 0s; }
.tb-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5); border-bottom: 1px solid var(--line); min-height: 60px; }
.tb-drawer-head h3 { margin: 0; font-size: var(--text-lg); }
.tb-drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-2) var(--space-5); }
.tb-drawer-foot { padding: var(--space-4) var(--space-5) calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.tb-subtotal { font-size: var(--text-base); margin-bottom: var(--space-3); display: flex; justify-content: space-between; }
.tb-menu-links { display: flex; flex-direction: column; padding-top: 0; }
.tb-menu-links a { display: flex; align-items: center; min-height: 56px; font-size: var(--text-lg); font-weight: 700; color: var(--on-surface-strong); border-bottom: 1px solid var(--line); letter-spacing: var(--track-tight); }
.tb-menu-links a:last-child { border-bottom: none; }

.tb-cart-line { display: flex; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.tb-cart-line img, .tb-cart-line .ph { width: 64px; height: 64px; border-radius: var(--radius-md); object-fit: cover; background: var(--photo-bg); flex: none; }
.tb-cart-line .ph { background: var(--surface-warm); }
.tb-cart-line-info { flex: 1; min-width: 0; }
.tb-cart-line-info .name { font-size: var(--text-sm); font-weight: 600; }
.tb-cart-line-info .unit { font-size: var(--text-xs); color: var(--muted); }
.tb-cart-line-info .price { font-size: var(--text-sm); color: var(--accent); font-weight: 700; }
.tb-cart-line-info .gone { font-size: var(--text-xs); color: var(--danger); font-weight: 600; }
.tb-cart-line.is-gone .name, .tb-cart-line.is-gone img, .tb-cart-line.is-gone .ph { opacity: 0.5; }
.tb-qty-stepper { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.tb-qty-stepper button { border: 1px solid var(--line-strong); background: var(--surface-warm); color: var(--on-surface-strong); border-radius: var(--radius-md); width: 40px; height: 40px; font-size: var(--text-lg); }
.tb-qty-stepper span { min-width: 20px; text-align: center; font-weight: 700; }
.tb-remove-btn { border: none; background: none; color: var(--muted); font-size: var(--text-xs); text-decoration: underline; min-height: 40px; padding: 0 var(--space-2); }
.tb-qty-stepper .tb-remove-btn { width: auto; height: 40px; border: none; background: none; font-size: var(--text-sm); }

/* ---- Modales: hoja inferior en móvil, centrado en escritorio ---- */
.tb-modal {
  position: fixed; z-index: 80; background: var(--surface-raised); overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--line);
  left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 92vh; max-height: 92dvh;
  border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(100%); visibility: hidden;
  transition: transform var(--dur-slow) var(--ease-emphasized), visibility 0s linear var(--dur-slow);
}
.tb-modal.open { transform: translateY(0); visibility: visible; transition-delay: 0s; }
.tb-modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 10px auto 0; }
.tb-modal-close { position: sticky; top: 6px; float: right; margin: 6px 8px -52px 0; z-index: 3; background: var(--glass-raised); color: var(--on-surface-strong); }
.tb-modal-body { --pad: var(--space-5); padding: var(--space-4) var(--pad) calc(var(--pad) + env(safe-area-inset-bottom, 0px)); }
.tb-modal-body img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: var(--space-4); background: var(--photo-bg); }
.tb-modal-body h3 { font-size: var(--text-xl); margin: 0 0 var(--space-1); letter-spacing: -0.02em; }
.tb-modal-unit { color: var(--muted); font-size: var(--text-sm); margin: 0 0 var(--space-3); }
.tb-modal-price { font-size: var(--text-2xl); font-weight: 800; color: var(--accent); margin-bottom: var(--space-4); }

.tb-form-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); margin: var(--space-4) 0; }
.tb-form-grid label { font-size: var(--text-sm); font-weight: 600; display: flex; flex-direction: column; gap: var(--space-1); }
.tb-form-grid input, .tb-form-grid select {
  height: 48px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0 var(--space-3);
  font-size: 16px; font-weight: 400; width: 100%; min-width: 0; max-width: 100%; background: var(--surface-warm);
  color: var(--on-surface-strong);
}
.tb-form-grid input::placeholder, .tb-track-form input::placeholder { color: var(--muted); }
/* Los nombres de barrio de las zonas son largos: sin esto el <select> se
   ensancha a su opción más larga y desborda el modal. */
.tb-form-grid select { text-overflow: ellipsis; }
.tb-form-full { grid-column: 1 / -1; }
.tb-msg { font-size: var(--text-sm); margin-bottom: var(--space-2); min-height: 18px; }
.tb-msg.error { color: var(--danger); }
.tb-msg.ok { color: var(--accent); }
/* El botón de confirmar nunca queda escondido bajo el teclado ni al fondo
   de un formulario largo: pegajoso abajo dentro de la hoja. */
.tb-checkout-cta {
  position: sticky; bottom: 0; background: var(--surface-raised); border-top: 1px solid var(--line);
  margin: var(--space-4) calc(-1 * var(--pad, var(--space-5))) calc(-1 * var(--pad, var(--space-5)));
  padding: var(--space-3) var(--pad, var(--space-5)) calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
}
.tb-modal-confirm .tb-modal-body { text-align: center; padding-top: var(--space-8); }
.tb-modal-confirm h3 { font-size: var(--text-xl); margin: var(--space-3) 0 var(--space-2); }

/* Selector de idioma (ES/EN/FR/HT): solo checkout y rastreador. */
.tb-lang-switch { display: flex; gap: var(--space-1); }
.tb-lang-btn { border: 1px solid var(--line); background: var(--surface-warm); color: var(--on-surface); border-radius: var(--radius-sm); min-height: 36px; padding: 0 var(--space-3); font-size: var(--text-xs); font-weight: 700; }
.tb-lang-btn.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Método de pago */
.tb-payment-methods { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-1) 0 var(--space-2); }
.tb-payment-option { display: flex; align-items: center; gap: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0 var(--space-4); min-height: 52px; cursor: pointer; font-size: var(--text-base); }
.tb-payment-option input { width: 20px; height: 20px; accent-color: var(--accent); }
.tb-payment-option.selected { border-color: var(--accent); background: var(--accent-tint); }

/* Rastreador de pedidos (track.html) */
.tb-track-form { display: flex; flex-direction: column; gap: var(--space-3); margin: var(--space-5) 0; }
.tb-track-form label { font-size: var(--text-sm); font-weight: 600; display: flex; flex-direction: column; gap: var(--space-1); }
.tb-track-form input { height: 48px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0 var(--space-3); font-size: 16px; font-weight: 400; background: var(--surface-warm); color: var(--on-surface-strong); }
.tb-track-result { margin-top: var(--space-6); }
.tb-track-placed { color: var(--muted); font-size: var(--text-sm); margin: 0 0 var(--space-4); }

/* Línea con íconos (Sam, 22/09/2026: antes eran solo puntos) — cada paso es un ícono en un círculo,
   conectado al siguiente por una barra vertical que se pinta de acento cuando ese paso ya pasó. */
.tb-track-timeline { display: flex; flex-direction: column; margin-bottom: var(--space-5); }
.tb-track-step { position: relative; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; color: var(--muted); font-size: var(--text-base); font-weight: 600; }
.tb-track-step:not(:last-child)::before {
  content: ""; position: absolute; left: 19px; top: 46px; bottom: -6px; width: 2px; background: var(--line);
}
.tb-track-step.done:not(:last-child)::before { background: var(--accent); }
.tb-track-icon {
  position: relative; z-index: 1; flex: none; width: 40px; height: 40px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center; background: var(--surface-warm);
  border: 2px solid var(--line); color: var(--muted); box-sizing: border-box;
  transition: background var(--dur) var(--ease-standard), border-color var(--dur) var(--ease-standard), color var(--dur) var(--ease-standard);
}
.tb-track-step.done .tb-track-icon { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
.tb-track-step.current .tb-track-icon { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.tb-track-step.done, .tb-track-step.current { color: var(--on-surface-strong); }
.tb-track-cancelled { color: var(--danger); font-weight: 700; font-size: var(--text-lg); }

/* Mensaje que rota mientras espera — honesto, ligado al estado real (i18n.js::TRACK_MESSAGES). */
.tb-track-rotating { color: var(--on-surface); font-size: var(--text-sm); font-style: italic; margin: 0 0 var(--space-5); transition: opacity 220ms var(--ease-standard); min-height: 1.4em; }

/* Mapa en vivo — solo mientras OUT_FOR_DELIVERY y el repartidor ya reportó una posición real. */
.tb-track-live { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); margin-bottom: var(--space-5); }
.tb-track-live-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.tb-track-live-head h3 { margin: 0; font-size: var(--text-base); }
.tb-track-updated { color: var(--muted); font-size: var(--text-xs); }
.tb-track-map { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); }
.tb-track-map #tr-map { height: 260px; width: 100%; background: var(--surface-warm); }
.tb-track-map-empty { color: var(--muted); font-size: var(--text-sm); margin: 0; text-align: center; padding: var(--space-4) 0; }
.tb-track-marker { background: none; border: none; }
.tb-track-marker-dot {
  display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-full);
  background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 14px -4px rgba(0,0,0,0.5), 0 0 0 4px var(--accent-tint);
}

.tb-track-details { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); font-size: var(--text-sm); line-height: 1.8; margin-bottom: var(--space-5); }
.tb-track-details p { margin: 0; }

/* Promos internas mientras espera — reales (Healthy Box, Reto Verde, referidos), nunca inventadas ni externas. */
.tb-track-promos { display: flex; flex-direction: column; gap: var(--space-3); }
.tb-track-promo {
  display: flex; flex-direction: column; gap: 4px; background: var(--surface-raised); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--space-4); transition: border-color var(--dur) var(--ease-standard);
}
@media (hover: hover) { .tb-track-promo:hover { border-color: var(--accent); } }
.tb-track-promo-eyebrow { color: var(--accent-warm); font-weight: 700; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--track-caps); }
.tb-track-promo-text { color: var(--on-surface); font-size: var(--text-sm); }
.tb-track-promo-link { color: var(--accent); font-weight: 700; font-size: var(--text-sm); margin-top: 2px; }
@media (min-width: 641px) { .tb-track-promos { flex-direction: row; } .tb-track-promo { flex: 1; } }

/* ======================= TABLET ======================= */
@media (min-width: 600px) {
  .tb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
  .tb-drawer { width: 420px; box-shadow: -12px 0 40px rgba(0,0,0,0.5); }
  .tb-hero-actions .tb-btn-ghost { display: inline-flex; }
  .tb-values-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Modales centrados a partir de tablet (en teléfono son hoja inferior). */
@media (min-width: 641px) {
  .tb-modal {
    left: 50%; right: auto; top: 50%; bottom: auto; width: 92vw; max-width: 560px; max-height: 88vh;
    border-radius: var(--radius-xl); opacity: 0; transform: translate(-50%, -46%) scale(0.97);
    transition: transform var(--dur) var(--ease-emphasized), opacity var(--dur) var(--ease-standard), visibility 0s linear var(--dur);
  }
  .tb-modal.open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  .tb-modal::before { display: none; }
  .tb-modal-body { --pad: 28px; padding-top: var(--space-6); }
  .tb-modal-body img { aspect-ratio: 1 / 1; }
  .tb-form-grid { grid-template-columns: 1fr 1fr; }
}

/* ======================= ESCRITORIO ======================= */
@media (min-width: 861px) {
  .tb-header { position: sticky; top: 0; z-index: 45; }
  .tb-header-inner { flex-wrap: nowrap; height: 64px; padding: 0 var(--space-6); gap: var(--space-6); }
  .tb-nav { display: flex; gap: 22px; flex: 1; }
  .tb-nav a { font-size: var(--text-sm); font-weight: 600; color: var(--on-surface); }
  .tb-nav a:hover { color: var(--accent); }
  .tb-menu-btn { display: none; }  /* en escritorio los mismos enlaces ya están en .tb-nav */
  .tb-search { order: 0; flex: 0 0 260px; }
  .tb-header-actions { margin-left: 0; }
  /* Una sola fila de categorías también en escritorio (como Store.link):
     18 chips en varias filas medían 160px de alto. Se desplaza con la
     rueda del mouse (ver app.js) o con el trackpad. */
  .tb-catbar { top: var(--hdr-h); }
  .tb-chips { padding: var(--space-2) var(--space-6); max-width: 1180px; margin: 0 auto; }
  .tb-collections, .tb-healthybox, .tb-section, .tb-collections, .tb-list { scroll-margin-top: calc(var(--hdr-h) + 64px); }

  .tb-hero { padding: var(--space-16) var(--space-6) var(--space-12); display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--space-12); align-items: center; }
  .tb-hero h1 { font-size: clamp(2.5rem, 5.4vw, 3.75rem); margin: var(--space-3) 0 var(--space-4); }
  .tb-hero-sub { font-size: 18px; margin: 0 0 var(--space-6); max-width: 480px; }
  .tb-hero-actions { margin-top: 0; }
  .tb-hero-collage { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; aspect-ratio: 1 / 1; }

  .tb-trustbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 0; overflow: visible; }
  .tb-trust-item { padding: var(--space-5) var(--space-4); text-align: center; align-items: center; min-width: 0; border-right: 1px solid var(--line); }
  .tb-trust-item:last-child { border-right: none; }

  .tb-list { padding: var(--space-4) var(--space-6) var(--space-16); }
  .tb-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .tb-healthybox { padding: 72px var(--space-6); }
  .tb-healthybox h2 { font-size: 36px; }
  .tb-healthybox-copy { font-size: var(--text-base); }
  .tb-section { padding: 56px var(--space-6); }
  .tb-footer { padding-bottom: var(--space-10); }

  .tb-chat-fab {
    display: inline-flex; align-items: center; gap: var(--space-2); position: fixed; right: var(--space-6); bottom: var(--space-6); z-index: 45;
    min-height: 52px; padding: 0 var(--space-5); border: none; border-radius: var(--radius-full); cursor: pointer;
    background: var(--accent); color: var(--on-accent); font-family: inherit; font-size: var(--text-sm); font-weight: 700; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(63,211,90,0.35);
    transition: transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur) var(--ease-standard);
  }
  .tb-chat-fab:hover { transform: translateY(-2px); }
  .tb-chat-fab:active { transform: scale(0.97); }
  .tb-chat-fab:focus-visible { outline: 3px solid var(--accent-warm); outline-offset: 3px; }
  /* Con el panel abierto, el botón sobra (el panel ocupa su lugar). */
  body.tb-chat-open .tb-chat-fab { display: none; }
}


/* =====================================================================
   FASE 2 — Comprar sin fricción
   ===================================================================== */

/* 2.1 Franja de entrega en vivo */
.tb-delivery {
  margin: var(--space-3) max(var(--space-4), calc((100% - 1180px) / 2 + var(--space-6))); padding: var(--space-4);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4);
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.tb-delivery-main { flex: 1 1 240px; font-size: var(--text-sm); color: var(--on-surface); line-height: 1.4; min-width: 0; }
.tb-delivery-main strong { display: block; color: var(--on-surface-strong); font-size: var(--text-base); letter-spacing: -0.01em; }
.tb-delivery-main .tb-left { color: var(--accent); font-weight: 700; }
.tb-delivery-zone { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; font-size: var(--text-xs); color: var(--muted); font-weight: 600; min-width: 0; }
.tb-delivery-zone select {
  height: 44px; width: 100%; min-width: 0; padding: 0 var(--space-3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-md); background: var(--surface-warm); color: var(--on-surface-strong); font-size: 16px; text-overflow: ellipsis;
}

/* 2.2 Barra de carrito (solo móvil, sobre la barra inferior) */
.tb-cartbar { display: none; }
@media (max-width: 860px) {
  .tb-cartbar {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    position: fixed; left: var(--space-3); right: var(--space-3); z-index: 49;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px) + var(--space-2));
    min-height: 52px; padding: 0 var(--space-5); border: none; border-radius: var(--radius-full);
    background: var(--accent); color: var(--on-accent); font: inherit; font-size: var(--text-sm); font-weight: 700; text-align: left;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(63, 211, 90, 0.35); cursor: pointer; touch-action: manipulation;
    animation: tb-rise var(--dur-slow) var(--ease-emphasized) both;
  }
  .tb-cartbar:active { transform: scale(0.98); }
  .tb-cartbar-go { flex: none; }
  body.tb-has-cartbar .tb-footer { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
}

/* 2.3 Repetir mi último pedido */
.tb-reorder {
  margin: var(--space-4) max(var(--space-4), calc((100% - 1180px) / 2 + var(--space-6))) 0; padding: var(--space-4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.tb-reorder div { min-width: 0; }
.tb-reorder strong { display: block; color: var(--on-surface-strong); font-size: var(--text-base); letter-spacing: -0.01em; }
.tb-reorder span { display: block; color: var(--on-surface); font-size: var(--text-sm); }
.tb-reorder .tb-btn { flex: none; min-height: 44px; padding: 0 var(--space-5); font-size: var(--text-sm); }

/* 2.4 Hoja de producto: cantidad + "Agregar · RD$X" */
.tb-sheet-buy { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.tb-sheet-buy .tb-qty-stepper { margin: 0; flex: none; }
.tb-sheet-buy .tb-btn { flex: 1; min-width: 0; }
.tb-modal { touch-action: pan-y; }

/* 2.5 Checkout en 3 pasos */
.tb-steps { list-style: none; display: flex; gap: var(--space-2); margin: 0 0 var(--space-4); padding: 0; }
.tb-steps li { flex: 1; display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: 600; color: var(--muted); min-width: 0; }
.tb-steps li span {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-strong); font-size: 12px; font-weight: 700;
}
.tb-steps li.on { color: var(--on-surface-strong); }
.tb-steps li.on span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tb-steps li.done { color: var(--on-surface); }
.tb-steps li.done span { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
.tb-field-err { color: var(--danger); font-size: var(--text-xs); font-weight: 500; }
.tb-field-err:empty { display: none; }
.tb-form-grid input[aria-invalid="true"], .tb-form-grid select[aria-invalid="true"] { border-color: var(--danger); }
.tb-summary { background: var(--surface-warm); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); margin-bottom: var(--space-4); font-size: var(--text-sm); }
.tb-summary-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-direction: column; gap: var(--space-2); max-height: 28vh; overflow-y: auto; }
.tb-summary-list li { display: flex; justify-content: space-between; gap: var(--space-3); color: var(--on-surface); }
.tb-summary-list small { color: var(--muted); }
.tb-summary-list b { color: var(--on-surface-strong); flex: none; }
.tb-summary-total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: var(--space-3); font-size: var(--text-base); color: var(--on-surface-strong); }
.tb-summary-ship { margin: var(--space-2) 0 0; color: var(--accent); font-weight: 600; }
.tb-summary-ship:empty { display: none; }
.tb-summary-addr { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--text-xs); }
.tb-cta-row { display: flex; gap: var(--space-3); }
.tb-cta-row .tb-btn { flex: 1; }
.tb-cta-row .tb-btn-neutral { flex: 0 0 104px; }

/* 2.7 Invitación a instalar (solo tras un pedido) */
.tb-install {
  margin-top: var(--space-4); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-warm); text-align: left; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); color: var(--on-surface);
}
.tb-install strong { color: var(--on-surface-strong); }
.tb-install-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.tb-install .tb-btn { min-height: 44px; font-size: var(--text-sm); padding: 0 var(--space-5); }
.tb-link { background: none; border: none; color: var(--muted); text-decoration: underline; min-height: 44px; font-size: var(--text-xs); padding: 0 var(--space-2); }
.tb-build { margin: var(--space-2) 0 0; color: var(--muted); font-size: 11px; opacity: 0.7; }

/* =====================================================================
   Idioma, WhatsApp y Reto Verde
   ===================================================================== */

/* Selector de idioma: esquina superior derecha del encabezado */
.tb-langbox { position: relative; }
.tb-langtoggle {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 var(--space-2); border: none; background: none;
  color: var(--on-surface-strong); font: inherit; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em;
  border-radius: var(--radius-md); cursor: pointer; touch-action: manipulation;
}
@media (hover: hover) { .tb-langtoggle:hover { background: var(--surface-warm); } }
.tb-langmenu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 156px; z-index: 60; padding: var(--space-1);
  background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.tb-langmenu button {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 var(--space-3); border: none; background: none;
  color: var(--on-surface); border-radius: var(--radius-md); font: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer;
}
.tb-langmenu button[aria-checked="true"] { color: var(--accent); font-weight: 700; }
.tb-langmenu button[aria-checked="true"]::after { content: "\2713"; margin-left: auto; }
@media (hover: hover) { .tb-langmenu button:hover { background: var(--surface-warm); } }

/* Botón de WhatsApp (canal principal de la TOS) */
.tb-btn-wa { background: transparent; color: var(--on-surface-strong); border: 1px solid var(--accent); gap: var(--space-2); }
.tb-btn-wa svg { color: var(--accent); flex: none; }
@media (hover: hover) { .tb-btn-wa:hover { background: var(--accent-tint); } }
.tb-step-label { font-weight: inherit; }

/* Reto Verde — empieza el 1 de octubre de 2026 */
.tb-rv {
  padding: var(--space-12) var(--space-4); border-top: 1px solid var(--line); scroll-margin-top: 64px;
  background: radial-gradient(70% 90% at 50% 0%, var(--accent-warm-tint), transparent 75%), var(--surface);
}
.tb-rv-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.tb-rv h2 { font-size: var(--text-xl); letter-spacing: var(--track-tight); margin: var(--space-2) 0 var(--space-4); }
.tb-rv-copy { color: var(--on-surface); font-size: var(--text-sm); margin: 0 0 var(--space-4); }
.tb-rv-when { color: var(--accent-warm); font-weight: 700; margin: 0 0 var(--space-5); }
.tb-rv-more { margin: var(--space-4) 0 0; font-size: var(--text-sm); }
.tb-rv-more a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 861px) { .tb-rv { padding: 72px var(--space-6); } .tb-rv h2 { font-size: 36px; } .tb-rv-copy { font-size: var(--text-base); } }

/* =====================================================================
   Tema claro / oscuro: icono sol-luna en el centro superior del encabezado
   ===================================================================== */
html[data-theme="light"] .tb-overlay { background: rgba(30, 24, 12, 0.45); }
html[data-theme="light"] .tb-chat-fab, html[data-theme="light"] .tb-cartbar { box-shadow: var(--shadow-lg); }
html[data-theme="light"] .tb-btn-primary { box-shadow: 0 8px 24px -12px var(--accent); }

.tb-themebtn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: auto;
  border: 1px solid var(--line); border-radius: var(--radius-full); background: var(--surface-raised); color: var(--on-surface-strong);
  cursor: pointer; touch-action: manipulation; transition: background var(--dur) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}
.tb-themebtn:active { transform: scale(0.94); }
@media (hover: hover) { .tb-themebtn:hover { background: var(--surface-warm); } }
.tb-themebtn svg { display: none; }
html:not([data-theme="light"]) .tb-themebtn .ic-sun { display: block; }   /* en oscuro se muestra el sol: "pasar a claro" */
html[data-theme="light"] .tb-themebtn .ic-moon { display: block; }          /* en claro se muestra la luna: "pasar a oscuro" */
@media (min-width: 1100px) {
  .tb-header-inner { position: relative; }
  .tb-themebtn { position: absolute; left: 50%; top: 50%; margin: 0; transform: translate(-50%, -50%); }
  .tb-themebtn:active { transform: translate(-50%, -50%) scale(0.94); }
}

/* Solo para lectores de pantalla */
.tb-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- La Caja Saludable (#/caja) ---------- */
body[data-view="box"] .tb-catbar, body[data-view="rv"] .tb-catbar, body[data-view="account"] .tb-catbar { display: none; }
.tb-box { padding-bottom: var(--space-12); }
.tb-box-wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--space-4); }
.tb-box-back { display: inline-flex; align-items: center; min-height: 44px; margin-top: var(--space-2); color: var(--muted); font-size: var(--text-sm); }
.tb-box-hero { display: grid; gap: var(--space-6); padding: var(--space-3) 0 var(--space-10); }
.tb-box-media { border-radius: var(--radius-xl); overflow: hidden; background: var(--photo-bg); border: 1px solid var(--line); aspect-ratio: 1 / 1; }
.tb-box-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tb-box-info h1 { font-size: clamp(2.6rem, 10vw, 4.6rem); line-height: 1; letter-spacing: -0.02em; margin: var(--space-2) 0 var(--space-4); text-wrap: balance; }
.tb-box-lede { color: var(--on-surface); line-height: 1.6; margin: 0 0 var(--space-5); max-width: 52ch; }
.tb-box-buy { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface-raised); }
.tb-box-price { display: block; font-size: var(--text-xl); font-weight: 800; color: var(--accent); }
.tb-box-unit { display: block; color: var(--muted); font-size: var(--text-sm); margin-top: 2px; }
.tb-box-note { color: var(--on-surface); font-size: var(--text-sm); margin: var(--space-3) 0 0; }
.tb-box-links { margin: var(--space-4) 0 0; font-size: var(--text-sm); }
.tb-box-links a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.tb-box-sec { padding: var(--space-8) 0; border-top: 1px solid var(--line); }
.tb-box-sec h2 { font-size: clamp(2rem, 7vw, 3rem); line-height: 1.05; margin: var(--space-2) 0 var(--space-5); max-width: 18ch; }
.tb-box-list { list-style: none; margin: 0 0 var(--space-4); padding: 0; border-top: 1px solid var(--line); }
.tb-box-list li { display: grid; grid-template-columns: 44px 1fr; column-gap: var(--space-3); row-gap: 2px; padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.tb-box-list li > span { grid-row: 1 / span 2; color: var(--accent); font-size: var(--text-xs); font-weight: 700; letter-spacing: var(--track-caps); padding-top: 0.7rem; }
.tb-box-list h3 { margin: 0; font-size: 1.5rem; line-height: 1.1; color: var(--on-surface-strong); }
.tb-exp .tb-box-list h3 { font-family: var(--font-serif); font-weight: 400; font-size: 1.8rem; }
.tb-box-list p { margin: 0; color: var(--on-surface); font-size: var(--text-sm); line-height: 1.55; }
.tb-box-fine { color: var(--on-surface); font-size: var(--text-sm); line-height: 1.6; margin: 0 0 var(--space-2); max-width: 60ch; }
.tb-box-fine a { color: var(--accent); }
.tb-box-faq { border-bottom: 1px solid var(--line); }
.tb-box-faq summary { min-height: 52px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--on-surface-strong); list-style: none; }
.tb-box-faq summary::-webkit-details-marker { display: none; }
.tb-box-faq summary::after { content: "+"; margin-left: auto; color: var(--accent); font-size: 22px; }
.tb-box-faq[open] summary::after { content: "\2212"; }
.tb-box-faq p { margin: 0 0 var(--space-4); color: var(--on-surface); font-size: var(--text-sm); line-height: 1.6; max-width: 60ch; }
.tb-box-cta { display: flex; justify-content: center; padding-top: var(--space-6); }
@media (min-width: 861px) {
  .tb-box-wrap { padding: 0 var(--space-6); }
  .tb-box-hero { grid-template-columns: 1.05fr 1fr; align-items: center; gap: var(--space-10); padding: var(--space-4) 0 var(--space-16); }
  .tb-box-list li { grid-template-columns: 110px 1fr 1.2fr; align-items: baseline; padding: var(--space-6) 0; }
  .tb-box-list li > span { grid-row: auto; padding-top: 0; }
  .tb-box-cta { display: none; }
}
.tb-box-ask { padding: var(--space-8) 0 var(--space-4); border-top: 1px solid var(--line); }
.tb-box-ask h2 { font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1.05; margin: var(--space-2) 0 var(--space-4); }
.tb-box-ask-btns { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* Fotos de producto con IA (29/09/2026): insignia discreta "IA · ilustrativa" — solo productos sin marca. */
.tb-modal-media { position: relative; }
.tb-modal-media .tb-aibadge {
  position: absolute; left: 10px; bottom: 10px; top: auto; z-index: 2; padding: 4px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; pointer-events: none;
}

/* Interruptor del Modo IA (SOP-33) en la cabecera */
.tb-aibtn { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent-tint); color: var(--accent); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; flex: none; }
@media (hover: hover) { .tb-aibtn:hover { background: var(--accent); color: var(--on-accent); } }
@media (max-width: 520px) { .tb-aibtn { width: 40px; height: 40px; padding: 0; justify-content: center; } .tb-aibtn span { display: none; } }
@media (max-width: 420px) { .tb-header-inner { padding-left: 12px; padding-right: 12px; } .tb-header-inner .tb-icon-btn, .tb-header-inner .tb-themebtn, .tb-aibtn { width: 38px; height: 38px; } }
@media (max-width: 370px) { .tb-header-inner .tb-themebtn { display: none; } }
