/* ══════════════════════════════════════════════════════════════════
   Secure Payment Modal — Stripe Embedded Checkout over the order page.
   Shared by kbi_order.html, trivia_t2_order.html and v28_order.html
   (markup is injected by js/pay-modal.js).
   ══════════════════════════════════════════════════════════════════ */
.pay-overlay { position: fixed; inset: 0; z-index: 3500; background: rgba(8, 12, 24, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.pay-overlay.active { opacity: 1; visibility: visible; }
.pay-modal { position: fixed; top: 50%; left: 50%; z-index: 3501; display: grid; grid-template-columns: 360px minmax(0, 1fr); width: min(96vw, 1000px); height: min(92vh, 760px); overflow: hidden; background: #fff; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); opacity: 0; visibility: hidden; transform: translate(-50%, -48%) scale(.97); transition: opacity .3s, transform .3s, visibility .3s; font-family: 'Inter', sans-serif; line-height: 1.4; text-align: left; }
.pay-modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

/* Isolate the modal from each order page's global element styles */
.pay-modal *, .pay-modal *::before, .pay-modal *::after { box-sizing: border-box; }
.pay-modal h2, .pay-modal p, .pay-modal figure, .pay-modal dl, .pay-modal dd, .pay-modal ul { margin: 0; padding: 0; }
.pay-modal img { max-width: 100%; }

.pay-brand { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 30px 28px 26px; overflow-y: auto; color: #e6ebf5; background: radial-gradient(120% 70% at 0% 0%, #1b3170 0%, rgba(27, 49, 112, 0) 60%), linear-gradient(160deg, #0e1e4b 0%, #00143d 100%); }
.pay-logo { display: flex; align-items: center; gap: 10px; }
.pay-logo-icon { height: 34px; width: auto; }
.pay-logo-name { height: 15px; width: auto; }
.pay-modal .pay-eyebrow { margin: 6px 0 0; color: #8fa3cf; font: 700 10px 'Orbitron', sans-serif; letter-spacing: .2em; text-transform: uppercase; }
.pay-modal .pay-product-name { margin: 4px 0 0; color: #fff; font: 800 22px/1.15 'Manrope', 'Inter', sans-serif; letter-spacing: -.01em; text-transform: none; }
.pay-product-media { position: relative; padding: 10px; background: #fff; border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); }
.pay-modal .pay-product-media { padding: 10px; }
.pay-product-frame { overflow: hidden; aspect-ratio: 4 / 3; border-radius: 6px; }
.pay-modal .pay-product-frame img { display: block; width: 100%; height: 100%; object-fit: contain; transform: scale(var(--pay-image-zoom, 1)); }
.pay-product-media figcaption { margin-top: 8px; color: #5b6478; font-size: 11px; font-weight: 600; text-align: center; }
.pay-config { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 12.5px; }
.pay-config dt { color: #8fa3cf; font-weight: 400; }
.pay-config dd { color: #fff; font-weight: 600; text-align: right; }
.pay-due { display: flex; justify-content: space-between; align-items: baseline; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .14); }
.pay-due span { color: #b8c4e0; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.pay-due strong { color: #fff; font: 800 26px 'Manrope', 'Inter', sans-serif; letter-spacing: -.02em; }
.pay-modal .pay-assure { list-style: none; margin: auto 0 0; display: grid; gap: 8px; color: #9fb0d6; font-size: 11.5px; line-height: 1.45; }
.pay-assure li { display: flex; gap: 9px; align-items: flex-start; }
.pay-assure i { width: 14px; margin-top: 2px; color: #7fd1ae; text-align: center; }
.pay-checkout { display: flex; flex-direction: column; min-height: 0; background: #fff; }
.pay-checkout-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px 14px; border-bottom: 1px solid #eef0f4; }
.pay-checkout-title { display: flex; align-items: center; gap: 9px; color: #171a20; font: 700 12px 'Orbitron', sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.pay-checkout-title i { color: #16a34a; }
.pay-close { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: #f3f4f6; color: #4b5563; font-size: 20px; line-height: 1; cursor: pointer; transition: background .2s, color .2s; }
.pay-close:hover { background: #e5e7eb; color: #111827; }
.pay-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 24px 24px; }
.pay-mount { max-width: 520px; margin: 0 auto; }
.pay-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 340px; color: #6b7280; font-size: 13px; text-align: center; }
.pay-spinner { width: 34px; height: 34px; border: 3px solid #e5e7eb; border-top-color: #0e1e4b; border-radius: 50%; animation: pay-spin .8s linear infinite; }
.pay-state.is-error { color: #b91c1c; }
.pay-state.is-error button { padding: 10px 18px; border: 1.5px solid #0e1e4b; border-radius: 8px; background: #fff; color: #0e1e4b; font-weight: 700; cursor: pointer; }
@keyframes pay-spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .pay-modal { inset: 0; top: 0; left: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); width: auto; height: auto; border-radius: 0; transform: translateY(12px); }
  .pay-modal.active { transform: none; }
  .pay-brand, .pay-checkout { min-width: 0; }
  .pay-brand { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 16px 18px; overflow: visible; }
  .pay-logo { width: 100%; }
  .pay-modal .pay-product-media { width: 86px; padding: 5px; border-radius: 8px; }
  .pay-product-media figcaption, .pay-config, .pay-modal .pay-assure, .pay-modal .pay-eyebrow { display: none; }
  .pay-modal .pay-product-name { flex: 1; min-width: 0; margin: 0; font-size: 16px; }
  .pay-due { width: 100%; padding-top: 10px; }
  .pay-due strong { font-size: 20px; }
  .pay-checkout-head { padding: 12px 16px 10px; }
  .pay-body { padding: 14px 14px 20px; }
}
