/* Tienda WEEM (/tienda/ y /admin/tienda). Usa los tokens --w-* de /shared/weem-ui.css, que ya
   resuelven claro y oscuro; acá solo se arma la composición de cada pantalla. */
/* El cuerpo lleva la misma familia que el resto del sitio: sin esto, el menú y el pie compartidos
   (que heredan la fuente) caían en la tipografía por defecto del navegador. */
body[data-content-template="kit-tienda"]:not(.tda-admin-body) { margin: 0; font-family: var(--w-font); color: var(--w-ink); }
.tda { color: var(--w-ink); font-family: var(--w-font); }
.tda [hidden] { display: none !important; }
.tda-wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.tda-narrow { width: min(640px, 100% - 32px); }
.tda-hero { padding: clamp(40px, 7vw, 88px) 0 clamp(20px, 3vw, 32px); }
.tda-eyebrow { margin: 0 0 12px; font: 500 12px/1.4 var(--w-font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--weem-sec-strong, var(--w-accent)); }
.tda-hero h1, .tda-product__title { margin: 0 0 14px; font-size: clamp(30px, 5vw, 48px); line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; }
.tda-lead { margin: 0; max-width: 62ch; font-size: clamp(16px, 2vw, 19px); line-height: 1.6; color: var(--w-ink-2); }
.tda-section { padding: 0 0 clamp(48px, 8vw, 96px); }
.tda-section--top { padding-top: clamp(24px, 4vw, 40px); }
.tda-back { margin: 0 0 20px; }
.tda-back a, .tda-foot-note a { color: var(--weem-sec-strong, var(--w-accent)); }
.tda-foot-note { margin: 28px 0 0; color: var(--w-muted); font-size: 14px; }
.tda-hint { margin: 8px 0 0; color: var(--w-muted); font-size: 14px; line-height: 1.5; }
.tda-h2 { margin: 0 0 12px; font-size: 18px; }

.tda-status { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--w-radius); background: var(--w-surface-2); color: var(--w-ink-2); font-size: 14px; line-height: 1.5; }
.tda-status:empty, .tda-status[hidden] { display: none; }
.tda-status[data-tone="error"] { background: var(--w-danger-soft); color: var(--w-danger); }
.tda-status[data-tone="ok"] { background: var(--w-success-soft); color: var(--w-success); }
.tda-status--inline { margin: 8px 0 0; padding: 8px 10px; }

/* Catálogo */
.tda-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.tda-skeleton { height: 360px; border-radius: var(--w-radius-lg); }
.tda-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; color: inherit; text-decoration: none; }
.tda-card__body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; }
.tda-card__title { margin: 4px 0 0; font-size: 19px; line-height: 1.3; }
.tda-card__sub { margin: 0; color: var(--w-muted); font-size: 14px; line-height: 1.5; }
.tda-card__foot { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 12px; }
.tda-card__cta { color: var(--weem-sec-strong, var(--w-accent)); font-size: 14px; font-weight: 600; white-space: nowrap; }
.tda-price { font: 600 18px/1.2 var(--w-font-mono); white-space: nowrap; }
.tda-cover { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--w-radius-lg) var(--w-radius-lg) 0 0;
  background: radial-gradient(120% 90% at 20% 10%, var(--w-accent-soft), transparent 60%), var(--w-surface-2); }
.tda-cover img { width: 100%; height: 100%; object-fit: cover; }
.tda-cover__kind { font: 600 14px/1 var(--w-font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--weem-sec-strong, var(--w-accent)); }

/* Producto */
.tda-product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); grid-template-areas: "media checkout" "info checkout"; gap: 28px 40px; align-items: start; }
.tda-product__media { grid-area: media; }
.tda-product__media .tda-cover { border-radius: var(--w-radius-lg); }
.tda-product__info { grid-area: info; }
.tda-product__info .w-chip { display: inline-flex; margin-bottom: 12px; }
.tda-description { margin-top: 20px; white-space: pre-line; line-height: 1.7; color: var(--w-ink-2); }
.tda-checkout { grid-area: checkout; position: sticky; top: 96px; }
.tda-checkout__title { margin: 0 0 12px; font-size: 20px; }
.tda-test { margin: 0 0 14px; padding: 8px 12px; border-radius: var(--w-radius); background: var(--w-warning-soft); color: var(--w-warning); font-size: 13px; font-weight: 600; }
.tda-summary { display: grid; gap: 8px; margin: 0 0 18px; }
.tda-summary > div { display: flex; justify-content: space-between; gap: 16px; }
.tda-summary dt { color: var(--w-muted); }
.tda-summary dd { margin: 0; text-align: right; font-family: var(--w-font-mono); overflow-wrap: anywhere; }
.tda-summary__total { padding-top: 10px; border-top: 1px solid var(--w-line); font-weight: 700; font-size: 18px; }
.tda-summary__total dt { color: var(--w-ink); }
.tda-form { display: grid; gap: 14px; min-width: 0; }
.tda-form .w-field, .tda-form__row > * { min-width: 0; }
.tda-form .w-input { width: 100%; max-width: 100%; box-sizing: border-box; }
.tda-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tda-coupon { display: flex; gap: 8px; }
.tda-coupon .w-input { flex: 1; min-width: 0; text-transform: uppercase; }
.tda-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.5; }
.tda-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--w-accent); }
.tda-check a { color: var(--weem-sec-strong, var(--w-accent)); }
.tda-secure { margin: 0; color: var(--w-muted); font-size: 12px; line-height: 1.5; text-align: center; }

/* Gracias, Mis compras, pasarela de prueba */
.tda-delivery { display: grid; justify-items: start; gap: 4px; margin: 4px 0 0; }
.tda-library { display: grid; gap: 14px; margin-top: 16px; }
.tda-purchase { display: grid; grid-template-columns: 120px 1fr; overflow: hidden; padding: 0; }
.tda-purchase .tda-cover { height: 100%; aspect-ratio: auto; min-height: 120px; border-radius: 0; }
.tda-purchase__body { display: grid; gap: 8px; padding: 16px; }
.tda-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.tda-library-form { margin-bottom: 16px; }

@media (max-width: 860px) {
  .tda-product { grid-template-columns: 1fr; grid-template-areas: "media" "info" "checkout"; }
  .tda-checkout { position: static; }
}
@media (max-width: 520px) {
  .tda-form__row { grid-template-columns: 1fr; }
  .tda-purchase { grid-template-columns: 1fr; }
  .tda-purchase .tda-cover { min-height: 140px; }
  .tda-actions .w-btn { flex: 1; }
}

/* Panel /admin/tienda */
.tda-admin { width: min(1240px, 100% - 32px); margin-inline: auto; padding: 24px 0 64px; }
.tda-admin__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.tda-admin__title { margin: 0 auto 0 0; font-size: 22px; }
.tda-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--w-line); overflow-x: auto; }
.tda-tab { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--w-muted); font: 600 14px/1 var(--w-font); cursor: pointer; white-space: nowrap; }
.tda-tab[aria-selected="true"] { color: var(--w-ink); border-bottom-color: var(--w-accent); }
.tda-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tda-kpi { padding: 16px; border: 1px solid var(--w-line); border-radius: var(--w-radius-lg); background: var(--w-surface); }
.tda-kpi span { display: block; color: var(--w-muted); font-size: 13px; }
.tda-kpi strong { display: block; margin-top: 6px; font: 600 22px/1.2 var(--w-font-mono); }
.tda-kpi small { display: block; margin-top: 4px; color: var(--w-muted); }
.tda-admin__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.tda-top { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.tda-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.tda .tda-toolbar > * { flex: 0 0 auto; width: auto; }
.tda .tda-toolbar .w-input[type="search"] { flex: 1 1 260px; min-width: 0; }
.tda-admin .w-table td { vertical-align: top; }
.tda-admin .w-table td small { display: block; color: var(--w-muted); }
.tda-row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tda-coupon-form { margin-bottom: 16px; }
.tda-form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.tda-span { grid-column: 1 / -1; }
.tda-dialog { width: min(760px, 100% - 24px); max-height: calc(100dvh - 24px); padding: 24px; border: 1px solid var(--w-line); border-radius: var(--w-radius-lg); background: var(--w-surface); color: var(--w-ink); }
.tda-dialog::backdrop { background: rgba(11, 13, 18, .5); }
.tda-dialog textarea { min-height: 120px; resize: vertical; }
.tda-events { margin: 12px 0 0; padding-left: 18px; font-size: 13px; color: var(--w-ink-2); }
