* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: #f9f6f3;
  color: #2f2a28;
}

.page {
  max-width: 720px;
  margin: 0 auto;
}

.header {
  padding: 20px 16px 12px;
}

.header h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
}

.header p {
  margin: 0;
  font-size: 0.875rem;
  color: #5d5248;
}

.content {
  padding-bottom: 24px;
}

/* Сетка товаров */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 8px 12px;
}

.product-card {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(45, 35, 29, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.product-card:active {
  transform: scale(0.97);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.product-info {
  padding: 8px;
}

.product-title {
  margin: 0 0 3px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-price {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #2d7a4f;
}

/* Кнопки на карточке товара */
.btn-add {
    width: 100%;
    background: #2d7a4f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
}

.btn-add:active {
    background: #245f3e;
}

.qty-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    background: #eef6f1;
    border-radius: 8px;
    overflow: hidden;
}

.btn-qty {
    background: none;
    border: none;
    font-size: 20px;
    width: 34px;
    height: 32px;
    cursor: pointer;
    color: #2d7a4f;
    font-weight: 700;
    line-height: 1;
    padding: 0;
}

.qty-num {
    font-weight: 700;
    font-size: 14px;
    color: #2f2a28;
}

/* Корзина */
.cart-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 80px;
}

.cart-item {
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(45, 35, 29, 0.07);
}

.cart-item img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-subtotal {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #2d7a4f;
}

.cart-total-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #fff;
    border-top: 1px solid #ede9e5;
    font-size: 16px;
    box-shadow: 0 -4px 16px rgba(45, 35, 29, 0.08);
}

.cart-total-bar strong {
    font-size: 18px;
    color: #2d7a4f;
}

/* Оформление заказа */
.checkout-form {
  padding: 16px 16px 40px;
}

.checkout-title {
  margin: 0 0 20px;
  font-size: 1.2rem;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #5d5248;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0d9d3;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus {
  border-color: #2d7a4f;
}

/* Вкладки оплаты */
.payment-tabs {
  display: flex;
  gap: 8px;
}

.pay-tab {
  flex: 1;
  padding: 10px;
  border: 1.5px solid #e0d9d3;
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #5d5248;
  cursor: pointer;
  transition: all 0.15s;
}

.pay-tab.active {
  border-color: #2d7a4f;
  background: #eef6f1;
  color: #2d7a4f;
}

/* СБП — QR */
.sbp-section {
  margin-top: 16px;
}

.qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  padding: 20px 16px 16px;
  box-shadow: 0 2px 12px rgba(45,35,29,0.08);
  margin-bottom: 16px;
}

.qr-label {
  margin: 10px 0 4px;
  font-size: 13px;
  color: #5d5248;
  text-align: center;
}

.qr-amount {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #2d7a4f;
}

/* Карта */
.card-section {
  margin-top: 16px;
}

/* Кнопка отправки формы */
.btn-submit {
  width: 100%;
  padding: 14px;
  background: #2d7a4f;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  margin-top: 8px;
}

.btn-submit:active {
  background: #245f3e;
}

.btn-submit:disabled {
  background: #b0c9bc;
  cursor: default;
}

/* Экран успеха */
.success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 32px 24px;
  text-align: center;
}

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #2d7a4f;
  color: #fff;
  font-size: 36px;
  line-height: 72px;
  margin-bottom: 20px;
}

.success-title {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.success-text {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.success-note {
  margin: 0;
  font-size: 0.875rem;
  color: #5d5248;
}

/* Загрузка */
.loading {
  text-align: center;
  padding: 40px 16px;
  color: #5d5248;
  font-size: 0.9rem;
}

/* Одиночная карточка (ошибки, сообщения) */
.card {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px;
  margin: 16px;
  box-shadow: 0 4px 20px rgba(45, 35, 29, 0.08);
}

.card p {
  margin: 0;
  line-height: 1.75;
}
