/*
 * 優惠券樣式 (pf-coupon*)
 * 還原自 commit 93a3549，原寫於 style-member.css，於 d8ac546 重編 scss 時被意外覆蓋。
 * 獨立成檔，避免再被 style-member.scss 重新編譯時清掉。
 * 使用頁面：app/Views/web/member/coupon.php + public/js/page/member-coupon.js
 */

.pf-coupon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.pf-coupon {
  --pf-coupon-accent: #7e4985;
  --pf-coupon-accent-soft: #f0e2f3;
  --pf-coupon-bg: #ffffff;
  --pf-coupon-notch: var(--pf-coupon-bg);

  position: relative;
  display: grid;
  grid-template-columns: 120px 1px 1fr;
  align-items: stretch;
  min-height: 168px;
  background: var(--pf-coupon-bg);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(20, 20, 40, 0.06);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pf-coupon:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20, 20, 40, 0.10);
}

/* 以 #7e4985 為基準色，做深 / 中 / 淺三階變化 */
.pf-coupon--percentage    { --pf-coupon-accent: #5a2a63; --pf-coupon-accent-soft: #e3d0e7; } /* 深 */
.pf-coupon--fixed         { --pf-coupon-accent: #7e4985; --pf-coupon-accent-soft: #f0e2f3; } /* 中 (base) */
.pf-coupon--free_shipping { --pf-coupon-accent: #f6ab00; --pf-coupon-accent-soft: #fff1cc; } /* 對比金黃 */

/* Left stub: amount */
.pf-coupon__stub {
  background: var(--pf-coupon-accent);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  text-align: center;
  gap: 6px;
}

.pf-coupon__stub-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  line-height: 1;
}

.pf-coupon__stub-prefix,
.pf-coupon__stub-suffix {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.9;
}

.pf-coupon__stub-value {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pf-coupon__stub-label {
  font-size: 0.78rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  letter-spacing: 0.05em;
}

/* Divider with two notches */
.pf-coupon__divider {
  position: relative;
  width: 1px;
  background: transparent;
  border-left: 1.5px dashed rgba(0, 0, 0, 0.18);
  margin: 14px 0;
}

.pf-coupon__divider::before,
.pf-coupon__divider::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 18px;
  height: 18px;
  background: #f6f6f8;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.pf-coupon__divider::before { top: -23px; }
.pf-coupon__divider::after  { bottom: -23px; }

/* Right body */
.pf-coupon__body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.pf-coupon__code {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-weight: 700;
  font-size: 1.15rem;
  color: #212529;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.pf-coupon__desc {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.45;
}

.pf-coupon__meta {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: #6c757d;
}

.pf-coupon__meta li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pf-coupon__meta li.is-urgent {
  color: #5a2a63;
  font-weight: 600;
}

.pf-coupon__meta i {
  flex-shrink: 0;
  width: 14px;
}

.pf-coupon__action {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--pf-coupon-accent);
  background: var(--pf-coupon-accent-soft);
  color: var(--pf-coupon-accent);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pf-coupon__action:hover {
  background: var(--pf-coupon-accent);
  color: #fff;
}

@media (max-width: 480px) {
  .pf-coupon {
    grid-template-columns: 100px 1px 1fr;
    min-height: 156px;
  }
  .pf-coupon__stub-value { font-size: 1.75rem; }
  .pf-coupon__body { padding: 14px; }
}
