/* 文件职责：商品页面抽屉样式。 */
.product-editor-drawer,
.product-quick-edit-drawer,
.product-soldout-drawer {
  .ant-drawer-header {
    min-height: 56px;
    padding: 0 22px;
    border-bottom: 1px solid #f0f0f0;
  }

  .ant-drawer-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
  }

  .ant-drawer-body {
    padding: 18px 20px 12px;
  }

  .ant-drawer-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
  }

  .product-drawer-section {
    margin-bottom: 16px;
  }

  .product-drawer-section-title {
    position: relative;
    padding-left: 14px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
  }

  .product-drawer-section-title::before {
    position: absolute;
    top: -2px;
    bottom: -2px;
    left: 0;
    width: 4px;
    content: '';
    background: linear-gradient(180deg, #4da3ff 0%, #1677ff 100%);
    border-radius: 6px;
    box-shadow: 0 0 0 1px rgb(22 119 255 / 10%);
  }

  .drawer-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .drawer-form-item.full {
    grid-column: 1 / -1;
  }

  .drawer-form-item.compact {
    display: inline-flex;
    gap: 8px;
    align-items: center;
  }

  .drawer-form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
  }

  .drawer-form-label.required::before {
    margin-right: 4px;
    color: #ef4444;
    content: '*';
  }

  .stock-input {
    width: 120px;
  }

  .unit {
    font-size: 12px;
    color: #6b7280;
  }

  .hint {
    margin-top: 6px;
    font-size: 12px;
    color: #9ca3af;
  }

  .switch-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #4b5563;
  }
}

.product-editor-drawer {
  .drawer-field-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
  }

  .price-stock-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-kind-pill-group {
    display: flex;
    gap: 8px;
  }

  .product-kind-pill {
    min-width: 90px;
    height: 34px;
    padding: 0 16px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    transition:
      color 0.2s ease,
      border-color 0.2s ease,
      background-color 0.2s ease;
  }

  .product-kind-pill.active {
    color: #1677ff;
    background: #eff6ff;
    border-color: #1677ff;
  }

  .product-shelf-radio-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
  }

  .shelf-radio-item {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 12px;
    margin-inline: 0;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
  }

  .shelf-time-row {
    margin-top: 10px;
  }

  .combo-hint {
    margin-bottom: 10px;
  }

  .combo-group-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .combo-group-card {
    padding: 12px;
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
  }

  .combo-group-head {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
  }

  .combo-group-range {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
  }

  .combo-range-input {
    width: 48px;
  }

  .combo-remove-group {
    flex-shrink: 0;
    padding-inline: 8px;
  }

  .combo-item-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
  }

  .combo-item-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #edf0f3;
    border-radius: 8px;
  }

  .combo-item-empty {
    padding: 10px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
  }

  .combo-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    color: #1f2937;
    white-space: nowrap;
  }

  .combo-item-actions {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
    align-items: center;
  }

  .combo-item-multiplier {
    font-size: 12px;
    color: #9ca3af;
  }

  .combo-quantity-input {
    width: 50px;
  }

  .combo-remove-item {
    padding-inline: 8px;
    color: #6b7280;
  }

  .combo-remove-item:hover {
    color: #ef4444;
  }

  .combo-add-product {
    padding-left: 0;
    font-size: 13px;
  }

  .combo-add-group {
    width: 100%;
    height: 36px;
    font-size: 13px;
    color: #9ca3af;
    cursor: pointer;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-style: dashed;
    border-radius: 8px;
    transition:
      color 0.2s ease,
      border-color 0.2s ease;
  }

  .combo-add-group:hover {
    color: #1677ff;
    border-color: #1677ff;
  }
}

.combo-picker-search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.combo-picker-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
}

.combo-picker-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f5f5f5;
}

.combo-picker-item:last-child {
  border-bottom: none;
}

.combo-picker-item .name {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1f2937;
  white-space: nowrap;
}

.combo-picker-item .spu {
  font-size: 12px;
  color: #9ca3af;
}

.combo-picker-item .price {
  font-size: 12px;
  color: #1677ff;
}

.combo-picker-empty {
  padding: 24px 0;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}

.product-quick-edit-drawer,
.product-soldout-drawer {
  .product-quick-card,
  .product-soldout-card {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    margin-bottom: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
  }

  .product-quick-cover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    font-size: 16px;
    font-weight: 700;
    color: #94a3b8;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
  }

  .product-quick-meta {
    flex: 1;
    min-width: 0;
  }

  .product-quick-meta .name {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
  }

  .product-quick-meta .sub {
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
  }
}

.product-soldout-drawer {
  .soldout-mode-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
  }

  .soldout-mode-item {
    padding: 8px 10px;
    margin-inline-start: 0;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
  }
}

.product-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-drawer-footer-right {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.product-drawer-footer-right .ant-btn {
  min-width: 92px;
  height: 40px;
  border-radius: 10px;
}
