/* Ro'zg'or Mini App — mobil-birinchi, Telegram temasiga moslashadi */

:root {
  --tg-bg: #ffffff;
  --tg-text: #111111;
  --tg-hint: #8a8a8e;
  --tg-link: #2481cc;
  --tg-button: #2481cc;
  --tg-button-text: #ffffff;
  --tg-secondary-bg: #f2f2f7;
  --danger: #e5484d;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--tg-bg);
  color: var(--tg-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
}

.header {
  padding: 18px 16px 8px;
}

.title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--tg-hint);
  font-size: 14px;
}

.main {
  flex: 1;
  padding: 8px 12px 96px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--tg-secondary-bg);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.item:active {
  opacity: 0.7;
}

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

.item-name {
  font-size: 16px;
  font-weight: 500;
  word-break: break-word;
}

.item-meta {
  margin-top: 3px;
  font-size: 13px;
  color: var(--tg-hint);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.item-qty {
  font-weight: 600;
  color: var(--tg-text);
  opacity: 0.75;
}

.item-cat {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(36, 129, 204, 0.12);
  color: var(--tg-link);
  font-size: 12px;
}

/* Sotib olingan mahsulot — chizib tashlanadi (asosiy g'oya) */
.item.bought .item-name {
  text-decoration: line-through;
  color: var(--tg-hint);
}

.item.bought {
  opacity: 0.55;
}

.del-btn {
  flex: none;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--tg-hint);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.del-btn:active {
  background: rgba(229, 72, 77, 0.15);
  color: var(--danger);
}

.empty {
  text-align: center;
  color: var(--tg-hint);
  padding: 48px 16px;
}

.empty p {
  margin: 4px 0;
}

.empty-hint {
  font-size: 14px;
}

.notice {
  margin: 12px 4px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(229, 72, 77, 0.1);
  color: var(--danger);
  font-size: 14px;
  text-align: center;
}

.add-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--tg-bg);
  border-top: 1px solid rgba(128, 128, 128, 0.15);
  max-width: 640px;
  margin: 0 auto;
}

.add-input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--tg-secondary-bg);
  color: var(--tg-text);
  font-size: 16px;
  outline: none;
}

.add-input::placeholder {
  color: var(--tg-hint);
}

.add-btn {
  flex: none;
  width: 48px;
  border: none;
  border-radius: var(--radius);
  background: var(--tg-button);
  color: var(--tg-button-text);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.add-btn:disabled {
  opacity: 0.5;
}
