/* 优惠券功能样式 */

/* 优惠券弹窗样式 */
.coupon-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transform: scale(1);
  transition: all 0.3s ease-in-out;
}

.coupon-popup-content {
  background: #ffffff;
  border-radius: 15px;
  padding: 0;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.coupon-popup-header {
  position: relative;
  background: linear-gradient(135deg, #4cbbdb, #3e9db8);
  padding: 15px 20px;
  text-align: right;
}

.coupon-popup-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.coupon-popup-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.coupon-popup-body {
  padding: 30px 20px;
  text-align: center;
}

.coupon-icon {
  font-size: 60px;
  margin-bottom:40px;
  animation: bounce 2s infinite;
}

.coupon-title {
  color: #222222;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 10px;
  font-family: "Raleway", sans-serif;
}

.coupon-message {
  color: #666666;
  font-size: 16px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.coupon-code-display {
  background: #f8f9fa;
  border: 2px dashed #4cbbdb;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 25px;
}

.coupon-code-label {
  color: #666666;
  font-size: 14px;
  display: block;
  margin-bottom: 5px;
}

.coupon-code-value {
  color: #4cbbdb;
  font-size: 18px;
  font-weight: 600;
  font-family: monospace;
  letter-spacing: 2px;
}

.coupon-claim-btn {
  background: linear-gradient(135deg, #4cbbdb, #3e9db8);
  color: #ffffff;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.coupon-claim-btn:hover {
  background: linear-gradient(135deg, #3e9db8, #2d7a8f);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(76, 187, 219, 0.4);
}

/* 悬浮图标样式 */
.coupon-floating-icon {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #4cbbdb, #3e9db8);
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 5px 20px rgba(76, 187, 219, 0.4);
  transition: all 0.3s ease;
  animation: float 3s ease-in-out infinite;
  /* 确保始终可见 */
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* 悬浮图标隐藏状态 */
.coupon-floating-icon.hidden {
  transform: translateX(-100px);
  opacity: 0;
  pointer-events: none;
}

/* 悬浮图标显示状态 */
.coupon-floating-icon.visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.coupon-floating-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(76, 187, 219, 0.6);
}

/* 移除已领取状态的样式，保持原来的蓝色渐变 */

.coupon-icon-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(76, 187, 219, 0.3);
  animation: pulse-ring 2s infinite;
}

.coupon-icon-content {
  position: relative;
  z-index: 2;
}

.coupon-icon-emoji {
  font-size: 24px;
  color: #ffffff;
}

/* 侧边栏优惠券提醒 */
.sidebar-coupon-reminder {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border: 2px solid #ffc107;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
}

.coupon-reminder-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.coupon-reminder-icon {
  font-size: 20px;
}

.coupon-reminder-text {
  color: #856404;
  font-weight: 600;
  font-size: 14px;
}

/* 购物车优惠券区域 */
.coupon-section {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.coupon-section h4 {
  color: #222222;
  font-size: 18px;
  margin-bottom: 15px;
  font-family: "Raleway", sans-serif;
}

.coupon-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.coupon-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
}

.coupon-input:focus {
  outline: none;
  border-color: #4cbbdb;
  box-shadow: 0 0 0 2px rgba(76, 187, 219, 0.2);
}

.coupon-apply-btn {
  background: #4cbbdb;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.coupon-apply-btn:hover {
  background: #3e9db8;
}

.coupon-apply-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.coupon-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #e9ecef;
  margin-top: 15px;
}

.coupon-discount {
  color: #28a745;
  font-weight: 600;
}

.coupon-remove-btn {
  background: #dc3545;
  color: #ffffff;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.3s ease;
}

.coupon-remove-btn:hover {
  background: #c82333;
}

/* 动画效果 */
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.4);
  }
  50% {
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.8);
  }
  100% {
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.4);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* 左右移动动画 */
@keyframes a_l_r {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-200px);
  }
  40% {
    transform: translateX(-200px);
  }
  60% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(0);
  }
}

/* 悬浮图标移动效果 */
.coupon-floating-icon.shake {
  animation: a_l_r 5s infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .coupon-popup-content {
    width: 95%;
    margin: 20px;
  }

  .coupon-popup-body {
    padding: 20px 15px;
  }

  .coupon-title {
    font-size: 20px;
  }

  .coupon-message {
    font-size: 14px;
  }

  .coupon-floating-icon {
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
  }

  .coupon-icon-emoji {
    font-size: 20px;
  }

  .coupon-input-group {
    flex-direction: column;
  }

  .coupon-apply-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .coupon-floating-icon {
    bottom: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
  }

  .coupon-icon-emoji {
    font-size: 18px;
  }

  .coupon-popup-content {
    margin: 10px;
  }

  .coupon-popup-body {
    padding: 15px 10px;
  }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
  .coupon-popup-content {
    background: #2d3748;
    color: #e2e8f0;
  }

  .coupon-title {
    color: #e2e8f0;
  }

  .coupon-message {
    color: #a0aec0;
  }

  .coupon-code-display {
    background: #4a5568;
    border-color: #4cbbdb;
  }

  .coupon-section {
    background: #4a5568;
    border-color: #718096;
  }

  .coupon-section h4 {
    color: #e2e8f0;
  }

  .coupon-input {
    background: #2d3748;
    border-color: #718096;
    color: #e2e8f0;
  }
}
