/* PopShop™ — checkout-runtime.css
   PSCheckout — Checkout sheet UI styles.
   PASS 11B (PS-4012B)
*/

/* ── Overlay ─────────────────────────────────────────────── */
.ps-checkout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: psCoFadeIn .2s ease-out;
}
@keyframes psCoFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Sheet ───────────────────────────────────────────────── */
.ps-checkout-sheet {
  width: 100%;
  max-width: 540px;
  background: var(--ps-surface, #141420);
  border-radius: 22px 22px 0 0;
  border: 1px solid rgba(255,255,255,.07);
  border-bottom: none;
  box-shadow: 0 -16px 64px rgba(0,0,0,.65);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.ps-checkout-sheet--visible { transform: translateY(0); }

.ps-checkout-drag-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.18);
  margin: 10px auto 0;
  flex-shrink: 0;
}

/* ── Header ──────────────────────────────────────────────── */
.ps-checkout-header {
  display: flex;
  align-items: center;
  padding: 14px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  position: relative;
}
.ps-checkout-title {
  flex: 1;
  font-family: var(--ps-font-display, 'Outfit', sans-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ps-text, #f0f0f5);
  text-align: center;
}
.ps-checkout-back,
.ps-checkout-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
  transition: color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.ps-checkout-back  { font-size: 24px; }
.ps-checkout-back:hover,
.ps-checkout-close:hover { color: var(--ps-text, #f0f0f5); }

/* ── Body (scrollable) ───────────────────────────────────── */
.ps-checkout-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 20px;
}

/* ── Footer ──────────────────────────────────────────────── */
.ps-checkout-footer {
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  background: var(--ps-surface, #141420);
}

/* ── Cart item rows ──────────────────────────────────────── */
.ps-co-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ps-co-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--ps-surface-2, #1c1c30);
  border-radius: 12px;
}
.ps-co-item-img {
  width: 50px;
  height: 50px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}
.ps-co-item-img--placeholder {
  background: rgba(255,255,255,.06);
}
.ps-co-item-info {
  flex: 1;
  min-width: 0;
}
.ps-co-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ps-text, #f0f0f5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-co-item-note {
  font-size: 12px;
  color: var(--ps-text-muted, #8888a0);
  margin-top: 2px;
}
.ps-co-item-price {
  font-size: 13px;
  color: var(--ps-primary,#00e676);
  font-weight: 600;
  margin-top: 3px;
}
.ps-co-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ps-co-qty-btn {
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,.08);
  border: none;
  border-radius: 8px;
  color: var(--ps-text, #f0f0f5);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.ps-co-qty-btn:hover { background: rgba(255,255,255,.14); }
.ps-co-qty-num {
  min-width: 22px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ps-text, #f0f0f5);
}
.ps-co-item-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,.25);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  line-height: 1;
  margin-left: 2px;
  transition: color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.ps-co-item-remove:hover { color: var(--ps-danger, #ff6b6b); }

/* ── Footer subtotal + primary button ───────────────────── */
.ps-co-subtotal {
  font-size: 14px;
  color: var(--ps-text-muted, #8888a0);
  margin-bottom: 12px;
}
.ps-co-subtotal strong {
  color: var(--ps-text, #f0f0f5);
}
.ps-co-primary-btn {
  width: 100%;
  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;
  transition: filter .15s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.ps-co-primary-btn:hover  { filter: brightness(1.08); }
.ps-co-primary-btn:active { transform: scale(.97); }
.ps-co-primary-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

/* ── Sections in payment / confirm steps ─────────────────── */
.ps-co-section {
  margin-bottom: 20px;
}
.ps-co-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ps-text-muted, #8888a0);
  margin-bottom: 10px;
}
.ps-co-total-preview {
  font-size: 14px;
  color: var(--ps-text-muted, #8888a0);
  margin-bottom: 12px;
}
.ps-co-total-preview strong {
  color: var(--ps-text, #f0f0f5);
  font-size: 18px;
}

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

.ps-co-confirm-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 14px 0;
}
.ps-co-confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 4px 0;
}
.ps-co-confirm-label { color: var(--ps-text-muted, #8888a0); }
.ps-co-confirm-value {
  color: var(--ps-text, #f0f0f5);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ps-co-confirm-handle {
  font-size: 12px;
  color: var(--ps-text-muted, #8888a0);
}

/* ── Error state ─────────────────────────────────────────── */
.ps-co-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255, 107, 107, .12);
  border: 1px solid rgba(255, 107, 107, .25);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ps-danger, #ff6b6b);
  line-height: 1.4;
}

/* ── Loading state ───────────────────────────────────────── */
.ps-co-loading {
  text-align: center;
  padding: 32px;
  font-size: 14px;
  color: var(--ps-text-muted, #8888a0);
}

/* ── Place order button ──────────────────────────────────── */
.ps-co-place-btn {
  background: linear-gradient(135deg, var(--ps-primary,#00e676) 0%, #00c853 100%);
  font-size: 17px;
  padding: 16px;
}

/* ── Price breakdown (PSPricing.renderBreakdown output) ─── */
.ps-price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ps-price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.ps-price-line .ps-price-label { color: var(--ps-text-muted, #8888a0); }
.ps-price-line .ps-price-value { color: var(--ps-text, #f0f0f5); font-weight: 500; }
.ps-price-line--total .ps-price-label,
.ps-price-line--total .ps-price-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--ps-text, #f0f0f5);
}
/* PS-4305 quote checkout grouping */
.ps-co-quote-tag{display:inline-flex;align-items:center;min-height:20px;padding:0 7px;border-radius:999px;background:color-mix(in srgb,var(--ps-primary,#00e676) 12%,transparent);border:1px solid color-mix(in srgb,var(--ps-primary,#00e676) 26%,rgba(255,255,255,.08));color:var(--ps-primary,#00e676);font-size:9px;font-weight:850}.ps-co-cart-notice{margin:0 0 10px;border:1px solid rgba(255,110,120,.24);border-radius:11px;background:rgba(255,80,90,.07);color:#ffafb4;padding:9px 10px;font-size:10px}
