/* ==========================================================================
   TapNexa Homepage v8 — Component 2: Four-Step Process Infographic
   Section: "On your counter in four steps."
   Mobile composition: 4:3 | Desktop composition: 16:9
   ========================================================================== */

.tnx-steps {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--tnx-font-body);
  padding: 40px 16px;
  box-sizing: border-box;
}

.tnx-steps *,
.tnx-steps *::before,
.tnx-steps *::after {
  box-sizing: border-box;
}

.tnx-steps__inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.tnx-steps__title {
  margin: 0;
  font-family: var(--tnx-font-head);
  font-size: clamp(1.5rem, 5.2vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* 4:3 on mobile, adapting to 16:9 on desktop */
.tnx-steps__stage {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.tnx-steps__stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 2;
}

.tnx-steps__counter {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--amber-ink);
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

.tnx-steps__scenes {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 8px 0;
}

.tnx-steps__scene {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  pointer-events: none;
  transition:
    opacity 300ms var(--tnx-ease-glide),
    transform 460ms var(--tnx-ease-settle);
}

.tnx-steps__scene.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Scene 1: Product selection */
.tnx-scene1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.tnx-scene1__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.74rem;
  font-weight: 600;
}

.tnx-scene1__item--side {
  width: 78px;
  opacity: 0.72;
}

.tnx-scene1__item--main {
  width: 122px;
  background: #ffffff;
  border: 2px solid var(--amber);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(43, 26, 12, 0.08);
  transform: translateY(4px);
  transition: transform 500ms var(--tnx-ease-settle);
}

.tnx-steps__scene.is-active .tnx-scene1__item--main {
  transform: translateY(-3px);
}

.tnx-scene1__item--main img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  display: block;
}

.tnx-scene1__check {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--amber);
  color: var(--ink);
  display: grid;
  place-items: center;
}

/* Scene 2: Logo & links after ordering */
.tnx-scene2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 460px;
}

.tnx-scene2__form {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.tnx-scene2__chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink);
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity 420ms var(--tnx-ease-glide),
    transform 460ms var(--tnx-ease-settle);
}

.tnx-steps__scene.is-active .tnx-scene2__chip--1 {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 80ms;
}

.tnx-steps__scene.is-active .tnx-scene2__chip--2 {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 200ms;
}

.tnx-scene2__tag {
  font-size: 0.68rem;
  color: var(--amber-ink);
  font-weight: 600;
  padding-left: 2px;
}

.tnx-scene2__arrow {
  flex: 0 0 auto;
  color: var(--amber-ink);
}

.tnx-scene2__preview {
  flex: 0 0 92px;
  width: 92px;
  height: 110px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--line-2);
  padding: 8px;
  display: grid;
  place-items: center;
}

.tnx-scene2__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Scene 3: Design approval & free India shipping */
.tnx-scene3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 480px;
}

.tnx-scene3__proof {
  position: relative;
  width: 104px;
  padding: 8px 8px 10px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.tnx-scene3__proof img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
}

.tnx-scene3__stamp {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--amber);
  color: var(--ink);
  white-space: nowrap;
}

.tnx-scene3__route {
  color: var(--line-2);
  flex: 0 1 88px;
  display: grid;
  place-items: center;
}

.tnx-scene3__route svg {
  width: 100%;
  height: auto;
}

.tnx-scene3__ship {
  width: 112px;
  padding: 10px 8px;
  border-radius: 14px;
  background: var(--navy);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
  transform: translateX(6px);
  transition: transform 500ms var(--tnx-ease-settle) 120ms;
}

.tnx-steps__scene.is-active .tnx-scene3__ship {
  transform: translateX(0);
}

/* Scene 4: Delivered standee at a business counter */
.tnx-scene4 {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  padding-bottom: 18px;
}

.tnx-scene4__counter {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 6px;
  height: 16px;
  border-radius: 10px;
  background: var(--sand);
  border: 1px solid var(--line-2);
}

.tnx-scene4__standee {
  position: relative;
  z-index: 1;
  width: 112px;
  height: 124px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 8px;
  box-shadow: 0 10px 18px rgba(43, 26, 12, 0.09);
  display: grid;
  place-items: center;
}

.tnx-scene4__standee img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tnx-scene4__phone {
  position: relative;
  z-index: 2;
  width: 96px;
  padding: 12px 8px;
  border-radius: 18px;
  background: var(--navy);
  border: 2px solid var(--nav);
  color: var(--amber-soft);
  transform: translate(12px, -6px) rotate(4deg);
  transition: transform 560ms var(--tnx-ease-glide) 100ms;
}

.tnx-steps__scene.is-active .tnx-scene4__phone {
  transform: translate(0, -10px) rotate(0deg);
}

.tnx-scene4__phone-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--paper);
}

/* Progress Bars (transform: scaleX only — zero reflow) */
.tnx-steps__bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  z-index: 2;
}

.tnx-steps__bar {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.tnx-steps__bar > span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--amber);
  transform-origin: left center;
  transform: scaleX(0);
}

.tnx-steps__bar.is-done > span {
  transform: scaleX(1);
}

.tnx-steps.is-inview:not(.is-paused) .tnx-steps__bar.is-active > span {
  animation: tnxStepFill var(--tnx-step-ms, 3400ms) linear forwards;
}

.tnx-steps.is-paused .tnx-steps__bar.is-active > span {
  transform: scaleX(1);
}

@keyframes tnxStepFill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.tnx-steps__caption {
  margin: 8px 2px 0;
  font-size: 0.74rem;
  color: var(--ink-2);
}

/* Editable 4-Step List */
.tnx-steps__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.tnx-steps__item-btn {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    background-color var(--tnx-dur-ui) var(--ease),
    border-color var(--tnx-dur-ui) var(--ease);
}

.tnx-steps__item-btn:hover {
  border-color: var(--line-2);
}

.tnx-steps__item-btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.tnx-steps__item.is-active .tnx-steps__item-btn {
  background: var(--cream);
  border-color: var(--amber);
}

.tnx-steps__num {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--paper);
  font-family: var(--tnx-font-head);
  font-size: 0.85rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  transition:
    background-color var(--tnx-dur-ui) var(--ease),
    color var(--tnx-dur-ui) var(--ease);
}

.tnx-steps__item.is-active .tnx-steps__num {
  background: var(--amber);
  color: var(--ink);
}

.tnx-steps__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tnx-steps__item-title {
  font-family: var(--tnx-font-head);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.tnx-steps__item-desc {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink-2);
}

/* Desktop: 16:9 Stage + 2x2 Step Grid */
@media (min-width: 768px) {
  .tnx-steps {
    padding: 56px 24px;
  }

  .tnx-steps__stage {
    aspect-ratio: 16 / 9;
    padding: 18px 24px 20px;
  }

  .tnx-scene1__item--main {
    width: 156px;
    padding: 14px;
  }

  .tnx-scene1__item--main img {
    width: 108px;
    height: 108px;
  }

  .tnx-scene1__item--side {
    width: 108px;
    padding: 14px;
  }

  .tnx-scene4__standee {
    width: 142px;
    height: 156px;
  }

  .tnx-scene4__phone {
    width: 114px;
    padding: 14px 10px;
  }

  .tnx-steps__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* Full static presentation for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tnx-steps__scene,
  .tnx-scene1__item--main,
  .tnx-scene2__chip,
  .tnx-scene3__ship,
  .tnx-scene4__phone,
  .tnx-steps__item-btn {
    transition: none !important;
    transform: none !important;
  }

  .tnx-steps__scene.is-active .tnx-scene2__chip {
    opacity: 1 !important;
  }

  .tnx-steps__bar.is-active > span {
    animation: none !important;
    transform: scaleX(1) !important;
  }

  .tnx-steps__stage-bar .tnx-motion-toggle {
    display: none;
  }
}
