/* WC Order Progress Stepper
 * Horizontal stepper, collapses to vertical on small screens.
 * Colours use CSS custom properties so you can override per-theme.
 */

.wcop-stepper {
  --wcop-done: #2e7d32;
  --wcop-current: #1565c0;
  --wcop-upcoming: #c4c8cf;
  --wcop-line: #e0e3e8;
  --wcop-text: #1f2530;
  --wcop-muted: #6b7280;
  --wcop-node-size: 38px;

  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 1.5em 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--wcop-text);
}

.wcop-step {
  position: relative;
  flex: 1 1 0;
  text-align: center;
  padding: 0 6px;
  min-width: 0;
}

/* Connector line sits behind, running left from each node to the previous. */
.wcop-step__connector {
  position: absolute;
  top: calc(var(--wcop-node-size) / 2);
  left: -50%;
  right: 50%;
  height: 3px;
  background: var(--wcop-line);
  z-index: 0;
}

.wcop-step:first-child .wcop-step__connector {
  display: none;
}

.wcop-step--done .wcop-step__connector,
.wcop-step--current .wcop-step__connector {
  background: var(--wcop-done);
}

.wcop-step__node {
  position: relative;
  z-index: 1;
  width: var(--wcop-node-size);
  height: var(--wcop-node-size);
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: var(--wcop-upcoming);
  box-shadow: 0 0 0 4px #fff;
}

.wcop-step--done .wcop-step__node {
  background: var(--wcop-done);
}

.wcop-step--current .wcop-step__node {
  background: var(--wcop-current);
  box-shadow:
    0 0 0 4px #fff,
    0 0 0 7px rgba(21, 101, 192, 0.25);
}

.wcop-step__check {
  font-size: 18px;
  line-height: 1;
}

.wcop-step__label {
  font-weight: 600;
  margin-bottom: 2px;
}

.wcop-step__date {
  font-size: 12px;
  color: var(--wcop-muted);
  margin-bottom: 4px;
}

.wcop-step__text {
  font-size: 13px;
  color: var(--wcop-muted);
}

.wcop-step--current .wcop-step__label {
  color: var(--wcop-current);
}

/* Vertical layout on narrow screens. */
@media (max-width: 600px) {
  .wcop-stepper {
    flex-direction: column;
    gap: 0;
  }

  .wcop-step {
    display: grid;
    grid-template-columns: var(--wcop-node-size) 1fr;
    gap: 0 14px;
    text-align: left;
    padding: 0 0 18px 0;
  }

  .wcop-step__node {
    margin: 0;
    grid-row: span 2;
  }

  .wcop-step__connector {
    top: var(--wcop-node-size);
    bottom: -18px;
    left: calc(var(--wcop-node-size) / 2 - 1.5px);
    right: auto;
    width: 3px;
    height: auto;
  }

  .wcop-step:last-child .wcop-step__connector {
    display: none;
  }

  .wcop-step__body {
    align-self: center;
  }
}

/* ---- Public lookup form ---- */
.wcop-lookup {
  margin: 1.5em auto;
  padding: 0 2em;
}

.wcop-lookup__form + .wcop-lookup__result {
  margin-top: 25px;
}

.wcop-lookup__form {
  max-width: 500px;
  margin: 0 auto;
}

.wcop-lookup__field {
  margin: 0 0 12px;
}

.wcop-lookup__field label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
}

.wcop-lookup__field input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid #c4c8cf;
  border-radius: 6px;
  font-size: 15px;
}

.wcop-lookup__field input:focus {
  outline: none;
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.18);
}

.wcop-lookup__message {
  margin-top: 8px;
  font-size: 14px;
  color: #6b7280;
}

.wcop-lookup__message--error {
  color: #c62828;
}

.wcop-lookup__result:not(:empty) {
  margin-top: 8px;
}

/* When a result is shown, the stepper inside is full width regardless of the
   form's narrower column. */
.wcop-lookup__result .wcop-stepper {
  max-width: none;
}
