/* Cart 页内会员付款弹窗 — 与 vip-funnel 色板一致 */
.vpm-root {
  --vpm-accent: var(--vf-accent, #ff5745);
  --vpm-accent-soft: var(--vf-accent-soft, rgba(255, 87, 69, 0.1));
  --vpm-ink: var(--vf-ink, #1a1a1a);
  --vpm-muted: var(--vf-muted, #6a6a6a);
  --vpm-line: var(--vf-line, #e5e6ea);
  --vpm-surface: var(--vf-surface, #fff);
  --vpm-canvas: var(--vf-canvas, #f2f3f5);
  --vpm-ok: var(--vf-ok, #34968e);
  --vpm-wx: #07c160;
  --vpm-ali: #1677ff;
  --vpm-pp: #003087;
  --vpm-radius: 16px;
  --vpm-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
}

.vpm-root.is-open {
  pointer-events: auto;
  visibility: visible;
}

.vpm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 22, 0.48);
  opacity: 0;
  transition: opacity 0.28s var(--vpm-ease);
  backdrop-filter: blur(2px);
}

.vpm-root.is-open .vpm-backdrop {
  opacity: 1;
}

.vpm-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: min(92vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--vpm-surface);
  color: var(--vpm-ink);
  border-radius: var(--vpm-radius) var(--vpm-radius) 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
  transform: translateY(110%);
  transition: transform 0.36s var(--vpm-ease);
  overflow: hidden;
}

.vpm-root.is-open .vpm-sheet {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .vpm-root {
    align-items: center;
    padding: 1.5rem;
  }

  .vpm-sheet {
    max-width: 520px;
    border-radius: var(--vpm-radius);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    transform: translateY(18px) scale(0.97);
    opacity: 0;
    transition: transform 0.32s var(--vpm-ease), opacity 0.28s var(--vpm-ease);
  }

  .vpm-root.is-open .vpm-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.vpm-grab {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 0.15rem;
}

.vpm-grab span {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: var(--vpm-line);
}

@media (min-width: 768px) {
  .vpm-grab {
    display: none;
  }
}

.vpm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--vpm-line);
}

.vpm-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--vpm-accent);
  text-transform: uppercase;
}

.vpm-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.vpm-sub {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--vpm-muted);
}

.vpm-close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--vpm-canvas);
  color: var(--vpm-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-size: 1.1rem;
  line-height: 1;
}

.vpm-close:hover {
  background: var(--vpm-accent-soft);
  color: var(--vpm-accent);
}

.vpm-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.25rem 0.5rem;
}

.vpm-section {
  margin-bottom: 1.15rem;
}

.vpm-section-label {
  margin: 0 0 0.55rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--vpm-ink);
}

.vpm-durations {
  display: grid;
  gap: 0.5rem;
}

.vpm-duration {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--vpm-line);
  border-radius: 12px;
  background: var(--vpm-surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.vpm-duration:hover {
  border-color: rgba(255, 87, 69, 0.45);
}

.vpm-duration.is-on {
  border-color: var(--vpm-accent);
  background: var(--vpm-accent-soft);
  box-shadow: 0 0 0 1px var(--vpm-accent);
}

.vpm-duration-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.vpm-duration-label {
  font-size: 0.9375rem;
  font-weight: 600;
}

.vpm-duration-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  vertical-align: middle;
  color: var(--vpm-accent);
  background: rgba(255, 87, 69, 0.12);
  border-radius: 999px;
}

.vpm-duration-sub {
  font-size: 0.75rem;
  color: var(--vpm-muted);
}

.vpm-duration-price {
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.vpm-pays {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
}

.vpm-pay {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.5rem;
  border: 1.5px solid var(--vpm-line);
  border-radius: 12px;
  background: var(--vpm-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.vpm-pay input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vpm-pay.is-off {
  display: none;
}

.vpm-pay.is-on {
  border-color: var(--vpm-accent);
  background: var(--vpm-accent-soft);
  box-shadow: 0 0 0 1px var(--vpm-accent);
}

.vpm-pay-icon {
  width: 1.4rem;
  height: 1.4rem;
  flex-shrink: 0;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.vpm-pay[data-method="wxpay"] .vpm-pay-icon {
  background: var(--vpm-wx);
}

.vpm-pay[data-method="alipay"] .vpm-pay-icon {
  background: var(--vpm-ali);
}

.vpm-pay[data-method="paypal"] .vpm-pay-icon {
  background: var(--vpm-pp);
  font-size: 0.55rem;
}

.vpm-pay-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--vpm-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vpm-summary {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--vpm-canvas);
}

.vpm-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--vpm-muted);
}

.vpm-summary-row strong {
  font-weight: 600;
  color: var(--vpm-ink);
}

.vpm-summary-row.is-total {
  margin-top: 0.15rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--vpm-line);
  font-size: 0.9375rem;
}

.vpm-summary-row.is-total strong {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--vpm-accent);
  letter-spacing: -0.02em;
}

.vpm-foot {
  flex-shrink: 0;
  padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--vpm-line);
  background: var(--vpm-surface);
}

.vpm-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--vpm-accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.vpm-cta:hover:not(:disabled) {
  filter: brightness(1.05);
}

.vpm-cta:active:not(:disabled) {
  transform: scale(0.985);
}

.vpm-cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.vpm-legal {
  margin: 0.65rem 0 0;
  font-size: 0.7rem;
  line-height: 1.45;
  color: var(--vpm-muted);
  text-align: center;
}

.vpm-legal a {
  color: var(--vpm-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vpm-fallback {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.72rem;
  color: var(--vpm-muted);
  text-align: center;
}

.vpm-fallback a {
  color: var(--vpm-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vpm-paypane {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem 0 0.25rem;
  animation: vpm-fade-in 0.28s var(--vpm-ease);
}

.vpm-root.is-paying .vpm-config {
  display: none;
}

.vpm-root.is-paying .vpm-paypane {
  display: flex;
}

.vpm-root.is-paying .vpm-cta-label-pay {
  display: none;
}

.vpm-paypane-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.vpm-paypane-hint {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--vpm-muted);
}

.vpm-paypane-amount {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--vpm-accent);
  letter-spacing: -0.02em;
}

.vpm-qr-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 1rem;
  border-radius: 12px;
  background: var(--vpm-canvas);
  overflow: hidden;
}

.vpm-qr-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.vpm-qr-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--vpm-muted);
  background: var(--vpm-canvas);
}

.vpm-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--vpm-line);
  border-top-color: var(--vpm-accent);
  border-radius: 50%;
  animation: vpm-spin 0.7s linear infinite;
}

.vpm-h5-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  max-width: 280px;
  margin: 0.25rem auto 0.75rem;
}

.vpm-h5-go {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--vpm-accent);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
}

.vpm-back-config {
  border: 0;
  background: transparent;
  color: var(--vpm-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0.35rem;
}

.vpm-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 0.5rem;
  animation: vpm-fade-in 0.32s var(--vpm-ease);
}

.vpm-root.is-success .vpm-config,
.vpm-root.is-success .vpm-paypane,
.vpm-root.is-success .vpm-foot {
  display: none;
}

.vpm-root.is-success .vpm-success {
  display: flex;
}

.vpm-success-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.85rem;
  border-radius: 999px;
  background: rgba(52, 150, 142, 0.14);
  color: var(--vpm-ok);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.vpm-success h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.vpm-success p {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--vpm-muted);
}

.vpm-success-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  background: var(--vpm-accent);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
}

body.vpm-lock {
  overflow: hidden;
}

@keyframes vpm-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes vpm-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vpm-backdrop,
  .vpm-sheet,
  .vpm-paypane,
  .vpm-success {
    transition: none !important;
    animation: none !important;
  }
}
