/* =====================================================================
   SHIPPING WIZARD – a 2005-style setup wizard inside the Buy window:
   gel title bar, numbered steps, a rough route map from Japan, classic
   Back / Next / Cancel buttons on a status-bar panel.
   ===================================================================== */
.app--buy .win__body {
  position: relative;
}

/* Dims the Buy content behind the dialog */
.wizard-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--overlay-white-70);
}

.wizard-layer[hidden] {
  display: none;
}

.wizard {
  display: flex;
  flex-direction: column;
  width: min(600px, 100%);
  max-height: 100%;
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--chrome-border);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-window);
  overflow: hidden;
  font-family: var(--chrome-font);
  animation: wizard-open var(--dur-open) var(--ease-open) both;
}

@keyframes wizard-open {
  from {
    opacity: 0;
    transform: scale(.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.wizard__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
}

/* ---------------------------------------------------------------------
   Steps – a real sequence, so numbered
   --------------------------------------------------------------------- */
.wizard__steps {
  list-style: none;
  margin: 0;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--matcha-100);
  border-right: 1px solid var(--line-panel);
  font-size: var(--fs-12);
  color: var(--matcha-700);
  counter-reset: step;
}

.wizard__step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-medium);
  counter-increment: step;
}

.wizard__step::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-round);
  border: 1px solid var(--matcha-500);
  background: var(--paper);
  color: var(--matcha-700);
  font-weight: 700;
  font-size: var(--fs-11);
}

.wizard__step.is-current {
  background: var(--paper);
  border-color: var(--line-tab-selected);
  box-shadow: var(--shadow-tab);
  color: var(--matcha-900);
  font-weight: 700;
}

.wizard__step.is-current::before,
.wizard__step.is-done::before {
  background: var(--matcha-500);
  border-color: var(--matcha-500);
  color: var(--white);
}

/* ---------------------------------------------------------------------
   Main column
   --------------------------------------------------------------------- */
.wizard__main {
  min-width: 0;
  overflow: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--content-font);
}

.wizard__page {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wizard__page[hidden] {
  display: none;
}

.wizard__heading {
  margin: 0;
  font-size: var(--fs-18);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.25;
}

/* Focus is moved to the heading for screen readers; it isn't a control */
.wizard__heading:focus {
  outline: none;
}

.wizard__note {
  margin: 0;
  font-size: var(--fs-12-5);
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------
   Route map
   --------------------------------------------------------------------- */
.route-map {
  position: relative;
  flex: none;
  border: 1px solid var(--map-edge);
  border-radius: var(--radius-medium);
  overflow: hidden;
}

.route-map__svg {
  display: block;
  width: 100%;
  height: auto;
}

.route-map__sea {
  fill: var(--map-sea);
}

.route-map__land {
  fill: var(--map-land);
  stroke: var(--map-coast);
  stroke-width: .5;
  stroke-linejoin: round;
}

.route-map__origin {
  fill: var(--map-origin);
}

.route-map__dot {
  fill: var(--map-origin);
  stroke: var(--white);
  stroke-width: .8;
}

.route-map__dest {
  fill: var(--map-dest);
  transition: fill var(--dur-hover) ease;
}

.route-map__dest.is-active {
  fill: var(--map-dest-active);
}

.route-map__route {
  fill: none;
  stroke: var(--map-route);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

/* The chosen route streams from Japan to the destination */
.route-map__route.is-active {
  stroke: var(--map-route-active);
  stroke-width: 1.4;
  stroke-dasharray: 3 3;
  animation: route-stream var(--dur-stream) linear infinite;
}

@keyframes route-stream {
  to {
    stroke-dashoffset: -6;
  }
}

.route-map__parcel {
  display: none;
  fill: var(--white);
  stroke: var(--map-route-active);
  stroke-width: .9;
}

.route-map__parcel.is-moving {
  display: inline;
}

.route-map__label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 2px 6px;
  border: 1px solid var(--line-panel);
  border-radius: var(--radius-small);
  background: var(--overlay-white-85);
  color: var(--text-status);
  font-family: var(--chrome-font);
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}

.route-map__label.is-active {
  background: var(--paper);
  border-color: var(--map-dest-active);
  color: var(--matcha-900);
}

/* Positions in viewBox units: x 118–358, y 18–118 */
.route-map__label--jp {
  left: 16.7%;
  top: 38%;
}

.route-map__label--mx {
  left: 75.8%;
  top: 28%;
}

.route-map__label--pe {
  left: 86.7%;
  top: 74%;
}

/* ---------------------------------------------------------------------
   Destination choices
   --------------------------------------------------------------------- */
.wizard__choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2px 12px;
  min-height: 56px;
  padding: 9px 14px;
  border: 1px solid var(--line-tab-selected);
  border-radius: var(--radius-medium);
  background: var(--paper);
}

.choice:hover {
  background: var(--matcha-100);
}

.choice:has(input:checked) {
  border-color: var(--selection);
  box-shadow: var(--shadow-choice-selected);
}

.choice:has(input:focus-visible) {
  outline: 2px dotted var(--matcha-900);
  outline-offset: 2px;
}

.choice input {
  grid-row: span 2;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--selection);
}

.choice input:focus-visible {
  outline: none;
}

.choice__name {
  font-size: var(--fs-15);
  font-weight: 800;
}

.choice__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  font-size: var(--fs-12-5);
  color: var(--text-muted);
}

.choice__meta span + span::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: var(--radius-round);
  background: var(--text-muted);
}

/* ---------------------------------------------------------------------
   Summary (step 2)
   --------------------------------------------------------------------- */
.wizard__summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  margin: 0;
  font-size: var(--fs-14);
}

.wizard__summary dt {
  color: var(--text-muted);
}

.wizard__summary dd {
  margin: 0;
  font-weight: 700;
}

.wizard__facts {
  margin: 0;
}

/* ---------------------------------------------------------------------
   Footer – status-bar panel with classic buttons
   --------------------------------------------------------------------- */
.wizard__foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-status);
  border-top: 1px solid var(--line-status);
}

.btn {
  min-width: 84px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--progress-line);
  border-radius: var(--radius-control);
  background: var(--gel-classic);
  box-shadow: var(--shadow-ctl);
  font-family: var(--chrome-font);
  font-size: var(--fs-13);
  color: var(--matcha-900);
}

.btn:hover {
  filter: brightness(1.04);
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled] {
  opacity: .5;
  filter: none;
  transform: none;
}

/* The forward action is the primary one: the yellow gel */
.btn--primary {
  border-color: var(--yolk-dark);
  background: var(--gel-cta);
  color: var(--text-on-yolk);
  font-weight: 700;
}
