/* vtw-process-timeline.css */
/* VendTheWeb Section Library — vendtheweb.com */
/* Version: 1.0.0 */

/* ── Variable resolution ─────────────────────────────── */
.vtw-process-timeline {
  --_bg:           var(--vtw-section-bg,     var(--vtw-brand-bg,     #faf9f7));
  --_text:         var(--vtw-section-text,   var(--vtw-brand-text,   #1a1a1a));
  --_accent:       var(--vtw-section-accent, var(--vtw-brand-accent, #5c6b3a));
  --_accent-text:  var(--vtw-section-accent-text, var(--vtw-brand-accent-text, #ffffff));
  --_surface:      var(--vtw-section-surface,
                   var(--vtw-brand-surface, #f0ede8));
  --_border:       var(--vtw-section-border,
                   var(--vtw-brand-border, #e8e3dc));
  --_heading-font: var(--vtw-section-heading-font,
                   var(--vtw-brand-heading-font, Georgia, serif));
  --_body-font:    var(--vtw-section-body-font,
                   var(--vtw-brand-body-font, 'Assistant', Georgia, serif));
  --_radius:       var(--vtw-brand-radius-md, 12px);
  --_radius-sm:    var(--vtw-brand-radius-sm, 8px);
  --_speed:        var(--vtw-brand-speed, 260ms);
  --_ease:         cubic-bezier(0.25, 0.1, 0.25, 1);

  /* Private sizing tokens */
  --_badge-size:   48px;
  --_badge-ring:   3px;
  --_w-contained:  1280px;
}

/* ── Base layout ─────────────────────────────────────── */
.vtw-process-timeline {
  background-color: var(--_bg);
  color: var(--_text);
  padding-top: var(--_pad-start, 96px);
  padding-bottom: var(--_pad-end, 96px);
  font-family: var(--_body-font);
  position: relative;
  overflow: hidden;
}

.vtw-process-timeline__container {
  max-width: var(--_w-contained);
  margin-inline: auto;
  padding-inline: clamp(24px, 4vw, 48px);
}

.vtw-process-timeline[data-width="full"] .vtw-process-timeline__container {
  max-width: none;
  padding-inline: clamp(24px, 6vw, 80px);
}

/* ── Header ──────────────────────────────────────────── */
.vtw-process-timeline__header {
  max-width: 640px;
  margin: 0 auto 64px;
  text-align: center;
}

.vtw-process-timeline[data-text-align="left"] .vtw-process-timeline__header {
  margin-inline: 0;
  text-align: left;
}

.vtw-process-timeline[data-text-align="right"] .vtw-process-timeline__header {
  margin-inline: 0 0;
  margin-left: auto;
  text-align: right;
}

.vtw-process-timeline__label {
  font-family: var(--_body-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--_accent);
  margin: 0 0 14px;
}

.vtw-process-timeline__heading {
  font-family: var(--_heading-font);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--_text);
  margin: 0 0 16px;
}

.vtw-process-timeline__body {
  font-family: var(--_body-font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--_text);
  opacity: 0.78;
}

.vtw-process-timeline__body p {
  margin: 0 0 12px;
}

.vtw-process-timeline__body p:last-child {
  margin-bottom: 0;
}

/* ── Timeline list ───────────────────────────────────── */
.vtw-process-timeline__list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

/* ── Step (default = vertical layout; overridden for horizontal below) ──
   Two layouts:
   - 2-col `[badge | content]` when no step in the list has an image
   - 3-col `[badge | figure | content]` when any step in the list has an image

   When data-has-images="true" is set on the <ol>, all steps get the 3-col
   grid — even steps without an uploaded image keep an empty figure slot so
   the row-to-row alignment stays consistent. Image aspect is 4:3 (landscape)
   to feel like a process photograph rather than a thumbnail. */
.vtw-process-timeline__step {
  display: grid;
  grid-template-columns: var(--_badge-size) 1fr;
  column-gap: 20px;
  row-gap: 10px;
  align-items: start;
  position: relative;
  min-width: 0;
  text-align: left;
}

.vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step {
  grid-template-columns: var(--_badge-size) clamp(140px, 20vw, 220px) 1fr;
  column-gap: 24px;
  align-items: center;
}

.vtw-process-timeline__step + .vtw-process-timeline__step {
  margin-top: 40px;
}

.vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step + .vtw-process-timeline__step {
  margin-top: 48px;
}

.vtw-process-timeline__step-badge {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

.vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step-badge {
  align-self: center;
}

.vtw-process-timeline__step-figure {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--_radius-sm);
  overflow: hidden;
  background-color: var(--_surface);
  transition: transform var(--_speed) var(--_ease), box-shadow var(--_speed) var(--_ease);
}

.vtw-process-timeline__step-figure:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.08);
}

.vtw-process-timeline__step-figure-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vtw-process-timeline__step-content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step-content {
  grid-column: 3;
  grid-row: 1;
}

/* ── Step badge (circle / square / diamond / hex) ────── */
.vtw-process-timeline__step-badge {
  width: var(--_badge-size);
  height: var(--_badge-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--_accent);
  color: var(--_accent-text);
  font-family: var(--_heading-font);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 0 0 var(--_badge-ring) var(--_surface);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.vtw-process-timeline[data-badge-shape="circle"] .vtw-process-timeline__step-badge {
  border-radius: 50%;
}

.vtw-process-timeline[data-badge-shape="square"] .vtw-process-timeline__step-badge {
  border-radius: 10px;
}

.vtw-process-timeline[data-badge-shape="diamond"] .vtw-process-timeline__step-badge {
  border-radius: 4px;
  transform: rotate(45deg);
}

.vtw-process-timeline[data-badge-shape="diamond"] .vtw-process-timeline__step-badge-number,
.vtw-process-timeline[data-badge-shape="diamond"] .vtw-process-timeline__step-badge-icon {
  transform: rotate(-45deg);
}

.vtw-process-timeline[data-badge-shape="hex"] .vtw-process-timeline__step-badge {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  border-radius: 0;
  box-shadow: none;
}

.vtw-process-timeline__step-badge-icon {
  width: 60%;
  height: 60%;
  object-fit: contain;
  display: block;
}

.vtw-process-timeline__step-badge-number {
  display: inline-block;
}

/* ── Editorial numeral badge style ──────────────────────
   When `data-badge-style="numeral"`, strip the shape treatment and show the
   number as a large serif italic numeral in the accent color. The container
   keeps its badge-size bounds so the connector line still passes through a
   predictable vertical center. If a custom icon is uploaded, it displays
   at its natural size without the shape background. */
.vtw-process-timeline[data-badge-style="numeral"] .vtw-process-timeline__step-badge {
  background-color: transparent;
  color: var(--_accent);
  box-shadow: none;
  border-radius: 0;
  clip-path: none;
  transform: none;
  font-size: clamp(32px, 3.2vw, 44px);
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.01em;
  /* Preserve badge-size bounding box so the connector crosses a known center */
  width: var(--_badge-size);
  height: var(--_badge-size);
}

.vtw-process-timeline[data-badge-style="numeral"] .vtw-process-timeline__step-badge-number {
  transform: none;  /* override diamond's -45deg that isn't relevant here */
}

.vtw-process-timeline[data-badge-style="numeral"] .vtw-process-timeline__step-badge-icon {
  width: 80%;
  height: 80%;
}

/* ── Step content ────────────────────────────────────── */
.vtw-process-timeline__step-title {
  font-family: var(--_heading-font);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--_text);
  margin: 0 0 8px;
}

.vtw-process-timeline__step-description {
  font-family: var(--_body-font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--_text);
  opacity: 0.82;
  max-width: 56ch;
}

.vtw-process-timeline__step-description p {
  margin: 0 0 10px;
}

.vtw-process-timeline__step-description p:last-child {
  margin-bottom: 0;
}

/* ── Connector line (vertical-axis by default) ───────────
   Default pattern draws a vertical line on the left — used on vertical layout
   and on any mobile viewport (where horizontal configs fall back to vertical).
   The horizontal override inside @media (min-width: 769px) swaps axes.

   CRITICAL: do NOT add a redundant `.vtw-process-timeline[data-layout="vertical"]...`
   selector here. The extra attribute would raise this rule's specificity above
   the style-override rules below, silently re-dashing the line. Keep one base.

   Styles (dashed / dotted / solid) are set in both border-left-style AND
   border-top-style so the single override rule works for both orientations
   (only the axis with non-zero border-width renders). */
.vtw-process-timeline[data-connector="true"] .vtw-process-timeline__list::before {
  content: "";
  position: absolute;
  top: var(--_badge-size);
  bottom: var(--_badge-size);
  left: calc(var(--_badge-size) / 2);
  right: auto;
  width: 0;
  height: auto;
  border-left: 2px dashed var(--_border);
  border-top: 0;
  transform: translateX(-1px);
  z-index: 0;
}

.vtw-process-timeline[data-connector-style="dashed"] .vtw-process-timeline__list::before {
  border-left-style: dashed;
  border-top-style: dashed;
}

.vtw-process-timeline[data-connector-style="dotted"] .vtw-process-timeline__list::before {
  border-left-style: dotted;
  border-top-style: dotted;
}

.vtw-process-timeline[data-connector-style="solid"] .vtw-process-timeline__list::before {
  border-left-style: solid;
  border-top-style: solid;
}

/* ── Horizontal layout (desktop only) ──────────────────
   Column count is driven by step count, not viewport:
     3 steps → 3 cols (1 row)
     4 steps → 4 cols (1 row)
     5 steps → 5 cols (1 row)
     6 steps → 3 cols (2 rows, 3+3 balanced)
     7 steps → 4 cols (2 rows, 4+3)
     8 steps → 4 cols (2 rows, 4+4 balanced)
   Connector drops on multi-row because numbered badges already carry
   sequence — a snake-path line across rows is over-engineered for the
   marginal visual payoff. */
@media (min-width: 769px) {
  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__list {
    display: grid;
    column-gap: clamp(16px, 2vw, 32px);
    row-gap: 0;
  }

  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__list {
    --_col-gap: clamp(16px, 2vw, 32px);
    column-gap: var(--_col-gap);
    align-items: start;  /* force row-top alignment so every step cell begins at row top, regardless of per-step height differences */
  }

  .vtw-process-timeline[data-layout="horizontal"][data-count="3"] .vtw-process-timeline__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vtw-process-timeline[data-layout="horizontal"][data-count="4"] .vtw-process-timeline__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .vtw-process-timeline[data-layout="horizontal"][data-count="5"] .vtw-process-timeline__list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .vtw-process-timeline[data-layout="horizontal"][data-count="6"] .vtw-process-timeline__list { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 72px; }
  .vtw-process-timeline[data-layout="horizontal"][data-count="7"] .vtw-process-timeline__list { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 72px; }
  .vtw-process-timeline[data-layout="horizontal"][data-count="8"] .vtw-process-timeline__list { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 72px; }

  /* Step = flex-column, centered. Badge is the first flex child so it sits
     at the top of every step — no padding-top reservation needed. Figures
     are absolute-positioned at the BOTTOM of the step so they appear after
     the title/description as a "visual reward". When the list has images,
     every step reserves `padding-bottom` for the figure so all step heights
     stay consistent across a row (steps without a figure just show empty
     reserved space at the bottom). */
  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
    margin-top: 0;
    padding-inline: 4px;
    position: relative;
    gap: 14px;
  }

  /* The default `.step + .step { margin-top }` rule applies at all layouts
     (needed for mobile horizontal-fallback step stacking). On desktop
     horizontal, every step sits on the same row — no top margin needed.
     Specificity here (0, 3, 1) beats the default (0, 2, 0 with adjacent
     sibling) and the has-images variant (0, 3, 0). See learnings.md 2026-04
     "vertical margin-top leak into horizontal layout". */
  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__step + .vtw-process-timeline__step,
  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step + .vtw-process-timeline__step {
    margin-top: 0;
  }

  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step {
    padding-bottom: calc(clamp(160px, 18vw, 240px) * 0.75 + 20px);
  }

  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__step-figure {
    position: absolute;
    bottom: 0;
    top: auto;
    left: 50%;
    width: clamp(160px, 18vw, 240px);
    max-width: none;
    margin: 0;
    aspect-ratio: 4 / 3;
    grid-row: unset;
    grid-column: unset;
    transform: translateX(-50%);
  }

  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__step-figure:hover {
    transform: translateX(-50%) translateY(-2px);
  }

  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__step-badge {
    grid-row: unset;
    grid-column: unset;
    align-self: center;  /* Reset the vertical-layout `align-self: start` so the badge respects the flex-column parent's align-items: center. */
  }

  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__step-content {
    grid-column: unset;
    grid-row: unset;
    max-width: 28ch;
  }

  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__step-description {
    margin-inline: auto;
    font-size: 15.5px;
  }

  /* ── Horizontal connector: absolute on list (row 1) + step-level ::after (row 2) ──
     The first-row line is `::before` on the <ol>, absolute-positioned at
     y = badge-size / 2 so it threads through row 1 badges. This keeps steps
     out of conflict with grid-auto-placement (which happens if the pseudo
     claims grid cells explicitly).

     The second-row line attaches as `::after` to the FIRST STEP OF ROW 2
     (step 4 for count=6, step 5 for counts 7/8) — absolute-positioned
     relative to that step. That step has a predictable Y inside its own
     cell, so the line ends up at (row 2 top + badge-center) automatically.
     The line's width spans its row via `N * 100% + (N-1) * gap`, where
     100% is the step's own column width. */
  .vtw-process-timeline[data-layout="horizontal"][data-connector="true"] .vtw-process-timeline__list::before {
    top: calc(var(--_badge-size) / 2);
    bottom: auto;
    left: 8%;
    right: 8%;
    width: auto;
    height: 0;
    border-top: 2px dashed var(--_border);
    border-left: 0;
    transform: translateY(-1px);
  }

  /* Second-row line — attached to the first step of row 2. Only rendered
     when multi-row AND merchant opts in via `show_connector_multi_row`. */
  .vtw-process-timeline[data-layout="horizontal"][data-connector="true"][data-connector-multi-row="true"][data-count="6"] .vtw-process-timeline__step:nth-child(4)::after,
  .vtw-process-timeline[data-layout="horizontal"][data-connector="true"][data-connector-multi-row="true"][data-count="7"] .vtw-process-timeline__step:nth-child(5)::after,
  .vtw-process-timeline[data-layout="horizontal"][data-connector="true"][data-connector-multi-row="true"][data-count="8"] .vtw-process-timeline__step:nth-child(5)::after {
    content: "";
    position: absolute;
    top: calc(var(--_badge-size) / 2);
    left: 0;
    height: 0;
    border-top: 2px dashed var(--_border);
    transform: translateY(-1px);
    z-index: 0;
  }

  /* Row-2 line widths — extends from the first-of-row-2 step across all
     its row's steps (N columns + N-1 gaps). */
  .vtw-process-timeline[data-layout="horizontal"][data-count="6"] .vtw-process-timeline__step:nth-child(4)::after {
    width: calc(3 * 100% + 2 * var(--_col-gap));
  }
  .vtw-process-timeline[data-layout="horizontal"][data-count="7"] .vtw-process-timeline__step:nth-child(5)::after {
    width: calc(3 * 100% + 2 * var(--_col-gap));
  }
  .vtw-process-timeline[data-layout="horizontal"][data-count="8"] .vtw-process-timeline__step:nth-child(5)::after {
    width: calc(4 * 100% + 3 * var(--_col-gap));
  }

  /* Hide first-row connector on multi-row when merchant hasn't opted in.
     Default behavior: no lines at all on multi-row (cleanest look). */
  .vtw-process-timeline[data-layout="horizontal"][data-connector-multi-row="false"][data-count="6"] .vtw-process-timeline__list::before,
  .vtw-process-timeline[data-layout="horizontal"][data-connector-multi-row="false"][data-count="7"] .vtw-process-timeline__list::before,
  .vtw-process-timeline[data-layout="horizontal"][data-connector-multi-row="false"][data-count="8"] .vtw-process-timeline__list::before {
    display: none;
  }

  /* Horizontal style overrides — apply to list::before and step::after so
     multi-row lines match the merchant's chosen style. */
  .vtw-process-timeline[data-layout="horizontal"][data-connector-style="dotted"] .vtw-process-timeline__list::before,
  .vtw-process-timeline[data-layout="horizontal"][data-connector-style="dotted"] .vtw-process-timeline__step::after {
    border-top-style: dotted;
  }

  .vtw-process-timeline[data-layout="horizontal"][data-connector-style="solid"] .vtw-process-timeline__list::before,
  .vtw-process-timeline[data-layout="horizontal"][data-connector-style="solid"] .vtw-process-timeline__step::after {
    border-top-style: solid;
  }

  .vtw-process-timeline[data-layout="horizontal"][data-connector-style="dashed"] .vtw-process-timeline__list::before,
  .vtw-process-timeline[data-layout="horizontal"][data-connector-style="dashed"] .vtw-process-timeline__step::after {
    border-top-style: dashed;
  }

  /* Horizontal lines grow left → right (both rows). ::before animates on the
     list; ::after animates on the row-2-first step. Both use the same
     animation name + timing so rows 1 and 2 draw synchronously. */
  .vtw-process-timeline[data-layout="horizontal"][data-animate="true"][data-connector="true"].vtw-animate-ready .vtw-process-timeline__list::before,
  .vtw-process-timeline[data-layout="horizontal"][data-animate="true"][data-connector="true"].vtw-animate-ready .vtw-process-timeline__step::after {
    clip-path: inset(0 100% 0 0);
  }

  .vtw-process-timeline[data-layout="horizontal"][data-animate="true"][data-connector="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__list::before,
  .vtw-process-timeline[data-layout="horizontal"][data-animate="true"][data-connector="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__step::after {
    animation-name: vtw-process-timeline-line-grow-h;
  }

  /* Tighten description font at high counts (14px floor per learnings.md). */
  .vtw-process-timeline[data-layout="horizontal"][data-count="7"] .vtw-process-timeline__step-content,
  .vtw-process-timeline[data-layout="horizontal"][data-count="8"] .vtw-process-timeline__step-content {
    max-width: 24ch;
  }

  .vtw-process-timeline[data-layout="horizontal"][data-count="7"] .vtw-process-timeline__step-description,
  .vtw-process-timeline[data-layout="horizontal"][data-count="8"] .vtw-process-timeline__step-description {
    font-size: 14px;
  }

  /* Text alignment for horizontal layout — left/right swap the whole cell */
  .vtw-process-timeline[data-layout="horizontal"][data-text-align="left"] .vtw-process-timeline__step {
    align-items: flex-start;
    text-align: left;
  }

  .vtw-process-timeline[data-layout="horizontal"][data-text-align="left"] .vtw-process-timeline__step-figure {
    left: 0;
    transform: none;
  }

  .vtw-process-timeline[data-layout="horizontal"][data-text-align="left"] .vtw-process-timeline__step-description {
    margin-inline-start: 0;
  }

  .vtw-process-timeline[data-layout="horizontal"][data-text-align="right"] .vtw-process-timeline__step {
    align-items: flex-end;
    text-align: right;
  }

  .vtw-process-timeline[data-layout="horizontal"][data-text-align="right"] .vtw-process-timeline__step-figure {
    left: auto;
    right: 0;
    transform: none;
  }

  .vtw-process-timeline[data-layout="horizontal"][data-text-align="right"] .vtw-process-timeline__step-description {
    margin-inline-end: 0;
    margin-inline-start: auto;
  }

  /* ── Vertical layout, desktop, with images ─────────────
     Editorial 3-col `[left-side | badge-centerline | right-side]`.
     Badge sits in the middle column, on the vertical connector line.
     Image and text split across the sides. Default: image left, text right.
     Opt-in `[data-alternate="true"]` flips even steps to text-left/image-right,
     creating the magazine-style alternating rhythm. */
  .vtw-process-timeline[data-layout="vertical"] .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step {
    grid-template-columns: 1fr var(--_badge-size) minmax(0, 1fr);
    column-gap: clamp(24px, 4vw, 48px);
    align-items: center;
    row-gap: 0;
  }

  .vtw-process-timeline[data-layout="vertical"] .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step + .vtw-process-timeline__step {
    margin-top: 80px;  /* generous editorial spacing between phases */
  }

  /* Column assignments: image column 1 (right-justified), badge column 2
     (centered on line), text column 3 (left-justified). */
  .vtw-process-timeline[data-layout="vertical"] .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step-figure {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 4 / 3;
  }

  .vtw-process-timeline[data-layout="vertical"] .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step-badge {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    align-self: center;
  }

  .vtw-process-timeline[data-layout="vertical"] .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step-content {
    grid-column: 3;
    grid-row: 1;
    max-width: 480px;
    justify-self: start;
  }

  /* Connector line shifts to the center column when vertical + has-images. */
  .vtw-process-timeline[data-layout="vertical"][data-connector="true"] .vtw-process-timeline__list[data-has-images="true"]::before {
    left: 50%;
    transform: translateX(-1px);
  }

  /* Alternating sides: even steps swap image ↔ content. */
  .vtw-process-timeline[data-layout="vertical"][data-alternate="true"] .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step:nth-child(even) .vtw-process-timeline__step-figure {
    grid-column: 3;
    justify-self: start;
  }

  .vtw-process-timeline[data-layout="vertical"][data-alternate="true"] .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step:nth-child(even) .vtw-process-timeline__step-content {
    grid-column: 1;
    justify-self: end;
    text-align: right;
  }
}

/* Horizontal layout DISABLED on mobile — force vertical */
@media (max-width: 768px) {
  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__list {
    display: block;
  }

  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__step {
    transform: none;
  }

  /* Vertical connector at mobile for a horizontal-configured timeline.
     Reset every property the desktop horizontal override set (grid-item
     positioning, margin-top, border-top, etc.) back to the absolute
     vertical-line default. */
  .vtw-process-timeline[data-layout="horizontal"][data-connector="true"] .vtw-process-timeline__list::before {
    content: "";
    position: absolute;
    top: var(--_badge-size);
    bottom: var(--_badge-size);
    left: calc(var(--_badge-size) / 2);
    right: auto;
    width: 0;
    height: auto;
    border-left: 2px dashed var(--_border);
    border-top: 0;
    grid-row: auto;
    grid-column: auto;
    align-self: auto;
    margin-top: 0;
    margin-inline: 0;
    transform: translateX(-1px);
  }

  /* Step ::after has no role on mobile — it was only for multi-row desktop.
     On mobile the timeline falls back to vertical single-column stacking,
     so the row-2 line concept doesn't apply. */
  .vtw-process-timeline[data-layout="horizontal"] .vtw-process-timeline__step::after {
    display: none;
  }

  .vtw-process-timeline[data-layout="horizontal"][data-connector-style="dotted"] .vtw-process-timeline__list::before {
    border-left-style: dotted;
    border-top-style: dotted;
  }

  .vtw-process-timeline[data-layout="horizontal"][data-connector-style="solid"] .vtw-process-timeline__list::before {
    border-left-style: solid;
    border-top-style: solid;
  }

  .vtw-process-timeline__header {
    margin-bottom: 40px;
  }

  /* Mobile alignment override */
  .vtw-process-timeline[data-text-align-mobile="left"] .vtw-process-timeline__header {
    text-align: left;
    margin-inline: 0;
  }

  .vtw-process-timeline[data-text-align-mobile="center"] .vtw-process-timeline__header {
    text-align: center;
    margin-inline: auto;
  }

  .vtw-process-timeline__step-title {
    font-size: 18px;
  }

  .vtw-process-timeline__step-description {
    font-size: 15px;
  }

  /* ── Mobile layout with images: 2-col [badge-col | text+image stacked] ──
     At narrow widths the 3-col `[badge | figure | content]` layout squeezes
     the text column below readable width. Mobile drops to 2-col with the
     image stacked UNDER the text in the right column. Badge spans both rows
     and is vertically centered — the connector line still threads cleanly
     through all badges on the left. */
  .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step {
    grid-template-columns: var(--_badge-size) 1fr;
    grid-template-rows: auto auto;
    column-gap: 16px;
    row-gap: 16px;
    align-items: center;
  }

  .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step-badge {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: start;
  }

  .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step-content {
    grid-column: 2;
    grid-row: 1;
    max-width: none;
    justify-self: stretch;
    text-align: left;
  }

  .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step-figure {
    grid-column: 2;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    max-width: none;
    aspect-ratio: 4 / 3;
  }

  /* Alternating is a desktop-only treatment. Reset on mobile so every step
     renders identically (image under text, badge on left). */
  .vtw-process-timeline[data-alternate="true"] .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step:nth-child(even) .vtw-process-timeline__step-figure {
    grid-column: 2;
    grid-row: 2;
    justify-self: stretch;
  }

  .vtw-process-timeline[data-alternate="true"] .vtw-process-timeline__list[data-has-images="true"] .vtw-process-timeline__step:nth-child(even) .vtw-process-timeline__step-content {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    text-align: left;
  }
}

/* ── Empty state ─────────────────────────────────────── */
.vtw-process-timeline__empty {
  text-align: center;
  font-family: var(--_body-font);
  font-size: 14px;
  color: var(--_text);
  opacity: 0.6;
  padding: 60px 20px;
  border: 1px dashed var(--_border);
  border-radius: var(--_radius-sm);
  margin: 0;
}

/* ── Animations (scroll-entry reveal, no-JS safe) ────── */
/* CSS default is fully visible — JS upgrades to hidden via .vtw-animate-ready,
   then IntersectionObserver adds .vtw-is-visible to trigger the reveal. See
   learnings.md 2026-04 "no-JS progressive-enhancement". */
.vtw-process-timeline[data-animate="true"].vtw-animate-ready .vtw-process-timeline__header,
.vtw-process-timeline[data-animate="true"].vtw-animate-ready .vtw-process-timeline__step {
  opacity: 0;
}

.vtw-process-timeline[data-animate="true"].vtw-animate-ready .vtw-process-timeline__header,
.vtw-process-timeline[data-animate="true"].vtw-animate-ready .vtw-process-timeline__step {
  transform: translateY(18px);
}

.vtw-process-timeline[data-animate="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__header {
  animation: vtw-process-timeline-header-rise 600ms var(--_ease) forwards;
}

.vtw-process-timeline[data-animate="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__step {
  animation: vtw-process-timeline-step-rise 600ms var(--_ease) forwards;
}

/* Stagger — steps enter sequentially in reading order.
   80ms interval per design-language.md:131 ("Stagger children: 80-100ms delay between items"). */
.vtw-process-timeline[data-animate="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__step:nth-child(1) { animation-delay: 120ms; }
.vtw-process-timeline[data-animate="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__step:nth-child(2) { animation-delay: 200ms; }
.vtw-process-timeline[data-animate="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__step:nth-child(3) { animation-delay: 280ms; }
.vtw-process-timeline[data-animate="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__step:nth-child(4) { animation-delay: 360ms; }
.vtw-process-timeline[data-animate="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__step:nth-child(5) { animation-delay: 440ms; }
.vtw-process-timeline[data-animate="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__step:nth-child(6) { animation-delay: 520ms; }
.vtw-process-timeline[data-animate="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__step:nth-child(7) { animation-delay: 600ms; }
.vtw-process-timeline[data-animate="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__step:nth-child(8) { animation-delay: 680ms; }

@keyframes vtw-process-timeline-header-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes vtw-process-timeline-step-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Animated connector line ─────────────────────────────
   Line grows in sync with the step stagger so the merchant sees the
   timeline build as each step appears — not a pre-revealed line with
   empty steps filling in behind it.

   Uses clip-path instead of transform: scale() because the line already
   owns its transform slot for pixel snapping (translateX/Y(-1px)). Duration
   scales with step count via calc() so 3-step and 8-step timelines both
   finish drawing the line exactly as the last step lands:
     line_duration = step_count * 80ms + 440ms
     (80ms stagger interval × n steps + 600ms final-step fade − 120ms head delay + 360ms padding)

   Default direction is vertical (top → bottom). The horizontal override
   inside @media (min-width: 769px) swaps to left → right. */

/* Hidden state + animation apply to list::before (single-row + vertical line)
   AND step::after (second-row line on multi-row horizontal). Both use the
   same timing function and duration so rows 1 and 2 draw synchronously.
   The horizontal clip direction is overridden inside @media below. */
.vtw-process-timeline[data-animate="true"][data-connector="true"].vtw-animate-ready .vtw-process-timeline__list::before,
.vtw-process-timeline[data-animate="true"][data-connector="true"].vtw-animate-ready .vtw-process-timeline__step::after {
  clip-path: inset(0 0 100% 0);
}

.vtw-process-timeline[data-animate="true"][data-connector="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__list::before,
.vtw-process-timeline[data-animate="true"][data-connector="true"].vtw-animate-ready.vtw-is-visible .vtw-process-timeline__step::after {
  animation: vtw-process-timeline-line-grow-v
             calc(var(--_step-count) * 80ms + 440ms)
             var(--_ease)
             120ms
             forwards;
}

@keyframes vtw-process-timeline-line-grow-v {
  to { clip-path: inset(0); }
}

@keyframes vtw-process-timeline-line-grow-h {
  to { clip-path: inset(0); }
}

/* ── Motion (reduced) ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .vtw-process-timeline *,
  .vtw-process-timeline *::before,
  .vtw-process-timeline *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }

  .vtw-process-timeline[data-animate="true"].vtw-animate-ready .vtw-process-timeline__header,
  .vtw-process-timeline[data-animate="true"].vtw-animate-ready .vtw-process-timeline__step {
    opacity: 1;
    transform: none;
  }

  .vtw-process-timeline[data-animate="true"][data-connector="true"].vtw-animate-ready .vtw-process-timeline__list::before,
  .vtw-process-timeline[data-animate="true"][data-connector="true"].vtw-animate-ready .vtw-process-timeline__step::after {
    clip-path: none;
  }
}
