/* Главная сайта = магазин. Здесь только то, что нужно сайту поверх app.css.
   В Telegram (html.tg) все блоки сайта скрыты — там магазин выглядит как раньше. */
.tg .site-only { display: none !important; }
body:not([data-tab="catalog"]) .home-only { display: none !important; }
.sitenav { white-space: nowrap; }

/* шапка с заголовком для поиска */
.s-hero { padding: 26px 0 8px; }
.s-hero h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.25; margin: 10px 0 10px; }
.s-hero p { color: var(--muted); margin: 0 0 16px; max-width: 640px; }
.s-row { display: flex; gap: 10px; flex-wrap: wrap; }
.s-hero .sc { margin-top: 18px; }

/* блоки под каталогом */
.s-blocks section { border-top: 1px solid var(--line); padding: 28px 0 8px; margin-top: 28px; scroll-margin-top: 80px; }
.s-blocks h2 { font-size: 26px; margin-bottom: 14px; }
.s-blocks a { color: var(--gold); }
.s-steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.s-steps li { counter-increment: s; position: relative; padding: 14px 16px 14px 56px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.s-steps li::before { content: counter(s); position: absolute; left: 14px; top: 14px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); display: grid; place-items: center; font: 15px var(--display); }
.s-steps b { display: block; }
.s-steps span { color: var(--muted); font-size: 14px; }
.s-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.s-dl div { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.s-dl span { color: var(--gold); font-weight: 600; }
.s-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.s-posts { display: grid; gap: 12px; }
.s-post { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-decoration: none; color: var(--ink) !important; }
.s-post img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; }
.s-post b { display: block; font-weight: 600; line-height: 1.35; }
.s-post-go { display: inline-block; margin-top: 8px; font-style: normal; font-weight: 700; font-size: 13px; color: var(--gold); }
.s-post small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; margin-top: 4px; }
.s-faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.s-faq summary { cursor: pointer; font-weight: 600; }
.s-faq p { color: var(--muted); margin: 8px 0 0; font-size: 14px; }

/* подвал */
.s-ft { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0 8px; }
.s-ft-in { display: grid; gap: 20px; }
.s-col { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.s-col a, .s-legal a { color: var(--muted); text-decoration: none; }
.s-col a:hover, .s-legal a:hover { color: var(--gold); }
.s-legal { border-top: 1px solid var(--line); padding-top: 14px; margin: 20px 0 0; }

/* сортировка под видами чая */
.sorts { padding-top: 4px !important; }
.sorts .chip { font-size: 12px; padding: 7px 12px; }

/* Компьютер: шире; закреплённая шапка с логотипом по центру */
@media (min-width: 900px) {
  html:not(.tg) body { max-width: 1120px; padding: 0 24px 40px; display: flex; flex-direction: column; }
  html:not(.tg) .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  html:not(.tg) .top { order: -2; height: 72px; }
  .hdr-r { display: flex; align-items: center; gap: 20px; grid-column: 3; grid-row: 1; justify-self: end; }
  html:not(.tg) .top .sitenav { margin: 0; }
  /* разделы магазина — полосой под шапкой, тоже закреплены */
  html:not(.tg) .nav { order: -1; position: sticky; top: 72px; bottom: auto; left: auto; transform: none; width: 100%; z-index: 24;
    display: flex; gap: 6px; padding: 8px 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); background: var(--bg); }
  html:not(.tg) .nav a { flex-direction: row; gap: 8px; padding: 8px 14px; font-size: 14px; }
  html:not(.tg) .nav svg { width: 18px; height: 18px; }
  html:not(.tg) .badge { position: static; margin-left: 2px; }
  html:not(.tg) .toast, html:not(.tg) .undo { bottom: 24px; }
  html:not(.tg) .build-bar { bottom: 16px; }
}
/* Широкий экран: разделы магазина прямо в шапке слева — одна строка */
@media (min-width: 1180px) {
  html:not(.tg) .nav { position: fixed; top: 0; left: max(24px, calc(50% - 536px)); width: auto; height: 72px; z-index: 26;
    padding: 0; border: 0; background: transparent; align-items: center; gap: 2px; }
  html:not(.tg) .nav a { padding: 8px 10px; gap: 6px; }
  html:not(.tg) .nav svg { display: none; }
}
@media (min-width: 900px) {
  .s-dl { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* шапка: текст слева, карусель справа */
  .s-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px; align-items: center; }
  .s-hero > * { min-width: 0; }
  .s-hero .sc { margin: 0; align-self: center; }
  .s-posts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s-post { flex-direction: column; align-items: stretch; }
  .s-post img { width: 100%; height: 150px; }
  .s-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s-ft-in { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
/* Шапка сайта: логотип по центру, шапка закреплена при прокрутке */
.tg .site-acc { display: none !important; }
html:not(.tg) .top { position: sticky; top: 0; z-index: 25; background: var(--bg); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
html:not(.tg) .top .brand { grid-column: 2; grid-row: 1; }
html:not(.tg) .top .site-acc { font-size: 14px; text-decoration: none; }
/* телефон: «Блог» слева, логотип по центру, «Войти» справа */
@media (max-width: 899px) {
  .hdr-r { display: contents; }
  html:not(.tg) .top .sitenav { grid-column: 1; grid-row: 1; margin: 0; justify-self: start; }
  html:not(.tg) .top .site-acc { grid-column: 3; grid-row: 1; justify-self: end; }
}
@media (max-width: 640px) { .sitenav a[data-home] { display: none; } }

/* вход через Telegram */
.acc { color: var(--gold) !important; font-weight: 600; }
.login-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 6px 0 14px; padding: 14px 16px; border: 1px solid #2aabee66; border-radius: 12px; background: #2aabee12; }
.login-box b { display: block; }
.login-box small { display: block; color: var(--muted); font-size: 13px; max-width: 460px; }
.tg-login { min-height: 40px; }
/* без белой подложки: у тёмной страницы и светлого окна Telegram разная цветовая схема — уравниваем */
.tg-login iframe { color-scheme: light; background: transparent !important; }

.tg-login { display: flex; flex-direction: column; gap: 6px; }
.login-wait { color: var(--gold); font-size: 12px; }
