/* ============================================
   MAISON NOIR — Checkout Stylesheet
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --noir: #0d0d0d;
  --white: #ffffff;
  --cream: #f8f6f2;
  --cream-2: #f0ebe2;
  --gold: #c9a96e;
  --gold-l: rgba(201,169,110,0.12);
  --border: #e4e1da;
  --text: #1a1a1a;
  --text-2: #6b6b6b;
  --text-3: #a8a8a8;
  --error: #c0392b;
  --success: #27ae60;
  --esewa: #60bb46;
  --khalti: #5c2d91;
  --cips: #003580;
  --fonepay: #e31e25;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 12px;
}

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
}

/* ============================================
   NAV
   ============================================ */
.co-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1rem;
}

.co-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--noir);
  text-decoration: none;
}

.co-logo span { color: var(--gold); }

.co-steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.co-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.04em;
  transition: color 0.3s;
}

.co-step span {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.3s, color 0.3s, transform 0.25s, box-shadow 0.25s;
}
.co-step:hover span { transform: scale(1.1); }
.co-step.active span { box-shadow: 0 0 0 4px rgba(201,169,110,0.25); }

.co-step.active { color: var(--noir); }
.co-step.active span { background: var(--gold); color: white; }
.co-step.done span { background: var(--success); color: white; }
.co-step.done span::after { content: '✓'; }

.co-step-line {
  width: 40px;
  height: 1px;
  background: var(--border);
  margin: 0 0.5rem;
}

.co-secure {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.co-secure svg {
  width: 14px; height: 14px;
  stroke: var(--success);
  fill: none;
  stroke-width: 1.5;
}

/* ============================================
   LAYOUT
   ============================================ */
.co-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  max-width: 1100px;
  margin: 2.5rem auto;
  padding: 0 1.5rem 4rem;
}

/* ============================================
   LEFT PANEL
   ============================================ */
.co-left { min-width: 0; }

.co-panel {
  display: none;
  animation: fadeSlide 0.4s var(--ease);
}

.co-panel.active { display: block; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.panel-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--noir);
}

.edit-link {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gold);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.edit-link:hover { opacity: 0.7; }

/* ============================================
   CART ITEMS (review)
   ============================================ */
.cart-review-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.875rem;
}

.cri-img {
  width: 72px; height: 90px;
  border-radius: 8px;
  background-size: cover;
  background-position: center top;
  background-color: var(--cream-2);
  flex-shrink: 0;
}

.cri-info { flex: 1; min-width: 0; }
.cri-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.cri-meta { font-size: 0.75rem; color: var(--text-3); margin-bottom: 0.75rem; }

.cri-qty-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  font-family: inherit;
}

.qty-btn:hover { background: var(--gold-l); border-color: var(--gold); }
.qty-val { font-size: 0.85rem; font-weight: 600; min-width: 24px; text-align: center; }

.cri-price { font-size: 0.95rem; font-weight: 700; color: var(--noir); white-space: nowrap; }
.cri-remove { font-size: 0.7rem; color: var(--text-3); cursor: pointer; background: none; border: none; display: block; margin-top: 4px; text-align: right; font-family: inherit; text-decoration: underline; text-underline-offset: 2px; transition: color 0.2s; }
.cri-remove:hover { color: var(--error); }

/* ============================================
   PROMO
   ============================================ */
.order-note-wrap {
  margin: 1rem 0;
}

.order-note-wrap label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.4rem;
}

.order-note-wrap label span { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-3); }

.order-note-wrap textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-family: inherit;
  font-size: 0.83rem;
  color: var(--text);
  resize: none;
  outline: none;
  height: 70px;
  transition: border-color 0.2s;
}

.order-note-wrap textarea:focus { border-color: var(--gold); }

.promo-row {
  display: flex;
  gap: 0.625rem;
  margin: 1rem 0 0.25rem;
}

.promo-field {
  flex: 1;
  padding: 0.7rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: border-color 0.2s;
}

.promo-field:focus { border-color: var(--gold); }

.promo-msg {
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  min-height: 1rem;
  transition: opacity 0.3s;
}

.promo-msg.success { color: var(--success); }
.promo-msg.error { color: var(--error); }

/* ============================================
   SHIPPING FORM
   ============================================ */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.875rem; }

.field-g { margin-bottom: 1rem; }

.field-g label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.35rem;
}

.field-g input,
.field-g select {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.field-g input:focus,
.field-g select:focus {
  outline: none;
  border-color: var(--noir);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.3);
}

.field-g input.err { border-color: var(--error); }

.ferr {
  display: block;
  font-size: 0.68rem;
  color: var(--error);
  margin-top: 0.25rem;
  min-height: 0.9rem;
}

.phone-wrap {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.phone-wrap:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}

.phone-code {
  padding: 0.75rem 0.875rem;
  background: var(--cream-2);
  border-right: 1px solid var(--border);
  font-size: 0.83rem;
  white-space: nowrap;
  color: var(--text-2);
}

.phone-wrap input {
  flex: 1;
  border: none;
  border-radius: 0;
  box-shadow: none !important;
}

/* Delivery options */
.delivery-options { display: flex; gap: 0.75rem; }

.delivery-opt {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--white);
}

.delivery-opt input[type="radio"] { display: none; }
.delivery-opt.active { border-color: var(--gold); background: var(--gold-l); }
.delivery-opt .del-info { flex: 1; }
.delivery-opt .del-info strong { display: block; font-size: 0.83rem; font-weight: 600; }
.delivery-opt .del-info span { font-size: 0.72rem; color: var(--text-3); }
.delivery-opt .del-price { font-size: 0.83rem; font-weight: 700; color: var(--noir); white-space: nowrap; }

/* ============================================
   PAYMENT METHODS
   ============================================ */
.payment-methods { display: flex; flex-direction: column; gap: 0.625rem; margin-bottom: 1.25rem; }

.pm-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: var(--white);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.pm-card:hover { border-color: var(--text-3); }
.pm-card.selected { border-color: var(--gold); background: var(--gold-l); box-shadow: 0 0 0 3px rgba(201,169,110,0.1); }
.pm-card input[type="radio"] { display: none; }

.pm-logo {
  width: 52px; height: 38px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.pm-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

.pm-logo-fallback {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.esewa-fallback { background: #e8f7e1; color: var(--esewa); }
.khalti-fallback { background: var(--khalti); }
.mbank-logo { background: var(--cips); }
.mbank-logo svg { width: 22px; height: 22px; stroke: white; fill: none; stroke-width: 1.5; }
.cod-logo { background: #f0f8e8; }
.cod-logo svg { width: 22px; height: 22px; stroke: var(--success); fill: none; stroke-width: 1.5; }

.pm-info { flex: 1; }
.pm-info strong { display: block; font-size: 0.85rem; font-weight: 600; color: var(--noir); }
.pm-info span { font-size: 0.72rem; color: var(--text-3); }

.pm-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.pm-card.selected .pm-check {
  background: var(--gold);
  border-color: var(--gold);
}

.pm-card.selected .pm-check::after {
  content: '';
  width: 5px; height: 8px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* ============================================
   PAYMENT DETAILS
   ============================================ */
.payment-detail {
  margin-bottom: 1.25rem;
  animation: fadeSlide 0.35s var(--ease);
}

.payment-detail.hidden { display: none; }

.payment-detail-inner {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.6;
}

.pd-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
}

.pd-icon svg { width: 22px; height: 22px; }

.esewa-test-creds {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  background: rgba(96,187,70,0.06);
  border: 1px solid rgba(96,187,70,0.2);
  border-radius: 8px;
  font-size: 0.78rem;
}

.esewa-test-creds strong { display: block; margin-bottom: 0.6rem; color: var(--esewa); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
.cred-row { display: flex; justify-content: space-between; padding: 0.3rem 0; border-bottom: 1px dashed rgba(96,187,70,0.15); }
.cred-row:last-child { border-bottom: none; }
.cred-row span { color: var(--text-3); }
.cred-row code { font-family: monospace; font-size: 0.82rem; color: var(--noir); background: rgba(0,0,0,0.04); padding: 1px 6px; border-radius: 4px; }

/* Bank grid */
.bank-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.bank-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.65rem;
  color: var(--text-2);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.bank-btn:hover { border-color: var(--cips); background: rgba(0,53,128,0.04); transform: translateY(-2px); }
.bank-btn.selected { border-color: var(--cips); background: rgba(0,53,128,0.06); }

.bank-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: white;
  letter-spacing: 0.03em;
}

.hbl { background: #b90000; }
.nabil { background: #004a9c; }
.nic { background: #00703c; }
.ebl { background: #002d72; }
.sbl { background: #7b0026; }
.gime { background: #d4001e; }
.lxb { background: #006b3f; }
.pb { background: #004b87; }

.selected-bank-info {
  padding: 0.875rem 1rem;
  background: rgba(0,53,128,0.06);
  border: 1px solid rgba(0,53,128,0.15);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-2);
  animation: fadeSlide 0.3s var(--ease);
}

.selected-bank-info.hidden { display: none; }

.sbi-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--cips);
  margin-bottom: 0.4rem;
}

.sbi-header svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* FonePay QR */
.qr-container { display: flex; gap: 2rem; align-items: flex-start; margin: 1rem 0; }

.qr-box { text-align: center; }

.qr-code-svg {
  width: 160px; height: 160px;
  border: 2px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  padding: 8px;
  position: relative;
  overflow: hidden;
}

.qr-amount-label { font-size: 0.72rem; color: var(--text-3); margin-top: 0.5rem; }
.qr-amount-label strong { color: var(--fonepay); }

.qr-steps { flex: 1; }

.qr-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.8rem;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}

.qr-step:last-child { border-bottom: none; }

.qr-step span {
  width: 22px; height: 22px;
  background: var(--fonepay);
  color: white;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fonepay-supported { margin-top: 0.875rem; }
.fonepay-supported > span { font-size: 0.7rem; color: var(--text-3); }

.fp-banks { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }

.fp-bank {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-2);
}

/* COD */
.cod-note {
  margin-top: 0.875rem;
  padding: 0.75rem 1rem;
  background: rgba(39,174,96,0.06);
  border: 1px solid rgba(39,174,96,0.2);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-2);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-next, .btn-pay {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
}

.full-btn { margin-top: 1.5rem; }

.btn-next { background: var(--noir); color: white; }
.btn-next::before { content: ''; position: absolute; inset: 0; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease); }
.btn-next:hover::before { transform: scaleX(1); }
.btn-next span, .btn-next:not(:has(span)) { position: relative; z-index: 1; }

.btn-pay {
  background: var(--gold);
  color: white;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.btn-pay.hidden { display: none; }
.btn-pay:hover { background: #b8954f; transform: translateY(-1px); }
.btn-pay:active { transform: translateY(0); }

.pay-btn-content { display: flex; align-items: center; gap: 0.625rem; position: relative; z-index: 1; }
.pay-btn-content svg { width: 18px; height: 18px; stroke: white; fill: none; stroke-width: 1.5; }

.btn-outline-sm {
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.btn-outline-sm:hover { background: var(--gold-l); border-color: var(--gold); }

.btn-loader-inner {
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-pay.loading .pay-btn-content { opacity: 0; }
.btn-pay.loading .btn-loader-inner { opacity: 1; }

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

.pay-terms { font-size: 0.7rem; color: var(--text-3); text-align: center; margin-top: 0.75rem; line-height: 1.5; }
.pay-terms a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }

/* ============================================
   RIGHT: ORDER SUMMARY
   ============================================ */
.summary-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  position: sticky;
  top: 90px;
}

.summary-box h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--noir);
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.summary-items { margin-bottom: 1.25rem; }

.sum-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}

.sum-item:last-child { border-bottom: none; }

.sum-item-img {
  width: 46px; height: 58px;
  border-radius: 6px;
  background-size: cover;
  background-position: center top;
  background-color: var(--cream-2);
  flex-shrink: 0;
  position: relative;
}

.sum-item-qty {
  position: absolute;
  top: -5px; right: -5px;
  width: 18px; height: 18px;
  background: var(--noir);
  color: white;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sum-item-info { flex: 1; min-width: 0; }
.sum-item-name { font-size: 0.8rem; font-weight: 600; color: var(--noir); }
.sum-item-cat { font-size: 0.7rem; color: var(--text-3); }
.sum-item-price { font-size: 0.85rem; font-weight: 700; color: var(--noir); white-space: nowrap; }

.summary-lines { border-top: 1px solid var(--border); padding-top: 1rem; }

.sum-line {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.82rem;
  color: var(--text-2);
}

.sum-line.discount { color: var(--success); }
.sum-line.hidden { display: none; }

.sum-total {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0 0;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 700;
  color: var(--noir);
}

/* Trust badges */
.trust-badges {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.trust-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  color: var(--text-3);
  text-align: center;
  letter-spacing: 0.03em;
}

.trust-item svg { width: 18px; height: 18px; stroke: var(--gold); fill: none; stroke-width: 1.5; }

/* Accepted payments */
.accepted-payments {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.ap-label { font-size: 0.65rem; color: var(--text-3); }

.ap-icons { display: flex; gap: 0.35rem; }

.ap-icon {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid;
}

.esewa-ap { background: rgba(96,187,70,0.08); color: var(--esewa); border-color: rgba(96,187,70,0.3); }
.khalti-ap { background: rgba(92,45,145,0.08); color: var(--khalti); border-color: rgba(92,45,145,0.3); }
.cips-ap { background: rgba(0,53,128,0.08); color: var(--cips); border-color: rgba(0,53,128,0.3); }
.fp-ap { background: rgba(227,30,37,0.08); color: var(--fonepay); border-color: rgba(227,30,37,0.3); }

/* ============================================
   KHALTI MODAL
   ============================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.modal-backdrop.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.khalti-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalUp 0.35s var(--ease);
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.km-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: var(--khalti);
  color: white;
}

.km-logo { display: flex; align-items: center; gap: 0.625rem; }
.km-logo span { font-size: 1rem; font-weight: 700; color: white; letter-spacing: 0.04em; }

.khalti-k {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: white;
}

.km-close {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.2s;
}

.km-close:hover { background: rgba(255,255,255,0.25); }

.km-body { padding: 1.5rem; }

.km-merchant {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  background: #f8f7ff;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(92,45,145,0.1);
}

.km-merchant-logo {
  width: 36px; height: 36px;
  background: var(--noir);
  color: var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.km-merchant strong { display: block; font-size: 0.85rem; color: var(--noir); }
.km-merchant span { font-size: 0.7rem; color: var(--text-3); }

.km-amount {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--khalti);
  text-align: center;
  margin-bottom: 0.25rem;
}

.km-sub { text-align: center; font-size: 0.78rem; color: var(--text-3); margin-bottom: 1.25rem; }

.km-field { margin-bottom: 1rem; }
.km-field label { display: block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); margin-bottom: 0.35rem; }

.km-field input[type="tel"],
.km-field input[type="text"],
.km-field input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.km-field input:focus { border-color: var(--khalti); box-shadow: 0 0 0 3px rgba(92,45,145,0.1); }

.km-pin-row { display: flex; gap: 0.5rem; }

.km-pin-digit {
  flex: 1;
  height: 48px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.2s;
  background: white;
}

.km-pin-digit:focus { border-color: var(--khalti); }

.km-pay-btn {
  width: 100%;
  padding: 0.875rem;
  background: var(--khalti);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  margin-top: 0.5rem;
}

.km-pay-btn:hover { background: #4a1f7d; transform: translateY(-1px); }

.km-loader {
  position: absolute;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  opacity: 0;
  transition: opacity 0.2s;
}

.km-pay-btn.loading span { opacity: 0; }
.km-pay-btn.loading .km-loader { opacity: 1; }

.km-otp-screen { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.km-otp-screen.hidden { display: none; }
.km-otp-msg { font-size: 0.8rem; color: var(--text-2); text-align: center; margin-bottom: 1rem; }

.km-error {
  padding: 0.625rem 0.875rem;
  background: rgba(192,57,43,0.06);
  border: 1px solid rgba(192,57,43,0.2);
  border-radius: 8px;
  color: var(--error);
  font-size: 0.78rem;
  margin-top: 0.75rem;
}

.km-error.hidden { display: none; }

.km-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.875rem;
  background: #f5f0ff;
  font-size: 0.68rem;
  color: var(--khalti);
  border-top: 1px solid rgba(92,45,145,0.1);
}

.km-footer svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* ============================================
   CONNECT IPS MODAL
   ============================================ */
.cips-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalUp 0.35s var(--ease);
}

.cips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: var(--cips);
  color: white;
}

.cips-logo { display: flex; align-items: center; gap: 0.625rem; }
.cips-logo span { font-size: 0.95rem; font-weight: 700; color: white; }

.cips-icon {
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: white;
}

.cips-body { padding: 1.5rem; }

.cips-bank-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-2);
  margin-bottom: 0.875rem;
}

.cips-bank-label svg { width: 18px; height: 18px; stroke: var(--cips); fill: none; stroke-width: 1.5; }

.cips-amount {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--cips);
  text-align: center;
  margin-bottom: 0.25rem;
}

.cips-ref { text-align: center; font-size: 0.72rem; color: var(--text-3); margin-bottom: 1.25rem; }
.cips-ref code { font-family: monospace; background: #f0f4ff; padding: 1px 6px; border-radius: 4px; color: var(--cips); }

.cips-pay-btn {
  width: 100%;
  padding: 0.875rem;
  background: var(--cips);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

.cips-pay-btn:hover { background: #002460; }
.cips-pay-btn.loading span { opacity: 0; }
.cips-pay-btn.loading .km-loader { opacity: 1; }

/* ============================================
   TOAST
   ============================================ */
.co-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 1.5rem));
  background: var(--noir);
  color: white;
  padding: 0.875rem 1.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.4s var(--ease);
  white-space: nowrap;
  border-left: 3px solid var(--gold);
  pointer-events: none;
}

.co-toast.show { transform: translateX(-50%) translateY(0); }

/* ============================================
   QR CODE (pure CSS pattern)
   ============================================ */
.qr-pixel-grid {
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  width: 100%;
  height: 100%;
}

.qr-pixel { background: black; }
.qr-pixel.w { background: white; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .co-layout { grid-template-columns: 1fr; }
  .co-right { order: -1; }
  .summary-box { position: static; }
  .co-steps { display: none; }
}

@media (max-width: 600px) {
  .co-nav { padding: 1rem 1.25rem; }
  .co-layout { padding: 0 1rem 3rem; margin: 1.25rem auto; }
  .form-row { grid-template-columns: 1fr; }
  .delivery-options { flex-direction: column; }
  .bank-grid { grid-template-columns: repeat(3, 1fr); }
  .qr-container { flex-direction: column; align-items: center; }
}
