/* Магазин в боте. Система — web/DESIGN.md: белый фон, светло-серые скруглённые блоки, чёрная главная кнопка. */
@font-face { font-family: Onest; font-weight: 400 900; font-display: swap; src: url('fonts/onest-cyrillic.woff2') format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Onest; font-weight: 400 900; font-display: swap; src: url('fonts/onest-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: Ruble; font-weight: 400 900; src: url('fonts/inter-ruble-wght.woff2') format('woff2'); unicode-range: U+20BD; }

:root {
  --bg: #ffffff; --tile: #f2f3f5; --tile-2: #e7e9ed; --ink: #16171a; --ink-2: #33363d; --muted: #6b6f78; --line: #e3e5e9;
  --a: #1fae55; --a-d: #13863f; --b: #ff5a3c;
  --t-blue: #e3eaf6; --t-green: #e3f2e9; --t-dark: #202128; --t-coral: #fde9e5;
  --on-primary: #ffffff; --r-xl: 24px; --r: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
:root.dark {
  --bg: #0f1012; --tile: #1b1c20; --tile-2: #26282d; --ink: #f2f3f5; --ink-2: #d6d9de; --muted: #9a9ea6; --line: #2a2c31;
  --t-blue: #1c2433; --t-green: #182a20; --t-dark: #24262c; --t-coral: #32211d; --on-primary: #0f1012;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 400 16px/1.45 Onest, Ruble, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
#app { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(120px + var(--safe-b)); }
.i { width: 1em; height: 1em; flex: none; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }

/* шапка */
.top { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; }
.eye { width: 30px; height: 22px; flex: none; display: block; }
.brand { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.dev { margin-left: auto; font-size: 12px; font-weight: 700; background: var(--tile); border-radius: 8px; padding: 4px 8px; color: var(--muted); }
h1 { font-size: 30px; line-height: 1.05; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0 0 18px; font-size: 15px; }

/* вкладки */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--tile); border-radius: 14px; padding: 4px; margin-bottom: 16px; }
.seg a { text-align: center; padding: 10px 0; border-radius: 11px; font-weight: 700; font-size: 15px; color: var(--muted); text-decoration: none; }
.seg a.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.seg b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: var(--ink); color: var(--on-primary); font-size: 12px; margin-left: 6px; padding: 0 6px; }

/* карточки каталога */
.list { display: grid; gap: 12px; }
.card { display: grid; grid-template-columns: 1fr 112px; gap: 8px; align-items: center; border-radius: var(--r-xl); padding: 18px 14px 18px 18px; text-decoration: none; color: var(--ink); position: relative; min-height: 148px; transition: transform .15s ease; }
.card:active { transform: scale(0.985); }
.card img { width: 112px; height: 112px; object-fit: contain; }
.card h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.2; letter-spacing: -0.015em; font-weight: 800; }
.card p { margin: 0 0 12px; font-size: 14px; color: var(--muted); line-height: 1.35; }
.tone-blue { background: var(--t-blue); } .tone-green { background: var(--t-green); } .tone-coral { background: var(--t-coral); }
.tone-dark { background: var(--t-dark); color: #fff; } .tone-dark p, .tone-dark .price .alt { color: #b3b6bd; } .tone-dark h3 { color: #fff; }
.price { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; font-size: 16px; }
.price .st { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); color: var(--ink); border-radius: 10px; padding: 5px 9px; font-size: 15px; }
.tone-dark .price .st { background: #fff; color: #16171a; }
.price .st .i { width: 15px; height: 15px; }
.price .alt { font-weight: 600; font-size: 14px; color: var(--muted); }
.owned { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 4px; background: var(--a); color: #fff; font-size: 12px; font-weight: 700; border-radius: 9px; padding: 4px 8px; }
.owned .i { width: 13px; height: 13px; }

/* страница продукта */
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 15px; margin: 0 0 12px; text-decoration: none; }
.hero { border-radius: var(--r-xl); display: grid; place-items: center; padding: 18px; margin-bottom: 18px; }
.hero img { width: 200px; height: 200px; object-fit: contain; }
.pp h1 { font-size: 28px; } .pp .sub { margin-bottom: 14px; }
.pricebox { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; background: var(--tile); border-radius: var(--r); padding: 14px 16px; margin-bottom: 16px; }
.pricebox b { display: inline-flex; align-items: center; gap: 6px; font-size: 24px; letter-spacing: -0.02em; } .pricebox b .i { width: 20px; height: 20px; }
.pricebox span { color: var(--muted); font-size: 14px; }
.points { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.points li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; background: var(--tile); border-radius: 14px; padding: 12px 14px; font-size: 15px; line-height: 1.35; }
.points .i { width: 20px; height: 20px; color: var(--a-d); margin-top: 1px; } :root.dark .points .i { color: #5fe39a; }
.note { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 13px; color: var(--muted); line-height: 1.4; padding: 0 4px; }
.note .i { width: 18px; height: 18px; margin-top: 1px; }

/* нижняя панель кнопок */
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, transparent); padding: 18px 16px calc(14px + var(--safe-b)); }
.bar > div { max-width: 528px; margin: 0 auto; display: grid; gap: 8px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; border-radius: var(--r); font-weight: 800; font-size: 16px; padding: 0 18px; width: 100%; text-decoration: none; }
.btn .i { width: 18px; height: 18px; }
.btn.primary { background: var(--ink); color: var(--on-primary); } .btn.secondary { background: var(--tile); color: var(--ink); }
.btn.small { min-height: 44px; font-size: 15px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn.busy .i { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* мои покупки и формы */
.box { background: var(--tile); border-radius: var(--r-xl); padding: 18px; margin-bottom: 12px; }
.box h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.box h3 .i { width: 20px; height: 20px; }
.box p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.box .btn { margin-top: 4px; } .box .btn.secondary { background: var(--bg); }
.done { display: inline-flex; align-items: center; gap: 6px; color: var(--a-d); font-weight: 700; font-size: 14px; } :root.dark .done { color: #5fe39a; }
.done .i { width: 18px; height: 18px; }
label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; }
input, textarea, select { width: 100%; border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: 16px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
.err { color: var(--b); font-size: 13px; font-weight: 600; margin-top: 6px; }
.empty { text-align: center; padding: 36px 16px; } .empty .i { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--muted); }
.empty h3 { margin: 0 0 4px; } .empty p { color: var(--muted); margin: 0 0 16px; }

/* загрузка и ошибки */
.sk { background: var(--tile); border-radius: var(--r-xl); height: 148px; margin-bottom: 12px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
.alert { background: var(--t-coral); border-radius: var(--r); padding: 14px 16px; font-size: 14px; margin-bottom: 12px; }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(140px + var(--safe-b)); max-width: 528px; margin: 0 auto; background: var(--ink); color: var(--on-primary); border-radius: 14px; padding: 14px 16px; font-weight: 600; font-size: 15px; z-index: 10; box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
:root.dark .card img, :root.dark .hero img { border-radius: 18px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
