/* 一頁式選購區 v2 — 頂部限時橫幅、左圖右文、付款方式、2x2 方案、用碼省/已省 */

/* 頂部：粉絲限時免運 + 優惠倒數 */
.sv2-urgency-bar {
  position: sticky;
  top: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px 10px;
  background: linear-gradient(
    135deg,
    var(--sv2-urgency-deep, var(--sv2-blue-dark)) 0%,
    var(--sv2-urgency-mid, var(--sv2-blue)) 55%,
    var(--sv2-urgency-light, var(--sv2-blue)) 100%
  );
  color: #fff;
  text-align: center;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--sv2-urgency-deep, var(--sv2-blue-dark)) 28%, transparent);
}

.sv2-urgency-bar__text {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.sv2-urgency-bar__text em {
  font-style: normal;
  color: var(--sv2-urgency-highlight, #ffe8a8);
  animation: sv2-urgency-glow 2s ease-in-out infinite;
}

@keyframes sv2-urgency-glow {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50% { text-shadow: 0 0 12px color-mix(in srgb, var(--sv2-urgency-highlight, #ffe8a8) 60%, transparent); }
}

.sv2-urgency-bar__countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.95;
}

.sv2-urgency-bar__countdown-time {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sv2-urgency-bar__countdown-time > span:not(.sv2-urgency-bar__sep) {
  display: inline-block;
  min-width: 1.4em;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.18);
  text-align: center;
}

.sv2-urgency-bar__sep {
  font-weight: 700;
  opacity: 0.9;
}

/* 折扣碼區塊 */
.shop-v2-discount {
  margin: 0 16px 14px;
  padding: 16px 14px 12px;
  background: linear-gradient(180deg, #fff 0%, color-mix(in srgb, var(--sv2-payment-bg, var(--sv2-blue-light)) 55%, #fff) 100%);
  border-radius: var(--sv2-radius);
  border: 2px solid color-mix(in srgb, var(--sv2-blue) 32%, var(--sv2-border));
  box-shadow: var(--sv2-shadow);
}

.shop-v2-discount__title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--sv2-blue-dark);
  line-height: 1.35;
  font-family: "Noto Serif TC", "Songti TC", Georgia, serif;
}

.shop-v2-discount__lead {
  margin: 0 0 12px;
  font-size: 0.72rem;
  color: var(--sv2-muted);
  line-height: 1.55;
}

.shop-v2-discount__lead strong {
  color: var(--sv2-blue);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

.shop-v2-discount__form {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
}

.shop-v2-discount__form input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1.5px solid color-mix(in srgb, var(--sv2-border) 80%, #d0d5db);
  border-radius: 10px;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--sv2-text);
  background: #fff;
}

.shop-v2-discount__form input:focus {
  outline: none;
  border-color: var(--sv2-blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sv2-blue) 18%, transparent);
}

.shop-v2-discount__form input::placeholder {
  color: #a8b0b8;
}

.shop-v2-discount__apply {
  flex-shrink: 0;
  min-width: 64px;
  padding: 11px 16px;
  border: none;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--sv2-blue-dark), color-mix(in srgb, var(--sv2-blue-dark) 75%, #1a1a2e));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--sv2-blue-dark) 28%, transparent);
}

.shop-v2-discount__apply:active {
  transform: scale(0.98);
}

.shop-v2-discount__msg {
  margin: 0 0 8px;
  min-height: 1.1em;
  font-size: 0.7rem;
  line-height: 1.45;
  text-align: center;
}

.shop-v2-discount__msg.is-ok {
  color: var(--sv2-green);
  font-weight: 600;
}

.shop-v2-discount__msg.is-err {
  color: #d64545;
  font-weight: 600;
}

.shop-v2-discount__promo {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 10px 10px 10px 12px;
  border: none;
  border-radius: 10px;
  border-left: 4px solid var(--sv2-blue);
  background: var(--sv2-payment-bg, var(--sv2-blue-light));
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.shop-v2-discount__promo:active {
  transform: scale(0.99);
}

.shop-v2-discount__promo-tag {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  color: #fff;
  background: var(--sv2-blue);
  line-height: 1.3;
  white-space: nowrap;
}

.shop-v2-discount__promo-text {
  flex: 1;
  min-width: 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--sv2-text);
  line-height: 1.5;
}

.shop-v2-discount__code {
  display: inline-block;
  margin: 0 2px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1.5px dashed color-mix(in srgb, var(--sv2-blue) 55%, transparent);
  background: color-mix(in srgb, var(--sv2-payment-bg, var(--sv2-blue-light)) 70%, #fff);
  color: var(--sv2-blue-dark);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.sv2-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:root {
  --sv2-blue: #3b8fd9;
  --sv2-blue-dark: #2a6fad;
  --sv2-blue-light: #e8f4fc;
  --sv2-orange: #f5a623;
  --sv2-green: #2db87a;
  --sv2-text: #1a1a1a;
  --sv2-muted: #8a8a8a;
  --sv2-border: #e0e8ef;
  --sv2-white: #fff;
  --sv2-radius: 16px;
  --sv2-shadow: 0 8px 28px rgba(42, 111, 173, 0.1);
}

.shop-v2-card {
  margin: 0 16px;
  padding: 16px;
  background: var(--sv2-white);
  border-radius: var(--sv2-radius);
  border: 1px solid var(--sv2-border);
  box-shadow: var(--sv2-shadow);
}

.shop-v2-layout {
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 58%);
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.shop-v2-media {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--sv2-blue-light);
  aspect-ratio: 1;
}

.shop-v2-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s ease;
}

.shop-v2-media.is-fading img {
  opacity: 0.35;
}

.shop-v2-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--sv2-payment-fg, var(--sv2-blue-dark));
  background: color-mix(in srgb, var(--sv2-payment-bg, var(--sv2-blue-light)) 95%, transparent);
  border: 1px solid color-mix(in srgb, var(--sv2-blue) 25%, transparent);
}

.shop-v2-info {
  min-width: 0;
}

.shop-v2-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--sv2-text);
  line-height: 1.3;
  font-family: "Noto Serif TC", "Songti TC", Georgia, serif;
}

.shop-v2-subtitle {
  margin: 0 0 8px;
  font-size: 0.68rem;
  color: var(--sv2-muted);
  line-height: 1.45;
}

.shop-v2-price-original {
  margin: 0 0 2px;
  font-size: 0.72rem;
  color: #b0b0b0;
  text-decoration: line-through;
}

.shop-v2-price-original[hidden] {
  display: none;
}

.shop-v2-price-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.shop-v2-price-now {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--sv2-blue);
  line-height: 1;
}

.shop-section.is-discount-applied .shop-v2-price-now {
  color: var(--sv2-blue-dark);
}

.shop-v2-save-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--sv2-white);
  background: var(--sv2-orange);
  white-space: nowrap;
}

.shop-section.is-discount-applied .shop-v2-save-badge {
  background: var(--sv2-green);
}

.shop-v2-payment {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--sv2-payment-bg, var(--sv2-blue-light));
  border: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sv2-payment-fg, var(--sv2-text));
  line-height: 1.4;
}

.shop-v2-payment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
}

.shop-v2-payment-row + .shop-v2-payment-row {
  margin-top: 10px;
}

.shop-v2-payment-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 18px;
  color: color-mix(in srgb, var(--sv2-payment-fg, var(--sv2-text)) 88%, var(--sv2-blue-dark));
}

.shop-v2-payment-icon svg {
  display: block;
  width: 20px;
  height: auto;
}

.shop-v2-payment-text {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--sv2-payment-fg, var(--sv2-text));
}

.shop-v2-cards {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-left: auto;
}

.shop-v2-card-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}

.shop-v2-card-logo--visa {
  min-width: 30px;
  padding: 0 4px;
  font-size: 0.46rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.04em;
  color: #1a1f71;
  background: #fff;
}

.shop-v2-card-logo--mc svg,
.shop-v2-card-logo--jcb svg {
  display: block;
  height: 14px;
  width: auto;
}

.shop-v2-plans-heading {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--sv2-text);
}

.shop-v2-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.shop-v2-plan-btn {
  padding: 10px 8px;
  border: 1.5px solid #d8dfe6;
  border-radius: 10px;
  background: var(--sv2-white);
  font-size: 0.72rem;
  font-weight: 700;
  color: #4a5560;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.35;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.shop-v2-plan-btn.is-active {
  border-color: var(--sv2-blue);
  border-width: 2px;
  color: var(--sv2-blue-dark);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sv2-blue) 15%, transparent);
}

.shop-v2-plan-btn:active {
  transform: scale(0.98);
}

.shop-v2-note {
  margin: 0 0 12px;
  padding: 10px 12px 10px 14px;
  border-radius: 10px;
  background: var(--sv2-blue-light);
  border-left: 4px solid var(--sv2-blue);
}

.shop-v2-note-title {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--sv2-blue-dark);
  line-height: 1.35;
}

.shop-v2-note-desc {
  margin: 0;
  font-size: 0.68rem;
  color: #5a6a75;
  line-height: 1.55;
}

.shop-v2-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.shop-v2-qty-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sv2-text);
}

.shop-v2-qty-control {
  display: inline-grid;
  grid-template-columns: 36px 44px 36px;
  border: 1.5px solid #d8dfe6;
  border-radius: 8px;
  overflow: hidden;
  background: var(--sv2-white);
}

.shop-v2-qty-control button {
  border: none;
  background: #f6f8fa;
  font-size: 1.1rem;
  font-weight: 700;
  color: #4a5560;
  cursor: pointer;
  font-family: inherit;
  min-height: 34px;
}

.shop-v2-qty-control span {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-left: 1px solid #e8ecef;
  border-right: 1px solid #e8ecef;
}

.shop-v2-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--sv2-white);
  text-decoration: none;
  background: linear-gradient(135deg, var(--sv2-blue), var(--sv2-blue-dark));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--sv2-blue) 35%, transparent);
  cursor: pointer;
  font-family: inherit;
}

.shop-v2-buy:active {
  transform: scale(0.98);
}

.shop-v2-buy svg {
  flex-shrink: 0;
}

/* 左下角購買提示 */
.sv2-social-toast {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  bottom: calc(80px + env(safe-area-inset-bottom, 0));
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(300px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--sv2-border);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--sv2-blue) 16%, transparent);
  font-size: 0.74rem;
  line-height: 1.45;
  color: #3a4a55;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}

.sv2-social-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sv2-social-toast__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sv2-green);
  animation: sv2-pulse 2s ease-in-out infinite;
}

@keyframes sv2-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.sv2-social-toast strong {
  color: var(--sv2-blue-dark);
  font-weight: 700;
}

@media (max-width: 360px) {
  .shop-v2-layout {
    grid-template-columns: 1fr;
  }

  .shop-v2-media {
    aspect-ratio: 4 / 3;
    max-height: 200px;
  }
}
