.pisell-sku-detail-modal {
  /**
   * 固定弹窗高度，确保内部滚动容器有“可计算的最大高度”
   * 否则内容会把 modal 撑开，overflow-y: auto 无法生效（看起来就“滚不动”）
   */
  height: 884px;

  // PisellModal（PC）内容容器：固定高度，内部 body 使用 flex 占满剩余空间
  .pisell-lowcode-modal-content {
    height: 884px;
    max-height: 884px!important;
  }

  /**
   * @description 矮屏设备适配（例如 1366×763）
   * - 当屏幕高度本身低于 884px 时，整体弹窗高度下调，避免弹窗显示不全
   * - 同步调整右侧滚动容器最大高度，确保滚动区域可用
   */
  @media screen and (max-height: 883px) {
    height: 650px;

    .pisell-lowcode-modal-content {
      height: 650px;
      max-height: 650px !important;
    }

    .sku-detail-right-content {
      max-height: 496px;
    }
  }

  // SkuDetailModal 内部使用自定义滚动容器（右侧内容区），避免整块 modal body 滚动
  .pisell-lowcode-modal-body {
    overflow: hidden !important;
    min-height: 0;
  }

  // 让 Procedure 的 content 在 modal body 的高度内进行布局，子元素可使用 min-height:0 正常滚动
  .pisell-procedure-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  // Procedure 本体撑满 modal body 高度（否则内部 100% 高度链条断开）
  .pisell-sku-procedure,
  .pisell-procedure {
    height: 100%;
    min-height: 0;
  }

  // 右侧内容区作为 SKUOptionsSelection 的 scroll parent（真正发生滚动的容器）
  .sku-detail-right-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    max-height: 730px;
    /**
     * @description
     * 让滚动条不要贴着内容（尤其是 macOS overlay scrollbar 会覆盖内容）
     */
    box-sizing: border-box;
    padding-right: 12px;
    scrollbar-gutter: stable;
  }

  .pisell-sku-procedure {
    .pisell-procedure-content {
      padding-top: 0 !important;
      padding-bottom: 0;
      height: fit-content !important;
    }
    .pisell-batch-selector {
      padding-top: 0 !important;
    }
    .pisell-product-select__tabs-wrapper {
      padding-top: 0 !important;
    }
    .pisell-lowcode-layout {
      background: #fff !important;
    }
    .pisell-procedure-footer {
      border-top: 1px solid #e8e8e8 !important;
      background: #fff !important;
    }
    .pisell-procedure-sider-content-top {
      height: 100% !important;
    }
  }
  .pisell-lowcode-modal-body {
    border-radius: 16px;
    padding: 0 !important;
    gap: 0 !important;
  }
  .sku-detail-left-close {
    font-size: 20px;
    color: #7958d3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    margin-left: 100px;
  }

  /**
   * @description Header 左侧返回按钮（非第一步显示） + 第一页占位
   * 第一页必须渲染一个空 div 占位，避免 header 左右布局抖动
   */
  .sku-detail-left-back {
    font-size: 20px;
    color: #7958d3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    margin-right: 100px;
  }

  .sku-detail-left-back-placeholder {
    width: 66px;
    height: 24px;
    margin-right: 100px;
  }

  .product-image {
    width: 100%;
    height: 124px;
    flex-shrink: 0; // 关键：不让 flex 把它压小
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      background: lightgray 50% / cover no-repeat;
    }

    .product-cover-text {
      width: 100%;
      height: 100%;
      background-color: #dedede;
      color: #747474;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 40px;
      font-weight: 600;
      line-height: 1;
      user-select: none;
    }
  }

  .product-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;

    .add-note-btn {
      width: 100%;
      height: 48px;
    }
  }

  .sku-detail-left {
    padding-left: 14px;
    /**
     * 让左侧内容成为垂直 flex 容器，便于把底部价格汇总“贴底”
     * 前提：父级侧边栏容器具备可用高度（PisellProcedure 内部通常已设置）
     */
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  .sku-detail-right {
    display: flex;
    flex-direction: column;
  }

  .product-info {
    display: flex;
    flex-direction: row;
    margin-bottom: 20px;

    .product-info-left {
      flex: 1;
      display: flex;
      flex-direction: column;

      .product-name {
        color: #1b1b1b;
        font-size: 14px;
        font-weight: 600;
        margin-top: 20px;
      }

      .product-spec {
        color: #344054;
        font-size: 14px;
        font-weight: 400;
      }
    }

    .item-price {
      color: #7f56da;
      font-size: 20px;
      font-weight: 600;
      text-align: right;
    }
  }

  .quantity-section {
    margin-top: 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    .quantity-section-title {
      color: #000;
      font-size: 14px;
      font-weight: 600;
      margin-right: 30px;
    }

    span {
      color: #000;
      font-size: 14px;
      font-weight: 600;
    }
  }

  .note-section {
    margin-top: 8px;
    color: #7f56da;
    font-size: 14px;
    font-weight: 400;

    .note-text {
      margin-top: 16px;
      width: fit-content;
      text-decoration: underline;
      text-underline-offset: 2px;
      cursor: pointer;
    }
  }

  .price-summary-section {
    /**
     * 在垂直 flex 布局中将价格汇总推到底部
     */
    margin-top: auto;
    padding-top: 16px;
    flex-shrink: 0;

    .price-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      font-size: 14px;

      div {
        &:first-child {
          color: #344054;
          font-size: 14px;
          font-weight: 400;
        }

        &:last-child {
          color: #344054;
          font-size: 14px;
          font-weight: 600;
          white-space: nowrap;
        }
      }

      &-danger {
        color: #f04438 !important;
      }

      .price-item-override {
        color: #7f56da;
        font-size: 14px;
        font-weight: 400;
        cursor: pointer;
        // 兼容性更好的下划线解决方案
        text-decoration: none;
        border-bottom: 1px solid #7f56da;
        padding-bottom: 1px;
      }
    }

    .price-item-total {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 18px;
      font-weight: 600;
      color: #722ed1;
      padding-top: 8px;
      border-top: 1px solid rgba(0, 0, 0, 0.3);

      div {
        &:first-child {
          color: #344054;
          font-size: 16px;
          font-weight: 600;
        }

        &:last-child {
          color: #7f56da;
          font-size: 24px;
          font-weight: 600;
        }
      }

      .price-item-total-gst {
        color: #344054;
        font-size: 14px;
        font-weight: 400;
      }
    }

    .price-divider {
      height: 1px;
      background: #e8e8e8;
      margin: 12px 0;
    }
  }
  .sku-detail-content-footer-confirm-btn {
    width: 200px;
  }

  .sku-detail-content-footer {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;

    .sku-detail-content-footer-remove-btn {
      width: 120px;
    }

    .modal-actions {
      display: flex;
      gap: 8px;
      justify-content: flex-end;

      .sku-detail-content-footer-price-btn {
        width: 140px;

        .sku-detail-content-footer-price-btn-text {
          width: 100%;
          text-align: center;
          // 支持换行显示
          white-space: wrap;
          font-size: 16px;
          font-weight: 400;
          line-height: 20px;
        }
      }
    }
  }
}

// 价格调整覆盖层样式 - 现在通过 Portal 渲染到 document.body
.pisell-price-adjust-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999; // 由于现在渲染到 document.body，使用更高的 z-index
  display: flex;
  align-items: center;
  justify-content: center;
}

.pisell-price-adjust-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent; // 纯透明遮罩
  cursor: pointer; // 显示点击手势
}

.pisell-price-adjust-container {
  position: relative;
  z-index: 10000; // 确保键盘在遮罩之上
}

.sku-detail-right-content-detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #667085;

  p {
    margin: 0;
    text-align: center;
    font-size: 16px;
  }
}