/* =====================================================================
   Checkout PINK — form, QRIS, struk (mode terang & gelap)
   ===================================================================== */
.container { width: 100%; max-width: 620px; margin: 0 auto; padding: 4px 14px 8px; }
body.has-paybar { padding-bottom: 120px; }
.topbar, .back-link { display: none !important; }
.ui-back { max-width: 620px; }

/* langkah 1-2-3 */
.co-steps { max-width: 620px; margin: 12px auto 14px; padding: 0 14px; }
.co-steps .bars { display: none; }
.co-steps .lbl { display: flex; align-items: center; font-size: .72rem; font-weight: 600; color: var(--muted); counter-reset: st; }
.co-steps .lbl span { display: flex; align-items: center; gap: 6px; counter-increment: st; white-space: nowrap; }
.co-steps .lbl span::before { content: counter(st); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 700; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.co-steps .lbl span:not(:last-child)::after { content: ""; flex: 1; min-width: 20px; height: 2px; border-radius: 2px; margin-left: 8px; background: var(--line); }
.co-steps .lbl span:not(:last-child) { flex: 1; padding-right: 8px; }
body[data-step="1"] .co-steps .lbl span:nth-child(1), body[data-step="2"] .co-steps .lbl span:nth-child(2), body[data-step="3"] .co-steps .lbl span:nth-child(3) { color: var(--text); }
body[data-step="1"] .co-steps .lbl span:nth-child(1)::before,
body[data-step="2"] .co-steps .lbl span:nth-child(2)::before,
body[data-step="3"] .co-steps .lbl span:nth-child(3)::before { background: var(--grad); color: #fff; border-color: transparent; }
body[data-step="2"] .co-steps .lbl span:nth-child(1)::before,
body[data-step="3"] .co-steps .lbl span:nth-child(1)::before,
body[data-step="3"] .co-steps .lbl span:nth-child(2)::before { content: "\2713"; background: #10b981; color: #fff; border-color: transparent; }
body[data-step="2"] .co-steps .lbl span:nth-child(1)::after,
body[data-step="3"] .co-steps .lbl span::after { background: var(--grad); }

/* ---------- produk ---------- */
.product-header-wrapper { margin-bottom: 12px; }
.product-header-clean { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh); }
.product-header-img { width: 44%; max-width: 230px; aspect-ratio: 16 / 9; height: auto; object-fit: cover; flex: none; border-radius: 12px; background: var(--surface-2); }
.product-header-info { min-width: 0; flex: 1; }
.product-header-info h1 { font-family: var(--font-d); font-size: .95rem; font-weight: 700; line-height: 1.2; text-transform: uppercase; margin-bottom: 5px; }
.co-variant-line { font-size: .74rem; color: var(--muted); font-weight: 500; margin-bottom: 5px; }
.co-variant-line i { color: var(--brand); }
.co-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.co-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 7px; font-size: .6rem; font-weight: 700; border: 1px solid var(--line); color: var(--brand); background: var(--surface-2); text-transform: uppercase; }
.co-tag .amp { opacity: .55; }
.co-tag.root { border-color: transparent; background: rgba(255, 0, 212, .12); }

/* ---------- form ---------- */
.container > p { display: none; }
#checkoutForm { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--sh); padding: 16px 16px 4px; }
.form-group { margin-bottom: 16px; }
.form-group > label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .84rem; color: var(--text); margin-bottom: 9px; }
.form-group > label > i { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand) !important; font-size: .72rem; margin: 0 !important; }
.form-group > label span { color: var(--muted) !important; font-weight: 500 !important; }
.form-group input[type=text], .form-group input[type=tel] { width: 100%; padding: 12px 14px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); font-size: .93rem; outline: none; transition: .15s; }
.form-group input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.form-group input::placeholder { color: var(--muted); }
.form-group input.input-error { border-color: var(--bad) !important; background: var(--bad-soft) !important; }
.field-msg { font-size: .74rem; margin-top: 6px; display: flex; align-items: center; gap: 5px; font-weight: 600; line-height: 1.3; opacity: 0; max-height: 0; overflow: hidden; transition: .2s; }
.field-msg.show { opacity: 1; max-height: 44px; }
.field-msg.error { color: var(--bad); }
.data-tersimpan { margin-top: 8px; font-size: .74rem; font-weight: 600; color: var(--ok); }
.data-tersimpan a { color: var(--muted); text-decoration: underline; }

.variant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 520px) { .variant-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.variant-box { position: relative; cursor: pointer; padding: 11px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); display: flex; flex-direction: column; gap: 4px; min-height: 82px; user-select: none; transition: .12s; }
.variant-box:hover { border-color: var(--brand-line); }
.variant-box .v-name { font-weight: 700; font-size: .88rem; padding-right: 26px; line-height: 1.2; }
.v-price-wrapper { margin-top: auto; }
.v-old-row { display: flex; align-items: center; gap: 6px; }
.v-old { font-size: .68rem; color: var(--muted); text-decoration: line-through; }
.badge-discount { position: absolute; top: 9px; right: 9px; font-size: .58rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: #f43f5e; color: #fff; }
.v-price { display: block; font-weight: 800; font-size: 1rem; color: var(--brand); }
.check-icon { position: absolute; top: 9px; right: 9px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .6rem; background: #fff; color: #e100c8; opacity: 0; transform: scale(.5); transition: .15s; }
.variant-box.selected { border-color: transparent; background: var(--grad); color: #fff; box-shadow: var(--sh); }
.variant-box.selected .v-price, .variant-box.selected .v-old { color: #fff; }
.variant-box.selected .v-old { opacity: .75; }
.variant-box.selected .check-icon { opacity: 1; transform: none; }
.variant-box.selected .badge-discount { display: none; }
.variant-grid.input-error .variant-box { border-color: var(--bad); }

.qty-stepper { display: flex; width: 150px; border: 1.5px solid var(--line); border-radius: 13px; overflow: hidden; }
.qty-btn { width: 44px; flex: none; border: 0; background: var(--surface-2); color: var(--brand); cursor: pointer; font-size: .82rem; }
.qty-btn:disabled { opacity: .4; cursor: not-allowed; }
.qty-input { flex: 1; min-width: 0; text-align: center; font-weight: 700; font-size: 1rem; padding: 10px 4px; border: 0; background: var(--bg); color: var(--text); -moz-appearance: textfield; }
.qty-input::-webkit-inner-spin-button, .qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-hint { font-size: .72rem; color: var(--muted); margin-top: 7px; }

.kupon-row { display: flex; border: 1.5px dashed var(--line-strong); border-radius: 13px; overflow: hidden; }
.kupon-row input { flex: 1; min-width: 0; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; text-transform: uppercase; letter-spacing: .04em; }
.kupon-btn { flex: none; padding: 0 18px; border: 0; background: var(--surface-2); color: var(--brand); font-weight: 700; cursor: pointer; }
.kupon-btn.hapus { color: var(--muted); }
.kupon-msg { font-size: .76rem; font-weight: 600; margin-top: 7px; }
.kupon-msg.ok { color: var(--ok); } .kupon-msg.err { color: var(--bad); }

.pay-bar { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; width: calc(100% - 28px); max-width: 592px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 10px 10px 10px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.kupon-line { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: .74rem; font-weight: 600; color: var(--ok); }
.total-price { display: flex; flex-direction: column; line-height: 1.15; }
.total-price span:first-child { font-size: .68rem; color: var(--muted); font-weight: 500; }
#totalPrice { font-size: 1.2rem; font-weight: 800; white-space: nowrap; }
.btn-pay { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border: 0; border-radius: 14px; cursor: pointer; background: var(--grad); color: #fff; font-weight: 700; font-size: .88rem; box-shadow: var(--sh); white-space: nowrap; min-width: 140px; }
.btn-pay:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.btn-pay.is-loading { pointer-events: none; opacity: .85; }
.btn-spin { width: 16px; height: 16px; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- QRIS ---------- */
.qr-box { display: flex; flex-direction: column; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--sh); padding-bottom: 16px; }
.timer-box { order: 1; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--grad); color: #fff; }
.qr-timer-label { font-size: .72rem; font-weight: 500; opacity: .92; }
.qr-timer { font-family: var(--font-d); font-size: 1.45rem; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.qr-timer.warn { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .5; } }
.qris-image-container { order: 2; position: relative; align-self: center; margin: 26px 16px 8px; padding: 14px; background: #fff; border-radius: 18px; border: 2px solid #fbd3f3; }
.scan-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 4px 14px; border-radius: 99px; background: var(--grad); color: #fff; font-family: var(--font-d); font-size: .64rem; letter-spacing: .16em; white-space: nowrap; box-shadow: var(--sh); }
#qrcode { position: relative; }
#qrcode img { width: min(220px, 62vw); height: auto; display: block; }
#qrcode.expired img { filter: grayscale(1); opacity: .35; }
.expired-stamp { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg); border: 4px solid #e11d48; color: #e11d48; font-weight: 900; font-size: 1.3rem; letter-spacing: .2em; padding: 6px 14px; border-radius: 10px; background: #fff; text-transform: uppercase; }
#qrcode.expired .expired-stamp { display: block; }
.qr-box::after { content: "Scan pakai e-wallet / m-banking apa saja"; order: 3; font-size: .72rem; color: var(--muted); }
.qr-btns { order: 4; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin: 14px 16px 0; }
.btn-download-qr { display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin: 0; padding: 11px 6px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--brand); font-weight: 600; font-size: .8rem; cursor: pointer; }
.total-box { order: 5; text-align: left; margin: 14px 16px 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); }
.total-row { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; padding: 4px 0; }
.total-row .label { color: var(--muted); }
.total-row .value { font-weight: 600; }
.total-row.grand { margin-top: 6px; padding-top: 10px; border-top: 1.5px dashed var(--line); font-size: .95rem; }
.total-row.grand .label { color: var(--text); font-weight: 700; }
.total-row.grand .value { color: var(--brand); font-weight: 800; font-size: 1.1rem; }
.qr-status { order: 6; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: .82rem; font-weight: 600; color: var(--muted); margin: 0 16px 12px; }
.spinner-ring { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--surface-2); border-top-color: var(--brand); animation: spin .8s linear infinite; display: inline-block; flex: none; }
.btn-check-status { order: 7; margin: 0 16px; padding: 14px; border: 0; border-radius: 15px; background: var(--grad); color: #fff; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--sh); }
.btn-check-status:disabled { opacity: .7; }
.btn-cancel-order { order: 8; margin: 8px 16px 0; padding: 12px; border-radius: 15px; border: 1.5px solid var(--line); background: transparent; color: var(--bad); font-weight: 600; cursor: pointer; }

/* ---------- struk ---------- */
.invoice-box { margin-top: 2px; }
.receipt { display: flex; flex-direction: column; gap: 0; background: transparent; }
.receipt > * { order: 10; }
.receipt-header { order: 1; position: relative; overflow: hidden; border-radius: 22px; padding: 22px 16px; text-align: center; background: var(--grad); color: #fff; box-shadow: var(--sh); }
.receipt-header::before { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; background: #fff; color: #16a34a; display: grid; place-items: center; font-size: 1.5rem; }
.receipt-header::after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .1); right: -50px; top: -60px; }
.receipt-header h2 { position: relative; z-index: 1; font-family: var(--font-d); font-size: .7rem; letter-spacing: .1em; opacity: .85; }
.receipt-header h2::before { content: "PEMBAYARAN BERHASIL"; display: block; font-size: 1.2rem; letter-spacing: .02em; opacity: 1; margin-bottom: 2px; }
.receipt-header p { display: none; }
.receipt-key-label { order: 2; margin-top: 12px; padding: 14px 14px 8px; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; font-weight: 700; font-size: .84rem; }
.receipt-key-label::before { content: "\f084"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: var(--brand); margin-right: 8px; }
.invoice-key-box { order: 3; display: flex; align-items: center; gap: 10px; padding: 0 14px 14px; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 20px 20px; box-shadow: var(--sh); margin-bottom: 12px; }
.invoice-key-box > span { flex: 1; padding: 11px 12px; border-radius: 13px; border: 1.5px dashed var(--brand); background: var(--surface-2); font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: .92rem; letter-spacing: .03em; word-break: break-all; }
.btn-copy-key { flex: none; width: 44px; align-self: stretch; border: 0; border-radius: 12px; background: var(--grad); color: #fff; cursor: pointer; }
.btn-copy-key.copied, .btn-copy-all.copied { background: #16a34a; }
.invoice-key-box.multi-key { flex-direction: column; align-items: stretch; }
.multi-key-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; }
.key-row { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; border: 1.5px dashed var(--brand-line); background: var(--surface-2); font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: .86rem; word-break: break-all; }
.key-num { width: 22px; height: 22px; flex: none; border-radius: 7px; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: .68rem; font-family: var(--font); }
.btn-copy-all { width: 100%; padding: 12px; border: 0; border-radius: 13px; background: var(--grad); color: #fff; font-weight: 700; cursor: pointer; }
.invoice-key-box.manual-warning { flex-direction: column; align-items: stretch; text-align: center; padding-top: 4px; }
.manual-msg { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px; border-radius: 13px; background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: .84rem; }
.manual-msg i { font-size: 1.3rem; }
.btn-wa-admin { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; padding: 12px; border-radius: 13px; background: #16a34a; color: #fff; font-weight: 700; }
.key-wait { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .74rem; font-weight: 600; color: var(--brand); margin-top: 8px; }
/* rincian struk dalam satu kartu */
.receipt-divider, .receipt-row, .receipt-item-name, .receipt-barcode, .receipt-footer { background: var(--surface); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.receipt-divider { height: 0; border-top: 1.5px dashed var(--line); margin: 0; padding: 0; border-left: 0; border-right: 0; }
.receipt-divider:first-of-type { border-radius: 20px 20px 0 0; border: 1px solid var(--line); border-bottom: 0; height: 14px; }
.receipt-row { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; padding: 4px 16px; }
.receipt-row .label { color: var(--muted); }
.receipt-row > span:last-child { font-weight: 600; text-align: right; word-break: break-all; }
.receipt-row.discount-line, .receipt-row.discount-line .label { color: var(--ok); }
.receipt-row.total { padding-top: 10px; padding-bottom: 10px; font-weight: 800; font-size: 1rem; }
.receipt-row.total span:last-child { color: var(--brand); font-size: 1.1rem; }
.receipt-item-name { font-weight: 700; font-size: .86rem; padding: 10px 16px 4px; }
.receipt-barcode { height: 10px; }
.receipt-footer { text-align: center; font-size: .7rem; color: var(--muted); padding: 4px 16px 16px; line-height: 1.6; border-bottom: 1px solid var(--line); border-radius: 0 0 20px 20px; box-shadow: var(--sh); }
.receipt-footer strong { display: none; }
.btn-back-shop { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 24px; border-radius: 14px; background: var(--grad); color: #fff !important; font-weight: 700; box-shadow: var(--sh); }

/* ---------- status / error ---------- */
.status-msg { text-align: center; padding: 28px 18px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh); }
.status-msg .ico { width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; background: var(--surface-2); color: var(--brand); }
.status-msg.failed .ico { background: var(--bad-soft); color: var(--bad); }
.status-msg > div[style] { color: var(--text) !important; }
.status-msg p { color: var(--muted); font-size: .86rem; margin-top: 6px; line-height: 1.6; }
.error-msg { background: var(--bad-soft) !important; color: var(--bad) !important; border: 1px solid rgba(225, 29, 72, .3) !important; border-radius: 13px !important; }

/* ---------- popup batal ---------- */
.cancel-modal-overlay { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-end; justify-content: center; padding: 16px; background: rgba(10, 0, 12, .55); backdrop-filter: blur(3px); }
.cancel-modal-overlay.open { display: flex; }
@media (min-width: 560px) { .cancel-modal-overlay { align-items: center; } }
.cancel-modal { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px 18px 18px; text-align: center; animation: uiUp .25s ease both; }
.cancel-modal .ico { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); font-size: 1.4rem; }
.cancel-modal h3 { font-size: 1.05rem; margin-bottom: 6px; }
.cancel-modal p { font-size: .86rem; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.cancel-modal .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-confirm-cancel, .btn-keep-paying { padding: 13px 6px; border-radius: 13px; font-weight: 700; font-size: .84rem; cursor: pointer; }
.btn-confirm-cancel { border: 1.5px solid var(--line); background: transparent; color: var(--bad); }
.btn-keep-paying { border: 0; background: var(--grad); color: #fff; }

/* ---------- notifikasi ---------- */
.toast { position: fixed; top: calc(var(--header-h) + 12px); left: 50%; transform: translate(-50%, -12px); z-index: 9999; opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: .85rem; line-height: 1.4; color: #fff; background: #2a0f26; box-shadow: var(--shadow-lg); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.info { background: #d97706; } .toast.success { background: #059669; } .toast.error { background: #e11d48; }
.toast i { font-size: 1.15rem; flex: none; }
.toast .toast-msg { flex: 1; }
.signature-toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.92); z-index: 9999; opacity: 0; pointer-events: none; padding: 12px 24px; border-radius: 99px; background: var(--grad); color: #fff; font-weight: 700; font-size: .84rem; white-space: nowrap; box-shadow: var(--sh); transition: .2s; }
.signature-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.order-summary { display: none; }
