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

.@{sale-detail-prefix}-tmpl-a {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #181818;

  .@{sale-detail-prefix}-tmpl-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background-color: #181818;
  }

  .@{sale-detail-prefix}-tmpl-aside {
    flex: none;
    width: 100px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }

  .@{sale-detail-prefix}-tmpl-content {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .@{sale-detail-prefix}-inline-layout {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .@{sale-detail-prefix}-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
    padding: 12px 6px 8px;
  }

  .@{sale-detail-prefix}-client-entry {
    display: flex;
    flex: none;
    gap: 10px;

    .@{sale-detail-prefix}-client {
      flex: 1;
      min-width: 0;
      margin-bottom: 0;
    }
  }

  .@{sale-detail-prefix}-scroll-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;

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

  .@{sale-detail-prefix}-cart-actions {
    padding: 8px 8px 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .@{sale-detail-prefix}-footer {
    flex: none;
    overflow: hidden;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
  }

  .@{sale-detail-prefix}-button-actions {
    flex: none;
    padding: 8px 10px 8px;
    background: #fff;

    .pisell-lowcode-flex {
      gap: 8px;
      margin-bottom: 0 !important;
    }

    .pisell-lowcode-space {
      display: flex;
      width: 100%;
    }

    .pisell-lowcode-space-item {
      flex: 1;
      min-width: 0;

      > .pisell-lowcode-btn {
        width: 100%;
        height: 48px;
        border-radius: 8px;
      }
    }

    &--template-a {
      .pisell-lowcode-space-item:nth-child(3) {
        flex: 1.35;
      }
    }

    &__button {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 48px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 700;
      line-height: 16px;
      white-space: normal;
      word-break: normal;
      overflow-wrap: normal;

      .pisell-lowcode-btn-icon {
        display: inline-flex;
        flex: none;
        align-items: center;
        font-size: 18px;

        svg {
          width: 18px;
          height: 18px;
        }
      }

      > span:not(.pisell-lowcode-btn-icon) {
        display: -webkit-box;
        flex: 0 1 auto;
        min-width: 0;
        max-height: 32px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        word-break: normal;
        overflow-wrap: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
      }

      &--return > .@{sale-detail-prefix}-button-actions__return-label {
        display: -webkit-box;
        max-width: calc(100% - 26px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
      }

      &--primary {
        color: #fff;
        border-color: #7f56d9;
        background: #7f56da;

        &:not(:disabled):hover,
        &:not(:disabled):active {
          color: #fff;
          border-color: #6941c6;
          background: #6941c6;
        }
      }

      &--note {
        position: relative;
        color: #fff;
        border-color: #0891b2;
        background: #0891b2;

        &:not(:disabled):hover,
        &:not(:disabled):active {
          color: #fff;
          border-color: #0e7490;
          background: #0e7490;
        }

        .@{sale-detail-prefix}-button-actions__note-content {
          display: inline-flex;
          align-items: center;
          justify-content: center;
        }

        .note-indicator {
          position: absolute;
          top: 0;
          right: 0;
          display: flex;
          align-items: center;
          justify-content: center;
          width: 24px;
          height: 24px;
          border-radius: 50%;
          color: #fff;
          font-size: 30px;
          font-weight: 700;
          line-height: 1;
          background-color: #7f56da;
          box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
          pointer-events: none;
          transform: translate(12%, -12%);
        }
      }

      &--save {
        color: #fff;
        border-color: #f79009;
        background: #f79009;

        &:not(:disabled):hover,
        &:not(:disabled):active {
          color: #fff;
          border-color: #dc6803;
          background: #dc6803;
        }

        &:disabled {
          color: #d0d5dd;
          border-color: #e5e7eb;
          background: #f9fafb;
        }
      }

      &--edit {
        color: #2563eb;
        border-color: #2563eb;

        &:not(:disabled):hover,
        &:not(:disabled):active {
          color: #2563eb;
          border-color: #2563eb;
        }
      }

      &:disabled {
        color: #fff;
        cursor: not-allowed;
        background: #bfbfbf;
        border-color: #bfbfbf;

        &:hover {
          color: #fff;
          background: #bfbfbf;
          border-color: #bfbfbf;
        }
      }
    }

    &__button > &__checkout-content {
      display: inline-flex;
      flex: 1 1 auto;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      max-height: none;
      overflow: visible;
      line-height: 16px;
      text-align: center;
      white-space: normal;
    }

    &__checkout-title {
      display: block;
      width: 100%;
      white-space: nowrap;
    }

    &__checkout-amount {
      display: block;
      width: 100%;
      font-size: 12px;
      font-weight: 500;
      white-space: nowrap;
    }
  }
}

.@{sale-detail-prefix}--phone {
  .@{sale-detail-prefix}-tmpl-a {
    .@{sale-detail-prefix}-tmpl-aside {
      width: 56px;
    }

    .@{sale-detail-prefix}-main {
      padding-top: 12px;
    }

  }
}

.@{sale-detail-prefix}-tmpl-a--mobile-sheet {
  height: 0;
  overflow: visible;
  background: transparent;

  .pisell-sale-detail-mobile-sheet__footer {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
