/*
 * Ningbo Happiness — Our Factory Production Flow
 * Scoped under .hp-factory-process to avoid conflicts with an existing WordPress theme.
 */
.hp-factory-process {
  --hp-red: #ef233c;
  --hp-red-dark: #d91c33;
  --hp-ink: #0d1b2a;
  --hp-text: #445160;
  --hp-muted: #7b8794;
  --hp-line: #e6e9ed;
  --hp-soft: #f6f8fa;
  --hp-white: #ffffff;
  --hp-pass: #2e9f62;
  --hp-pending: #c98917;
  --hp-fail: #d84a4a;
  --hp-radius: 18px;
  --hp-shadow: 0 18px 45px rgba(18, 31, 45, 0.08);

  background: var(--hp-white);
  color: var(--hp-ink);
  font-family: inherit;
  padding: clamp(72px, 8vw, 126px) 0;
  scroll-margin-top: 120px;
}

.hp-factory-process *,
.hp-factory-process *::before,
.hp-factory-process *::after {
  box-sizing: border-box;
}

.hp-factory-process__shell {
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto;
}

.hp-factory-process__header {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.7fr);
  gap: 64px;
  align-items: end;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--hp-line);
}

.hp-factory-process__eyebrow {
  margin: 0 0 16px;
  color: var(--hp-red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.hp-factory-process__header h2 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(36px, 4.1vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 760;
}

.hp-factory-process__intro {
  max-width: 540px;
  margin: 0 0 4px;
  color: var(--hp-text);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.8;
}

.hp-factory-process__index {
  position: sticky;
  top: 88px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0;
  margin: 28px 0 70px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--hp-line);
  box-shadow: 0 10px 30px rgba(18, 31, 45, 0.05);
  backdrop-filter: blur(12px);
}

.hp-factory-process__index a {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border-right: 1px solid var(--hp-line);
  color: #586473;
  text-decoration: none;
  text-align: center;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
  transition: color 220ms ease, background-color 220ms ease;
}

.hp-factory-process__index a:last-child {
  border-right: 0;
}

.hp-factory-process__index a span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 50%;
  background: var(--hp-soft);
  color: var(--hp-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  transition: background-color 220ms ease, color 220ms ease;
}

.hp-factory-process__index a:hover,
.hp-factory-process__index a.is-active {
  color: var(--hp-ink);
  background: #fff;
}

.hp-factory-process__index a:hover span,
.hp-factory-process__index a.is-active span {
  background: var(--hp-red);
  color: #fff;
}

.hp-factory-process__timeline {
  position: relative;
  display: grid;
  gap: 76px;
}

.hp-factory-process__timeline::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, transparent 0, var(--hp-line) 3%, var(--hp-line) 97%, transparent 100%);
  transform: translateX(-50%);
}

.hp-process-step {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(52px, 6vw, 98px);
  align-items: center;
  min-height: 500px;
  scroll-margin-top: 185px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 650ms ease, transform 650ms cubic-bezier(.2,.7,.2,1);
}

.hp-process-step.is-visible {
  opacity: 1;
  transform: none;
}

.hp-process-step:nth-child(even) .hp-process-step__media {
  grid-column: 2;
}

.hp-process-step:nth-child(even) .hp-process-step__content {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.hp-process-step::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--hp-red);
  box-shadow: 0 0 0 1px rgba(239, 35, 60, 0.2), 0 4px 14px rgba(239, 35, 60, 0.24);
  transform: translate(-50%, -50%);
}

.hp-process-step__media {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  aspect-ratio: 16 / 10;
  border-radius: var(--hp-radius);
  background: #eef1f4;
  box-shadow: var(--hp-shadow);
}

.hp-process-step__media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(.2,.7,.2,1);
}

.hp-process-step:hover .hp-process-step__media img {
  transform: scale(1.025);
}

.hp-process-step__photo-label {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.6);
  background: rgba(13, 27, 42, 0.62);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  letter-spacing: .05em;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.hp-process-step__content {
  width: min(100%, 520px);
  position: relative;
  padding: 10px 0;
}

.hp-process-step__number {
  position: absolute;
  top: -26px;
  right: 0;
  color: #eef1f4;
  font-size: clamp(72px, 7vw, 112px);
  line-height: .8;
  font-weight: 800;
  letter-spacing: -0.08em;
  z-index: -1;
  user-select: none;
}

.hp-process-step:nth-child(even) .hp-process-step__number {
  right: auto;
  left: 0;
}

.hp-process-step__kicker {
  margin: 0 0 12px;
  color: var(--hp-red);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: .14em;
}

.hp-process-step__content h3 {
  margin: 0 0 18px;
  color: var(--hp-ink);
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 740;
}

.hp-process-step__content > p:not(.hp-process-step__kicker) {
  margin: 0;
  color: var(--hp-text);
  font-size: 16px;
  line-height: 1.78;
}

.hp-process-step__points {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.hp-process-step__points li {
  position: relative;
  padding-left: 22px;
  color: #334150;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 600;
}

.hp-process-step__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .7em;
  width: 8px;
  height: 2px;
  background: var(--hp-red);
}

.hp-quality-gate {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 26px;
}

.hp-quality-gate__item {
  min-width: 0;
  padding: 15px 14px 14px;
  border: 1px solid var(--hp-line);
  background: #fff;
}

.hp-quality-gate__item strong,
.hp-quality-gate__item span {
  display: block;
}

.hp-quality-gate__item strong {
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: .09em;
}

.hp-quality-gate__item span {
  color: var(--hp-muted);
  font-size: 11px;
  line-height: 1.35;
}

.hp-quality-gate__item--pass { border-top: 3px solid var(--hp-pass); }
.hp-quality-gate__item--pending { border-top: 3px solid var(--hp-pending); }
.hp-quality-gate__item--fail { border-top: 3px solid var(--hp-fail); }
.hp-quality-gate__item--pass strong { color: var(--hp-pass); }
.hp-quality-gate__item--pending strong { color: var(--hp-pending); }
.hp-quality-gate__item--fail strong { color: var(--hp-fail); }

.hp-inspection-list {
  display: grid;
  gap: 1px;
  margin-top: 26px;
  border: 1px solid var(--hp-line);
  background: var(--hp-line);
}

.hp-inspection-list > div {
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 12px;
  padding: 13px 14px;
  background: #fff;
}

.hp-inspection-list span {
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--hp-soft);
  color: var(--hp-red);
  font-size: 10px;
  font-weight: 800;
}

.hp-inspection-list strong {
  align-self: end;
  color: var(--hp-ink);
  font-size: 13px;
}

.hp-inspection-list small {
  align-self: start;
  margin-top: 2px;
  color: var(--hp-muted);
  font-size: 11px;
}

.hp-process-step__gate-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding: 12px 15px 12px 12px;
  border: 1px solid #dfe8e3;
  background: #f7fbf9;
  color: #2d6d4b;
  font-size: 13px;
  font-weight: 700;
}

.hp-process-step__gate-note span {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--hp-pass);
  color: #fff;
  font-size: 13px;
}

.hp-process-step--final .hp-process-step__media {
  box-shadow: 0 22px 52px rgba(18, 31, 45, 0.1);
}

@media (max-width: 1180px) {
  .hp-factory-process__shell {
    width: min(100% - 40px, 1180px);
  }

  .hp-factory-process__index {
    top: 76px;
    overflow-x: auto;
    grid-template-columns: repeat(8, 150px);
    justify-content: start;
    scrollbar-width: none;
  }

  .hp-factory-process__index::-webkit-scrollbar { display: none; }

  .hp-process-step {
    gap: 58px;
  }
}

@media (max-width: 900px) {
  .hp-factory-process {
    padding: 72px 0 84px;
  }

  .hp-factory-process__shell {
    width: min(100% - 30px, 760px);
  }

  .hp-factory-process__header {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hp-factory-process__index {
    position: relative;
    top: auto;
    margin: 24px 0 50px;
  }

  .hp-factory-process__timeline {
    gap: 62px;
  }

  .hp-factory-process__timeline::before {
    left: 18px;
  }

  .hp-process-step,
  .hp-process-step:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: 0;
    padding-left: 46px;
  }

  .hp-process-step::after {
    left: 18px;
    top: 28px;
  }

  .hp-process-step:nth-child(even) .hp-process-step__media,
  .hp-process-step:nth-child(even) .hp-process-step__content {
    grid-column: 1;
    grid-row: auto;
  }

  .hp-process-step__media {
    min-height: 0;
  }

  .hp-process-step__content,
  .hp-process-step:nth-child(even) .hp-process-step__content {
    width: 100%;
    justify-self: stretch;
  }

  .hp-process-step:nth-child(even) .hp-process-step__number {
    left: auto;
    right: 0;
  }
}

@media (max-width: 560px) {
  .hp-factory-process__shell {
    width: calc(100% - 24px);
  }

  .hp-factory-process__header h2 {
    font-size: 36px;
  }

  .hp-factory-process__intro {
    font-size: 15px;
  }

  .hp-process-step,
  .hp-process-step:nth-child(even) {
    padding-left: 34px;
  }

  .hp-factory-process__timeline::before,
  .hp-process-step::after {
    left: 10px;
  }

  .hp-process-step__content h3 {
    font-size: 31px;
  }

  .hp-quality-gate {
    grid-template-columns: 1fr;
  }

  .hp-process-step__photo-label {
    left: 12px;
    bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hp-process-step,
  .hp-process-step__media img,
  .hp-factory-process__index a,
  .hp-factory-process__index a span {
    transition: none !important;
  }
}
