/**
 * 水銷服務流程 — Figma node 121:79（process 區塊）
 * 僅用於 index-copy.html
 */

.pub-section--process-v2 {
  --process-v2-content-rail: 275px;
  --process-v2-card-width: 1160px;
  --process-v2-rail-gutter: clamp(24px, calc((100% - var(--process-v2-card-width)) / 2), var(--process-v2-content-rail));
  --process-v2-rail-width: min(var(--process-v2-card-width), calc(100% - 2 * var(--process-v2-rail-gutter)));
  padding:
    100px
    var(--process-v2-rail-gutter)
    100px !important;
  background: #f6f4f5;
}

.pub-section--process-v2 .pub-section__inner--process {
  max-width: none;
  width: var(--process-v2-rail-width);
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
}

/* ── Header ── */
.pub-process__header--v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto 32px;
  text-align: center;
}

.pub-process__eyebrow--v2 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 16.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e60012;
}

.pub-process__eyebrow-mark {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  background: #e60012;
}

.pub-process__title--v2 {
  margin: 0;
  font-family: 'Noto Sans TC', 'PingFang TC', sans-serif;
  font-size: 36px;
  font-weight: 600;
  line-height: 48px;
  color: #111;
  letter-spacing: 0;
}

.pub-process__desc--v2 {
  margin: 0;
  font-family: 'Noto Sans TC', 'PingFang TC', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 25.6px;
  color: rgba(17, 17, 17, 0.6);
}

/* ── Stage card（1160 × 457） ── */
.pub-process-stage--v2 {
  position: relative;
  width: 100%;
  max-width: 1160px;
  height: 457px;
  margin: 0 auto;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
}

.pub-process-stage--v2:focus-visible {
  box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.18);
}

.pub-process-stage--v2 .pub-process-stage__shell {
  display: grid;
  grid-template-columns: 256px 16px 1px 16px minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
  height: 100%;
  padding: 19px 15px 14px 16px;
  box-sizing: border-box;
}

/* ── 左側步驟切換器（w-64） ── */
.pub-process-stage--v2 .pub-process-stage__rail-panel {
  position: static;
  grid-column: 1;
  grid-row: 1;
  z-index: 2;
  width: auto;
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 8px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.pub-process-stage--v2 .pub-process-stage__rail {
  position: static;
  z-index: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 0;
  margin: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  overflow: visible;
}

.pub-process-stage--v2 .pub-process-stage__rail-btn {
  flex: 0 0 auto;
  align-self: stretch;
  min-width: 0;
  width: 100%;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #171717;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.pub-process-stage--v2 .pub-process-stage__rail-btn:hover:not(.pub-process-stage__rail-btn--active) {
  background: rgba(17, 17, 17, 0.03);
}

.pub-process-stage--v2 .pub-process-stage__rail-btn--active {
  border-radius: 4px;
  background: #171717;
  color: #fff;
}

.pub-process-stage--v2 .pub-process-stage__rail-btn--active:hover {
  background: #171717;
}

.pub-process-stage--v2 .pub-process-stage__rail-btn--timing::after {
  display: none;
}

.pub-process-stage--v2 .pub-process-stage__rail-btn:focus-visible {
  outline: 2px solid #e60012;
  outline-offset: 2px;
}

.pub-process-stage--v2 .pub-process-stage__rail-num {
  flex-shrink: 0;
  font-family: 'PingFang TC', 'Noto Sans TC', sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: normal;
  letter-spacing: 0;
  opacity: 1;
  color: rgba(23, 23, 23, 0.2);
}

.pub-process-stage--v2 .pub-process-stage__rail-btn--active .pub-process-stage__rail-num {
  color: rgba(255, 255, 255, 0.6);
}

.pub-process-stage--v2 .pub-process-stage__rail-label {
  flex: 1 1 0;
  min-width: 0;
  font-family: 'Noto Sans TC', 'PingFang TC', sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: normal;
  text-align: left;
  white-space: nowrap;
  color: #171717;
}

.pub-process-stage--v2 .pub-process-stage__rail-btn--active .pub-process-stage__rail-label {
  color: #fff;
}

/* ── 分隔線（與切換器間距 16px，高度 fill 容器） ── */
.pub-process-stage--v2 .pub-process-stage__divider {
  position: static;
  grid-column: 3;
  grid-row: 1;
  width: 1px;
  height: auto;
  min-height: 100%;
  align-self: stretch;
  justify-self: center;
  background: rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

/* ── 右側媒體區 ── */
.pub-process-stage--v2 .pub-process-stage__body {
  position: relative;
  grid-column: 5;
  grid-row: 1;
  width: auto;
  max-width: none;
  height: auto;
  min-height: 0;
  align-self: stretch;
  border-radius: 8px;
  overflow: hidden;
}

.pub-process-stage--v2 .pub-process-stage__media {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  max-height: none;
  min-height: 0;
  height: 100%;
  border-radius: 8px;
}

.pub-process-stage--v2 .pub-process-stage__scrim {
  top: auto;
  bottom: 0;
  height: 74%;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.35) 38%,
    rgba(0, 0, 0, 0.72) 100%
  );
}

.pub-process-stage--v2 .pub-process-stage__overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: block;
  padding: 0;
  pointer-events: none;
}

.pub-process-stage--v2 .pub-process-stage__panels {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: none;
}

.pub-process-stage--v2 .pub-process-stage__panel {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  transform: none;
  visibility: hidden;
  pointer-events: none;
}

.pub-process-stage--v2 .pub-process-stage__panel--active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.pub-process-stage--v2 {
  --process-v2-copy-bottom: 32px;
}

.pub-process-stage--v2 .pub-process-stage__step-index {
  position: absolute;
  left: 46px;
  top: auto;
  bottom: calc(var(--process-v2-copy-bottom) + 40px + 5px);
  margin: 0;
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.08em;
  color: #dc2626;
}

.pub-process-stage--v2 .pub-process-stage__panel-title {
  position: absolute;
  left: 46px;
  top: auto;
  bottom: var(--process-v2-copy-bottom);
  margin: 0;
  font-family: 'PingFang TC', 'Noto Sans TC', sans-serif;
  font-size: 30px;
  font-weight: 600;
  line-height: 40px;
  color: #fff;
  white-space: nowrap;
}

.pub-process-stage--v2 .pub-process-stage__panel-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.1);
  font-family: 'PingFang TC', 'Noto Sans TC', sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.pub-process-stage--v2 .pub-process-stage__panel-cta:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.85);
}

.pub-process-stage--v2 .pub-process-stage__panel-cta:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.pub-process-stage--v2 .pub-process-stage__panel-cta--primary {
  border-color: #e60012;
  background: #e60012;
  color: #fff;
}

.pub-process-stage--v2 .pub-process-stage__panel-cta--primary:hover {
  background: #c40010;
  border-color: #c40010;
}

.pub-process-stage--v2 .pub-process-stage__panel-cta--primary:focus-visible {
  outline-color: #fff;
}

.pub-process-stage--v2 .pub-process-stage__panel-side {
  position: absolute;
  left: 261px;
  right: 46px;
  bottom: var(--process-v2-copy-bottom);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 12px;
  max-width: 533px;
  pointer-events: auto;
}

.pub-process-stage--v2 .pub-process-stage__panel-desc {
  position: static;
  width: 100%;
  max-width: 533px;
  margin: 0;
  padding: 0;
  font-family: 'PingFang TC', 'Noto Sans TC', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 28px;
  color: rgba(255, 255, 255, 0.88);
}

.pub-process-stage--v2 .pub-process-stage__chips {
  position: static;
  margin: 0;
  padding: 0;
  pointer-events: auto;
}

.pub-process-stage--v2 .pub-process-stage__chip-btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.pub-process-stage--v2 .pub-process-stage__chip-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ── 底部進度條 ── */
.pub-process-stage--v2 .pub-process-stage__progress {
  position: absolute;
  left: 0;
  right: 0;
  width: auto;
  top: auto;
  bottom: 0;
  z-index: 5;
  height: 2px;
  pointer-events: none;
}

.pub-process-stage--v2 .pub-process-stage__progress-track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.3);
}

.pub-process-stage--v2 .pub-process-stage__progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  background: #dc2626;
  transform: scaleX(0);
  transform-origin: left center;
}

.pub-process-stage--v2 .pub-process-stage__progress-fill--timing {
  animation: pub-process-v2-step-timer var(--step-timer-ms, 4s) linear forwards;
}

@keyframes pub-process-v2-step-timer {
  to { transform: scaleX(1); }
}

@media (max-width: 1160px) {
  .pub-process-stage--v2 {
    height: auto;
    min-height: 457px;
    padding-bottom: 16px;
  }

  .pub-process-stage--v2 .pub-process-stage__shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 457px;
    padding: 16px;
  }

  .pub-process-stage--v2 .pub-process-stage__rail-panel {
    position: static;
    width: 100%;
    max-width: none;
    top: auto;
    left: auto;
  }

  .pub-process-stage--v2 .pub-process-stage__divider {
    display: none;
  }

  .pub-process-stage--v2 .pub-process-stage__rail {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .pub-process-stage--v2 .pub-process-stage__rail-btn {
    width: auto;
    min-width: 148px;
    flex: 0 0 auto;
  }

  .pub-process-stage--v2 .pub-process-stage__body {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    max-width: none;
    min-height: clamp(280px, 52vw, 428px);
    height: auto;
    aspect-ratio: 821 / 428;
  }

  .pub-process-stage--v2 .pub-process-stage__scrim {
    height: 82%;
  }

  .pub-process-stage--v2 .pub-process-stage__step-index {
    top: auto;
    bottom: calc(var(--process-v2-copy-bottom) + 40px + 5px);
    left: 20px;
  }

  .pub-process-stage--v2 .pub-process-stage__panel-title {
    top: auto;
    bottom: var(--process-v2-copy-bottom);
    left: 20px;
    font-size: clamp(24px, 5vw, 30px);
    line-height: 1.25;
    white-space: normal;
  }

  .pub-process-stage--v2 .pub-process-stage__panel-side {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    max-width: none;
    width: 100%;
    padding: 0 20px var(--process-v2-copy-bottom);
    margin-top: auto;
    gap: 12px;
  }

  .pub-process-stage--v2 .pub-process-stage__panel-desc {
    width: 100%;
    max-width: none;
  }

  .pub-process-stage--v2 .pub-process-stage__panel--active {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

  .pub-process-stage--v2 .pub-process-stage__progress {
    left: 0;
    width: 100%;
    top: auto;
    bottom: 0;
  }
}

@media (max-width: 991px) {
  .pub-section--process-v2 {
    padding-top: 76px !important;
    padding-bottom: 76px !important;
  }
}

@media (max-width: 575px) {
  .pub-section--process-v2 {
    --process-v2-rail-gutter: 24px;
  }

  .pub-process__title--v2 {
    font-size: clamp(28px, 7vw, 36px);
    line-height: 1.25;
  }

  .pub-process-stage--v2 .pub-process-stage__rail-num,
  .pub-process-stage--v2 .pub-process-stage__rail-label {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pub-process-stage--v2 .pub-process-stage__progress-fill--timing {
    animation: none;
    display: none;
  }
}
