/* ==========================================================================
   3 DRIP — ordering flow
   Cart · checkout · order confirmation · tracking. One calm column of
   steps beside a sticky summary; on phones the summary becomes a bottom bar.
   ========================================================================== */

/* Small pieces shared with the other page sets. */
.i-dir-back { transform: scaleX(-1); }
html[dir="rtl"] .i-dir-back { transform: none; }
.td-btn--lg { min-height: 56px; font-size: 1.0625rem; }
.td-lede { margin-top: 12px; max-width: 58ch; color: var(--td-ink-2); font-size: 1.0625rem; }
.td-h3 { font-size: 1.25rem; letter-spacing: -.01em; margin-bottom: 16px; }
.td-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.td-text-btn {
  min-height: 36px; padding: 0 2px; font-size: .875rem; font-weight: 300; color: var(--td-muted);
  text-decoration: underline; text-decoration-color: var(--td-line-strong); text-underline-offset: 4px;
}
.td-text-btn:hover { color: var(--td-ink); text-decoration-color: currentColor; }
.td-empty--left { justify-items: start; text-align: start; padding-inline: 0; }

/* ---------------------------------------------------------------- frame */
.td-flow { padding-bottom: clamp(48px, 7vw, 96px); }
.td-flow-head { padding-top: clamp(16px, 2.5vw, 28px); }
.td-flow-title {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 40px; flex-wrap: wrap;
  padding-block: clamp(20px, 3vw, 36px) clamp(20px, 3vw, 36px);
}
.td-flow-title h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); letter-spacing: -.03em; }

.td-steps { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: .875rem; font-weight: 300; color: var(--td-muted); }
.td-steps li { display: inline-flex; align-items: center; gap: 8px; }
.td-steps li + li::before { content: ""; width: 20px; height: 1px; background: var(--td-line-strong); margin-inline-end: 6px; }
.td-steps b {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--td-line-strong); font-size: .75rem; font-variant-numeric: lining-nums;
}
.td-steps [aria-current="step"] { color: var(--td-ink); }
.td-steps [aria-current="step"] b { background: var(--td-accent-ink); border-color: var(--td-accent-ink); color: #fff; }
.td-steps .is-done b { background: var(--td-ok); border-color: var(--td-ok); color: #fff; }
.td-steps .is-done { color: var(--td-ink-2); }
@media (max-width: 480px) { .td-steps li span { display: none; } .td-steps [aria-current="step"] span { display: inline; } }

.td-flow-grid {
  display: grid; gap: clamp(28px, 4vw, 64px); align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
}
.td-flow-grid--rev { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
.td-summary { position: sticky; top: calc(var(--td-header-h) + 20px); display: grid; gap: 16px; }
@media (max-width: 899px) {
  .td-flow-grid, .td-flow-grid--rev { grid-template-columns: minmax(0, 1fr); }
  .td-summary { position: static; }
  .td-flow-grid--rev .td-summary { order: -1; }
  /* the sticky bar already carries the total and the action on a phone */
  .td-has-bar .td-summary .td-btn { display: none; }
  .td-has-bar .td-summary .td-assure { display: none; }
}
.td-flow-page.td-has-bar .td-flow { padding-bottom: 96px; }
@media (min-width: 900px) { .td-flow-page.td-has-bar .td-flow { padding-bottom: clamp(48px, 7vw, 96px); } }

/* ----------------------------------------------------------------- card */
.td-card:not(article) { display: grid; gap: 16px; padding: clamp(18px, 2.4vw, 28px); background: var(--td-surface); border: 1px solid var(--td-line); border-radius: var(--td-r-lg); }
.td-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.td-card-title { font-size: 1.125rem; letter-spacing: -.01em; }

.td-sum { display: grid; gap: 10px; margin: 0; }
.td-sum > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: .9375rem; }
.td-sum dt { color: var(--td-ink-2); }
.td-sum dd { margin: 0; font-weight: 300; text-align: end; font-variant-numeric: lining-nums tabular-nums; }
.td-sum .is-pending { color: var(--td-muted); font-weight: 300; }
.td-sum .is-credit dd { color: var(--td-ok); }
.td-sum .is-total { padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--td-line); font-size: 1.0625rem; }
.td-sum .is-total dt { color: var(--td-ink); font-weight: 300; }
.td-sum .is-total dd { font-size: 1.375rem; font-weight: 300; letter-spacing: -.01em; }
.td-sum--facts { padding-bottom: 14px; border-bottom: 1px solid var(--td-line); }
.td-note { font-size: .875rem; color: var(--td-muted); }
.td-assure { list-style: none; margin: 0; padding: 0 4px; display: grid; gap: 10px; font-size: .875rem; color: var(--td-ink-2); }
.td-assure li { display: flex; gap: 10px; align-items: flex-start; }
.td-assure .i { color: var(--td-muted); margin-top: 2px; flex: 0 0 auto; }

/* ------------------------------------------------------------ cart lines */
.td-lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--td-ink); }
.td-line {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px 18px; align-items: start;
  padding-block: 20px; border-bottom: 1px solid var(--td-line);
  transition: opacity var(--td-base) ease;
}
.td-line[data-busy="true"] { opacity: .5; pointer-events: none; }
.td-line-img { aspect-ratio: 3 / 4; border-radius: var(--td-r-sm); }
.td-line-img img { width: 100%; height: 100%; object-fit: cover; }
.td-line-main { display: grid; gap: 6px; min-width: 0; }
.td-line-name { font-size: 1rem; font-weight: 300; line-height: 1.3; letter-spacing: 0; }
.td-line-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .8125rem; font-weight: 300; color: var(--td-muted); }
.td-line-unit { font-size: .875rem; color: var(--td-ink-2); }
.td-line-unit small { color: var(--td-muted); font-size: .8125rem; }
.td-line-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.td-line-total { font-size: 1.0625rem; font-weight: 300; white-space: nowrap; }
@media (max-width: 560px) {
  .td-line { grid-template-columns: 80px minmax(0, 1fr); }
  .td-line-total { grid-column: 2; justify-self: start; margin-top: -4px; }
}
.td-flow-links { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; margin-top: 20px; }

/* --------------------------------------------------------------- forms */
.td-form { display: grid; gap: clamp(22px, 3vw, 36px); min-width: 0; }
.td-step { display: grid; gap: 20px; padding-bottom: clamp(22px, 3vw, 36px); border-bottom: 1px solid var(--td-line); }
.td-step:last-of-type { border-bottom: 0; }
.td-step-head { display: flex; gap: 14px; align-items: flex-start; }
.td-step-n {
  flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--td-ink); color: #fff; font-size: .8125rem; font-weight: 300; margin-top: 2px;
}
.td-step-head h2 { font-size: 1.25rem; letter-spacing: -.01em; }
.td-step-head p { color: var(--td-muted); font-size: .9375rem; margin-top: 2px; }

.td-choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.td-choice {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 14px 16px; min-height: 68px; border: 1px solid var(--td-line-strong); border-radius: var(--td-r-md);
  background: var(--td-surface); cursor: pointer;
  transition: border-color var(--td-fast) ease, box-shadow var(--td-fast) ease;
}
.td-choice:hover { border-color: var(--td-ink); }
.td-choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.td-choice-mark { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--td-line-strong); display: grid; place-items: center; transition: border-color var(--td-fast) ease; }
.td-choice-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--td-accent-ink); transform: scale(0); transition: transform var(--td-fast) var(--td-ease); }
.td-choice[data-on="true"] { border-color: var(--td-accent-ink); box-shadow: 0 0 0 1px var(--td-accent-ink); background: var(--td-accent-soft); }
.td-choice[data-on="true"] .td-choice-mark { border-color: var(--td-accent-ink); }
.td-choice[data-on="true"] .td-choice-mark::after { transform: scale(1); }
.td-choice:has(input:focus-visible) { outline: 2px solid var(--td-accent-ink); outline-offset: 3px; }
.td-choice-body { display: grid; gap: 2px; min-width: 0; }
.td-choice-body strong { font-size: .9375rem; }
.td-choice-body small { color: var(--td-muted); font-size: .8125rem; }
.td-choice-fee { font-weight: 300; font-size: .9375rem; white-space: nowrap; }

.td-bureau { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--td-r-sm); background: var(--td-tint); font-size: .9375rem; line-height: 1.5; }
.td-bureau .i { margin-top: 3px; flex: 0 0 auto; color: var(--td-muted); }
.td-pay { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--td-line-strong); border-radius: var(--td-r-md); background: var(--td-surface); }
.td-pay > .i { width: 22px; height: 22px; margin-top: 2px; flex: 0 0 auto; }
.td-pay b { display: block; font-size: .9375rem; }
.td-pay small { display: block; color: var(--td-muted); font-size: .875rem; margin-top: 2px; }
.td-submit { display: grid; gap: 12px; }
@media (max-width: 899px) { .td-submit .td-btn { display: none; } }

.td-sum-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.td-sum-lines li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: .875rem; }
.td-sum-lines .td-frame { position: relative; aspect-ratio: 3 / 4; border-radius: var(--td-r-xs); overflow: visible; }
.td-sum-lines .td-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--td-r-xs); }
.td-sum-qty {
  position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px;
  background: var(--td-ink); color: #fff; font-size: .6875rem; font-weight: 300; display: grid; place-items: center;
}
.td-sum-name { display: grid; gap: 2px; min-width: 0; }
.td-sum-name b { font-weight: 300; line-height: 1.3; }
.td-sum-name small { color: var(--td-muted); font-weight: 300; font-size: .75rem; }
.td-sum-lines--page { margin-top: 4px; }
.td-sum-lines--page li { padding-block: 12px; border-bottom: 1px solid var(--td-line); font-size: .9375rem; grid-template-columns: 64px minmax(0, 1fr) auto; }

/* ---------------------------------------------------- confirmation & track */
.td-done { display: grid; gap: 14px; padding-bottom: clamp(24px, 4vw, 44px); justify-items: start; }
.td-done-lede { font-size: 1.125rem; max-width: 56ch; color: var(--td-ink-2); }
.td-ref { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 14px 18px; border: 1px solid var(--td-ink); border-radius: var(--td-r-md); background: var(--td-surface); }
.td-ref small { flex-basis: 100%; }
.td-ref strong { font-size: 1.5rem; letter-spacing: .02em; }

.td-timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.td-timeline li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding-bottom: 22px; }
.td-timeline li:last-child { padding-bottom: 0; }
.td-timeline li:not(:last-child)::before { content: ""; position: absolute; top: 28px; bottom: 0; inset-inline-start: 13.5px; width: 1px; background: var(--td-line-strong); }
.td-tl-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--td-line-strong); background: var(--td-canvas, var(--bg, #FAFAFA)); color: var(--td-muted); }
.td-timeline li.is-done .td-tl-dot { background: var(--td-ok); border-color: var(--td-ok); color: #fff; }
.td-timeline li.is-next .td-tl-dot { border-color: var(--td-ink); color: var(--td-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--td-accent) 28%, transparent); }
.td-timeline b { font-size: .9375rem; }
.td-timeline p { color: var(--td-muted); font-size: .875rem; margin-top: 2px; }
.td-timeline li:not(.is-done):not(.is-next) b { color: var(--td-muted); }

.td-track { margin-bottom: 20px; }
.td-track-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.td-track-head strong { display: block; font-size: 1.125rem; letter-spacing: .02em; }
.td-status { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 99px; background: var(--td-tint); font-size: .8125rem; font-weight: 300; }
.td-status[data-status="pending"] { background: var(--td-warn-soft); color: var(--td-warn); }
.td-status[data-status="confirmed"], .td-status[data-status="processing"], .td-status[data-status="shipped"] { background: var(--td-accent-soft); color: var(--td-accent-ink); }
.td-status[data-status="delivered"] { background: var(--td-ok-soft); color: var(--td-ok); }
.td-status[data-status="cancelled"], .td-status[data-status="canceled"], .td-status[data-status="returned"] { background: var(--td-bad-soft); color: var(--td-bad); }
