/* Шрифт: Onest, загружается отсюда же, чтобы не зависеть от внешних CDN */
@font-face {
  font-family: 'Onest';
  src: url('../fonts/onest-cyrillic-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  src: url('../fonts/onest-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  src: url('../fonts/onest-latin-ext-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+20A0-20C0;
}

:root {
  --bg: #fff;
  --fg: #0b0b0b;
  --muted: #6b6b6b;
  --faint: #9c9c9c;
  --line: #e6e6e6;
  --tile: #f4f4f4;
  --press: #ebebeb;
  --inv: #0b0b0b;
  --on-inv: #fff;
  --scrim: rgba(0, 0, 0, 0.45);

  --gutter: 16px;
  --r: 14px;
  --r-s: 10px;
  --tabs-h: 54px;
  --safe-b: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #000;
  --fg: #f4f4f4;
  --muted: #9b9b9b;
  --faint: #6c6c6c;
  --line: #242424;
  --tile: #141414;
  --press: #1e1e1e;
  --inv: #f4f4f4;
  --on-inv: #000;
  --scrim: rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; }
body {
  font: 400 15px/1.4 'Onest', -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-user-select: none;
  user-select: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
img { display: block; -webkit-user-drag: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

#app {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--tg-viewport-stable-height, 100dvh);
  max-width: 640px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
}
@media (min-width: 680px) {
  #app { border-inline: 1px solid var(--line); }
}
#views { position: absolute; inset: 0; }

/* Экран: своя прокрутка, поэтому позиция сохраняется при возврате назад */
.view {
  position: absolute;
  inset: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  visibility: hidden;
  pointer-events: none;
  scrollbar-width: none;
  padding-top: var(--safe-t);
}
.view::-webkit-scrollbar { display: none; }
.view.is-active { visibility: visible; pointer-events: auto; }
.view.is-leaving { visibility: visible; }
.view.with-tabs { padding-bottom: calc(var(--tabs-h) + var(--safe-b)); }

/* Нижнее меню */
#tabs {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabs-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--bg);
  border-top: 1px solid var(--line);
  transition: transform 0.28s var(--ease);
  z-index: 20;
}
#app[data-tabs='off'] #tabs { transform: translateY(100%); }
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition: color 0.15s;
}
.tab svg { transition: transform 0.2s var(--ease); }
.tab:active svg { transform: scale(0.88); }
.tab.is-active { color: var(--fg); font-weight: 600; }
.tab.is-active svg { stroke-width: 2; }
.tab-icon { position: relative; display: block; height: 24px; }
.count-badge {
  position: absolute;
  top: -4px;
  left: 15px;
  min-width: 17px;
  height: 17px;
  padding: 0 4.5px;
  border-radius: 9px;
  background: var(--fg);
  color: var(--bg);
  border: 2px solid var(--bg);
  box-sizing: content-box;
  font-size: 10px;
  font-weight: 600;
  line-height: 17px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.count-badge[hidden] { display: none; }
.bump { animation: bump 0.36s var(--ease); }
@keyframes bump { 40% { transform: scale(1.32); } }

/* Шапка экрана */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  padding: 0 8px 0 var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.bar.is-stuck { border-bottom-color: var(--line); }
.bar-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s, transform 0.18s;
}
.bar.is-stuck .bar-title { opacity: 1; transform: none; }
.logo { display: block; height: 19px; width: auto; }
.logo-dark { display: none; }
[data-theme='dark'] .logo-light { display: none; }
[data-theme='dark'] .logo-dark { display: block; }
.spacer { flex: 1; }

.icon-btn {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  transition: background 0.15s, transform 0.15s var(--ease);
}
.icon-btn:active { background: var(--press); transform: scale(0.92); }
.icon-btn .count-badge { top: 4px; left: 23px; }
.only-browser { display: none; }
html:not(.in-telegram) .only-browser { display: inline-flex; }
.back-btn { margin-left: -10px; }

.page-title {
  padding: 2px var(--gutter) 14px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.page-sub { padding: 0 var(--gutter) 16px; margin-top: -8px; color: var(--muted); font-size: 14px; }

/* Кнопки */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border-radius: var(--r);
  background: var(--inv);
  color: var(--on-inv);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.16s var(--ease), opacity 0.16s;
}
.btn:active { transform: scale(0.98); opacity: 0.86; }
.btn[disabled] { opacity: 0.35; pointer-events: none; }
.btn-line { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.btn-line:active { background: var(--press); opacity: 1; }
.btn-s { height: 42px; font-size: 14px; border-radius: 12px; width: auto; }
.btn-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.text-btn { color: var(--muted); font-size: 14px; padding: 10px 8px; transition: color 0.15s; }
.text-btn:active { color: var(--fg); }

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 13px;
  border-radius: var(--r-s);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, transform 0.15s var(--ease);
}
.chip:active { transform: scale(0.96); }
.chip.is-on { background: var(--inv); color: var(--on-inv); box-shadow: none; }

.hscroll {
  display: flex;
  gap: 8px;
  overflow: auto hidden;
  padding: 0 var(--gutter);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.hscroll::-webkit-scrollbar { display: none; }

/* Плитка с фото */
.tile { position: relative; background: var(--tile); border-radius: var(--r); overflow: hidden; }
.fade-img { opacity: 0; transition: opacity 0.35s ease; }
.fade-img.is-loaded { opacity: 1; }

/* Карточка товара */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 10px; padding: 0 var(--gutter); }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { position: relative; display: block; min-width: 0; }
.card-link { position: absolute; inset: 0; z-index: 1; border-radius: var(--r); }
.card-tile { aspect-ratio: 1; transition: transform 0.2s var(--ease); }
.card:active .card-tile { transform: scale(0.98); }
.card-tile img { position: absolute; inset: 9%; width: 82%; height: 82%; object-fit: contain; }
.tag {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--inv);
  color: var(--on-inv);
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
}
.tag-off { background: var(--bg); color: var(--fg); }
.card-fav, .card-add {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  transition: transform 0.16s var(--ease);
}
.card-fav::after, .card-add::after { content: ''; position: absolute; inset: -6px; }
.card-fav { top: 4px; right: 4px; color: var(--muted); }
.card-fav.is-on { color: var(--fg); }
.card-fav.is-on svg { fill: currentColor; }
.card-fav:active, .card-add:active { transform: scale(0.84); }
.card-add {
  right: 8px;
  bottom: 8px;
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.card-add.is-on { background: var(--inv); color: var(--on-inv); }
.pop { animation: pop 0.34s var(--ease); }
@keyframes pop { 35% { transform: scale(1.28); } }
.card-title { margin-top: 10px; font-size: 14.5px; line-height: 1.25; font-weight: 500; letter-spacing: -0.01em; }
.card-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-price { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.price { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.price-none { color: var(--muted); font-weight: 500; font-size: 14px; }
.old { color: var(--faint); font-size: 12.5px; text-decoration: line-through; font-variant-numeric: tabular-nums; }

.shelf { padding-top: 34px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 var(--gutter) 14px; }
.shelf-title { font-size: 22px; line-height: 1.15; font-weight: 600; letter-spacing: -0.025em; }
.shelf-link { flex: none; color: var(--muted); font-size: 14px; }
.shelf-track { gap: 10px; scroll-snap-type: x proximity; scroll-padding: 0 var(--gutter); }
.shelf-track .card { flex: 0 0 min(44vw, 176px); scroll-snap-align: start; }

/* Главная: герой */
.hero { position: relative; background: #000; color: #fff; overflow: hidden; }
.hero-track { display: flex; overflow: auto hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide {
  position: relative;
  flex: 0 0 100%;
  height: clamp(440px, 128vw, 560px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}
.hero-link { position: absolute; inset: 0; z-index: 1; }
.hero-text { position: absolute; inset: 34px var(--gutter) auto; z-index: 2; pointer-events: none; }
.hero-kicker { font-size: 13px; color: #a6a6a6; font-weight: 500; }
.hero-title { margin-top: 4px; font-size: clamp(32px, 9.4vw, 44px); line-height: 1.03; font-weight: 600; letter-spacing: -0.035em; }
.hero-price { margin-top: 8px; font-size: 16px; color: #dcdcdc; font-variant-numeric: tabular-nums; }
.hero-slide.is-current .hero-text > * { animation: rise 0.7s var(--ease) both; }
.hero-slide.is-current .hero-title { animation-delay: 0.05s; }
.hero-slide.is-current .hero-price { animation-delay: 0.1s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.hero-stage { position: absolute; inset: 132px 0 64px; will-change: transform; }
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.965) translateY(10px);
  transition: opacity 0.9s ease, transform 1.3s var(--ease);
}
.hero-photo.is-on { opacity: 1; transform: none; }
.hero-foot { position: absolute; inset: auto var(--gutter) 14px; z-index: 3; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.hero-swatch {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #1a1a1a;
  pointer-events: auto;
  transition: transform 0.16s var(--ease);
}
.hero-swatch:active { transform: scale(0.92); }
.hero-swatch img { position: absolute; inset: 4px; width: 30px; height: 30px; object-fit: contain; }
.hero-swatch.is-on { box-shadow: inset 0 0 0 1.5px #fff; }
.hero-color { margin-left: 8px; font-size: 13px; color: #cfcfcf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-bars { position: absolute; inset: 14px var(--gutter) auto; z-index: 4; display: flex; gap: 4px; pointer-events: none; }
.hero-bar { flex: 1; height: 2px; border-radius: 1px; background: rgba(255, 255, 255, 0.24); overflow: hidden; }
.hero-bar i { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: left; }
.hero-bar.is-past i { transform: none; }
.hero-bar.is-now i { animation: barfill var(--slide-ms, 8000ms) linear both; }
.hero.is-paused .hero-bar.is-now i { animation-play-state: paused; }
@keyframes barfill { to { transform: none; } }

/* Главная: разделы */
.home-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px var(--gutter) 14px;
  height: 44px;
  padding: 0 13px;
  border-radius: 12px;
  background: var(--tile);
  color: var(--muted);
  font-size: 15px;
  transition: background 0.15s;
}
.home-search:active { background: var(--press); }
.sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 var(--gutter); }
.sec-tile { display: block; height: 164px; transition: transform 0.2s var(--ease); }
.sec-tile:active { transform: scale(0.98); }
.sec-tile.is-wide { grid-column: span 2; }
.sec-name { position: absolute; top: 13px; left: 14px; z-index: 1; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.sec-count { position: absolute; top: 37px; left: 14px; z-index: 1; font-size: 12.5px; color: var(--muted); }
.sec-tile img { position: absolute; right: -6%; bottom: -12%; width: 78%; height: 86%; object-fit: contain; object-position: right bottom; }
.sec-tile.is-wide img { right: 4%; width: 52%; height: 100%; bottom: -8%; }
.sec-tile img.is-land { right: -14%; bottom: 8px; width: 104%; height: 68%; }
.sec-tile.is-wide img.is-land { right: 4%; width: 62%; height: 80%; bottom: 8px; }

.facts { margin: 34px var(--gutter) 0; border-top: 1px solid var(--line); }
.fact { display: flex; gap: 14px; align-items: flex-start; padding: 15px 0; border-bottom: 1px solid var(--line); }
.fact svg { flex: none; }
.fact b { display: block; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.fact span { display: block; margin-top: 1px; font-size: 13.5px; color: var(--muted); }

.store {
  margin: 34px 0 0;
  padding: 26px var(--gutter) 22px;
  background: #000;
  color: #fff;
}
.store h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.store p { margin-top: 6px; color: #a6a6a6; font-size: 14px; }
.store-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.store .btn { background: #fff; color: #000; }
.store .btn-line { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px #3a3a3a; }

/* Каталог */
.cat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px var(--gutter);
  transition: background 0.15s;
}
.cat-row:active { background: var(--tile); }
.cat-row .tile { flex: none; width: 76px; height: 76px; }
.cat-row img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; }
.cat-body { flex: 1; min-width: 0; }
.cat-name { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.cat-subs { margin-top: 2px; font-size: 13px; line-height: 1.3; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chev { flex: none; color: var(--faint); }

.controls { display: flex; align-items: center; gap: 8px; padding: 0 var(--gutter) 16px; }
.ctrl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px 0 9px;
  border-radius: var(--r-s);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.15s;
}
.ctrl:active { transform: scale(0.97); background: var(--press); }
.ctrl-dot { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--fg); color: var(--bg); font-size: 10.5px; font-weight: 600; line-height: 16px; text-align: center; }
.sub-chips { padding-bottom: 10px; }
.result-count { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }

.empty { padding: 56px 28px; text-align: center; }
.empty h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.empty p { margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.empty .btn { margin: 20px auto 0; width: auto; }

/* Товар */
.p-top { position: absolute; top: calc(var(--safe-t) + 6px); inset-inline: 8px; z-index: 5; display: flex; pointer-events: none; }
.p-top .icon-btn { pointer-events: auto; width: 38px; height: 38px; margin-left: 6px; background: var(--bg); }
.p-top .icon-btn:first-child { margin-left: 0; }
.p-top .icon-btn:active { background: var(--press); }
.p-top .icon-btn svg { width: 21px; height: 21px; }
.p-top .count-badge { top: 1px; left: 21px; }
.p-fav.is-on svg { fill: currentColor; }
.gallery { position: relative; background: var(--tile); }
.gallery-track { display: flex; overflow: auto hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { position: relative; flex: 0 0 100%; aspect-ratio: 1; scroll-snap-align: center; scroll-snap-stop: always; cursor: zoom-in; }
.gallery-slide img { position: absolute; inset: 11% 9% 9%; width: 82%; height: 80%; object-fit: contain; }
.gallery-dots { position: absolute; inset: auto 0 12px; display: flex; justify-content: center; gap: 4px; pointer-events: none; }
.gallery-dots i { width: 18px; height: 2px; border-radius: 1px; background: var(--fg); opacity: 0.18; transition: opacity 0.2s; }
.gallery-dots i.is-on { opacity: 1; }
.is-swap { animation: swap 0.42s var(--ease); }
@keyframes swap { from { opacity: 0; transform: scale(0.985); } }
.p-head { padding: 18px var(--gutter) 0; }
.p-type { font-size: 13px; color: var(--muted); font-weight: 500; }
.p-title { margin-top: 2px; font-size: 27px; line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; }
.p-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin-top: 10px; }
.p-price .price { font-size: 24px; letter-spacing: -0.025em; }
.p-price .old { font-size: 15px; }
.p-off { padding: 2px 6px; border-radius: 6px; background: var(--inv); color: var(--on-inv); font-size: 12px; font-weight: 600; align-self: center; font-variant-numeric: tabular-nums; }
.p-note { margin-top: 8px; color: var(--muted); font-size: 13.5px; }
.opt { padding-top: 22px; }
.opt-head { display: flex; gap: 8px; padding: 0 var(--gutter) 10px; font-size: 14px; }
.opt-label { color: var(--muted); }
.opt-value { font-weight: 500; }
.swatch {
  flex: none;
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  background: var(--tile);
  transition: transform 0.15s var(--ease), box-shadow 0.15s;
}
.swatch img { position: absolute; inset: 7px; width: 54px; height: 54px; object-fit: contain; }
.swatch:active { transform: scale(0.95); }
.swatch.is-on { box-shadow: inset 0 0 0 1.5px var(--fg); }
.swatch.is-off img { opacity: 0.42; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; padding: 0 var(--gutter); }
.opt-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 56px;
  padding: 7px 11px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  transition: transform 0.15s var(--ease), box-shadow 0.15s;
}
.opt-chip:active { transform: scale(0.97); }
.opt-chip b { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.opt-chip span { display: block; margin-top: 1px; font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.opt-chip.is-on { box-shadow: inset 0 0 0 1.5px var(--fg); }
.opt-chip.is-off { box-shadow: none; outline: 1px dashed var(--line); outline-offset: -1px; }
.opt-chip.is-off b { color: var(--faint); font-weight: 500; }
.opt-chip.is-text { min-height: 44px; }

.rows { margin: 26px var(--gutter) 0; border-top: 1px solid var(--line); }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  transition: opacity 0.15s;
}
.row:active { opacity: 0.55; }
.row svg:first-child { flex: none; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-size: 14.5px; font-weight: 500; letter-spacing: -0.005em; }
.row-main span { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); }

.p-section { padding: 30px var(--gutter) 0; }
.p-section h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; }
.spec { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; text-align: right; font-weight: 500; }
dl { margin: 0; }
.more-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 1px;
  transition: opacity 0.15s;
}
.more-btn:active { opacity: 0.5; }
.desc { color: var(--muted); font-size: 14.5px; line-height: 1.5; max-height: 160px; overflow: hidden; position: relative; }
.desc.is-open { max-height: none; }
.desc:not(.is-open)::after { content: ''; position: absolute; inset: auto 0 0; height: 70px; background: linear-gradient(to bottom, transparent, var(--bg)); }
.desc h3 { color: var(--fg); font-size: 16px; font-weight: 600; letter-spacing: -0.015em; margin: 16px 0 4px; }
.desc h3:first-child { margin-top: 0; }
.desc p { margin: 0 0 8px; }
.desc ul { margin: 0 0 8px; padding-left: 18px; }
.skeleton { height: 14px; margin: 12px 0; border-radius: 4px; background: var(--tile); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* Панель покупки */
.buybar {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding: 10px var(--gutter) calc(10px + var(--safe-b));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.buybar-price { flex: 1; min-width: 0; }
.buybar-price .price { display: block; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; }
.buybar-price .old { display: block; font-size: 12.5px; line-height: 1.1; }
.buybar .btn { flex: 0 0 auto; width: 58%; overflow: hidden; }
.buybar .btn.is-done { pointer-events: none; }
.btn-label { display: inline-flex; align-items: center; gap: 8px; animation: rise 0.28s var(--ease); }

.stepper {
  flex: none;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
  user-select: none;
}
.stepper button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  transition: background 0.12s;
}
.stepper button:active { background: var(--press); }
.stepper button[disabled] { color: var(--faint); pointer-events: none; }
.stepper output { min-width: 22px; text-align: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper-l button { width: 50px; height: 50px; border-radius: var(--r); }

/* Корзина */
.cart-item { overflow: hidden; }
.cart-inner { display: flex; gap: 12px; padding: 12px var(--gutter); }
.cart-thumb { flex: none; width: 86px; height: 86px; display: block; }
.cart-thumb img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; }
.cart-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart-title { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; }
.cart-label { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.cart-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cart-foot .stepper button { width: 34px; height: 34px; }
.cart-sum { text-align: right; }
.cart-sum .old { display: block; line-height: 1.1; }
.cart-remove { flex: none; align-self: flex-start; margin: -8px -9px 0 0; color: var(--faint); }
.summary { margin: 14px var(--gutter) 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14.5px; }
.sum-row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.sum-total { margin-top: 6px; color: var(--fg); font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.sticky-cta {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin-top: 18px;
  padding: 10px var(--gutter);
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.with-safe { padding-bottom: calc(10px + var(--safe-b)); }

/* Форма заказа */
.form { padding: 0 var(--gutter); display: grid; gap: 14px; }
.form-group-title { margin-top: 12px; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.field { display: block; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.field-action { color: var(--fg); font-weight: 500; font-size: 13px; border-bottom: 1px solid var(--line); }
.input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--tile);
  box-shadow: inset 0 0 0 1px transparent;
  font-size: 16px;
  transition: box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
textarea.input { height: 84px; padding: 13px 14px; resize: none; line-height: 1.35; }
.input:focus, .input:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--fg); background: var(--bg); }
.input::placeholder { color: var(--faint); }
.field.has-error .input { box-shadow: inset 0 0 0 1.5px var(--fg); }
.field-error { display: none; margin-top: 5px; font-size: 13px; font-weight: 500; }
.field.has-error .field-error { display: block; animation: rise 0.2s var(--ease); }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 12px; background: var(--tile); }
.seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 10px; background: var(--inv); transition: transform 0.26s var(--ease); }
.seg[data-i='1'] .seg-thumb { transform: translateX(100%); }
.seg button { position: relative; height: 42px; font-size: 14.5px; font-weight: 500; transition: color 0.2s; }
.seg button.is-on { color: var(--on-inv); font-weight: 600; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.switch-row b { display: block; font-size: 14.5px; font-weight: 500; }
.switch-row small { display: block; margin-top: 1px; color: var(--muted); font-size: 13px; }
.switch { position: relative; flex: none; width: 46px; height: 28px; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 14px; background: var(--press); transition: background 0.2s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.22s var(--ease); }
.switch input:checked + i { background: var(--inv); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--on-inv); }
.hint-box { padding: 12px 14px; border-radius: 12px; background: var(--tile); font-size: 14px; }
.hint-box span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.small-print { color: var(--muted); font-size: 12px; line-height: 1.4; }
.small-print a { text-decoration: underline; text-underline-offset: 2px; }
.reveal-enter { animation: rise 0.28s var(--ease); }

/* Заказ принят */
.done { display: flex; flex-direction: column; min-height: 100%; padding: 56px var(--gutter) calc(16px + var(--safe-b)); }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--inv); color: var(--on-inv); display: flex; align-items: center; justify-content: center; animation: pop 0.5s var(--ease); }
.done-mark path { stroke-dasharray: 26; stroke-dashoffset: 26; animation: draw 0.45s 0.18s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done h1 { margin-top: 22px; font-size: 30px; line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; }
.done p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.done-btns { margin-top: auto; padding-top: 28px; display: grid; gap: 8px; }

/* Поиск */
.search-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px var(--gutter); background: var(--bg); }
.search-field { flex: 1; min-width: 0; position: relative; }
.search-field > svg { position: absolute; top: 10px; left: 11px; color: var(--muted); pointer-events: none; }
.search-input { height: 44px; padding: 0 40px; font-size: 16px; }
.search-clear { position: absolute; top: 1px; right: 1px; color: var(--muted); }
.search-label { padding: 14px var(--gutter) 10px; font-size: 13px; color: var(--muted); }

/* Контакты */
.legal { padding: 22px var(--gutter) 24px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* Шторка */
.scrim { position: absolute; inset: 0; background: var(--scrim); z-index: 40; animation: fadein 0.22s ease; }
@keyframes fadein { from { opacity: 0; } }
.sheet {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 41;
  display: flex;
  flex-direction: column;
  max-height: 86%;
  border-radius: 20px 20px 0 0;
  background: var(--bg);
  animation: sheetin 0.32s var(--ease);
  will-change: transform;
}
@keyframes sheetin { from { transform: translateY(100%); } }
.sheet-grip { flex: none; padding: 8px 0 2px; touch-action: none; }
.sheet-grip::before { content: ''; display: block; width: 36px; height: 4px; margin: 0 auto; border-radius: 2px; background: var(--line); }
.sheet-head { flex: none; display: flex; align-items: center; min-height: 48px; padding: 0 8px 0 var(--gutter); touch-action: none; }
.sheet-title { flex: 1; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 var(--gutter) 16px; overscroll-behavior: contain; font-size: 14.5px; }
.sheet-body > p { color: var(--muted); line-height: 1.45; margin-bottom: 8px; }
.sheet-foot { flex: none; padding: 10px var(--gutter) calc(10px + var(--safe-b)); border-top: 1px solid var(--line); }
.sheet-foot.is-plain { border-top: 0; }
.sort-opt { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 50px; border-bottom: 1px solid var(--line); font-size: 15px; text-align: left; }
.sort-opt:last-child { border-bottom: 0; }
.sort-opt:active { opacity: 0.55; }
.filter-block { padding: 14px 0; border-bottom: 1px solid var(--line); }
.filter-block:last-child { border-bottom: 0; }
.filter-block h3 { margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filter-prices .input { height: 44px; font-size: 15px; }

/* Просмотр фото */
.lightbox { position: absolute; inset: 0; z-index: 60; background: var(--tile); color: var(--fg); animation: fadein 0.2s ease; touch-action: none; }
.lb-track { display: flex; height: 100%; overflow: auto hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; scroll-snap-align: center; scroll-snap-stop: always; overflow: hidden; touch-action: pan-x; }
.lb-slide img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; padding: 8px; transform-origin: 0 0; will-change: transform; }
.lb-close { position: absolute; top: calc(var(--safe-t) + 8px); right: 8px; z-index: 2; background: var(--bg); }
.lb-count { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 18px); text-align: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }

/* Уведомление */
.toast {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabs-h) + var(--safe-b) + 10px);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--inv);
  color: var(--on-inv);
  font-size: 14px;
  font-weight: 500;
  animation: toastin 0.3s var(--ease);
}
.toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity 0.18s, transform 0.18s; }
@keyframes toastin { from { opacity: 0; transform: translateY(14px); } }
.toast button { flex: none; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
#app[data-tabs='off'] .toast { bottom: calc(var(--safe-b) + 84px); }

.fly { position: fixed; z-index: 80; pointer-events: none; object-fit: contain; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
