/* МЁДОФОН — витрина Mini App. Тёплая айвори/янтарная система как в панели. */
:root {
  --amber: #f5a623;
  --amber-deep: #dd8f0d;
  --amber-grad: linear-gradient(135deg, #ffc95e, #f09a12);
  --bg: #f8f3e5;
  --card: #fffdf7;
  --border: #eadfca;
  --text: #26241f;
  --muted: #857d6c;
  --green: #2f9e5f;
  --red: #d5493c;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; display: flex; flex-direction: column;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }

#topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--card); border-bottom: 1px solid var(--border);
}
#topbar h1 { font-size: 18px; margin: 0; flex: 1; }
#back-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text); border-radius: 9px; padding: 6px 11px; font-size: 14px;
}
.cart-chip {
  background: var(--amber-grad); color: #2a1c05;
  border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700;
}

#content { flex: 1; padding: 14px 14px 20px; }
.notice { color: var(--muted); padding: 30px 10px; text-align: center; }

.search-box { margin-bottom: 14px; }
.search-box input {
  width: 100%; padding: 12px 14px; font-size: 15px;
  border: 1px solid #d9cba9; border-radius: 12px; background: var(--card);
}
.search-box input:focus { outline: 2px solid rgba(245, 166, 35, .45); border-color: var(--amber); }

/* сетка фирм/плиток */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.tile {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 10px 12px; text-align: center; cursor: pointer;
}
.tile:active { border-color: var(--amber); }
.tile .glyph { font-size: 26px; margin-bottom: 6px; }
.tile .name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* список категорий/моделей */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 14px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
}
.row:active { border-color: var(--amber); }
.row .body { flex: 1; min-width: 0; }
.row .label { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .side { text-align: right; flex: 0 0 auto; }
.row .price { font-weight: 700; font-size: 15px; }
.row .chev { color: #d9cba9; }

/* карточки товаров */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 13px 14px; margin-bottom: 10px; }
.card .name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.card .price { color: var(--amber-deep); font-size: 18px; font-weight: 800; }
.card .price .was { color: var(--muted); text-decoration: line-through; font-size: 13px; font-weight: 400; margin-left: 8px; }
.card .offers { color: var(--muted); font-size: 12px; margin-top: 4px; }
.card .actions { margin-top: 10px; display: flex; gap: 8px; }

.badge {
  display: inline-block; border-radius: 999px; padding: 1px 8px;
  font-size: 11px; font-weight: 700; margin-left: 6px; vertical-align: middle;
}
.badge.new { background: #e6f3ea; color: var(--green); }
.badge.off { background: #f9e8e5; color: var(--red); }

button.buy {
  background: var(--amber-grad); color: #2a1c05; border: 0;
  border-radius: 10px; padding: 9px 16px; font-size: 14px; font-weight: 700;
}
button.buy.done { background: #e6f3ea; color: var(--green); }

/* нижняя навигация */
#tabbar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; border-top: 1px solid var(--border);
  background: var(--card); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
#tabbar .tab {
  flex: 1; background: transparent; border: 0; color: var(--muted);
  font-size: 19px; padding: 6px 0 2px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
#tabbar .tab span { font-size: 10.5px; font-weight: 600; }
#tabbar .tab.active { color: var(--amber-deep); }

/* форма заявки */
.field { margin-top: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; padding: 11px 12px; font-size: 15px;
  border: 1px solid #d9cba9; border-radius: 10px; background: #fff; color: var(--text);
}
.order-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.order-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 16px; padding: 10px 0; }
#order-status { margin-top: 10px; font-size: 14px; color: var(--muted); }
