/* ==========================================================================
   Jak probíhá výkup – trasa náklaďáku
   Desktop: sekce se připne na celé okno, náklaďák jede po SVG trase.
   Mobil (< 900 px): svislá trasa vlevo, kroky pod sebou.
   ========================================================================== */

.process {
  position: relative;
  /* trasa i náklaďák na jejím konci vybíhají za pravý okraj – nesmí rozšířit stránku */
  overflow-x: clip;
}

.process__pin {
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding-block: var(--s-10);
  background: var(--c-bg);
  transform-origin: 50% 0;
}

.process__inner {
  width: 100%;
}

.process__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
}

.process__more {
  flex: none;
  margin-bottom: 0.25rem;
}

/* ---------- Trasa ---------- */

.route {
  --route-base: #e4e1da;
  --route-progress: #b9b8ae;
  --route-dot: #aaada5;
  --route-dot-active: #737c71;
  /* neaktivní krok zůstává čitelný (kontrast ≥ 4,5 : 1 na pozadí stránky) – aktivní se liší tmavší barvou a plnou ikonou */
  --step-idle-title: #566055;
  --step-idle-text: var(--c-muted-2);
  position: relative;
  margin-top: var(--s-9);
  container-type: inline-size;
}

.route__svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  overflow: visible;
}

.route__line {
  fill: none;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route__line--base {
  stroke: var(--route-base);
}

.route__line--progress {
  stroke: var(--route-progress);
  stroke-dasharray: 0 99999;
}

.route__dot {
  fill: var(--route-dot);
  transition: fill 0.4s var(--ease-out);
}

.route__dot.is-reached {
  fill: var(--route-dot-active);
}

.route__pulse {
  fill: none;
  stroke: var(--route-dot-active);
  stroke-width: 1.5;
  opacity: 0;
}

.route__truck {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: calc(96 / 1280 * 100cqi);
  height: auto;
  filter: drop-shadow(0 6px 6px rgba(5, 17, 7, 0.18));
  will-change: transform;
  pointer-events: none;
}

/* Bez JS / před inicializací stojí náklaďák na startu */
.no-js .route__truck,
.route__truck:not(.is-ready) {
  transform: translate(calc(2 / 1280 * 100cqi), calc(-3 / 1280 * 100cqi));
}

/* ---------- Kroky ---------- */

.steps {
  position: relative;
  height: calc(260 / 1280 * 100cqi + 13rem);
}

.step {
  position: absolute;
  left: calc(var(--x) / 1280 * 100%);
  top: calc(var(--y) / 1280 * 100cqi);
  width: calc(var(--w, 340) / 1280 * 100%);
}

/* realistická ikonka místo čísla kroku – tlumená, dokud náklaďák kroku nedojede */
.step__icon {
  display: block;
  width: auto;
  height: 3.5rem;
  max-width: 8rem;
  object-fit: contain;
  object-position: left center;
  transform-origin: 0 100%;
  opacity: 0.72;
  filter: grayscale(0.7);
  transition: opacity 0.4s var(--ease-out), filter 0.5s var(--ease-out), transform 0.7s var(--ease-spring);
}

.step.is-active .step__icon {
  opacity: 1;
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .step__icon {
    transition: none;
  }
}

.step__title {
  display: block;
  margin-top: var(--s-2);
  color: var(--step-idle-title);
  transition: color var(--dur-slow) var(--ease-out);
}

.step__text {
  margin-top: var(--s-2);
  color: var(--step-idle-text);
  transition: color var(--dur-slow) var(--ease-out);
}

.step.is-active .step__title {
  color: var(--c-ink);
}

.step.is-active .step__text {
  color: var(--c-muted);
}

/* ---------- Mobil: svislá trasa ---------- */

@media (max-width: 899px) {
  .process {
    padding-top: var(--section-gap);
  }

  .process__pin {
    min-height: 0;
    padding-block: 0;
  }

  .process__head {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
  }

  .route {
    margin-top: var(--s-6);
    container-type: normal;
  }

  .route__svg {
    display: none;
  }

  .route__v {
    position: absolute;
    top: 0.75rem;
    bottom: 2rem;
    left: 1.25rem;
    width: 3px;
    margin-left: -1.5px;
    border-radius: 4px;
    background: var(--route-base);
  }

  .route__v-progress {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--route-progress);
    transform: scaleY(0);
    transform-origin: 50% 0;
  }

  .route__truck {
    left: 1.25rem;
    width: 4.5rem;
    transform: translate(-50%, 0) rotate(90deg);
  }

  .route__truck:not(.is-ready) {
    transform: translate(-50%, 0) rotate(90deg);
  }

  .steps {
    display: grid;
    gap: var(--s-6);
    height: auto;
    padding-top: var(--s-10);
  }

  .step {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    padding-left: var(--s-8);
  }

  .step::before {
    content: "";
    position: absolute;
    left: 1.25rem;
    top: 1rem;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: -0.625rem;
    border-radius: 50%;
    background: var(--route-dot);
    box-shadow: 0 0 0 6px var(--c-bg);
    transition: background-color 0.4s var(--ease-out), transform 0.4s var(--ease-spring);
  }

  .step.is-active::before {
    background: var(--route-dot-active);
    transform: scale(1.15);
  }

  /* ikonka vlevo vedle tečky trasy */
  .step__icon {
    height: 3rem;
    max-width: 6rem;
  }

  .step__title {
    margin-top: var(--s-1);
  }

  .step__text {
    margin-top: var(--s-1);
  }
}

@media (min-width: 900px) {
  .route__v {
    display: none;
  }
}

@media (min-width: 900px) and (max-width: 1199px) {
  .step__text {
    font-size: var(--fs-body);
  }
}

/* Přišpendlená sekce má dole vlastní rezervu, takže následující sekce nepotřebuje horní odsazení */
@media (min-width: 900px) {
  .process + .band,
  .process + .catalog {
    padding-top: 0;
  }
}
