@sale-detail-prefix: pisell-sale-detail;

.@{sale-detail-prefix}-pay-main {
  gap: 10px;
  padding: 8px 10px;
}

.@{sale-detail-prefix}-pay-overview-wrap {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 4px;
}

.@{sale-detail-prefix}-pay-overview {
  display: grid;
  flex: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 12px;
  border: 1px solid rgba(127, 86, 217, 0.44);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(127, 86, 217, 0.72), rgba(68, 43, 122, 0.9)),
    #241044;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);

  &__item {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
  }

  &__label {
    max-width: 100%;
    overflow: hidden;
    color: rgba(245, 247, 255, 0.76);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 12px;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  &__value {
    max-width: 100%;
    overflow: hidden;
    color: #f5f2ff;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.2px;
    line-height: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__item--warning &__value {
    color: #fdb022;
  }

  &__note {
    padding: 0 4px;
    color: rgba(234, 240, 255, 0.68);
    font-size: 11px;
    font-weight: 700;
    line-height: 15px;
  }
}

.@{sale-detail-prefix}-pay-timeline {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;

  &::-webkit-scrollbar {
    display: none;
  }

  &__empty {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 220px;

    .pisell-empty-wrap,
    .pisell-empty-wrap-description {
      color: rgba(234, 240, 255, 0.72);
    }
  }
}

.@{sale-detail-prefix}-pay-record {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(119, 133, 160, 0.24);
  border-left: 3px solid #17b26a;
  border-radius: 10px;
  background: #080d18;
  box-shadow: 0 8px 18px rgba(2, 8, 23, 0.24);

  &--refund {
    border-left-color: #fdb022;
  }

  &__date {
    overflow: hidden;
    color: rgba(234, 240, 255, 0.76);
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
  }

  &__sub-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
  }

  &__title {
    min-width: 0;
    overflow: hidden;
    color: #f5f7ff;
    font-size: 14px;
    font-weight: 800;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__sub-title {
    min-width: 0;
    overflow: hidden;
    color: rgba(234, 240, 255, 0.68);
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__amount {
    flex: none;
    color: #f5f7ff;
    font-size: 14px;
    font-weight: 900;
    line-height: 18px;
    white-space: nowrap;
  }

  &__sub-amount {
    flex: none;
    color: rgba(234, 240, 255, 0.68);
    font-size: 12px;
    font-weight: 800;
    line-height: 16px;
    white-space: nowrap;
  }

  &--refund &__amount {
    color: #fdb022;
  }
}

.@{sale-detail-prefix}-pay-v2 {
  &__stats {
    display: flex;
    align-items: center;
    flex: none;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 30px;
    padding: 2px 4px;
    color: rgba(234, 240, 255, 0.52);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.45px;
    line-height: 18px;
    text-transform: uppercase;
  }

  &__stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;

    strong {
      color: rgba(245, 247, 255, 0.92);
      font-size: 15px;
      font-variant-numeric: tabular-nums;
    }

    &--success strong {
      color: #32d583;
    }

    &--processing strong {
      color: #a4bcfd;
    }

    &--refunded strong {
      color: #fdb022;
    }

    &--failed strong {
      color: #f97066;
    }

    &--unknown strong {
      color: #98a2b3;
    }
  }

  &__stats-separator {
    color: rgba(234, 240, 255, 0.32);
  }

  &__stats-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: auto;
    border: 1px solid rgba(164, 188, 253, 0.5);
    border-radius: 50%;
    color: #b8c6ed;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
  }

  &__notice {
    flex: none;
    padding: 8px 10px;
    border: 1px solid rgba(253, 176, 34, 0.42);
    border-radius: 8px;
    color: #fec84b;
    font-size: 12px;
    font-weight: 700;
    line-height: 17px;
    background: rgba(127, 86, 0, 0.24);
  }

  &__timeline {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: auto;
    padding: 2px 2px 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;

    &::-webkit-scrollbar {
      display: none;
    }
  }

  &__group {
    position: relative;
    display: grid;
    flex: none;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 8px;

    &::before {
      position: absolute;
      top: 13px;
      bottom: -25px;
      left: 7px;
      width: 2px;
      content: '';
      background: rgba(113, 121, 255, 0.48);
    }

    &:last-child::before {
      display: none;
    }
  }

  &__marker {
    position: relative;
    z-index: 1;
    width: 12px;
    height: 12px;
    margin-top: 7px;
    margin-left: 1px;
    border: 2px solid rgba(166, 175, 255, 0.2);
    border-radius: 50%;
    background: #7f8cff;
    box-shadow: 0 0 10px rgba(127, 140, 255, 0.5);
    box-sizing: border-box;
  }

  &__group-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
  }

  &__refunds {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
    margin-left: 24px;
    padding-left: 16px;

    &::before {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: 2px;
      content: '';
      background: rgba(113, 121, 255, 0.36);
    }
  }

  &__refund {
    min-width: 0;
  }

  &__record {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
    padding: 9px 10px;
    border: 1px solid rgba(119, 133, 160, 0.42);
    border-left: 4px solid #32d583;
    border-radius: 10px;
    color: #f5f7ff;
    background: #080d18;
    box-shadow: 0 8px 18px rgba(2, 8, 23, 0.24);

    &--processing {
      border-left-color: #a4bcfd;
    }

    &--refunded {
      border-left-color: #fdb022;
    }

    &--failed {
      border-left-color: #f97066;
    }

    &--unknown {
      border-left-color: #667085;
    }
  }

  &__record-header,
  &__record-main,
  &__meta-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
  }

  &__record-date {
    min-width: 0;
    overflow: hidden;
    color: rgba(234, 240, 255, 0.68);
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    min-height: 22px;
    padding: 2px 10px;
    border: 1px solid rgba(50, 213, 131, 0.55);
    border-radius: 999px;
    color: #abefc6;
    font-size: 12px;
    font-weight: 800;
    line-height: 16px;
    background: rgba(3, 84, 63, 0.44);
  }

  &__record--processing &__status {
    border-color: rgba(164, 188, 253, 0.56);
    color: #d1e0ff;
    background: rgba(45, 56, 99, 0.54);
  }

  &__record--refunded &__status {
    border-color: rgba(253, 176, 34, 0.62);
    color: #fec84b;
    background: rgba(127, 86, 0, 0.46);
  }

  &__record--failed &__status {
    border-color: rgba(249, 112, 102, 0.58);
    color: #fda29b;
    background: rgba(122, 39, 26, 0.48);
  }

  &__record--unknown &__status {
    border-color: rgba(152, 162, 179, 0.58);
    color: #d0d5dd;
    background: rgba(52, 64, 84, 0.48);
  }

  &__record-copy {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
  }

  &__record-payment {
    display: flex;
    align-items: baseline;
    min-width: 0;
    gap: 6px;
  }

  &__record-title {
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 800;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__record-payment-separator {
    flex: none;
    color: rgba(234, 240, 255, 0.36);
  }

  &__record-payment-info {
    min-width: 0;
    overflow: hidden;
    color: rgba(234, 240, 255, 0.68);
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__record-amount-block {
    display: flex;
    align-items: flex-end;
    flex: none;
    flex-direction: column;
    gap: 1px;
  }

  &__record-service-charge {
    color: rgba(234, 240, 255, 0.74);
    font-size: 11px;
    font-weight: 700;
    line-height: 15px;
    white-space: nowrap;
  }

  &__record-amount {
    flex: none;
    font-size: 15px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 20px;
    white-space: nowrap;
  }

  &__record--refunded &__record-amount {
    color: #fdb022;
  }

  &__record-refunded {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    color: #fdb022;
    font-size: 13px;
    line-height: 18px;

    strong {
      overflow: hidden;
      font-weight: 900;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  &__meta-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 5px;
    border-top: 1px dashed rgba(119, 133, 160, 0.26);
  }

  &__meta-line {
    color: rgba(234, 240, 255, 0.66);
    font-size: 12px;
    line-height: 16px;

    strong {
      color: rgba(245, 247, 255, 0.86);
      font-weight: 800;
      font-variant-numeric: tabular-nums;
    }
  }

  &__audit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(119, 133, 160, 0.26);
    color: rgba(234, 240, 255, 0.52);
    font-size: 11px;
    line-height: 15px;

    strong {
      color: rgba(234, 240, 255, 0.7);
      font-weight: 700;
    }
  }

  &__audit-separator {
    color: rgba(234, 240, 255, 0.3);
  }

}

.@{sale-detail-prefix}--phone {
  .@{sale-detail-prefix}-pay-v2 {
    &__stats {
      gap: 4px;
      font-size: 11px;
    }

    &__stats-help {
      margin-left: 0;
    }

    &__group {
      grid-template-columns: 12px minmax(0, 1fr);
      gap: 5px;

      &::before {
        left: 5px;
      }
    }

    &__refunds {
      margin-left: 8px;
      padding-left: 10px;
    }

    &__marker {
      width: 10px;
      height: 10px;
      margin-left: 0;
    }

    &__record {
      padding: 8px;
    }

    &__record-main {
      align-items: flex-start;
      flex-direction: column;
      gap: 5px;
    }

    &__record-amount {
      align-self: flex-end;
    }

    &__record-amount-block {
      align-self: flex-end;
    }
  }
}
