/* v72 cache-bust 2026-02-05 (Added amount copy field, improved memo text & button spacing) */
/* ===== Переменные ===== */
:root {
  --primary: #5B7EF5;
  --primary-dark: #4A6DD4;
  --primary-light: #7B9BFF;
  --bg: #0F1419;
  --bg-secondary: #1B1F2E;
  --bg-card: #252A3D;
  --bg-card-hover: #2D3347;
  --text: #FFFFFF;
  --text-secondary: #8B92A9;
  --border: #2D3347;
  --success: #4CAF50;
  --error: #FF5252;
  --shadow: rgba(0, 0, 0, 0.3);
  --accent-gold: #FFD700;
}

/* ===== Сброс ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: auto;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

/* ===== App Container ===== */
.app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  overflow: visible;
}

.pages-wrapper {
  will-change: transform;
}

.page {
  min-height: 100vh;
  padding-bottom: 100px;
}

.page::after {
  content: '';
  display: block;
  height: 160px; /* позволяет проскроллить вниз даже на пустых страницах */
}

/* ===== Cart Page ===== */
#cartPage {
  padding-bottom: 240px; /* как на checkout */
  min-height: calc(100vh + 100px); /* как на checkout */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#cartPage::after {
  content: '';
  display: block;
  height: 240px; /* увеличиваем хвост */
}

.cart-header {
  padding: 20px;
  background: var(--bg);
}

.cart-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.cart-content {
  padding: 0 20px 20px;
  background: var(--bg);
}

.cart-footer-fixed {
  display: none !important; /* Скрыт, теперь используется tabbar-cart-summary */
  z-index: 100;
}

/* ===== Header ===== */
.header {
  display: none;
}

/* ===== Search Container ===== */
.search-container {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg);
}

.search {
  position: relative;
  flex: 1;
}

.search__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  z-index: 1;
}

.search__input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: all 0.2s;
}

.search__input:focus {
  border-color: var(--primary);
  background: var(--bg-card);
}

.search__input::placeholder {
  color: var(--text-secondary);
}

.favorites-btn {
  width: 48px;
  height: 48px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.favorites-btn svg {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
}

.favorites-btn:active {
  transform: scale(0.95);
  background: var(--bg-card);
}

/* ===== Banners ===== */
.banners {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 20px 20px;
  background: var(--bg);
}

.banner-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  aspect-ratio: 1 / 1; /* Квадратные баннеры */
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

.banner-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(91, 126, 245, 0.2) 0%, transparent 70%);
  opacity: 0.5;
}

.banner-card:hover {
  box-shadow: 0 0 20px rgba(91, 126, 245, 0.4);
  border-color: var(--primary);
}

.banner-card:active {
  transform: scale(0.97);
  background: linear-gradient(135deg, var(--bg-card-hover) 0%, var(--bg-card) 100%);
}

.banner-card__icon {
  font-size: 40px;
  position: relative;
  z-index: 1;
}

.banner-card__content {
  position: relative;
  z-index: 1;
  width: 100%;
}

.banner-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.banner-card__subtitle {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

/* ===== Section Header ===== */
.section-header {
  padding: 0 20px 16px;
  background: var(--bg);
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

/* ===== Categories ===== */
.categories {
  display: flex;
  gap: 8px;
  padding: 0 20px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}

.categories::-webkit-scrollbar {
  display: none;
}

.category {
  padding: 10px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.category.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.category:active {
  transform: scale(0.95);
}

/* ===== Products ===== */
.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 20px 20px;
  background: var(--bg);
  max-width: 100%;
  overflow: hidden;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  border-color: var(--primary);
}

.product-card:active {
  transform: scale(0.97);
  background: var(--bg-card-hover);
}

.product-card__image {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card-hover) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}

.product-card__image::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(91, 126, 245, 0.15) 0%, transparent 70%);
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  position: relative;
  z-index: 1;
}

.product-card__name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
  min-height: 39px;
  max-height: 39px;
  word-break: break-word;
}

.product-card__price {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.product-card__button {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 0.3px;
}

.product-card__button.in-cart {
  background: var(--bg-card);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.product-card__button:active {
  background: var(--primary-dark);
  transform: scale(0.95);
}

.product-card__button.in-cart:active {
  background: var(--bg-card-hover);
}

/* ===== Bottom Navigation ===== */
.tabbar {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 568px;
  margin: 0 auto;
  background: rgba(37, 42, 61, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(91, 126, 245, 0.2);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  padding: 0;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

/* Cart Summary в Tabbar */
.tabbar-cart-summary {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(91, 126, 245, 0.2);
  display: none; /* По умолчанию скрыт */
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tabbar-cart-summary.show {
  display: flex; /* Показывается только с классом .show */
}

.tabbar-cart-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tabbar-cart-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.tabbar-cart-total {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

/* Tabs Container */
.tabbar-tabs {
  display: flex;
  padding: 12px 8px;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 12px;
  position: relative;
}

.tab svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.tab span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  margin-top: 1px;
  width: 100%;
}

.tab__icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

/* Тонкая подстройка текста "Корзина" */
.tab[data-page="cart"] span {
  display: inline-block;
  transform: translate(2px, -2px);
}

.cart-count {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px;
  min-height: 22px;
  aspect-ratio: 1 / 1 !important;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border-radius: 50% !important;
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
  box-shadow: 0 2px 8px rgba(91, 126, 245, 0.5);
  border: 2px solid var(--bg);
  pointer-events: none;
  z-index: 10;
  padding: 0;
  box-sizing: border-box;
}

.tab.active {
  color: var(--primary);
  background: rgba(91, 126, 245, 0.15);
}

.tab.active svg {
  transform: scale(1.15);
  filter: drop-shadow(0 0 8px rgba(91, 126, 245, 0.6));
}

.tab:active {
  transform: scale(0.95);
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: flex-end;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
}

.modal__content {
  background: var(--bg-secondary);
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-bottom: none;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.modal__header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.modal__close {
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__close:active {
  background: var(--bg-card-hover);
  transform: scale(0.95);
}

.modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.modal__footer {
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.promo-section {
  margin-bottom: 16px;
}

.promo-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.promo-input-group {
  display: flex;
  gap: 8px;
}

.promo-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: all 0.2s;
}

.promo-input::placeholder {
  color: var(--text-secondary);
}

.promo-input:focus {
  border-color: var(--primary);
}

.promo-btn {
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.promo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.promo-btn:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.promo-btn:not(:disabled):active {
  background: var(--primary-dark);
  transform: scale(0.96);
}

.cart-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-summary-row {
  display: none;
}

.cart-total {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.cart-total span:first-child {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
}

.cart-total span:last-child {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.cart-footer-fixed .btn-primary {
  flex-shrink: 0;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== Payment Methods ===== */
.payment-methods {
  margin-bottom: 16px;
}

.payment-methods__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.payment-methods__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.payment-method {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.payment-method:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.payment-method.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(91, 126, 245, 0.15) 0%, rgba(91, 126, 245, 0.05) 100%);
  box-shadow: 0 0 0 1px var(--primary);
}

.payment-method__icon {
  font-size: 32px;
  line-height: 1;
}

.payment-method__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
}

.payment-method:active {
  transform: scale(0.96);
}

.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(91, 126, 245, 0.2);
}

.cart-item:last-child {
  margin-bottom: 0;
}

.cart-item__image {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card-hover) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cart-item__image::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, rgba(91, 126, 245, 0.2) 0%, transparent 70%);
}

.cart-item__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cart-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-item__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.cart-item__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
}

.cart-item__delete {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.cart-item__delete svg {
  width: 20px;
  height: 20px;
}

.cart-item__delete:active {
  color: var(--error);
  transform: scale(0.9);
}

.cart-item__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-item__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cart-item__btn {
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border-radius: 10px;
}

.cart-item__btn:active {
  background: var(--primary);
  color: white;
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(91, 126, 245, 0.3);
}

.cart-item__quantity {
  font-size: 16px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
  color: var(--text);
}

.cart-item__price {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* ===== Buttons ===== */
.btn {
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
  box-shadow: 0 4px 12px rgba(91, 126, 245, 0.3);
}

.btn-primary:active {
  background: var(--primary-dark);
  transform: scale(0.97);
  box-shadow: 0 2px 6px rgba(91, 126, 245, 0.3);
}

.btn-sm {
  width: auto;
  padding: 12px 24px;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  max-width: 80%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  pointer-events: all;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 16px;
  color: var(--text-secondary);
}

/* ===== Payment Modal ===== */
.payment-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.payment-modal.active {
  opacity: 1;
}

.payment-modal__content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 24px;
  max-width: 400px;
  width: 100%;
  padding: 24px;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.payment-modal.active .payment-modal__content {
  transform: scale(1);
}

.payment-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.payment-modal__close:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

.payment-modal__header {
  text-align: center;
  margin-bottom: 24px;
}

.payment-modal__icon {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 12px;
}

.payment-modal__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.payment-modal__amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.payment-modal__qr {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.payment-modal__qr-placeholder {
  width: 200px;
  height: 200px;
  color: #000;
}

.payment-modal__qr-placeholder svg {
  width: 100%;
  height: 100%;
}

.payment-modal__address {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.payment-modal__address-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.payment-modal__address-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  word-break: break-all;
  cursor: pointer;
  padding: 8px;
  background: var(--bg);
  border-radius: 8px;
  transition: all 0.2s;
}

.payment-modal__address-value:active {
  background: var(--bg-card-hover);
  transform: scale(0.98);
}

.payment-modal__info {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  margin-top: 16px;
}

/* ===== Checkout Page ===== */
#checkoutPage {
  padding-bottom: 240px; /* Увеличен для возможности скролла */
  min-height: calc(100vh + 100px); /* Добавляем высоту для скролла */
  overflow-y: auto;
}

.checkout-header {
  position: relative;
  display: flex;
  align-items: center;
  padding: 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.back-btn {
  position: absolute;
  left: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.back-btn svg {
  width: 20px;
  height: 20px;
}

.back-btn:active {
  background: var(--bg-card-hover);
  transform: scale(0.95);
}

.checkout-title {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.checkout-content {
  padding: 20px;
  background: var(--bg);
}

.username-section {
  margin-bottom: 24px;
}

.username-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.username-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.username-autofill {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.username-autofill:active {
  background: var(--bg-card);
  transform: scale(0.95);
}

.username-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  transition: all 0.2s;
  box-sizing: border-box;
}

.username-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg);
}

.username-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.checkout-summary {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.checkout-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  .products {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* ===== TON Payment Page ===== */
#tonPaymentPage {
  padding-bottom: 100px;
}

.ton-payment-content {
  padding: 12px;
  max-width: 480px;
  margin: 0 auto;
}

/* Main Card */
.ton-main-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.ton-order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.ton-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.ton-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.ton-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.ton-amount-ton {
  font-size: 28px;
  font-weight: 700;
  color: #0098EA;
}

.ton-amount-rub {
  font-size: 14px;
  color: var(--text-secondary);
}

/* QR Code - как в TG */
.ton-qr-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  text-align: center;
}

.ton-qr-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
}

.ton-qr-wrapper {
  background: #1f1f1f;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ton-qr-container {
  width: 180px;
  height: 180px;
  margin: 0 auto;
  padding: 12px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ton-qr-container canvas,
.ton-qr-container img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.ton-qr-hint {
  margin: 12px 0 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

/* Info Cards */
.ton-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.ton-info-card--highlight {
  background: rgba(255, 152, 0, 0.08);
  border-color: rgba(255, 152, 0, 0.3);
}

.ton-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.ton-copy-icon {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  padding: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ton-copy-icon svg {
  width: 18px;
  height: 18px;
}

.ton-copy-icon:active {
  transform: scale(0.9);
  color: rgba(255, 255, 255, 0.6);
}

.ton-info-value {
  font-family: monospace;
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.4;
}

.ton-info-value--large {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

/* Actions */
.ton-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.btn-large {
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  max-width: 320px;
  margin: 0 auto;
}

.btn-link {
  background: transparent;
  color: var(--primary);
  border: none;
  padding: 12px;
  font-size: 14px;
  font-weight: 400;
}

.btn-link:active {
  opacity: 0.6;
}

/* Status */
.ton-status {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 12px;
}

.ton-status-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.ton-status-icon {
  font-size: 24px;
}

.ton-status-text {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* Cache buster: 1770230574 */
