@charset "UTF-8";

/* ========================================
   Cart / Purchase Flow
   GENI Custom

   Structure:
   1. Base wrapper and design tokens
   2. Step list layout
   3. Arrow item shape
   4. Flow-specific token overrides
   5. Edge shape and separators
   6. Step states
   7. Labels
   8. SP overrides
======================================== */

.purchase-step {
  /* Colors */
  --purchase-step-text: #6b584c;
  --purchase-step-current: #ca1d1d;
  --purchase-step-complete: #eadfd4;
  --purchase-step-pending: #f7f4f0;
  --purchase-step-gap: #ffffff;

  /* Layout */
  --purchase-step-width: 760px;
  /* PC spacing below the step. SP overrides this to 32px. */
  --purchase-step-bottom-margin: 48px;
  --purchase-step-count: 4;
  --purchase-step-arrow: 18px;
  --purchase-step-divider: 6px;
  --purchase-step-radius: 4px;

  /* Step item */
  --purchase-step-item-min-height: 34px;
  --purchase-step-item-padding: 8px 28px;
  --purchase-step-edge-padding: 24px;
  --purchase-step-arrow-side-padding: 28px;
  --purchase-step-item-font-size: 13px;
  --purchase-step-item-line-height: 1.4;

  box-sizing: border-box;
  width: 100%;
  max-width: var(--purchase-step-width);
  margin: 0 auto var(--purchase-step-bottom-margin);
  padding: 24px 16px 0;
  color: var(--purchase-step-text);
  font-family: inherit;
  background: var(--purchase-step-gap);
}

.purchase-step__list {
  display: flex;
  align-items: stretch;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--purchase-step-gap);
}

.purchase-step__item {
  position: relative;
  display: flex;
  flex: 0 0 calc(100% / var(--purchase-step-count));
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
  min-height: var(--purchase-step-item-min-height);
  padding: var(--purchase-step-item-padding);
  color: var(--purchase-step-text);
  font-size: var(--purchase-step-item-font-size);
  font-weight: 700;
  line-height: var(--purchase-step-item-line-height);
  text-align: center;
  white-space: nowrap;
  background: var(--purchase-step-pending);
  clip-path: polygon(
    0 0,
    calc(100% - var(--purchase-step-arrow)) 0,
    100% 50%,
    calc(100% - var(--purchase-step-arrow)) 100%,
    0 100%,
    var(--purchase-step-arrow) 50%
  );
}

.purchase-step--member {
  /* Flow-specific override: member checkout has 3 steps. Guest and Amazon Pay use the default 4 steps. */
  --purchase-step-count: 3;
}

.purchase-step__item:first-child {
  /* The first item has no left notch. */
  padding-left: var(--purchase-step-edge-padding);
  padding-right: var(--purchase-step-arrow-side-padding);
  border-radius: var(--purchase-step-radius) 0 0 var(--purchase-step-radius);
  clip-path: polygon(
    0 0,
    calc(100% - var(--purchase-step-arrow)) 0,
    100% 50%,
    calc(100% - var(--purchase-step-arrow)) 100%,
    0 100%
  );
}

.purchase-step__item:last-child {
  padding-left: var(--purchase-step-arrow-side-padding);
  padding-right: var(--purchase-step-edge-padding);
  border-radius: 0 var(--purchase-step-radius) var(--purchase-step-radius) 0;
}

.purchase-step__item:not(:last-child)::after {
  /* White separator between clipped arrow shapes. */
  position: absolute;
  top: 0;
  right: calc(var(--purchase-step-divider) / -2);
  z-index: 2;
  width: var(--purchase-step-divider);
  height: 100%;
  background: var(--purchase-step-gap);
  content: "";
}

.purchase-step__item.is-complete {
  color: var(--purchase-step-text);
  background: var(--purchase-step-complete);
}

.purchase-step__item.is-current {
  color: #ffffff;
  font-weight: 800;
  background: var(--purchase-step-current);
}

.purchase-step__label {
  /* Keep intended label chunks from breaking into single Japanese characters. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.purchase-step__line {
  display: inline;
  white-space: nowrap;
}

@media screen and (max-width: 767px) {

  .purchase-step {
    /* SP token overrides: fixed-height arrows and smaller notches keep 3/4 steps aligned. */
    --purchase-step-arrow: 12px;
    --purchase-step-divider: 4px;
    --purchase-step-item-min-height: 56px;
    --purchase-step-item-padding: 0 8px;
    --purchase-step-edge-padding: 8px;
    --purchase-step-arrow-side-padding: 8px;
    --purchase-step-item-font-size: 11px;
    --purchase-step-item-line-height: 1.2;
    --purchase-step-bottom-margin: 32px;

    max-width: 100%;
    margin: 0 auto var(--purchase-step-bottom-margin);
    padding: 20px 12px 0;
  }

  .purchase-step__item {
    height: var(--purchase-step-item-min-height);
    white-space: normal;
  }

  .purchase-step__label {
    line-height: var(--purchase-step-item-line-height);
  }

  .purchase-step__label--sp-stack {
    flex-direction: column;
    row-gap: 2px;
  }

  .purchase-step__label--sp-stack .purchase-step__line {
    display: block;
  }

  /* Amazon Pay is the longest SP label; shift it away from the left notch and reduce only that line. */
  .purchase-step--amazon .purchase-step__item:nth-child(2) .purchase-step__label {
    transform: translateX(4px);
  }

  .purchase-step--amazon .purchase-step__item:nth-child(2) .purchase-step__line:first-child {
    font-size: 10px;
  }

}
