:root {
  --bg: var(--tg-theme-bg-color, #fff);
  --bg2: var(--tg-theme-secondary-bg-color, #f3f3f5);
  --text: var(--tg-theme-text-color, #1c1c1e);
  --hint: var(--tg-theme-hint-color, #8e8e93);
  --link: var(--tg-theme-link-color, #2a7ae2);
  --btn: var(--tg-theme-button-color, #e2683c);
  --btn-text: var(--tg-theme-button-text-color, #fff);
  --accent: #e2683c;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg2); color: var(--text);
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid rgba(128,128,128,.25);
  border-radius: 10px; padding: 11px 12px; width: 100%; outline: none; }
textarea { min-height: 64px; resize: vertical; }
.hidden { display: none !important; }
.loading { padding: 40vh 0; text-align: center; color: var(--hint); }

/* шапка */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 12px 0; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.hello { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hello b { font-size: 17px; }
.hello .sub { color: var(--hint); font-size: 13px; }
.hello .me { margin-left: auto; font-size: 22px; padding: 4px; }
.search { margin-bottom: 8px; }
.tabs, .chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.tabs::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; padding: 7px 12px; border-radius: 18px; background: var(--bg2); font-weight: 500; }
.tab.on { background: var(--btn); color: var(--btn-text); }
.chip { white-space: nowrap; padding: 5px 10px; border-radius: 14px; border: 1px solid rgba(128,128,128,.3); font-size: 13px; }
.chip.on { border-color: var(--accent); color: var(--accent); }

/* лента */
.list { padding: 10px 10px 110px; display: grid; gap: 10px; }
.card { display: flex; gap: 10px; background: var(--bg); border-radius: var(--radius); padding: 8px; align-items: stretch; }
.card.stopped { opacity: .5; }
.card img, .noimg { width: 104px; height: 104px; object-fit: cover; border-radius: 10px; flex: none; background: var(--bg2); }
.card .info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.card .name { font-weight: 600; line-height: 1.25; }
.card .meta { color: var(--hint); font-size: 13px; margin-top: 2px; }
.card .row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.price b { font-size: 16px; }
.price s { color: var(--hint); font-size: 12px; margin-left: 4px; }
.add { background: var(--btn); color: var(--btn-text); border-radius: 18px; min-width: 38px; height: 34px; padding: 0 12px; font-weight: 600; }
.qty { display: flex; align-items: center; gap: 2px; background: var(--bg2); border-radius: 18px; }
.qty button { width: 34px; height: 34px; font-size: 18px; font-weight: 600; }
.qty span { min-width: 18px; text-align: center; font-weight: 600; }
.empty { text-align: center; color: var(--hint); padding: 40px 10px; }

/* нижняя панель */
.bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg); box-shadow: 0 -1px 0 rgba(0,0,0,.08); z-index: 6; }
.big { width: 100%; background: var(--btn); color: var(--btn-text); border-radius: 12px; padding: 14px; font-weight: 600; font-size: 16px; }
.big:disabled { opacity: .5; }
.big.light { background: var(--bg2); color: var(--text); }

/* шторка */
#sheet-wrap { position: fixed; inset: 0; z-index: 10; }
#sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
#sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--bg);
  border-radius: 18px 18px 0 0; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery img { width: 100%; flex: none; aspect-ratio: 4/3; object-fit: cover; scroll-snap-align: center; }
.dots { text-align: center; color: var(--hint); font-size: 12px; margin-top: 4px; }
.pad { padding: 12px 14px; }
.title { font-size: 20px; font-weight: 700; margin: 4px 0; }
.desc { white-space: pre-line; margin: 10px 0; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.fact { background: var(--bg2); border-radius: 10px; padding: 6px 9px; font-size: 13px; }
.kbju { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin: 10px 0; }
.kbju div { background: var(--bg2); border-radius: 10px; padding: 6px 2px; font-size: 12px; color: var(--hint); }
.kbju b { display: block; color: var(--text); font-size: 15px; }
.vgroup { margin: 12px 0; }
.vgroup .vt { font-weight: 600; margin-bottom: 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { padding: 8px 12px; border-radius: 18px; background: var(--bg2); }
.opt.on { background: var(--btn); color: var(--btn-text); }
.upsell { margin: 12px 0; }
.upsell .ut { font-weight: 600; margin-bottom: 6px; }
.mini { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.mini .m { flex: none; width: 120px; background: var(--bg2); border-radius: 12px; padding: 6px; font-size: 12px; }
.mini .m img { width: 100%; height: 72px; object-fit: cover; border-radius: 8px; }
.mini .m button { margin-top: 4px; width: 100%; background: var(--btn); color: var(--btn-text); border-radius: 10px; padding: 5px; }
.sitelink { color: var(--link); font-size: 13px; }
.close { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 16px;
  background: rgba(0,0,0,.45); color: #fff; font-size: 18px; z-index: 2; }

/* корзина и оформление */
.page { padding: 12px 12px 120px; }
.page h2 { margin: 6px 0 12px; font-size: 20px; }
.box { background: var(--bg); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.box h3 { margin: 0 0 8px; font-size: 15px; }
.line { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.line + .line { border-top: 1px solid rgba(128,128,128,.15); }
.line .ln { flex: 1; min-width: 0; }
.line .lv { color: var(--hint); font-size: 12px; }
.sum { display: flex; justify-content: space-between; padding: 3px 0; }
.sum.total { font-weight: 700; font-size: 17px; padding-top: 8px; }
.hint { color: var(--hint); font-size: 13px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg2); border-radius: 12px; padding: 3px; margin-bottom: 8px; }
.seg button { padding: 9px; border-radius: 10px; font-weight: 500; }
.seg button.on { background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.days, .hours { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.hours { flex-wrap: wrap; }
.day, .hour { flex: none; padding: 8px 11px; border-radius: 12px; background: var(--bg2); text-align: center; }
.day small { display: block; color: var(--hint); font-size: 11px; }
.day.on, .hour.on { background: var(--btn); color: var(--btn-text); }
.day.on small { color: var(--btn-text); }
.field { margin-bottom: 8px; }
.field label { display: block; font-size: 13px; color: var(--hint); margin-bottom: 4px; }
.row2 { display: flex; gap: 6px; }
.row2 input { flex: 1; }
.linkbtn { color: var(--link); padding: 6px 0; font-size: 14px; }
.saved { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.check input { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.check a { color: var(--link); }
.err { color: #d93025; margin: 8px 0; font-size: 14px; }
.done { text-align: center; padding: 40px 16px; }
.done .ico { font-size: 54px; }
.paybox { text-align: left; white-space: pre-line; background: var(--bg); border-radius: var(--radius); padding: 14px; margin: 14px 0; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: rgba(0,0,0,.8); color: #fff;
  padding: 9px 14px; border-radius: 18px; z-index: 20; font-size: 14px; }
.order { background: var(--bg); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; }
.order .oh { display: flex; justify-content: space-between; font-weight: 600; }

/* нижняя навигация */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--bg); box-shadow: 0 -1px 0 rgba(0,0,0,.08); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
.nav { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--hint); }
.nav svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav.on { color: var(--btn); }
.badge { position: absolute; top: -3px; left: 50%; margin-left: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 11px; line-height: 17px; text-align: center; }
.bar.above { bottom: calc(52px + env(safe-area-inset-bottom)); box-shadow: none; padding-bottom: 8px; background: transparent; }
.list { padding-bottom: 150px; }
.page { padding-bottom: 160px; }
.mini .m { cursor: pointer; display: flex; flex-direction: column; }
.mini .m .mn { flex: 1; margin: 3px 0; line-height: 1.25; }
.mini .m .mi { width: 100%; height: 72px; }

/* шапка: аватар, «Обо мне» */
.hello { align-items: center; }
.hello .ava { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.hello b { font-size: 16px; display: block; }
.aboutbtn { margin-left: auto; padding: 7px 12px; border-radius: 16px; background: var(--bg2); font-weight: 500; font-size: 13px; white-space: nowrap; }
/* рубрики в два ряда, без прокрутки */
.cats { display: grid; gap: 6px; padding-bottom: 10px; }
.catrow { display: grid; grid-template-columns: 1.75fr 1fr 1fr; gap: 6px; }
.catrow.four { grid-template-columns: 1.25fr 1fr 1fr 44px; }
.cats .tab { padding: 8px 4px; text-align: center; border-radius: 12px; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.favtab { display: flex; align-items: center; justify-content: center; gap: 2px; }
.favtab small { font-size: 11px; }
/* сердечко */
.heart { width: 22px; height: 22px; fill: none; stroke: var(--hint); stroke-width: 1.8; stroke-linejoin: round; }
.heart.on { fill: #e5484d; stroke: #e5484d; }
.tab.on .heart { stroke: var(--btn-text); }
.tab.on .heart.on { fill: var(--btn-text); stroke: var(--btn-text); }
.acts { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.fav { padding: 2px; line-height: 0; }
.card .row { align-items: flex-end; }
.titlerow { display: flex; align-items: flex-start; gap: 8px; }
.titlerow .title { flex: 1; }
.big-fav .heart { width: 28px; height: 28px; margin-top: 4px; }
/* обо мне */
.about .hero { width: 100%; aspect-ratio: 3 / 4; max-height: 62vh; object-fit: cover; object-position: 68% 36%; border-radius: var(--radius); }  /* в центре кадра — лицо и плечи */
.about h2 { margin: 12px 0 0; }
.about p { margin: 10px 0; line-height: 1.45; }
.gal2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0 4px; }
.gal2 img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }

/* шапка в одну строку имени */
.hello .nm { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.hello .nm b { display: inline; font-size: 17px; }
.hello .nm .dot, .hello .nm .city { color: var(--hint); font-size: 13px; }
/* сердечко размером с «+», с отступом */
.acts { gap: 8px; }
.fav { width: 38px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 17px; background: var(--bg2); }
.fav .heart { width: 22px; height: 22px; }
.add { min-width: 38px; }
.big-fav { background: none; width: auto; height: auto; }
.big-fav .heart { width: 28px; height: 28px; }
/* лента рубрик */
.sec { display: grid; gap: 10px; }
.sech { margin: 8px 4px 0; font-size: 18px; }
.list { gap: 10px; }

.hello .nm, .hello .sub { width: max-content; }
.hello .sub span { white-space: nowrap; }

.sum.sep { border-top: 1px solid rgba(128,128,128,.3); margin-top: 6px; padding-top: 12px; }

/* поиск: залитое поле с лупой — заметно и в светлой, и в тёмной теме */
.search { background-color: var(--bg2); border: 1px solid rgba(128,128,128,.35); padding-left: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; background-size: 18px; }
.search::placeholder { color: var(--hint); opacity: 1; }
.search:focus { border-color: var(--btn); background-color: var(--bg); }
