.mk-payment-page {
  min-height: calc(100vh - 160px);
  padding: 38px 18px 54px;
  background: #f5f6f8;
}

.mk-payment-card,
.mk-purchases-wrap {
  max-width: 920px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.08);
}

.mk-payment-card {
  padding: 42px;
  text-align: center;
}

.mk-payment-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 42px;
}

.mk-payment-card--success .mk-payment-icon {
  background: #ecfdf5;
  color: #16a34a;
}

.mk-payment-card--warning .mk-payment-icon {
  background: #fffbeb;
  color: #d97706;
}

.mk-payment-card--error .mk-payment-icon {
  background: #fef2f2;
  color: #dc2626;
}

.mk-payment-card h1,
.mk-purchases-head h1 {
  margin: 0;
  color: #111827;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.mk-payment-card p,
.mk-purchases-head p {
  margin: 12px 0 0;
  color: #6b7280;
  font-size: 16px;
  line-height: 1.6;
}

.mk-payment-info {
  margin: 28px auto 0;
  max-width: 640px;
  display: grid;
  gap: 10px;
}

.mk-payment-info div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #eef0f3;
  text-align: left;
}

.mk-payment-info span {
  color: #6b7280;
}

.mk-payment-info strong {
  color: #111827;
  font-weight: 700;
}

.mk-payment-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.mk-payment-button,
.mk-payment-actions form button,
.mk-purchase-actions a,
.mk-purchase-actions button,
.mk-empty-purchases a {
  height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f3f4f6;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.mk-payment-button--primary,
.mk-payment-actions form button,
.mk-purchase-actions button,
.mk-empty-purchases a {
  background: #f97316;
  color: #fff;
}

.mk-purchases-wrap {
  padding: 30px;
}

.mk-purchases-head {
  margin-bottom: 22px;
}

.mk-payment-alert {
  margin: 0 0 18px;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
}

.mk-payment-alert--error {
  background: #fef2f2;
  color: #b91c1c;
}

.mk-payment-alert--warning {
  background: #fffbeb;
  color: #92400e;
}

.mk-payment-alert--success {
  background: #ecfdf5;
  color: #166534;
}

.mk-empty-purchases {
  padding: 50px 20px;
  text-align: center;
  background: #f9fafb;
  border-radius: 20px;
}

.mk-empty-purchases i {
  font-size: 52px;
  color: #9ca3af;
}

.mk-empty-purchases h2 {
  margin: 12px 0 6px;
  color: #111827;
  font-size: 24px;
}

.mk-empty-purchases p {
  margin: 0 0 18px;
  color: #6b7280;
}

.mk-purchases-list {
  display: grid;
  gap: 12px;
}

.mk-purchase-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid #eef0f3;
  border-radius: 18px;
  background: #fff;
}

.mk-purchase-image {
  width: 96px;
  height: 74px;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f4f6;
}

.mk-purchase-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mk-purchase-title {
  display: inline-block;
  max-width: 100%;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.mk-purchase-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #6b7280;
  font-size: 13px;
}

.mk-status {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-weight: 700;
}

.mk-status--succeeded {
  background: #ecfdf5;
  color: #166534;
}

.mk-status--pending,
.mk-status--waiting_for_capture {
  background: #fffbeb;
  color: #92400e;
}

.mk-status--canceled {
  background: #fef2f2;
  color: #991b1b;
}

@media (max-width: 720px) {
  .mk-payment-card,
  .mk-purchases-wrap {
    padding: 22px;
    border-radius: 20px;
  }

  .mk-payment-card h1,
  .mk-purchases-head h1 {
    font-size: 26px;
  }

  .mk-payment-info div {
    display: block;
  }

  .mk-payment-info strong {
    display: block;
    margin-top: 3px;
  }

  .mk-purchase-item {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .mk-purchase-image {
    width: 78px;
    height: 64px;
  }

  .mk-purchase-actions {
    grid-column: 1 / -1;
  }

  .mk-purchase-actions a,
  .mk-purchase-actions button {
    width: 100%;
  }
}


/* Mobile adaptation v1 — payment and purchases */
@media (max-width: 767.98px) {
  .mk-payment-page {
    padding: 18px 10px 42px !important;
  }

  .mk-payment-card,
  .mk-purchases-wrap {
    padding: 18px !important;
    border-radius: 20px !important;
  }

  .mk-payment-icon {
    width: 58px !important;
    height: 58px !important;
    border-radius: 18px !important;
    font-size: 34px !important;
  }

  .mk-payment-card h1,
  .mk-purchases-head h1 {
    font-size: 24px !important;
  }

  .mk-payment-card p,
  .mk-purchases-head p {
    font-size: 14px !important;
  }

  .mk-payment-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .mk-payment-button,
  .mk-payment-actions form button,
  .mk-purchase-actions a,
  .mk-purchase-actions button,
  .mk-empty-purchases a {
    width: 100% !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 10px 14px !important;
  }

  .mk-purchase-item {
    grid-template-columns: 74px minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 10px !important;
    border-radius: 16px !important;
  }

  .mk-purchase-image {
    width: 74px !important;
    height: 62px !important;
    border-radius: 12px !important;
  }

  .mk-purchase-title {
    font-size: 14px !important;
  }

  .mk-purchase-meta {
    gap: 6px !important;
    font-size: 11.5px !important;
  }

  .mk-purchase-actions {
    grid-column: 1 / -1 !important;
  }
}

/* ===== Cart page v1 ===== */
.mk-cart-wrap {
  max-width: 1120px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.08);
  padding: 30px;
}
.mk-cart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.mk-cart-head h1 {
  margin: 0;
  color: #111827;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.mk-cart-head p {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 16px;
  line-height: 1.55;
}
.mk-cart-back {
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #f3f4f6;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.mk-cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.mk-cart-list {
  display: grid;
  gap: 12px;
}
.mk-cart-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid #eef0f3;
  border-radius: 18px;
  background: #fff;
}
.mk-cart-item__image {
  width: 104px;
  height: 78px;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f4f6;
}
.mk-cart-item__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mk-cart-item__title {
  color: #111827;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}
.mk-cart-item__meta {
  margin-top: 7px;
  color: #6b7280;
  font-size: 13px;
}
.mk-cart-item__side {
  display: grid;
  justify-items: end;
  gap: 8px;
}
.mk-cart-item__side strong {
  color: #f97316;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}
.mk-cart-item__side form { margin: 0; }
.mk-cart-item__side button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: #6b7280;
  cursor: pointer;
}
.mk-cart-summary {
  position: sticky;
  top: 92px;
  padding: 20px;
  border: 1px solid #eef0f3;
  border-radius: 20px;
  background: #f9fafb;
}
.mk-cart-summary h2 {
  margin: 0 0 14px;
  color: #111827;
  font-size: 22px;
  font-weight: 800;
}
.mk-cart-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid #eef0f3;
  color: #6b7280;
  font-size: 15px;
}
.mk-cart-summary__row strong {
  color: #111827;
}
.mk-cart-summary__total strong {
  color: #f97316;
  font-size: 22px;
}
.mk-cart-summary form {
  margin: 10px 0 0;
}
.mk-cart-checkout,
.mk-cart-clear {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.mk-cart-checkout {
  background: #f97316;
  color: #fff;
}
.mk-cart-checkout:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.mk-cart-clear {
  background: #fff;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}
.mk-cart-note {
  margin: 14px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
}
.mk-paid-models {
  max-width: 680px;
  margin: 26px auto 0;
  display: grid;
  gap: 10px;
}
.mk-paid-model {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #eef0f3;
  border-radius: 14px;
  background: #f9fafb;
  text-align: left;
}
.mk-paid-model a {
  min-width: 0;
  color: #111827;
  font-weight: 700;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mk-paid-model form { margin: 0; flex: 0 0 auto; }
.mk-paid-model button {
  height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f97316;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.mk-purchase-order {
  border: 1px solid #eef0f3;
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
}
.mk-purchase-order__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  background: #f9fafb;
  border-bottom: 1px solid #eef0f3;
}
.mk-purchase-order__head h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 800;
}
.mk-purchase-order__head p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 13px;
}
.mk-purchase-models {
  display: grid;
  gap: 0;
}
.mk-purchase-models .mk-purchase-item {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #eef0f3;
}
.mk-purchase-models .mk-purchase-item:last-child { border-bottom: 0; }
@media (max-width: 900px) {
  .mk-cart-layout {
    grid-template-columns: 1fr;
  }
  .mk-cart-summary {
    position: static;
  }
}
@media (max-width: 640px) {
  .mk-cart-wrap {
    padding: 18px;
    border-radius: 20px;
  }
  .mk-cart-head {
    display: block;
  }
  .mk-cart-head h1 {
    font-size: 28px;
  }
  .mk-cart-back {
    margin-top: 14px;
  }
  .mk-cart-item {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
  }
  .mk-cart-item__image {
    width: 82px;
    height: 68px;
  }
  .mk-cart-item__side {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
    padding-top: 8px;
    border-top: 1px solid #eef0f3;
  }
  .mk-paid-model {
    display: grid;
  }
  .mk-paid-model a {
    white-space: normal;
  }
}


/* ===== Font consistency fix v2 =====
   Cart / purchases / success pages use the same Inter typography as catalog. */
body.mk-exact-page.mk-payment-body {
  margin: 0;
  background: var(--mk-bg, #f7f8fb) !important;
  color: var(--mk-text, #111827);
  font-family: "Inter", "Segoe UI", Roboto, Arial, Helvetica, sans-serif !important;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
body.mk-exact-page.mk-payment-body button,
body.mk-exact-page.mk-payment-body input,
body.mk-exact-page.mk-payment-body textarea,
body.mk-exact-page.mk-payment-body select {
  font-family: inherit !important;
}
body.mk-exact-page.mk-payment-body .mk-payment-page,
body.mk-exact-page.mk-payment-body .mk-payment-page * {
  font-family: inherit;
}
