/* Interactive Product Tour — homepage */

.public-product-tour {
  scroll-margin-top: 5rem;
}

.product-tour {
  display: grid;
  gap: 1.25rem;
}

.tour-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 0.35rem;
  margin-inline: -0.25rem;
  padding-inline: 0.25rem;
}

.tour-tabs::-webkit-scrollbar {
  height: 4px;
}

.tour-tabs::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
}

.tour-tab {
  flex: 0 0 auto;
  scroll-snap-align: start;
  padding: 0.55rem 1rem;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    background 0.25s var(--ease);
}

.tour-tab:hover {
  color: var(--text);
  border-color: var(--accent-border);
}

.tour-tab.is-active {
  color: var(--accent-light);
  border-color: var(--accent-border);
  box-shadow: 0 0 24px var(--accent-inset);
  background: rgba(212, 168, 83, 0.1);
}

.tour-panels {
  position: relative;
  min-height: 12rem;
}

.tour-panel {
  display: none;
  animation: tour-fade 0.32s var(--ease);
}

.tour-panel.is-active {
  display: grid;
  gap: 1rem;
}

@keyframes tour-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tour-scenario {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  padding: 1.15rem 1.1rem;
  border-color: var(--border-subtle);
}

.tour-scenario__col {
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.tour-scenario__col--challenge {
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.05);
}

.tour-scenario__col--helps {
  border-color: var(--accent-border);
  background: rgba(212, 168, 83, 0.06);
}

.tour-scenario__col--result {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.tour-scenario__label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.tour-scenario__col--helps .tour-scenario__label {
  color: var(--accent-light);
}

.tour-scenario__col--result .tour-scenario__label {
  color: var(--emerald);
}

.tour-scenario__col p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.tour-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.tour-flow__step {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.tour-flow__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-light);
  border-radius: 50%;
  background: rgba(212, 168, 83, 0.15);
  border: 1px solid var(--accent-border);
}

.tour-flow__arrow {
  display: inline-block;
  width: 1.25rem;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-border), var(--emerald));
  position: relative;
}

html[dir="rtl"] .tour-flow__arrow,
body.is-rtl .tour-flow__arrow {
  transform: scaleX(-1);
}

.tour-flow__arrow::after {
  content: "";
  position: absolute;
  inset-inline-end: 0;
  top: -3px;
  border: 4px solid transparent;
  border-inline-start-color: var(--emerald);
}

.product-tour .section-inline-cta {
  margin-top: 0.25rem;
  text-align: center;
}

@media (min-width: 640px) {
  .tour-tabs {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    scroll-snap-type: none;
  }
}

@media (max-width: 900px) {
  .tour-scenario {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .tour-tab {
    font-size: 0.8rem;
    padding: 0.5rem 0.85rem;
  }

  .tour-scenario {
    padding: 1rem 0.85rem;
  }

  .tour-flow {
    justify-content: flex-start;
  }

  .tour-flow__step {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-panel {
    animation: none;
  }
}
