/* 优惠码弹窗 - 停留挽留组件（遵循 CandyCake 设计规范） */

/* 遮罩层 - 毛玻璃 */
.cc-coupon-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, .4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.cc-coupon-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* 弹窗主体 - 毛玻璃卡片规范 */
.cc-coupon-popup {
  position: relative;
  width: 380px;
  max-width: 92vw;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(226, 232, 240, .85);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .10);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  overflow: hidden;
  transform: translateY(12px);
  transition: transform .25s ease;
}
.cc-coupon-overlay.show .cc-coupon-popup {
  transform: translateY(0);
}

/* 顶部装饰条 - 主蓝渐变 */
.cc-coupon-header {
  background: linear-gradient(135deg, var(--cc-blue, #2563eb) 0%, var(--cc-blue-600, #1d4ed8) 100%);
  padding: 24px 24px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cc-coupon-header::before {
  content: "";
  position: absolute;
  top: -24px;
  right: -24px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.cc-coupon-header::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: -16px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}

.cc-coupon-emoji {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 8px;
  display: block;
  animation: ccCouponBounce 2s ease-in-out infinite;
}
@keyframes ccCouponBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.cc-coupon-title {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}
.cc-coupon-subtitle {
  color: rgba(255, 255, 255, .8);
  font-size: 13px;
  font-weight: 400;
  margin-top: 4px;
}

/* 内容区域 */
.cc-coupon-body {
  padding: 24px;
  text-align: center;
}
.cc-coupon-desc {
  color: var(--cc-muted, #64748b);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* 折扣标签 */
.cc-coupon-discount {
  display: inline-block;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
}

/* 优惠码卡片 */
.cc-coupon-code-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--cc-bg, #f7fbff);
  border: 2px dashed var(--cc-blue, #2563eb);
  border-radius: 14px;
  padding: 16px 24px;
  margin-bottom: 24px;
}
.cc-coupon-code {
  font-size: 24px;
  font-weight: 700;
  color: var(--cc-blue, #2563eb);
  letter-spacing: 4px;
  user-select: all;
}

/* 复制按钮 - 主要按钮规范 */
.cc-coupon-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--cc-blue, #2563eb), var(--cc-blue-600, #1d4ed8));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .25);
  transition: all .2s ease;
  white-space: nowrap;
}
.cc-coupon-copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .3);
}
.cc-coupon-copy-btn.copied {
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 8px 20px rgba(22, 163, 74, .25);
}

/* 底部按钮组 */
.cc-coupon-actions {
  display: flex;
  gap: 12px;
}

/* 主操作按钮 - 主要按钮规范 */
.cc-coupon-use-btn {
  flex: 1;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--cc-blue, #2563eb), var(--cc-blue-600, #1d4ed8));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .25);
  transition: all .2s ease;
  text-decoration: none;
  text-align: center;
}
.cc-coupon-use-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .3);
  color: #fff;
  text-decoration: none;
}

/* 次操作按钮 - 次要按钮规范 */
.cc-coupon-close-btn {
  padding: 10px 14px;
  background: transparent;
  color: var(--cc-blue, #2563eb);
  border: 1px solid rgba(37, 99, 235, .4);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}
.cc-coupon-close-btn:hover {
  background: var(--cc-bg, #f7fbff);
  transform: translateY(-1px);
}

/* 右上角关闭 X */
.cc-coupon-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s ease;
  z-index: 1;
}
.cc-coupon-x:hover {
  background: rgba(255, 255, 255, .35);
}

/* 响应式 - 移动端 ≤640px */
@media (max-width: 640px) {
  .cc-coupon-popup { width: 94vw; }
  .cc-coupon-header { padding: 16px 16px 12px; }
  .cc-coupon-body { padding: 16px; }
  .cc-coupon-code { font-size: 20px; letter-spacing: 3px; }
  .cc-coupon-actions { flex-direction: column; }
}
