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

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

.@{walletpass-prefix} {
  width: 100%;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;

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

  &__panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
  }

  &__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    border: 1px dashed rgba(93, 112, 157, 0.56);
    border-radius: 8px;
    background: #080d18;

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

  &-group-view {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }
}

.@{walletpass-prefix}-group {
  width: 100%;
  min-width: 0;

  &__shell {
    overflow: hidden;
    border: 1px solid rgba(93, 112, 157, 0.72);
    border-radius: 8px;
    background: #080d18;
  }

  &__header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 50px;
    padding: 10px 12px;
    background: linear-gradient(90deg, #6941c6 0%, #10182c 100%);
    color: #ffffff;
  }

  &--used &__header-bar {
    background: linear-gradient(90deg, #4b5563 0%, #6b7280 100%);
  }

  &__title {
    min-width: 0;
    overflow: hidden;
    font-size: 16px;
    font-weight: 900;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__badge {
    flex: none;
    padding: 3px 12px;
    border: 1px solid rgba(45, 212, 191, 0.42);
    border-radius: 999px;
    background: transparent;
    color: #e8fff7;
    font-size: 16px;
    font-weight: 900;
    line-height: 20px;
    white-space: nowrap;
  }

  &__stats-wrap {
    padding: 9px 10px;
    border-bottom: 1px solid rgba(93, 112, 157, 0.44);
    background: #080d18;
  }

  &__body-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;

    .pisell-group-view__body-stack {
      gap: 8px;
    }
  }

}

.@{walletpass-prefix}-group-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;

  &__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    color: #aebbe0;
    font-size: 11px;
    font-weight: 900;
    line-height: 16px;
    text-transform: uppercase;

    &::after {
      color: rgba(174, 187, 224, 0.34);
      content: '·';
    }

    &:last-child::after {
      content: '';
    }
  }

  &__count {
    color: #12b76a;
    font-size: 13px;
    font-weight: 900;
    text-transform: none;
  }

  &__item--saved &__count {
    color: #fdb022;
  }
}

.@{walletpass-prefix}-record {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(93, 112, 157, 0.46);
  border-radius: 8px;
  background: #080d18;
  color: #eef4ff;

  &--received {
    border-color: rgba(18, 183, 106, 0.72);
    background: rgba(5, 46, 35, 0.74);
  }

  &__content {
    flex: 1 1 auto;
    min-width: 0;
  }

  &__pass-id {
    max-width: 100%;
    margin-bottom: 6px;
    overflow: hidden;
    color: #b7c2e6;
    font-size: 16px;
    font-weight: 900;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    min-width: 0;
    margin-bottom: 6px;
  }

  &__badge {
    max-width: 128px;
    padding: 1px 8px;
    overflow: hidden;
    border: 1px solid rgba(45, 212, 191, 0.5);
    border-radius: 999px;
    color: #34d399;
    background: rgba(20, 184, 166, 0.13);
    font-size: 10px;
    font-weight: 400;
    line-height: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__badge--used,
  &__badge--saved,
  &__badge--discount,
  &__badge--scope,
  &__badge--specific_item,
  &__badge--storewide {
    border-color: rgba(245, 158, 11, 0.5);
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.11);
  }

  &__badge--applied,
  &__badge--redeemed {
    border-color: rgba(127, 86, 217, 0.58);
    color: #c4b5fd;
    background: rgba(127, 86, 217, 0.15);
  }

  &__name {
    min-width: 0;
    margin-bottom: 6px;
    overflow: hidden;
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    color: #d6def7;
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;

    span {
      min-width: 0;
      overflow-wrap: anywhere;
    }

    strong {
      color: #ffffff;
      font-weight: 400;
    }
  }

  &__amount {
    display: inline-flex;
    align-self: flex-end;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: none;
    min-width: 108px;
    max-width: 154px;
    padding: 9px 11px;
    border: 1px solid rgba(45, 212, 191, 0.5);
    border-radius: 8px;
    color: #34d399;
    background: rgba(20, 184, 166, 0.13);
    font-size: 16px;
    font-weight: 900;
    line-height: 20px;
    text-align: center;
    white-space: nowrap;

    span,
    strong {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
}

.@{sale-detail-prefix}--phone {
  .@{walletpass-prefix}-record {
    flex-direction: column;
    align-items: stretch;

    &__amount {
      justify-content: flex-start;
      max-width: none;
      width: 100%;
    }
  }
}
