/* Collect flow block (tab_3cards) — 3 карточки + анимация валют */

.collect-flow-section {
  padding: 4rem 0 5rem;
  background: transparent;
  overflow: visible;
  --cf-stroke: rgba(255, 255, 255, 0.28);
}

.collect-flow-wrap {
  max-width: 1200px;
  margin: 0 auto;
}

.collect-flow-overflow {
  width: 100%;
  overflow: hidden;
}

.collect-flow-extend {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
}

.collect-flow-title {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 600;
  text-align: center;
  margin: 0 0 0.75rem;
  color: #fff;
  max-width: 720px;
}

.collect-flow-subtitle {
  text-align: center;
  margin: 0 auto 1.75rem;
  max-width: 640px;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  line-height: 1.5;
}

/* Верхняя вертикальная линия */
.collect-flow-stem {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.collect-flow-stem-inner {
  width: 68%;
  height: 40px;
  display: flex;
}

.collect-flow-stem-line {
  width: 50%;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
}

/* Зона монет + центральная иконка */
.collect-flow-coins {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto -2px;
  height: 92px;
  display: flex;
  justify-content: center;
  user-select: none;
}

.collect-flow-coins-grid {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  position: relative;
}

.collect-flow-coins-grid .hp2-3cards-money1,
.collect-flow-coins-grid .hp2-3cards-money2,
.collect-flow-coins-grid .hp2-3cards-money3 {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  top: -25px;
  z-index: 20;
  display: none;
  justify-content: center;
}

.collect-flow-coins-center {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  z-index: 40;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.collect-flow-coins-center img {
  width: 128px;
  height: 75px;
  object-fit: contain;
}

.collect-flow-coin-img {
  width: 80px;
  height: 94px;
  object-fit: contain;
}

/* Соединительные линии — схема «дерево»: горизонтальная шина + отводы к центрам
   трёх карточек, со скруглёнными углами. Центры карточек ≈ 1/6, 1/2, 5/6 ширины. */
.cf-tree {
  display: none;
  position: relative;
  width: 100%;
  max-width: 1000px;
  height: 56px;
  margin: 0 auto;
}

/* Вертикальная линия по центру — идёт сквозь весь блок (к центру и средней карточке) */
.cf-tree-center {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--cf-stroke);
}

/* Рамка-«скобка»: боковые отводы к крайним карточкам + горизонтальная шина */
.cf-tree-box {
  position: absolute;
  left: 15.6%;
  right: 15.6%;
  height: 36px;
  border-left: 1px solid var(--cf-stroke);
  border-right: 1px solid var(--cf-stroke);
}

/* Верх: шина сверху, отводы вниз к карточкам; центр приходит сверху (от иконки) */
.cf-tree-top .cf-tree-box {
  top: 20px;
  border-top: 1px solid var(--cf-stroke);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* Низ: шина снизу, отводы вверх от карточек; центр уходит вниз (к логотипу-хабу) */
.cf-tree-bottom .cf-tree-box {
  top: 0;
  border-bottom: 1px solid var(--cf-stroke);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* Карточки */
.collect-flow-cards {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: -24px;
  position: relative;
}

.collect-flow-card {
  max-width: 320px;
  width: 100%;
  position: relative;
  margin-top: 112px;
}

.collect-flow-card-frame {
  position: absolute;
  inset: 0;
}

.collect-flow-card-frame .card-stroke {
  position: absolute;
  inset: 0;
  border-radius: 8px;
}

.collect-flow-card-frame .bg-water {
  background-color: #a2e1d6;
}

.collect-flow-card-frame .bg-smurf {
  background-color: #aae0ff;
}

.collect-flow-card-frame .bg-green {
  background-color: #89e481;
}

.collect-flow-card-mobile-coins {
  position: absolute;
  top: -112px;
  left: 0;
  width: 100%;
  height: 112px;
  display: flex;
  justify-content: space-around;
}

.collect-flow-card-mobile-coins::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 0;
  bottom: 24px;
  width: 50%;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
}

.collect-flow-card-body {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  position: relative;
  z-index: 40;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  justify-content: space-between;
}

.collect-flow-card-img-wrap {
  margin-bottom: -45%;
  user-select: none;
}

.collect-flow-card-img-wrap img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 656 / 720;
  object-fit: cover;
  object-position: center top;
}

.collect-flow-card-text {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1.5rem 2rem;
  transform: translateY(26px);
  color: #1a1a1a;
}

.collect-flow-card-text p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: pre-line;
}

.collect-flow-processor {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}

/* Узел-хаб: сюда сходятся все способы оплаты — брендируем логотипом ииоплата */
.collect-flow-hub {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: 14px;
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
}

.collect-flow-hub img {
  display: block;
  height: 38px;
  width: auto;
  object-fit: contain;
  user-select: none;
}

@media (max-width: 767px) {
  .collect-flow-section {
    padding: 3rem 0 4rem;
  }

  .collect-flow-cards {
    gap: 1.75rem;
  }

  .collect-flow-card {
    max-width: min(100%, 340px);
    margin-left: auto;
    margin-right: auto;
  }

  .collect-flow-processor {
    margin-top: 2.75rem;
    margin-bottom: 1.5rem;
    padding-top: 0.5rem;
  }

  .collect-flow-hub {
    padding: 0.55rem 1.1rem;
  }
  .collect-flow-hub img {
    height: 30px;
  }

  .collect-flow-card-text {
    transform: translateY(14px);
    padding-bottom: 1.25rem;
  }
}

/* Анимации монет (оригинал Mangopay) */
.hp2-3cards-money1 {
  position: relative;
  animation: hp23cards1 2s cubic-bezier(0.69, -0.23, 0.43, 1.14) infinite;
}

.hp2-3cards-money1 > img,
.hp2-3cards-money1 .collect-flow-coin-img {
  animation: hp23cards1img 2s cubic-bezier(0, 1, 1, 0) infinite;
}

.hp2-3cards-money2 {
  position: relative;
}

.hp2-3cards-money2 > img,
.hp2-3cards-money2 .collect-flow-coin-img {
  animation: hp23cards2img 2s cubic-bezier(0.58, 0.17, 0.48, 1.27) infinite;
  animation-delay: 1.2s;
}

.hp2-3cards-money3 {
  position: relative;
  animation: hp23cards3 2s cubic-bezier(0.69, -0.23, 0.43, 1.14) infinite;
  animation-delay: 0.6s;
}

.hp2-3cards-money3 > img,
.hp2-3cards-money3 .collect-flow-coin-img {
  animation: hp23cards3img 2s cubic-bezier(0, 1, 1, 0) infinite;
  animation-delay: 0.6s;
}

.hp2-3cards-card1 > .card-stroke {
  animation: hp23cardsCard1anim 2s linear infinite;
  animation-delay: 0s;
}

.hp2-3cards-card1 .mobile-money {
  animation: hp23cardsCardMobileMoney 2s cubic-bezier(0.58, 0.17, 0.48, 1.27) infinite;
  animation-delay: 1s;
}

.hp2-3cards-card2 > .card-stroke {
  animation: hp23cardsCard1anim 2s linear infinite;
  animation-delay: 0.2s;
}

.hp2-3cards-card2 .mobile-money {
  animation: hp23cardsCardMobileMoney 2s cubic-bezier(0.58, 0.17, 0.48, 1.27) infinite;
  animation-delay: 1.2s;
}

.hp2-3cards-card3 > .card-stroke {
  animation: hp23cardsCard1anim 2s linear infinite;
  animation-delay: 0.6s;
}

.hp2-3cards-card3 .mobile-money {
  animation: hp23cardsCardMobileMoney 2s cubic-bezier(0.58, 0.17, 0.48, 1.27) infinite;
  animation-delay: 1.6s;
}

@keyframes hp23cards1 {
  0% { opacity: 1; transform: translate(0); }
  5% { opacity: 1; }
  90% { opacity: 1; }
  to { opacity: 1; transform: translate(-34.4%); }
}

@keyframes hp23cards1img {
  0% { opacity: 1; transform: translate(0) scale(0.7); }
  to { transform: translateY(200px) scale(0.7); }
}

@keyframes hp23cards2img {
  0% { opacity: 0; transform: translate(0) scale(0.7); }
  15% { opacity: 0; }
  25% { opacity: 1; }
  80% { opacity: 1; transform: translateY(200px) scale(0.7); }
  to { opacity: 1; transform: translateY(200px) scale(0.7); }
}

@keyframes hp23cards3 {
  0% { opacity: 0; transform: translate(0); }
  3% { opacity: 1; }
  90% { opacity: 1; }
  to { opacity: 1; transform: translate(34.4%); }
}

@keyframes hp23cards3img {
  0% { opacity: 1; transform: translate(0) scale(0.7); }
  to { transform: translateY(200px) scale(0.7); }
}

@keyframes hp23cardsCard1anim {
  0% { opacity: 1; transform: scale(1); }
  10% { opacity: 0; transform: scale(1.08); }
  90% { opacity: 0; transform: scale(1); }
  91% { transform: scale(1); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes hp23cardsCardMobileMoney {
  0% { opacity: 0; transform: translateY(-100px) scale(0.7); }
  5% { opacity: 1; }
  80% { opacity: 1; transform: translateY(150px) scale(0.7); }
  to { opacity: 1; transform: translateY(150px) scale(0.7); }
}

@media (min-width: 768px) {
  .collect-flow-coins-grid .hp2-3cards-money1,
  .collect-flow-coins-grid .hp2-3cards-money2,
  .collect-flow-coins-grid .hp2-3cards-money3 {
    display: flex;
  }

  .cf-tree {
    display: block;
  }

  .collect-flow-cards {
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    gap: 1.5rem;
    margin: 0 auto;
    max-width: 1000px;
  }

  .collect-flow-card {
    margin-top: 0;
    flex: 1;
  }

  .collect-flow-card-mobile-coins {
    display: none;
  }

  .collect-flow-card-text p {
    font-size: 1.15rem;
  }
}

@media (min-width: 1200px) {
  .collect-flow-cards {
    gap: 2rem;
  }

  .collect-flow-card-text p {
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hp2-3cards-money1,
  .hp2-3cards-money1 > img,
  .hp2-3cards-money1 .collect-flow-coin-img,
  .hp2-3cards-money2 > img,
  .hp2-3cards-money2 .collect-flow-coin-img,
  .hp2-3cards-money3,
  .hp2-3cards-money3 > img,
  .hp2-3cards-money3 .collect-flow-coin-img,
  .hp2-3cards-card1 > .card-stroke,
  .hp2-3cards-card2 > .card-stroke,
  .hp2-3cards-card3 > .card-stroke,
  .mobile-money {
    animation: none !important;
  }
}
