/**
 * 购物结账组件样式
 * 支持现代化界面设计、全屏显示、步骤导航等功能
 */

/* CSS变量定义 */
.wd-checkout-widget {
  --primary-color: #007cba;
  --bg-color: #ffffff;
  --text-color: #ffffff;
  --border-color: #444;
  --header-bg-color: #111111;
  --cart-item-bg-color: #111111;
  --customer-info-bg-color: #000000;
  --content-bg-color: #000000;
  --footer-bg-color: #333333;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.15);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* 基础容器 */
.wd-checkout-widget {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-color);
  background: var(--bg-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-light);
}

/* 全局字体颜色设置 - 应用于所有文字元素（除了按钮） */
.wd-checkout-widget,
.wd-checkout-widget h1,
.wd-checkout-widget h2,
.wd-checkout-widget h3,
.wd-checkout-widget h4,
.wd-checkout-widget h5,
.wd-checkout-widget h6,
.wd-checkout-widget p,
.wd-checkout-widget span,
.wd-checkout-widget div,
.wd-checkout-widget label,
.wd-checkout-widget td,
.wd-checkout-widget th,
.wd-checkout-widget input,
.wd-checkout-widget textarea,
.wd-checkout-widget .wd-checkout-step-label,
.wd-checkout-widget .wd-checkout-item-name,
.wd-checkout-widget .wd-checkout-item-description,
.wd-checkout-widget .wd-checkout-item-price,
.wd-checkout-widget .wd-checkout-total-items,
.wd-checkout-widget .wd-checkout-total-price,
.wd-checkout-widget .wd-checkout-total-amount,
.wd-checkout-widget .wd-checkout-price-label,
.wd-checkout-widget .wd-checkout-summary-item-name,
.wd-checkout-widget .wd-checkout-summary-item-quantity,
.wd-checkout-widget .wd-checkout-summary-item-price,
.wd-checkout-widget .wd-checkout-review-item {
  color: var(--text-color) !important;
}

/* 全屏模式 */
.wd-checkout-widget.wd-checkout-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
}

/* 页眉样式 */
.wd-checkout-header {
  background: var(--header-bg-color) !important;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.wd-checkout-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wd-checkout-back-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--primary-color);
  padding: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.wd-checkout-back-btn:hover {
  background: transparent;
}

.wd-checkout-title-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wd-checkout-cart-icon {
  font-size: 24px;
  color: var(--primary-color);
}

.wd-checkout-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #cccccc;
}

/* 步骤指示器 */
.wd-checkout-steps {
  display: flex;
  align-items: center;
  gap: 24px;
}

.wd-checkout-step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  transition: var(--transition);
  position: relative;
}

.wd-checkout-step.wd-checkout-step-active {
  opacity: 1;
}

.wd-checkout-step.wd-checkout-step-completed {
  opacity: 1;
  color: var(--primary-color);
}

.wd-checkout-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border-color);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
}

.wd-checkout-step.wd-checkout-step-active .wd-checkout-step-number {
  background: var(--primary-color);
  color: #fff;
}

.wd-checkout-step.wd-checkout-step-completed .wd-checkout-step-number {
  background: var(--primary-color);
}

.wd-checkout-step-label {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}



/* 主内容区域 */
.wd-checkout-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--main-bg-color, transparent);
}

.wd-checkout-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden; /* 隐藏水平滚动条 */
  background: var(--content-bg-color, transparent);
  /* 隐藏滚动条但保持滚动功能 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* 隐藏webkit浏览器的滚动条 */
.wd-checkout-content::-webkit-scrollbar {
  display: none;
}

/* 步骤内容 */
.wd-checkout-step-content {
  display: none;
}

.wd-checkout-step-content.wd-checkout-step-active {
  display: block;
  min-height: 100%; /* 确保至少占满整个容器高度 */
}

/* 结账组件步骤2内容布局（填写订单信息页面） */
.wd-checkout-step-content.wd-checkout-step-2.wd-checkout-step-active {
  display: block;
  height: auto;
  min-height: 100%;
}

/* 加载状态 */
.wd-checkout-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #666;
}

.wd-checkout-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: wd-checkout-spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes wd-checkout-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 购物车商品列表 - 表格式布局 */
.wd-checkout-cart-section {
  overflow: visible;
  padding-top: 2%;
  flex-shrink: 0; /* 不压缩购物车区域 */
}

/* 简化购物车显示样式 */
.wd-checkout-cart-simple {
  background: transparent;
  overflow: visible;
  padding: 0 16px 16px 16px;
}

.wd-checkout-cart-item-simple {
  display: flex;
  align-items: flex-start;
  padding: 16px 40px;
  padding-right: 200px;
  margin-bottom: 16px;
  /* border: 2px solid #333333; */
  border-radius: 8px;
  background: #000000;
  gap: 16px;
}

.wd-checkout-cart-item-simple:last-child {
  margin-bottom: 0;
}

.wd-checkout-cart-item-simple.is-selected {
  border-color: #555555;
  background: #2a2a2a;
}

.wd-checkout-cart-item-simple:hover {
  border-color: #444444;
}

/* 简化购物车商品信息样式 */
.wd-checkout-cart-item-simple .wd-checkout-item-info {
  width: 45%; /* 商品信息列宽度 */
  min-width: 0;
  height: 150px; /* 匹配图片高度 */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 8px 0;
  padding-right: 20%;
}

.wd-checkout-cart-item-simple .wd-checkout-item-name {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  border-bottom: 2px solid #e2e4e7;
  padding-bottom: 5px;
}

.wd-checkout-cart-item-simple .wd-checkout-item-description {
  color: #666;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
  flex-grow: 1;
  overflow: hidden;
}

.wd-checkout-cart-item-simple .wd-checkout-item-price {
  font-weight: 600;
  color: var(--text-color);
  font-size: 25px;
  width: 20%; /* 价格列宽度 */
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px; /* 匹配图片高度 */
}

.wd-checkout-cart-item-simple .wd-checkout-item-quantity {
  color: #666;
  font-size: 25px;
  width: 15%; /* 数量列宽度 */
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px; /* 匹配图片高度 */
}

.wd-checkout-cart-table {
  width: 100%;
  border-collapse: collapse;
  border: none;
  table-layout: fixed; /* 固定表格布局以控制列宽 */
  min-width: 800px; /* 设置最小宽度以适应大图片 */
}

.wd-checkout-cart-header {
  background: #333333;
}

.wd-checkout-cart-header th {
  padding: 16px 12px;
  text-align: center;
  vertical-align: middle;
  font-weight: 600;
  font-size: 14px;
  color: #cccccc;
  border: none;
}

.wd-checkout-cart-header th:last-child {
  border: none;
}

.wd-checkout-cart-header th:first-child {
  width: 40px;
  text-align: center;
}

/* 商品列表头 - 左对齐 */
.wd-checkout-cart-header th:nth-child(2) {
  text-align: left;
  width: 50%;
  min-width: 300px;
}

.wd-checkout-cart-header th:nth-child(3) {
  width: 12%;
  min-width: 80px;
}

.wd-checkout-cart-header th:nth-child(4) {
  width: 18%;
  min-width: 120px;
}

.wd-checkout-cart-header th:nth-child(5) {
  width: 8%;
  min-width: 60px;
}

.wd-checkout-select-all {
  margin: 0;
  transform: scale(1.2);
  border: none !important; /* 移除边框 */
  outline: none !important; /* 移除轮廓 */
  box-shadow: none !important; /* 移除阴影 */
}

.wd-checkout-select-all:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.wd-checkout-select-all:checked {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.wd-checkout-cart-items {
  /* background: var(--cart-item-bg-color); */
}

.wd-checkout-cart-item {
  border-bottom: 1px solid #f0f0f0;
  background: #111111; /* 深黑 */
}

.wd-checkout-cart-item.is-selected {
  background: #444444; /* 选中时浅灰色 */
}

.wd-checkout-cart-item:last-child {
  border-bottom: none;
}

/* 完全移除悬停效果 */
.wd-checkout-cart-item:hover {
  background: #111111; /* 保持原始背景色 */
}

.wd-checkout-cart-item.is-selected:hover {
  background: #444444; /* 选中状态下保持选中背景色 */
}

.wd-checkout-cart-item td {
  padding: 20px 12px;
  vertical-align: middle;
  text-align: center;
  border: none;
  height: 200px; /* 匹配图片高度+间距 */
}

/* 商品列特殊处理 - 左对齐 */
.wd-checkout-cart-item td:nth-child(2) {
  text-align: left;
  vertical-align: top;
  height: 200px; /* 匹配图片高度+间距 */
}

/* 数量列特殊处理 - 确保垂直居中 */
.wd-checkout-cart-item td:nth-child(4) {
  vertical-align: middle;
  text-align: center;
  display: table-cell;
  height: 200px; /* 匹配图片高度+间距 */
}

/* 操作列特殊处理 - 确保删除图标水平垂直居中 */
.wd-checkout-cart-item td:nth-child(5) {
  text-align: -webkit-center;
  vertical-align: middle;
  height: 200px;
  padding: 20px 12px; /* 恢复标准padding */
}

.wd-checkout-cart-item td:last-child {
  border: none;
}

.wd-checkout-item-checkbox {
  text-align: center;
}

.wd-checkout-item-select {
  margin: 0;
  transform: scale(1.2);
  border: none !important; /* 移除边框 */
  outline: none !important; /* 移除轮廓 */
  box-shadow: none !important; /* 移除阴影 */
}

.wd-checkout-item-select:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.wd-checkout-item-select:checked {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.wd-checkout-item-product {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: flex-start;
  width: 100%;
}

.wd-checkout-item-image {
  width: 150px;
  height: 150px;
  border-radius: 20px;
  object-fit: cover;
  flex-shrink: 0;
}

.wd-checkout-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-start;
  height: 100%;
  padding-top: 8%;
  padding-right: 30%;
}

.wd-checkout-item-name {
  font-weight: 600;
  font-size: 16px;
  color: #ffffff;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  border-bottom: 2px solid #e2e4e7;
  padding-bottom: 5px;
}

.wd-checkout-item-description {
  color: #cccccc;
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
}

.wd-checkout-item-price {
  font-weight: 600;
  color: var(--text-color);
  font-size: 25px;
}

.wd-checkout-item-quantity {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  color: var(--text-color);
  font-size: 25px;
}

.wd-checkout-quantity-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  /* border: 1px solid var(--border-color); */
  border-radius: 6px;
  overflow: hidden;
}

.wd-checkout-quantity-btn {
  background: #ffffff !important; /* 固定白色背景 */
  color: #000000 !important; /* 固定黑色文字 */
  border: 1px solid #ddd;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wd-checkout-quantity-btn:hover {
  background: #ffffff !important; /* 悬停时保持白色 */
  color: #000000 !important; /* 悬停时保持黑色 */
}

.wd-checkout-quantity-btn:active {
  background: #ffffff !important; /* 点击时保持白色 */
  color: #000000 !important; /* 点击时保持黑色 */
}

.wd-checkout-quantity-input {
  width: 50px;
  height: 32px;
  text-align: center;
  border: none;
  background-color: #222;
  color: #fff;
  font-size: 14px;
  -moz-appearance: textfield;
  border-radius: 0;
  outline: none;
  box-shadow: none;
}

.wd-checkout-quantity-input:focus {
  border: none;
  outline: none;
  box-shadow: none;
}

/* 移除数字输入框的上下箭头 */
.wd-checkout-quantity-input::-webkit-outer-spin-button,
.wd-checkout-quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox数字输入框样式 */
.wd-checkout-quantity-input[type="number"] {
  -moz-appearance: textfield;
}

.wd-checkout-item-actions {
  /* display: flex; */
  align-items: center;
  justify-content: center;
  width: 100%;
}

.wd-checkout-remove-btn {
  background: transparent !important; /* 强制透明背景 */
  border: none !important;
  color: #999 !important;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 0; /* 移除圆角 */
  display: flex;
  align-items: center;
  justify-content: center;
  /* 确保图标和文字都保持透明底 */
  text-decoration: none !important;
  outline: none !important;
}

.wd-checkout-remove-btn:hover {
  background: transparent !important; /* 悬停时保持透明 */
  color: #999 !important; /* 悬停时保持原色 */
  transform: none !important; /* 移除变换效果 */
}

.wd-checkout-remove-btn:active {
  background: transparent !important; /* 点击时保持透明 */
  color: #999 !important; /* 点击时保持原色 */
  transform: none !important; /* 移除变换效果 */
}

.wd-checkout-remove-btn:focus {
  background: transparent !important; /* 焦点时保持透明 */
  color: #999 !important; /* 焦点时保持原色 */
  outline: none !important; /* 移除焦点轮廓 */
}

/* 订单摘要 */
.wd-checkout-order-summary {
  background: var(--customer-info-bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 24px;
}

.wd-checkout-order-summary h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
}

.wd-checkout-summary-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.wd-checkout-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.wd-checkout-summary-item:last-child {
  border-bottom: none;
}

.wd-checkout-summary-item-name {
  font-size: 14px;
  color: var(--text-color);
}

.wd-checkout-summary-item-quantity {
  font-size: 14px;
  color: #666;
  margin-left: 8px;
}

.wd-checkout-summary-item-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
}

/* 客户信息区域 */
.wd-checkout-customer-info {
  /* border-radius: var(--border-radius); */
  padding: 20px 40px;
  /* margin-bottom: 20px; */
  border-top: 1px solid var(--border-color);
  flex-shrink: 0; /* 不压缩客户信息区域 */
}

.wd-checkout-customer-info h3 {
  display: none !important; /* 隐藏客户信息标题 */
}

.wd-checkout-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 支持表单字段横向排列 */
.wd-checkout-form-row {
  display: flex;
  gap: 16px;
  width: 100%;
  flex-wrap: wrap;
}

.wd-checkout-form-row .wd-checkout-field {
  flex: 1;
  min-width: 200px;
}

.wd-checkout-form-row {
  display: flex;
  flex-direction: column; /* 纵向排列表单字段 */
  gap: 20px;
  align-items: flex-start; /* 允许字段按设定宽度对齐 */
}

.wd-checkout-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: var(--field-width, 100%); /* 恢复自定义宽度支持 */
  max-width: 100%; /* 确保不超过容器宽度 */
  align-self: flex-start; /* 保持字段按设定宽度显示 */
}

/* 预定义的输入框宽度选项 - 更高权重 */
.wd-checkout-form-row .wd-checkout-field.field-width-25 {
  width: 25% !important;
}

.wd-checkout-form-row .wd-checkout-field.field-width-30 {
  width: 30% !important;
}

.wd-checkout-form-row .wd-checkout-field.field-width-33 {
  width: 33.333% !important;
}

.wd-checkout-form-row .wd-checkout-field.field-width-50 {
  width: 50% !important;
}

.wd-checkout-form-row .wd-checkout-field.field-width-75 {
  width: 75% !important;
}

.wd-checkout-form-row .wd-checkout-field.field-width-100 {
  width: 100% !important;
}

/* 支持自定义CSS变量设置宽度 - 更高权重 */
.wd-checkout-form-row .wd-checkout-field[style*="--field-width"] {
  width: var(--field-width) !important;
}

/* 调试：30%字段添加边框帮助识别 */
.wd-checkout-form-row .wd-checkout-field.field-width-30,
.wd-checkout-form-row .wd-checkout-field[style*="--field-width: 30%"] {
  /* border: 2px solid #007cba !important; */
  /* background-color: rgba(0, 124, 186, 0.1) !important; */
}

.wd-checkout-field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
}

.wd-checkout-required {
  color: #dc3545;
  margin-left: 4px;
}

.wd-checkout-field input,
.wd-checkout-field textarea {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 14px;
  transition: var(--transition);
  font-family: inherit;
}

.wd-checkout-field input:focus,
.wd-checkout-field textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* 只读字段样式 */
.wd-checkout-field input[readonly],
.wd-checkout-field textarea[readonly] {
  background-color: #f5f5f5;
  color: #666;
  cursor: not-allowed;
  border-color: var(--border-color);
}

.wd-checkout-field input[readonly]:focus,
.wd-checkout-field textarea[readonly]:focus {
  box-shadow: none;
  border-color: var(--border-color);
}

.wd-checkout-field textarea {
  resize: vertical;
  min-height: 80px;
}

/* 成功页面 */
.wd-checkout-success-section {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.wd-checkout-success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #28a745;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 24px auto;
  animation: wd-checkout-success-pop 0.5s ease-out;
}

@keyframes wd-checkout-success-pop {
  0% {
    transform: scale(0);
  }
  80% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.wd-checkout-success-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 16px 0;
}

.wd-checkout-success-message {
  font-size: 16px;
  color: #666;
  line-height: 1.5;
  margin: 0 0 24px 0;
}

.wd-checkout-order-details {
  display: none !important;
}

/* 固定底部 */
.wd-checkout-footer {
  background: var(--footer-bg-color, transparent);
  padding: 20px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wd-checkout-footer > div {
  display: none;
  width: 100%;
}

.wd-checkout-footer > div.wd-checkout-footer-active {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  gap: var(--footer-gap, 40px);
}

.wd-checkout-footer-step-3.wd-checkout-footer-active {
  justify-content: center;
}

.wd-checkout-total-items {
  font-size: 14px;
  color: #ffffff;
  flex-shrink: 0;
}

.wd-checkout-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.wd-checkout-total-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 4px;
}

.wd-checkout-total-price .wd-checkout-price-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-color);
}

.wd-checkout-total-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-color);
}

/* 按钮样式 */
.wd-checkout-next-btn,
.wd-checkout-submit-btn,

.wd-checkout-continue-shopping-btn {
  background: #000000;
  color: #ffffff !important;
  padding: 14px 28px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-width: 120px;
  height: 44px;
  white-space: nowrap;
}

/* 确保数量控制按钮和删除按钮有独立的颜色设置 */
.wd-checkout-quantity-btn,
.wd-cart-quantity-btn {
  color: #000000 !important;
}

.wd-checkout-remove-btn {
  color: #000000 !important;
}

.wd-checkout-back-btn {
  color: var(--primary-color) !important;
}

.wd-checkout-next-btn:hover,
.wd-checkout-submit-btn:hover,

.wd-checkout-continue-shopping-btn:hover {
  background: #333333;
}

.wd-checkout-next-btn:active,
.wd-checkout-submit-btn:active,

.wd-checkout-continue-shopping-btn:active {
  transform: translateY(1px);
}

.wd-checkout-submit-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* 2K和4K显示优化 */
@media (min-width: 2560px) {
  .wd-checkout-header {
    padding: 24px 32px;
  }

  .wd-checkout-title {
    font-size: 28px;
  }

  .wd-checkout-step-number {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .wd-checkout-step-label {
    font-size: 16px;
  }

  .wd-checkout-cart-table {
    font-size: 16px;
  }

  .wd-checkout-item-image {
    width: 150px;
    height: 150px;
  }

  .wd-checkout-item-name {
    font-size: 18px;
  }

  .wd-checkout-item-description {
    font-size: 16px;
  }

  .wd-checkout-item-price {
    font-size: 18px;
  }

  .wd-checkout-field input,
  .wd-checkout-field textarea {
    font-size: 16px;
    padding: 14px;
  }
}

@media (min-width: 3840px) {
  .wd-checkout-header {
    padding: 32px 40px;
  }

  .wd-checkout-title {
    font-size: 32px;
  }

  .wd-checkout-step-number {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .wd-checkout-step-label {
    font-size: 18px;
  }

  .wd-checkout-cart-table {
    font-size: 18px;
  }

  .wd-checkout-item-image {
    width: 150px;
    height: 150px;
  }

  .wd-checkout-item-name {
    font-size: 20px;
  }

  .wd-checkout-item-description {
    font-size: 18px;
  }

  .wd-checkout-item-price {
    font-size: 20px;
  }

  .wd-checkout-field input,
  .wd-checkout-field textarea {
    font-size: 18px;
    padding: 16px;
  }

  .wd-checkout-next-btn,
  .wd-checkout-submit-btn {
    font-size: 18px;
    padding: 16px 32px;
  }
}

/* 错误状态 */
.wd-checkout-error {
  color: #dc3545;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: var(--border-radius);
  padding: 16px;
  margin: 20px;
  text-align: center;
}

/* 消息提示 */
.wd-checkout-message {
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin: 16px 0;
  font-size: 14px;
}

.wd-checkout-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.wd-checkout-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.wd-checkout-message.warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* 动画效果 */
.wd-checkout-step-content {
  animation: wd-checkout-fade-in 0.3s ease-out;
}

@keyframes wd-checkout-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 空状态 */
.wd-checkout-empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  background: var(--cart-item-bg-color);
  border-radius: var(--border-radius);
}

.wd-checkout-empty-icon {
  font-size: 48px;
  color: #ccc;
  margin-bottom: 16px;
}

.wd-checkout-empty-message {
  font-size: 16px;
  margin-bottom: 24px;
}

/* 加载状态的商品卡片骨架屏 */
.wd-checkout-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: wd-checkout-skeleton-loading 1.5s infinite;
}

@keyframes wd-checkout-skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* 高对比度和无障碍支持 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  .wd-checkout-widget {
    --border-color: #000;
    --primary-color: #0000ff;
  }
}

/* 打印样式 */
@media print {
  .wd-checkout-widget.wd-checkout-fullscreen {
    position: static;
    height: auto;
    max-height: none;
  }

  .wd-checkout-footer,
  .wd-checkout-back-btn,
  .wd-checkout-quantity-controls,
  .wd-checkout-remove-btn {
    display: none !important;
  }
}

/* 全屏激活时body样式 */
body.wd-checkout-fullscreen-active {
  overflow: hidden;
}

/* 无图片状态 */
.wd-checkout-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #999;
  background: #f5f5f5;
}

/* 客户信息确认样式 */
.wd-checkout-customer-review {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-top: 24px;
}

.wd-checkout-customer-review h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
}

.wd-checkout-review-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.wd-checkout-review-item:last-child {
  border-bottom: none;
}

.wd-checkout-review-item strong {
  color: var(--text-color);
  margin-right: 8px;
}
