/* ================================================================
   Платёжное окно витрины (window.JWPay): шаги «Данные → Оплата → Счёт».
   Тёмная палитра задана явно, чтобы окно не зависело от темы сайта.
   ================================================================ */

.pm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(5, 7, 12, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.pm-backdrop[hidden] { display: none; }

.pm-dialog {
  width: 100%;
  max-width: 470px;
  max-height: 94vh;
  overflow-y: auto;
  background: #101116;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.9);
  color: #e4e4e7;
  animation: pm-pop 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes pm-pop {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.pm-mono { font-family: ui-monospace, 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace; }

/* ---------- шапка ---------- */

.pm-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.pm-order {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-steps { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.pm-steps i {
  width: 26px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.4s;
}

.pm-steps i.is-on { background: #8cc46b; }

.pm-steps span { font-size: 11px; font-weight: 700; color: #6b7280; }

.pm-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #71717a;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.pm-close:hover { background: rgba(255, 255, 255, 0.06); color: #e4e4e7; }
.pm-close svg { width: 15px; height: 15px; }

/* ---------- уведомление ---------- */

.pm-notice {
  margin: 14px 20px 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.pm-notice-ok {
  background: rgba(140, 196, 107, 0.1);
  border: 1px solid rgba(140, 196, 107, 0.35);
  color: #a3d483;
}

.pm-notice-error {
  background: rgba(224, 101, 95, 0.1);
  border: 1px solid rgba(224, 101, 95, 0.35);
  color: #e0908b;
}

/* ---------- общие элементы шагов ---------- */

.pm-step { padding: 20px; }

.pm-label {
  display: block;
  margin: 16px 0 7px;
  font-size: 13px;
  font-weight: 600;
  color: #d4d4d8;
}

.pm-label2 {
  margin: 18px 0 8px;
  font-family: ui-monospace, 'JetBrains Mono', Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #6b7280;
}

.pm-title { margin: 2px 0 12px; font-size: 20px; font-weight: 800; color: #fafafa; }

.pm-hint { margin: 7px 0 0; font-size: 11.5px; line-height: 1.5; color: #52525b; }
.pm-error { color: #e0655f; }
.pm-center { text-align: center; }
.pm-green { color: #a3d483; }

/* Подсказка про докуп и её ответ. Приглушённая зелёная у найденного зачёта:
   строка должна читаться как хорошая новость, но не спорить за внимание с
   кнопкой «Далее». Состояние «проверяем» намеренно бледное — оно живёт пару
   секунд, и мигать цветом на каждом вводе ника незачем. */
.pm-upgrade-hint { color: #71717a; }
.pm-upgrade-note { color: #71717a; }
.pm-upgrade-note.is-found { color: #a3d483; }
.pm-upgrade-note.is-warn { color: #d4b483; }
.pm-blue { color: #7cc0e8; }

.pm-dialog input:not([type='checkbox']) {
  width: 100%;
  padding: 11px 14px;
  background: #14161c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #f4f4f5;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pm-dialog input:not([type='checkbox']):focus {
  border-color: rgba(140, 196, 107, 0.65);
  box-shadow: 0 0 0 3px rgba(140, 196, 107, 0.14);
}

.pm-dialog input::placeholder { color: #52525b; }

/* ---------- товар ---------- */

.pm-product {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: #0c0d11;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
}

.pm-product-media {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #14161c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
}

.pm-product-media img { width: 100%; height: 100%; object-fit: cover; }

.pm-media-empty { font-size: 22px; font-weight: 800; color: #8cc46b; }

.pm-product-info { min-width: 0; }

.pm-product-info b {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: #f4f4f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-product-info span { display: block; margin-top: 3px; font-size: 12px; color: #6b7280; }

/* ---------- ник + аватар ---------- */

.pm-nick-row { display: flex; gap: 10px; }

.pm-nick-row input { flex: 1; }

.pm-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #14161c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 17px;
  font-weight: 800;
  color: #8cc46b;
}

/* ---------- количество ---------- */

.pm-qty { display: flex; align-items: center; justify-content: space-between; }
.pm-qty .pm-label { margin: 18px 0 0; }

.pm-qty-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 4px;
  background: #14161c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.pm-qty-row button {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #d4d4d8;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.pm-qty-row button:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.pm-qty-value { width: 34px; text-align: center; font-size: 14px; font-weight: 700; color: #f4f4f5; }

/* ---------- купон ---------- */

.pm-coupon-row { display: flex; gap: 10px; }
.pm-coupon-row input { flex: 1; text-transform: uppercase; letter-spacing: 0.04em; }
.pm-coupon-row input::placeholder { text-transform: none; letter-spacing: 0; }

.pm-coupon-ok {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px 11px 14px;
  background: rgba(140, 196, 107, 0.08);
  border: 1px solid rgba(140, 196, 107, 0.35);
  border-radius: 12px;
}

.pm-coupon-code { font-size: 13px; font-weight: 800; color: #a3d483; }
.pm-coupon-ok > span:not(.pm-coupon-code) { font-size: 12px; color: #8cc46b; }

.pm-coupon-ok button {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #71717a;
  cursor: pointer;
}

.pm-coupon-ok button:hover { background: rgba(255, 255, 255, 0.07); color: #d4d4d8; }
.pm-coupon-ok button svg { width: 14px; height: 14px; }

/* ---------- сводка ---------- */

.pm-summary {
  margin-top: 16px;
  padding: 14px 16px;
  background: #0c0d11;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
}

.pm-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 4.5px 0;
  font-size: 13px;
  color: #71717a;
}

.pm-row b { color: #d4d4d8; font-weight: 600; }
.pm-row span[id], .pm-row .pm-goods { color: #d4d4d8; }
.pm-row > span:first-child { color: #71717a; }

.pm-total-row { border-top: 1px solid rgba(255, 255, 255, 0.07); margin-top: 7px; padding-top: 11px; }

.pm-total { font-size: 21px; font-weight: 800; color: #fafafa; }

/* ---------- согласия ---------- */

.pm-consents { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }

.pm-consent {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 12.5px;
  color: #a1a1aa;
  line-height: 1.45;
}

.pm-consent a { color: #a3d483; text-decoration: none; }
.pm-consent a:hover { text-decoration: underline; }

.pm-consent input { position: absolute; opacity: 0; width: 0; height: 0; }

.pm-consent i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  color: transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.pm-consent i svg { width: 11px; height: 11px; }

.pm-consent input:checked + i {
  background: #8cc46b;
  border-color: #8cc46b;
  color: #101116;
}

.pm-consent input:focus-visible + i { box-shadow: 0 0 0 3px rgba(140, 196, 107, 0.3); }

/* ---------- кнопки ---------- */

.pm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
}

.pm-btn:active { transform: translateY(1px); }
.pm-btn:disabled { opacity: 0.55; pointer-events: none; }

.pm-btn svg { width: 15px; height: 15px; }

.pm-btn-primary { background: #8cc46b; color: #101116; }
.pm-btn-primary:hover { background: #98d078; }

.pm-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: #d4d4d8;
}

.pm-btn-ghost:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }

.pm-btn-text { background: none; border: none; color: #71717a; font-weight: 600; }
.pm-btn-text:hover { color: #d4d4d8; }

.pm-block { width: 100%; margin-top: 10px; }

.pm-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.pm-actions-row .pm-btn-pay { flex: 1; }
.pm-stepnote { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }

/* ---------- шаг 2: сводка заказа ---------- */

.pm-ordercard {
  position: relative;
  padding: 14px 16px;
  background: #0c0d11;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
}

.pm-edit {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 5px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #71717a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.pm-edit:hover { background: rgba(255, 255, 255, 0.06); color: #d4d4d8; }

.pm-userrow { display: flex; align-items: center; gap: 12px; padding-right: 70px; margin-bottom: 10px; }

.pm-userrow .pm-avatar { width: 40px; height: 40px; font-size: 15px; }

.pm-usertext { min-width: 0; }
.pm-usertext b { display: block; font-size: 14px; color: #f4f4f5; }
.pm-usertext span { display: block; font-size: 12px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- шаг 2: способы оплаты ---------- */

.pm-method {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  cursor: pointer;
  color: inherit;
  transition: border-color 0.25s, background 0.25s;
}

.pm-method + .pm-method { margin-top: 10px; }

.pm-method:hover { border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.045); }

.pm-method.is-on {
  border-color: rgba(140, 196, 107, 0.6);
  background: rgba(140, 196, 107, 0.07);
}

.pm-method-off { opacity: 0.45; cursor: not-allowed; }
.pm-method-off:hover { border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.02); }

.pm-method-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 800;
}

.pm-logo-sbp { background: #ef5da8; color: #fff; }
.pm-logo-crypto { background: linear-gradient(160deg, #6db4ec, #2b6cb0); }
.pm-logo-crypto svg { width: 30px; height: 30px; }

.pm-method-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }

/* wrap: заголовок «Система Быстрых Платежей» вместе с плашкой не влезает в
   плитку на узком экране, и без переноса плашка выезжала за край. */
.pm-method-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pm-method-title b { font-size: 15px; color: #f4f4f5; }

.pm-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid rgba(79, 159, 208, 0.35);
  background: rgba(79, 159, 208, 0.12);
  color: #7cc0e8;
  font-size: 10.5px;
  font-weight: 700;
}

.pm-badge-off {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #71717a;
}

.pm-method-sub { font-size: 12.5px; color: #71717a; }

.pm-radio {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
}

.pm-radio i { width: 10px; height: 10px; border-radius: 50%; background: #8cc46b; display: none; }
.pm-radio.is-on { border-color: #8cc46b; }
.pm-radio.is-on i { display: block; }

.pm-assets { display: flex; gap: 7px; margin-top: 12px; }

/* Выбор режима СБП: QR или приложение банка. */
.pm-modes { display: flex; gap: 8px; margin-top: 10px; }

/* Строка режимов встала МЕЖДУ двумя плитками способов оплаты, поэтому
   правило .pm-method + .pm-method до второй плитки больше не доходит:
   возвращаем ей отступ отдельно. */
.pm-modes + .pm-method { margin-top: 10px; }

.pm-modes button {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
  color: #a1a1aa;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pm-modes button b { font-size: 13.5px; color: #d4d4d8; }
.pm-modes button span { font-size: 11.5px; color: #71717a; }
.pm-modes button:hover { border-color: rgba(255, 255, 255, 0.24); }

.pm-modes button.is-on {
  border-color: #8cc46b;
  background: rgba(140, 196, 107, 0.1);
}

.pm-modes button.is-on b { color: #f4f4f5; }

/* Подсказка «как платить» и строка про комиссию шлюза. */
.pm-sbp-note {
  margin: 4px 0 14px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}

.pm-sbp-note p { margin: 0; font-size: 12.5px; line-height: 1.5; color: #a1a1aa; }
.pm-sbp-note .pm-sbp-fee { margin-top: 6px; color: #71717a; }

.pm-sbp-mini {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  overflow: hidden;
  flex: none;
  background: #14161c;
}

.pm-sbp-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pm-assets button {
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #71717a;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.pm-assets button:hover { border-color: rgba(255, 255, 255, 0.24); color: #d4d4d8; }

.pm-assets button.is-on {
  border-color: rgba(140, 196, 107, 0.45);
  background: rgba(140, 196, 107, 0.12);
  color: #a3d483;
}

/* ---------- шаг 3 ---------- */

.pm-centered { display: flex; flex-direction: column; align-items: center; padding: 26px 10px; }

.pm-spinner {
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 50%;
  border: 3px solid rgba(140, 196, 107, 0.18);
  border-top-color: #8cc46b;
  animation: pm-spin 0.9s linear infinite;
}

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

.pm-wait-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #f4f4f5;
}

.pm-wait-head b { font-size: 14.5px; }

.pm-crypto-mini {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(160deg, #6db4ec, #2b6cb0);
}

.pm-crypto-mini svg { width: 18px; height: 18px; }

.pm-timer {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
  font-weight: 700;
  color: #a1a1aa;
}

.pm-big { text-align: center; margin: 22px 0 8px; }

.pm-big-label { display: block; font-size: 12px; color: #71717a; }

.pm-big b { display: block; margin-top: 5px; font-size: 32px; font-weight: 800; color: #fafafa; line-height: 1.1; }

.pm-big .pm-blue { display: block; margin-top: 7px; font-size: 13.5px; font-weight: 700; }

/* ---------- успех ---------- */

.pm-ok-check {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(140, 196, 107, 0.15);
  border: 1px solid rgba(140, 196, 107, 0.45);
  color: #a3d483;
  animation: pm-pop 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.pm-ok-check svg { width: 26px; height: 26px; }

.pm-ok { padding: 22px 10px 8px; }
.pm-ok .pm-hint { margin-top: 10px; }

.pm-ok-details { margin-top: 18px; }

/* ---------- мелкие экраны ---------- */

@media (max-width: 560px) {
  .pm-backdrop { padding: 10px; }
  .pm-step { padding: 16px; }
  .pm-qty-row button { width: 34px; height: 34px; }
  .pm-method { padding: 12px; gap: 11px; }
  .pm-method-logo { width: 42px; height: 42px; }
}


/* Скрытое — действительно скрыто: display-правила выше не должны
   перебивать атрибут hidden (иначе зелёная строка купона видна зря). */
.pm-dialog [hidden] { display: none !important; }

/* Зазор между полем купона и зелёной строкой применённого купона */
.pm-coupon-ok { margin-top: 10px; }

/* Логотип СБП: картинка на белой подложке, как настоящая иконка */
.pm-logo-sbp { overflow: hidden; background: #14161c; }
.pm-logo-sbp img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 12px; }

/* Аватар: голова скина с /api/avatar; нет скина - белый фон */
.pm-avatar { background: #fff; color: #a1a1aa; overflow: hidden; }
.pm-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: pixelated; }
