:root {
  --bg: var(--tg-theme-bg-color, #1c1c1e);
  --text: var(--tg-theme-text-color, #fff);
  --hint: var(--tg-theme-hint-color, #8e8e93);
  --button: var(--tg-theme-button-color, #2ea6ff);
  --button-text: var(--tg-theme-button-text-color, #fff);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #2c2c2e);
  --link: var(--tg-theme-link-color, #2ea6ff);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 16px;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

#greeting {
  margin-bottom: 16px;
  color: var(--hint);
  font-size: 0.95rem;
}

.catalog {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--secondary-bg);
  border-radius: 12px;
  overflow: hidden;
}

.card .media {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.card-body {
  padding: 12px 14px 14px;
}

.card h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.card .short {
  margin: 0 0 8px;
  color: var(--hint);
  font-size: 0.9rem;
}

.card .long {
  margin: 0 0 12px;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.card .price {
  font-weight: 600;
  margin-bottom: 10px;
}

.card button {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 1rem;
  background: var(--button);
  color: var(--button-text);
  cursor: pointer;
}

.card button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.status {
  min-height: 1.2em;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--hint);
}

.status.error { color: #ff6b6b; }
