/* ==========================================================================
   Purchase funnel shell: /cart, /checkout, /checkout/thank-you,
   /order-confirmation, /order-tracking/{order}, /order-receipt/{order}, /bundles.
   Port of the handoff prototype's checkout / order-confirmation / order-tracking
   pages (The-Ideal-Card-Prototype/*.html): centred hero (kicker, h1 with serif
   gradient accent, lede), 16px-radius cards, kicker-titled summary tables and
   pill buttons. Everything is scoped under .tc-fn-page and namespaced tc-fn-*;
   each page adds its own file (cart.css, checkout.css, order.css, bundles.css).
   .tc-wrap and .tc-btn / .tc-btn-pop / .tc-btn-ghost come from the global tc
   files and are not re-declared here.
   ========================================================================== */

body.tc-page .page-wrapper:has(> .tc-fn-page) {
  padding-top: 0;
}
.tc-fn-page {
  /* Status colours the token set does not carry. Pop lime only reads on the dark
     canvas, so light flips it to deep purple (css/tc/product-detail.css precedent). */
  --tc-fn-ok: var(--tc-pop);
  --tc-fn-warn: var(--tc-warm);
  --tc-fn-danger: #fb7185;
  position: relative;
  min-width: 0;
}
[data-theme="light"] .tc-fn-page {
  --tc-fn-ok: var(--tc-accent-deep);
  --tc-fn-warn: color-mix(in srgb, var(--tc-warm) 55%, #000);
  --tc-fn-danger: #be123c;
}
.tc-fn-page :is(a, button, summary):focus-visible {
  outline: 2px solid var(--tc-accent);
  outline-offset: 3px;
}

/* ---------- Layout ---------- */
.tc-fn-block {
  padding: clamp(140px, 16vw, 220px) 0 clamp(96px, 12vw, 160px);
}
.tc-fn-narrow {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 32px;
}
.tc-fn-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  margin-top: 56px;
  align-items: start;
}
.tc-fn-grid > * { min-width: 0; }
.tc-fn-aside {
  position: sticky;
  top: 100px;
}
.tc-fn-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Type ---------- */
.tc-fn-hero { text-align: center; }
.tc-fn-kicker {
  display: inline-block;
  font-family: var(--tc-font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--tc-ink-3);
}
.tc-fn-kicker .tc-fn-n { color: var(--tc-accent); }
.tc-fn-page .tc-fn-h1 {
  max-width: 22ch;
  margin: 20px auto 0;
  font-family: var(--tc-font-display);
  font-size: clamp(48px, 6.5vw, 96px);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: .98;
  color: var(--tc-ink);
  overflow-wrap: anywhere;
}
.tc-fn-page .tc-fn-h3 {
  margin: 8px 0 0;
  font-family: var(--tc-font-display);
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--tc-ink);
}
.tc-fn-page .tc-serif {
  font-family: var(--tc-font-serif);
  font-style: normal;
  font-weight: 400;
  letter-spacing: -.005em;
}
.tc-fn-page .tc-grad-text {
  background: linear-gradient(90deg, #ff85e3 0%, #b3a0f7 55%, #6744da 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.tc-fn-page .tc-fn-lede {
  max-width: 52ch;
  margin: 24px auto 0;
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.55;
  color: var(--tc-ink-2);
}
.tc-fn-lede strong { color: var(--tc-ink); font-weight: 600; }
.tc-fn-mono { font-family: var(--tc-font-mono); }

/* ---------- Cards + kicker-titled summary tables ---------- */
.tc-fn-card {
  padding: 28px;
  border: 1px solid var(--tc-line);
  border-radius: 16px;
  background: var(--tc-card);
}
.tc-fn-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.tc-fn-card-link {
  font-family: var(--tc-font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--tc-accent);
}
.tc-fn-card-link:hover { color: var(--tc-ink); }
.tc-fn-rows { margin-top: 16px; }
.tc-fn-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--tc-line);
  font-size: 14px;
  color: var(--tc-ink);
}
.tc-fn-row:last-child { border-bottom: 0; }
.tc-fn-row-label { min-width: 0; color: var(--tc-ink); }
.tc-fn-row-val {
  flex-shrink: 0;
  max-width: 60%;
  text-align: right;
  color: var(--tc-ink);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tc-fn-row-val.is-ok { color: var(--tc-fn-ok); }
.tc-fn-row-total :is(.tc-fn-row-label, .tc-fn-row-val) { font-weight: 600; }
/* order-confirmation's table: body-copy labels, mono values */
.tc-fn-rows-lg .tc-fn-row-label {
  font-size: 16px;
  line-height: 1.65;
  color: var(--tc-ink-2);
}
.tc-fn-rows-lg .tc-fn-row-val { font-size: 14px; }
.tc-fn-rows-lg .tc-fn-row-val.tc-fn-mono { font-size: 13.5px; }

/* ---------- Form fields (prototype .co-step label / input) ---------- */
.tc-fn-label {
  display: block;
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tc-ink-3);
}
.tc-fn-input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--tc-line-2);
  border-radius: 10px;
  background: var(--tc-canvas);
  color: var(--tc-ink);
  font: inherit;
  font-size: 15px;
  transition: border-color 200ms, box-shadow 200ms;
}
.tc-fn-input::placeholder { color: var(--tc-ink-3); }
.tc-fn-input:focus {
  outline: none;
  border-color: var(--tc-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc-accent) 22%, transparent);
}

/* ---------- Buttons ---------- */
.tc-fn-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
}
.tc-fn-page .tc-fn-arrow { transition: transform 240ms cubic-bezier(.2, .7, .3, 1); }
.tc-fn-page .tc-btn:hover .tc-fn-arrow { transform: translateX(4px); }
.tc-fn-page .tc-btn-block { width: 100%; justify-content: center; }
.tc-fn-textlink {
  display: block;
  margin-top: 14px;
  text-align: center;
  font-family: var(--tc-font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--tc-ink-3);
}
.tc-fn-textlink:hover { color: var(--tc-ink); }

/* ---------- Status pill (live order / payment status) ---------- */
.tc-fn-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 1px solid var(--tc-line-2);
  border-radius: 999px;
  font-family: var(--tc-font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tc-ink-2);
  white-space: nowrap;
}
.tc-fn-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.tc-fn-status:is(.is-paid, .is-delivered, .is-approved) {
  color: var(--tc-fn-ok);
  border-color: color-mix(in srgb, var(--tc-fn-ok) 40%, transparent);
}
.tc-fn-status:is(.is-pending, .is-processing, .is-production, .is-shipped) {
  color: var(--tc-fn-warn);
  border-color: color-mix(in srgb, var(--tc-fn-warn) 40%, transparent);
}
.tc-fn-status:is(.is-failed, .is-cancelled, .is-refunded) {
  color: var(--tc-fn-danger);
  border-color: color-mix(in srgb, var(--tc-fn-danger) 40%, transparent);
}

/* ---------- Empty state ---------- */
.tc-fn-empty {
  margin-top: 56px;
  padding: 64px 24px;
  border: 1px dashed var(--tc-line-2);
  border-radius: 16px;
  text-align: center;
}
.tc-fn-empty p {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--tc-ink-2);
}
.tc-fn-empty a:not(.tc-btn) { color: var(--tc-accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .tc-fn-grid { grid-template-columns: minmax(0, 1fr); }
  .tc-fn-aside { position: static; }
}
@media (max-width: 640px) {
  .tc-fn-narrow { padding: 0 16px; }
  .tc-fn-page .tc-fn-h1 { font-size: clamp(34px, 10vw, 46px); line-height: 1.02; }
  .tc-fn-card { padding: 22px 18px; }
  .tc-fn-actions .tc-btn { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .tc-fn-page .tc-fn-arrow { transition: none; }
  .tc-fn-page .tc-btn:hover .tc-fn-arrow { transform: none; }
}

/* ---------- Print: only the page content, ink on paper ---------- */
@media print {
  body.tc-page .tc-nav,
  body.tc-page .tc-site-foot,
  body.tc-page .tc-fn-noprint { display: none !important; }
  body.tc-page { background: #fff !important; }
  .tc-fn-page .tc-fn-block { padding: 0; }
}
