/* PopShop™ — receipt-runtime.css
   PSReceiptRuntime — Receipt modal UI styles.
   PASS 11B (PS-4012B)
*/

/* ── Overlay ─────────────────────────────────────────────── */
.ps-receipt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  animation: psRcFadeIn .25s ease-out;
}
@keyframes psRcFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Modal card ──────────────────────────────────────────── */
.ps-receipt-modal {
  width: 100%;
  max-width: 400px;
  background: var(--ps-surface, #141420);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 16px 64px rgba(0,0,0,.7);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(.92) translateY(16px);
  opacity: 0;
  transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .3s ease;
}
.ps-receipt-modal--visible {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ── Header ──────────────────────────────────────────────── */
.ps-receipt-header {
  padding: 28px 24px 20px;
  text-align: center;
  background: linear-gradient(160deg,
    color-mix(in srgb,var(--ps-primary,#00e676) 12%,transparent) 0%,
    rgba(0,200,83,.06) 50%,
    transparent 100%);
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.ps-receipt-check-wrap {
  width: 60px;
  height: 60px;
  background: color-mix(in srgb,var(--ps-primary,#00e676) 15%,transparent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  border: 2px solid color-mix(in srgb,var(--ps-primary,#00e676) 30%,transparent);
}
.ps-receipt-check {
  font-size: 28px;
  line-height: 1;
}
.ps-receipt-title {
  font-family: var(--ps-font-display, 'Outfit', sans-serif);
  font-size: 22px;
  font-weight: 800;
  color: var(--ps-text, #f0f0f5);
  margin-bottom: 4px;
}
.ps-receipt-subtitle {
  font-size: 13px;
  color: var(--ps-text-muted, #8888a0);
  font-weight: 500;
}
.ps-receipt-date {
  font-size: 12px;
  color: var(--ps-text-muted, #8888a0);
  margin-top: 4px;
}

/* ── Body ────────────────────────────────────────────────── */
.ps-receipt-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 20px;
}
.ps-receipt-section {
  margin-bottom: 4px;
}
.ps-receipt-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ps-text-muted, #8888a0);
  margin-bottom: 10px;
}
.ps-receipt-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 14px 0;
}

/* ── Items ───────────────────────────────────────────────── */
.ps-receipt-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ps-receipt-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.ps-receipt-item-name  { color: var(--ps-text, #f0f0f5); }
.ps-receipt-item-price { color: var(--ps-text-muted, #8888a0); font-weight: 500; }

/* ── Rows (payment, fulfillment info) ────────────────────── */
.ps-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 3px 0;
}
.ps-receipt-row--total .ps-receipt-row-label,
.ps-receipt-row--total .ps-receipt-row-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--ps-text, #f0f0f5);
}
.ps-receipt-row-label { color: var(--ps-text-muted, #8888a0); }
.ps-receipt-row-value { color: var(--ps-text, #f0f0f5); font-weight: 500; }

/* ── Price breakdown (from PSPricing) ───────────────────── */
.ps-receipt-body .ps-price-breakdown { }
.ps-receipt-body .ps-price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 3px 0;
}
.ps-receipt-body .ps-price-line .ps-price-label { color: var(--ps-text-muted, #8888a0); }
.ps-receipt-body .ps-price-line .ps-price-value { color: var(--ps-text, #f0f0f5); font-weight: 500; }
.ps-receipt-body .ps-price-line--total .ps-price-label,
.ps-receipt-body .ps-price-line--total .ps-price-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--ps-text, #f0f0f5);
}

/* ── Payment instructions ────────────────────────────────── */
.ps-receipt-instructions {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ps-text-muted, #8888a0);
  line-height: 1.5;
}

/* ── Action buttons (Share / Copy) ──────────────────────── */
.ps-receipt-actions {
  display: flex;
  gap: 10px;
  padding: 0 20px 12px;
  flex-shrink: 0;
}
.ps-receipt-action-btn {
  flex: 1;
  padding: 11px;
  border-radius: 12px;
  font-family: var(--ps-font-display, 'Outfit', sans-serif);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.1);
  background: var(--ps-surface-2, #1c1c30);
  color: var(--ps-text, #f0f0f5);
  transition: background .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.ps-receipt-action-btn:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
}
.ps-receipt-share-btn {
  background: color-mix(in srgb,var(--ps-primary,#00e676) 10%,transparent);
  border-color: color-mix(in srgb,var(--ps-primary,#00e676) 20%,transparent);
  color: var(--ps-primary,#00e676);
}
.ps-receipt-share-btn:hover {
  background: color-mix(in srgb,var(--ps-primary,#00e676) 16%,transparent);
}

/* ── Done button ─────────────────────────────────────────── */
.ps-receipt-done-btn {
  display: block;
  width: calc(100% - 40px);
  margin: 0 20px calc(20px + env(safe-area-inset-bottom, 0px));
  padding: 14px;
  background: var(--ps-primary,#00e676);
  color: #000;
  border: none;
  border-radius: 14px;
  font-family: var(--ps-font-display, 'Outfit', sans-serif);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: filter .15s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.ps-receipt-done-btn:hover  { filter: brightness(1.08); }
.ps-receipt-done-btn:active { transform: scale(.97); }
