.selection-flow {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 16px;

  &__steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  &__step {
    border-radius: 999px;
    background: #f2f4f7;
    color: #667085;
    padding: 6px 12px;

    &--current {
      background: #f4ebff;
      color: #6941c6;
      font-weight: 600;
    }
  }

  &__content {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 20px;
  }

  &--sectioned &__content {
    gap: 0;
  }

  &__module {
    min-width: 0;
  }

  &__module-title {
    margin-bottom: 12px;
    color: #101828;
    font-size: 16px;
    font-weight: 600;
  }

  &__description {
    color: #667085;
    font-size: 14px;
    line-height: 20px;
  }

  &__module-error,
  &__completion-error,
  &--error {
    color: #d92d20;
    font-size: 14px;
    line-height: 20px;
  }

  &__navigation {
    display: flex;
    flex-shrink: 0;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #eaecf0;
  }
}

// 时间片列数由 SkuDetailModal 按真实 platform 解析：手机为两列，Kiosk
// 仍可保持四列。这里使用 columns 语义 class 兜底覆盖低代码运行时注入的
// 响应式样式，避免 phone Drawer 明明传入 columns={2} 却仍被压成单列。
.selection-flow-time-resource-selector--columns-2 {
  .pisell-view-grid-content {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.sku-detail-selection-flow-scroll-shell {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;

  // 阴影挂在不滚动的外壳上，因此不会混入 SKU／时间卡片并跟随内容移动。
  // 原 SKU Detail 和预约 Flow 共用，仅在下方仍有内容时展示。
  &--can-scroll-down::after {
    position: absolute;
    // Drawer 的竖向布局容器左右各有 8px padding。内容仍保留该间距，
    // 只有滚动提示向两侧延伸，形成占满 Drawer 宽度的完整分隔阴影。
    right: -8px;
    bottom: 0;
    left: -8px;
    z-index: 2;
    height: 24px;
    background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0),
      rgba(16, 24, 40, 0.18)
    );
    content: '';
    pointer-events: none;
  }
}

// 手机版 H5 的真正滚动容器已经提升到 FloatingLayer。阴影直接挂在同一份
// Footer 的顶部，因此 Footer 在“列表原位”和“吸附位置”之间切换时，阴影
// 会跟随同一节点定位并同步淡入。Kiosk 仍沿用上方 scroll-shell 样式。
.pisell-lowcode-floating-layer-content-auto-hide-header-footer {
  .sku-detail-selection-flow-scroll-shell--can-scroll-down::after {
    display: none;
  }

  > .pisell-lowcode-floating-layer-footer-collapse-region
    > .pisell-lowcode-floating-layer-footer {
    // 线上低代码基础样式会给 Drawer Footer 设置 overflow:hidden；阴影位于
    // Footer 顶部外侧，不解除裁剪就会生成成功但完全不可见。
    overflow: visible !important;
  }

  &.pisell-lowcode-floating-layer-content-can-scroll-down
    > .pisell-lowcode-floating-layer-footer-collapse-region
    > .pisell-lowcode-floating-layer-footer::before {
    position: absolute;
    top: -24px;
    right: 0;
    left: 0;
    height: 24px;
    background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0),
      rgba(16, 24, 40, 0.18)
    );
    content: '';
    pointer-events: none;
  }
}

.sku-detail-right-content--selection-flow {
  display: flex;
  flex: 1;
  flex-direction: column;

  /**
   * 旧布局中右侧内容区是 SKU Detail 的纵向滚动容器；手机版 H5 新布局
   * 会由 FloatingLayer 接管滚动，但这里仍需让 Flow 按真实内容高度撑开。
   * SelectionFlow 默认使用 flex: 1 1 0%，适合自身拥有固定高度的页面；
   * 但在 Drawer 中，折叠区重新展开后会把真实内容压在剩余高度内，内容
   * 只发生视觉溢出而不会撑高父级 scrollHeight，表现为能看到 SKU 却无法
   * 继续滚动。这里让 Flow 及其内容按真实高度参与父级滚动布局。
   */
  > .selection-flow,
  > .selection-flow > .selection-flow__content {
    flex: 0 0 auto;
  }
}

// POS 桌面端的日期、时间、资源各自是一张独立折叠卡片。相比整组外框，
// 独立边界更符合“每一项都可展开”的操作语义，也不再需要粗灰色分隔条。
.pisell-sku-detail-modal--pos-selection-flow {
  // 仅收紧 POS 当前 Selection Flow 的双栏布局。普通详情、旧预约抽屉和
  // Kiosk/H5 不带此作用域 class，因此继续沿用 Procedure 默认间距。
  .pisell-procedure-body > .pisell-lowcode-layout,
  .pisell-procedure-body > .ant-layout {
    gap: 8px !important;
  }

  .sku-detail-right-content--selection-flow {
    //padding-right: 0;
    // macOS 的 stable gutter 会在没有可见滚动条时仍永久预留一条空白。
    // POS Flow 使用 overlay scrollbar，不需要这段占位。
    scrollbar-gutter: auto;
  }

  .selection-flow--sectioned .selection-flow__content {
    gap: 12px;
  }

  .selection-flow__module--custom-container {
    .sku-detail-collapsible-section {
      overflow: hidden;
      padding: 0 16px;
      border: 1px solid #eaecf0;
      border-radius: 10px;
      background: #fff;
    }

    .sku-detail-collapsible-section__header {
      min-height: 64px;
    }
  }

  // 跨日 module 复用旧 MultiDayTimeSelect 的日期范围和天数选择器。
  // POS 触控场景扩大日期与 Duration 的点击区域，不影响其他终端。
  .selection-flow__module--multiDayDate .ant-picker,
  .selection-flow__module--multiDayDate .ant-select-selector {
    min-height: 80px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .selection-flow__module--multiDayDate .ant-select-selection-item {
    display: flex;
    align-items: center;
  }

  // Price 复用旧 DiscountKeyboard 输入能力，但在 Flow 折叠卡片里需要与
  // Resource 的选择框保持同一触控高度。只限制当前 POS Price module，
  // 不改变旧 Edit service 和其他使用 DiscountKeyboard 的页面。
  .selection-flow__module--price {
    .ant-input-affix-wrapper,
    .ant-input-number,
    .pisell-price-keyboard-input {
      min-height: 64px;
    }

    .ant-input,
    .ant-input-number-input {
      height: 62px;
    }
  }
}
