/* CashPaymentModule 组件样式 */

/* 主容器 */
.cash-pay-container {
  width: 100%;
  height: 100%;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 8px;
  display: inline-flex;
  flex-shrink: 0;
}

/* 标题栏 */
.cash-pay-header {
  align-self: stretch;
  padding-left: 8px;
  padding-right: 8px;
  justify-content: space-between;
  display: inline-flex;
  width: 100%;
}

.cash-pay-header-title {
  text-align: left;
  justify-content: center;
  display: flex;
  flex-direction: column;
  color: #101828;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  word-wrap: break-word;
}

.cash-pay-header-rounding {
  text-align: right;
  justify-content: center;
  display: flex;
  flex-direction: column;
  color: #5D3F9F;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  word-wrap: break-word;
}

/* 主内容区域 */
.cash-pay-main-content {
  align-self: stretch;
  padding: 8px;
  background: white;
  border-radius: 8px;
  outline: 1px #7F56DA solid;
  outline-offset: -1px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  display: flex;
}

/* 金额输入和支付按钮区域 */
.cash-pay-payment-area {
  align-self: stretch;
  padding-top: 2px;
  padding-bottom: 2px;
  background: white;
  overflow: hidden;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  display: flex;
}

.cash-pay-amount-input-area {
  flex: 1;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  display: flex;
  min-width: 0;
  overflow: hidden;
}

/* 编辑图标 */
.cash-pay-edit-icon {
  width: 24px;
  height: 24px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.cash-pay-edit-icon-inner {
  width: 20.12px;
  height: 20.12px;
  left: 2px;
  top: 1.88px;
  position: absolute;
  outline: 2px #475467 solid;
  outline-offset: -1px;
  border-radius: 2px;
}

.cash-pay-amount-edit-icon {
  font-size: 24px;
  color: #475467;
}

/* 金额输入包装器 */
.cash-pay-amount-input-wrapper {
  display: inline-flex;
  align-items: baseline;
  position: relative;
  cursor: pointer;
  border-bottom: 1px solid #475467;
  padding-bottom: 2px;
  transition: border-color 0.2s ease;

  &:hover {
    border-bottom-color: #7F56DA;
  }
}

/* 货币符号 */
.cash-pay-currency-symbol {
  color: #475467;
  font-size: 20px;
  font-weight: 400;
  line-height: 24px;
  margin-right: 2px;
}

/* 金额显示 */
.cash-pay-amount-display {
  color: #475467;
  font-size: 20px;
  font-weight: 400;
  line-height: 24px;
  margin-left: 2px;
  user-select: none;
  white-space: nowrap;
}

/* Cash Pay 按钮 */
.cash-pay-button {
  height: 48px;
  padding-left: 20px;
  padding-right: 20px;
  padding-top: 12px;
  padding-bottom: 12px;
  background: #7F56DA;
  box-shadow: 0px 1.03px 2.06px rgba(16, 24, 40, 0.05);
  overflow: hidden;
  border-radius: 8px;
  outline: 1px #EEE5FF solid;
  outline-offset: -1px;
  justify-content: center;
  align-items: center;
  gap: 8.24px;
  display: flex;
  cursor: pointer;
  /* 设置宽度与栅格按钮保持一致 */
  width: calc((100% - 16px) / 3);
  white-space: nowrap;
}

.cash-pay-button-text {
  color: white;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  word-wrap: break-word;
  white-space: nowrap;
}

/* 金额按钮栅格布局 */
.cash-pay-amount-button-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-self: stretch;
  width: 100%;
}

/* 响应式设计：在较小屏幕上改为2列 */
@media (max-width: 480px) {
  .cash-pay-amount-button-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 在超小屏幕上改为1列 */
@media (max-width: 320px) {
  .cash-pay-amount-button-grid {
    grid-template-columns: 1fr;
  }
}

/* 金额按钮 */
.cash-pay-amount-button {
  flex: 1;
  height: 48px;
  padding: 16px 20px;
  background: #EEE5FF;
  box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cash-pay-amount-button-text {
  color: #7F56DA;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  word-wrap: break-word;
}

/* 键盘模态框样式重置 */
:global(.keyboard-modal-wrapper .ant-modal) {
  height: auto !important;
  min-height: auto !important;
}

:global(.keyboard-modal-wrapper .ant-modal-content) {
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

:global(.keyboard-modal-wrapper .ant-modal-body) {
  padding: 0 !important;
  margin: 0 !important;
}

/* 更高优先级的Modal内容样式覆盖 */
:global(.keyboard-modal-wrapper .ant-modal-header) {
  display: none !important;
}

/* 更高优先级的Modal内容样式覆盖 */
:global(.keyboard-modal-wrapper .ant-modal-content) {
  padding: 0 !important;
}

/* 数字键盘样式 */
:global(.pisell-number-keyboard-wrap.pisell-number-keyboard-dark) {
  padding: 10px !important;
  border-radius: 10px !important;
}

/* 禁用状态样式 */
.cash-pay-container--disabled {
  pointer-events: none;
}

.cash-pay-main-content--disabled {
  background: white;
  border-radius: 8px;
  outline: 1px #D0D5DD solid;
  outline-offset: -1px;
}

.cash-pay-amount-input-area--disabled {
  pointer-events: none;
}

.cash-pay-amount-edit-icon--disabled {
  color: #475467;
}

.cash-pay-amount-input-wrapper--disabled {
  border-bottom-color: #475467;
  
  &:hover {
    border-bottom-color: #475467;
  }
}

.cash-pay-currency-symbol--disabled {
  color: #475467;
}

.cash-pay-amount-display--disabled {
  color: #475467;
}

.cash-pay-button--disabled {
  background: #D0D5DD;
  box-shadow: 0px 1.03px 2.06px rgba(16, 24, 40, 0.05);
  outline: 1px #EEE5FF solid;
  outline-offset: -1px;
  cursor: not-allowed;
  pointer-events: none;
}

.cash-pay-button-text--disabled {
  color: white;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.cash-pay-amount-button--disabled {
  background: #D0D5DD;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
}

.cash-pay-amount-button-text--disabled {
  color: white;
}