/* CashPaymentModule 组件样式 - 重新设计 */

/* 主容器 */
.cash-pay-container {
  align-self: stretch;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 8px;
  display: inline-flex;
}

/* 标题栏 */
.cash-pay-header {
  align-self: stretch;
  justify-content: space-between;
  align-items: flex-end;
  display: inline-flex;
}

.cash-pay-header-title {
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
  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-box-trim: trim-both;
  text-box-edge: cap alphabetic;
  text-align: right;
  justify-content: center;
  display: flex;
  flex-direction: column;
  color: #101828;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  word-wrap: break-word;
}

/* 主内容区域 */
.cash-pay-main-content {
  align-self: stretch;
  padding: 8px;
  background: #FCFCFD;
  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-info-section {
  align-self: stretch;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  display: inline-flex;
}

/* 信息项目（Balance Due 和 Change Due）*/
.cash-pay-info-item {
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  display: inline-flex;
}

.cash-pay-info-label {
  color: #667085;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  word-wrap: break-word;
}

.cash-pay-info-amount {
  color: #475467;
  font-size: 18px;
  font-weight: 700;
  line-height: 28px;
  word-wrap: break-word;
}

/* Cash Received 输入区域 */
.cash-pay-cash-received {
  flex: 1 1 0;
  padding-left: 16px;
  padding-right: 16px;
  padding-top: 6px;
  padding-bottom: 6px;
  background: white;
  box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.06);
  border-radius: 8px;
  outline: 1px #EAECF0 solid;
  outline-offset: -1px;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  display: inline-flex;
}

.cash-pay-cash-received-input {
  width: 100%;
  cursor: pointer;
}

.cash-pay-amount-display-section {
  justify-content: flex-start;
  align-items: center;
  display: inline-flex;
}

.cash-pay-currency-symbol {
  text-align: center;
  justify-content: center;
  display: flex;
  flex-direction: column;
  color: #101828;
  font-size: 20px;
  font-weight: 600;
  line-height: 30px;
  word-wrap: break-word;
}

.cash-pay-amount-value {
  text-align: center;
  justify-content: center;
  display: flex;
  flex-direction: column;
  color: #101828;
  font-size: 20px;
  font-weight: 600;
  line-height: 30px;
  word-wrap: break-word;
}

/* 蓝色光标指示器 */
.cash-pay-cursor-indicator {
  width: 2px;
  height: 30px;
  background: #1570EF;
  margin-left: 2px;
  animation: blink 1s infinite;
}

@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* 按钮网格布局 */
.cash-pay-button-grid {
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* 金额按钮（紫色风格）*/
.cash-pay-amount-button {
  padding-left: 16px;
  padding-right: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
  min-height: 40px; /* 确保按钮高度一致 */
  box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
  overflow: hidden;
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  display: flex;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cash-pay-amount-button--purple {
  background: #F9F5FF;
  outline: 1px #E9D7FE solid;
  outline-offset: -1px;
}

.cash-pay-amount-button--purple:hover {
  background: #F4F3FF;
}

.cash-pay-amount-button-text {
  color: #6941C6;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  word-wrap: break-word;
}

/* 操作按钮基础样式 */
.cash-pay-action-button {
  padding-left: 16px;
  padding-right: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
  min-height: 40px; /* 确保与金额按钮高度一致 */
  box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
  overflow: hidden;
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  display: flex;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* 灰色按钮样式 */
.cash-pay-action-button--gray {
  background: white;
  outline: 1px #D0D5DD solid;
  outline-offset: -1px;
}

.cash-pay-action-button--gray:hover {
  background: #F9FAFB;
}

/* 主要按钮样式（紫色）*/
.cash-pay-action-button--primary {
  background: #7F56DA;
  outline: 1px #7F56DA solid;
  outline-offset: -1px;
}

.cash-pay-action-button--primary:hover {
  background: #6941C6;
}

/* 按钮文字样式 */
.cash-pay-action-button-text {
  color: #344054;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  word-wrap: break-word;
}

.cash-pay-action-button-text--red {
  color: #D92D20;
}

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

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

.cash-pay-main-content--disabled {
  background: #F9FAFB;
  outline: 1px #D0D5DD solid;
  outline-offset: -1px;
}

.cash-pay-amount-button--disabled {
  background: #F2F4F7;
  outline: 1px #E4E7EC solid;
  outline-offset: -1px;
  cursor: not-allowed;
  pointer-events: none;
}

.cash-pay-amount-button--disabled .cash-pay-amount-button-text {
  color: #98A2B3;
}

.cash-pay-action-button--disabled {
  background: #F2F4F7;
  outline: 1px #E4E7EC solid;
  outline-offset: -1px;
  cursor: not-allowed;
  pointer-events: none;
}

.cash-pay-action-button--disabled .cash-pay-action-button-text {
  color: #98A2B3;
}

/* 键盘弹出框样式 */
:global(.cash-payment-keyboard-popover .ant-popover-content) {
  padding: 0;
}

:global(.cash-payment-keyboard-popover .ant-popover-arrow) {
  display: none;
}

:global(.cash-payment-keyboard-popover .ant-popover-inner) {
  border-radius: 12px;
  box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .cash-pay-info-section {
    flex-direction: column;
    gap: 12px;
  }

  .cash-pay-cash-received {
    align-self: stretch;
  }

  .cash-pay-button-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .cash-pay-button-grid {
    grid-template-columns: 1fr;
  }
}