/**
 * Goal Process Flow widget
 * Zigzag process: number, title, description, image per item.
 */

.process-flow {
  --pf-connector: #21a49b;
  --pf-number: #21a49b;
  --pf-title: #111827;
  --pf-desc: #374151;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 15px;
  overflow: visible;
}

.process-flow__header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.process-flow__header-title {
  margin: 0 0 0.5rem;
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.2;
}

.process-flow__header-subtitle {
  margin: 0;
  font-size: 1rem;
  opacity: 0.9;
}

.process-flow__list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  overflow: visible;
}

.process-flow__item {
  width: 100%;
  max-width: 85%;
}

.process-flow__item--left {
  align-self: flex-start;
}

.process-flow__item--right {
  align-self: flex-end;
}

@media (min-width: 768px) {
  .process-flow__item {
    max-width: 75%;
  }
}

/* Connector zigzag: xuống → ngang (trái/phải) → xuống + mũi tên (vị trí đánh dấu đỏ). */
.process-flow__connector {
  --pf-bend: 14%;
  position: relative;
  height: 4.5rem;
  min-height: 4.5rem;
  width: 100%;
  flex-shrink: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.process-flow__connector-seg {
  position: absolute;
  pointer-events: none;
  border-color: var(--pf-connector, #21a49b);
  z-index: 0;
}

/* V1: đoạn dọc từ card trên xuống */
.process-flow__connector-seg--h1 {
  top: 0;
  left: 50%;
  width: 0;
  height: 1.25rem;
  margin-left: -1px;
  border-left: 2px dashed var(--pf-connector, #21a49b);
}

/* H: đoạn ngang (rẽ trái/phải) */
.process-flow__connector-seg--h2 {
  top: 1.25rem;
  height: 0;
  width: var(--pf-bend);
  border-top: 2px dashed var(--pf-connector, #21a49b);
}

.process-flow__connector--to-right .process-flow__connector-seg--h2 {
  left: 50%;
}

.process-flow__connector--to-left .process-flow__connector-seg--h2 {
  right: 50%;
  left: auto;
}

/* V2: đoạn dọc xuống card dưới + mũi tên */
.process-flow__connector-seg--v {
  top: calc(1.25rem + 2px);
  bottom: 0;
  width: 0;
  margin-left: -1px;
  border-left: 2px dashed var(--pf-connector, #21a49b);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 0;
}

.process-flow__connector--to-right .process-flow__connector-seg--v {
  left: calc(50% + var(--pf-bend));
}

.process-flow__connector--to-left .process-flow__connector-seg--v {
  left: calc(50% - var(--pf-bend));
}

.process-flow__connector-seg--v::before {
  content: "";
  flex: 1;
  min-height: 0.5rem;
}

.process-flow__connector-arrow {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  color: var(--pf-connector, #21a49b);
  display: block;
  background: #fff;
  border-radius: 50%;
}

.process-flow__card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  gap: 0;
}

.process-flow__item--right .process-flow__card {
  flex-direction: row-reverse;
}

.process-flow__content {
  flex: 1 1 55%;
  padding: 1.5rem 1.5rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

@media (min-width: 992px) {
  .process-flow__content {
    padding: 2rem 2rem 2rem 2.25rem;
  }
}

.process-flow__number {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--pf-number, #21a49b);
  margin-bottom: 0.5rem;
  display: inline-block;
}

.process-flow__number::after {
  content: " ★";
  font-size: 0.4em;
  opacity: 0.9;
  vertical-align: super;
}

.process-flow__title {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--pf-title, #111827);
}

@media (min-width: 768px) {
  .process-flow__title {
    font-size: 1.25rem;
  }
}

.process-flow__desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--pf-desc, #374151);
}

.process-flow__media {
  flex: 0 0 42%;
  min-height: 180px;
  background: #f3f4f6;
  position: relative;
  overflow: hidden;
}

.process-flow__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (min-width: 768px) {
  .process-flow__media {
    min-height: 220px;
  }
}

@media (max-width: 575px) {
  .process-flow__connector {
    --pf-bend: 10%;
    height: 4rem;
    min-height: 4rem;
  }

  .process-flow__item {
    max-width: 100%;
  }

  .process-flow__card {
    flex-direction: column !important;
  }

  .process-flow__media {
    min-height: 160px;
    flex: 0 0 auto;
  }
}
