.discount-cards {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: nowrap;
}
.discount-cards .left-part,
.discount-cards .right-part {
  display: flex;
  justify-content: center;
}

.coupon-container-wrapper {
  width: var(--desktop-width);
}

@media screen and (max-width: 750px) {
  .discount-cards {
    flex-wrap: wrap;
  }
  .coupon-container-wrapper {
    width: calc(100vw - 48px);
  }
}

.coupon-container {
  width: 100%; /* 宽度自适应屏幕 */
  aspect-ratio: var(--aspect-ratio);

  background-image: var(--background-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  display: flex; /* 左右布局 */
  align-items: center; /* 垂直居中 */

  container-type: inline-size;
  border-radius: 8px;
}

/* 左侧折扣区 */
.left-part {
  width: 30%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  /* 这里的字体用 cqw (container width)，1cqw = 容器宽度的1% */
  /* 这样字号永远随卡片宽度等比缩放 */
  font-size: 6cqw;
  font-weight: bold;
  color: #333;
  line-height: 1.2;
}

/* 右侧详情区 */
.right-part {
  flex: 1; /* 占据剩余空间 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-right: 5cqw; /* 右边距也用相对单位 */
}

.code-text {
  font-size: 5cqw;
  color: #333;
  margin-bottom: 1cqw;
}

.desc-text {
  font-size: 4cqw;
  color: #555;
}

/* Copy overlay */
.copy-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.copy-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.copy-tip {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.coupon-container {
  position: relative;
}

.code-text[data-copyable] {
  cursor: pointer;
}

.code-text[data-copyable]:hover {
  opacity: 0.7;
}

/* Received button */
.received-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background-color: #2e7d32;
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  transform: rotate(12deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.received-btn.visible {
  display: flex;
}

.coupon-container[data-copyable] {
  cursor: pointer;
}

.coupon-container[data-copyable]:hover .right-part {
  opacity: 0.7;
}
