/* ==========================================================================
   Innovation Technologies · Tienda: catálogo, carrito, pago y confirmación.
   Usa los tokens de main.css.
   ========================================================================== */

/* ---------- Catálogo ---------- */
.shop-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.5rem;
}
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.filter {
  display: inline-flex; align-items: center; gap: 0.45rem;
  min-height: 40px; padding: 0.45rem 0.95rem;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background-color: var(--bg); color: var(--fg);
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.filter:hover { border-color: var(--fg-muted); }
.filter[aria-pressed="true"] { background-color: var(--fg); border-color: var(--fg); color: var(--bg); }
.shop-note { font-size: 0.875rem; color: var(--fg-muted); }

.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(0.75rem, 0.5rem + 1vw, 1.25rem); }
.products.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.products.cols-1 { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1000px) { .products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .products, .products.cols-2 { grid-template-columns: minmax(0, 1fr); } }

.product {
  position: relative;
  display: flex; flex-direction: column; gap: 1rem;
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background-color: var(--surface);
  scroll-margin-top: calc(var(--header-h) + 24px);
  transition: border-color 0.3s, box-shadow 0.4s var(--ease);
}
.product:hover { border-color: var(--line-strong); }
.product.is-highlight { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.product-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.75rem; }
.product-title { font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.4rem); font-stretch: 108%; }
.product-summary { color: var(--fg-muted); font-size: var(--t-small); }
.product .checks { font-size: 0.875rem; }
.product-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  margin-top: auto; padding-top: 1rem;
  border-top: 1px dashed var(--line-strong);
}
.product-price { display: grid; line-height: 1.15; }
.product-price strong { font-family: var(--font-display); font-size: 1.45rem; font-weight: 640; font-stretch: 110%; letter-spacing: -0.03em; }
.product-price span { font-size: 0.75rem; color: var(--fg-muted); }
.product-note { font-family: var(--font-mono); font-stretch: var(--wdth-mono); font-size: 0.625rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); }
.product-more {
  display: inline-flex; align-items: center; gap: 0.4em; align-self: flex-start;
  min-height: 32px;
  color: var(--accent-text); font-size: 0.875rem; font-weight: 600; text-decoration: none;
}
.product-more .i { width: 1em; height: 1em; transition: transform 0.25s var(--ease); }
.product-more:hover .i { transform: translateX(3px); }
.btn.is-added { --btn-bg: transparent; --btn-fg: var(--accent-text); --btn-line: var(--accent); }
.btn.is-added:hover { --btn-bg: var(--accent-soft); }

.how-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); counter-reset: paso; }
.how-steps li { display: grid; align-content: start; gap: 0.5rem; padding: 1.5rem 1.5rem 1.75rem 0; counter-increment: paso; }
.how-steps li + li { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.how-steps li::before { content: counter(paso, decimal-leading-zero); font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent-text); }
.how-steps h3 { font-size: 1.15rem; font-stretch: 106%; }
.how-steps p { color: var(--fg-muted); font-size: var(--t-small); }
@media (max-width: 900px) {
  .how-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-steps li:nth-child(3) { padding-left: 0; border-left: 0; }
  .how-steps li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .how-steps { grid-template-columns: minmax(0, 1fr); }
  .how-steps li, .how-steps li + li { padding: 1.25rem 0; border-left: 0; border-top: 1px solid var(--line); }
  .how-steps li:first-child { border-top: 0; }
}

/* ---------- Carrito y pago ---------- */
.checkout { display: grid; gap: 1.5rem; }
@media (min-width: 1000px) {
  .checkout { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 2.5rem; align-items: start; }
  .checkout-summary { position: sticky; top: calc(var(--header-h) + 24px); }
}
.checkout-main { display: grid; gap: 1.25rem; min-width: 0; }
.step-card {
  display: grid; gap: 1.25rem;
  padding: clamp(1.25rem, 0.9rem + 1.5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background-color: var(--surface);
  min-width: 0;
}
.step-card > h2 { display: flex; align-items: baseline; gap: 0.6rem; font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.45rem); font-stretch: 108%; }
.step-card > h2 span { font-family: var(--font-mono); font-stretch: var(--wdth-mono); font-size: 0.75rem; font-weight: 500; color: var(--accent-text); }

.cart-lines { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.cart-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.cart-line-info { display: grid; gap: 0.15rem; min-width: 0; }
.cart-line-info b { font-weight: 600; line-height: 1.3; }
.cart-line-info span { font-size: 0.8125rem; color: var(--fg-muted); }
.cart-line-total { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 6.5rem; text-align: right; }
.cart-remove { width: 36px; height: 36px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.qty-btn { width: 36px; height: 36px; border: 0; background: transparent; color: var(--fg); font-size: 1.1rem; cursor: pointer; }
.qty-btn:hover:not(:disabled) { background-color: var(--accent-soft); }
.qty-btn:disabled { color: var(--fg-muted); opacity: 0.5; cursor: not-allowed; }
.qty output { min-width: 2rem; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.qty-fixed { min-width: 2rem; text-align: center; color: var(--fg-muted); font-size: 0.875rem; }
@media (max-width: 560px) {
  .cart-line { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info quitar" "cant total"; row-gap: 0.6rem; }
  .cart-line-info { grid-area: info; }
  .cart-remove { grid-area: quitar; }
  .qty, .qty-fixed { grid-area: cant; justify-self: start; }
  .cart-line-total { grid-area: total; }
}
.cart-empty { display: grid; justify-items: start; gap: 1rem; padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.cart-empty h2 { font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.8rem); }
.cart-empty p { color: var(--fg-muted); max-width: 48ch; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem 1rem; }
.form-grid .is-wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.plan-options { display: grid; gap: 0.6rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.plan-option {
  position: relative;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.85rem; align-items: start;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background-color: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.plan-option:hover { border-color: var(--line-strong); }
.plan-option input { width: 20px; height: 20px; margin: 0.1rem 0 0; accent-color: var(--accent); }
.plan-option b { display: block; font-weight: 600; }
.plan-option b + span { display: block; margin-top: 0.2rem; font-size: 0.875rem; color: var(--fg-muted); }
.plan-option:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background-color: var(--accent-soft); }
.plan-badge { display: inline-flex; margin-left: 0.4rem; padding: 0.1rem 0.45rem; border-radius: 4px; background-color: var(--accent); color: var(--accent-fg); font-family: var(--font-mono); font-stretch: var(--wdth-mono); font-size: 0.5625rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: 0.15em; }

.checkout-summary {
  display: grid; gap: 1.25rem;
  padding: clamp(1.25rem, 0.9rem + 1.5vw, 2rem);
  border-radius: var(--r-md);
}
.checkout-summary h2 { font-size: 1.25rem; font-stretch: 108%; }
.summary-rows { display: grid; margin: 0; border-top: 1px solid var(--line); }
.summary-rows div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); font-size: var(--t-small); }
.summary-rows dt { color: var(--fg-muted); }
.summary-rows dd { font-variant-numeric: tabular-nums; text-align: right; }
.summary-rows .is-total dt { color: var(--fg); font-weight: 600; }
.summary-rows .is-total dd { font-family: var(--font-display); font-size: 1.5rem; font-weight: 640; font-stretch: 110%; letter-spacing: -0.03em; }
.summary-rows .is-today dt, .summary-rows .is-today dd { color: var(--accent-text); font-weight: 600; }
.checkout-summary .consent { color: var(--fg-muted); }
.checkout-summary .consent a { color: var(--accent-text); }
.checkout-summary .btn[type="submit"] { width: 100%; min-height: 56px; font-size: 1.05rem; }
.checkout-summary .btn[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }
.pay-note { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.8125rem; color: var(--fg-muted); }
.pay-note .i { color: var(--accent-text); margin-top: 0.1rem; flex-shrink: 0; }
.alert { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.9rem 1rem; border: 1px solid var(--danger); border-radius: var(--r-sm); background-color: color-mix(in srgb, var(--danger) 8%, transparent); font-size: 0.9rem; }
.alert .i { color: var(--danger); margin-top: 0.1rem; flex-shrink: 0; }

/* ---------- Confirmación ---------- */
.receipt-layout { display: grid; gap: 2rem; }
@media (min-width: 1000px) { .receipt-layout { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 3rem; align-items: start; } }
.receipt { display: grid; gap: 1.5rem; padding: clamp(1.25rem, 0.9rem + 1.5vw, 2.25rem); border: 1px solid var(--line); border-radius: var(--r-md); background-color: var(--surface); min-width: 0; }
.receipt-loading { display: flex; align-items: center; gap: 0.9rem; color: var(--fg-muted); }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: girar 0.9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.receipt-status { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: start; }
.receipt-status h2 { margin: 0.35rem 0 0.4rem; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); }
.receipt-status p:not(.eyebrow) { color: var(--fg-muted); max-width: 52ch; }
.receipt-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; }
.receipt-icon .i { width: 24px; height: 24px; stroke-width: 2.2; }
.is-ok .receipt-icon { background-color: var(--accent); color: var(--accent-fg); }
.is-espera .receipt-icon { background-color: var(--accent-soft); color: var(--accent-text); }
.is-aviso .receipt-icon { background-color: color-mix(in srgb, var(--signal) 22%, transparent); color: var(--fg); }

.pay-steps { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.pay-step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 1rem; padding-bottom: 1.25rem; }
.pay-step:last-child { padding-bottom: 0; }
.pay-step:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 0; width: 2px; background-color: var(--line); }
.pay-step.is-done:not(:last-child)::before { background-color: var(--accent); }
.pay-dot { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--line-strong); border-radius: 50%; background-color: var(--bg); }
.pay-step.is-done .pay-dot { border-color: var(--accent); background-color: var(--accent); color: var(--accent-fg); }
.pay-dot .i { width: 14px; height: 14px; stroke-width: 2.6; }
.pay-step-top { display: flex; justify-content: space-between; gap: 1rem; font-variant-numeric: tabular-nums; }
.pay-step p.muted { font-size: 0.875rem; margin-top: 0.15rem; }
.pay-invoice { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 0.5rem; font-size: 0.8125rem; }
.pay-invoice .i { color: var(--accent-text); }

.receipt-lines table { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.receipt-lines th, .receipt-lines td { padding: 0.65rem 0; border-top: 1px solid var(--line); text-align: left; font-weight: 400; }
.receipt-lines td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 1rem; }
.receipt-lines .is-total th, .receipt-lines .is-total td { font-weight: 600; font-size: 1rem; }
.receipt-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.dev-panel { display: grid; gap: 0.75rem; padding: 1rem 1.1rem; border: 1px dashed var(--signal); border-radius: var(--r-sm); font-size: 0.875rem; color: var(--fg-muted); }
.dev-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

@media print {
  .receipt-actions, .dev-panel, .receipt-layout > aside { display: none !important; }
  .receipt { border: 0; padding: 0; }
}
