/* Магазин мастер-классов — Telegram Mini App */
:root {
  --bg: #F3F1EE; --card: #FFFFFF; --soft: #ECE8E3; --soft-2: #E4DFD8;
  --text: #1C1F1E; --muted: #7A746D; --faint: #A9A29A; --line: #E6E0D9;
  --ink: #1E2422; --on-ink: #FFFFFF;
  --accent: #B5835A; --accent-soft: #F3E8DC; --on-accent: #FFFFFF;
  --club-a: #2B2521; --club-b: #6A5140; --on-club: #FBF6F0;
  --ok: #3E8E5E; --ok-soft: #E3F1E8; --warn: #B8741A; --warn-soft: #FBEEDB; --bad: #C2453D; --bad-soft: #FBE5E3;
  --shadow: 0 1px 2px rgba(30, 24, 18, .04), 0 8px 24px rgba(30, 24, 18, .06);
  --shadow-up: 0 -8px 30px rgba(30, 24, 18, .08);
  --r-xl: 28px; --r-lg: 22px; --r-md: 16px; --r-sm: 12px;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --safe-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --tabs-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121110; --card: #1C1A18; --soft: #262320; --soft-2: #2F2B27;
  --text: #F4F0EB; --muted: #A69F97; --faint: #6F6862; --line: #2E2A26;
  --ink: #F4F0EB; --on-ink: #161412;
  --accent: #D4A67E; --accent-soft: #3A2E24; --on-accent: #1A1512;
  --club-a: #2A2420; --club-b: #57422F; --on-club: #FBF6F0;
  --ok: #6CC08E; --ok-soft: #1E3326; --warn: #E3A452; --warn-soft: #3A2C17; --bad: #F07A72; --bad-soft: #3D2020;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-up: 0 -8px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
/* палитры (меняются в панели → Оформление) */
:root[data-palette="vanilla"] { --bg: #FBF7EC; --soft: #F3ECDA; --soft-2: #EDE3CC; --line: #EEE5D0; --accent: #D9468F; --accent-soft: #FBE1EE; --ink: #2B2118; --club-a: #3A2230; --club-b: #A2416F; }
:root[data-palette="vanilla"][data-theme="dark"] { --bg: #15120D; --card: #1E1A13; --soft: #2A241A; --soft-2: #332B1F; --line: #30291E; --accent: #F07DB5; --accent-soft: #3D2030; --ink: #FBF4E4; --on-ink: #18140E; }
:root[data-palette="sage"] { --bg: #F0F2ED; --soft: #E5E9E1; --soft-2: #DCE1D6; --line: #E0E4DA; --accent: #5F7F5E; --accent-soft: #E2EBDF; --ink: #1F2A22; --club-a: #1F2A22; --club-b: #4E6A4D; }
:root[data-palette="sage"][data-theme="dark"] { --bg: #101310; --card: #191D19; --soft: #232823; --soft-2: #2B312B; --line: #2A302A; --accent: #9DC19B; --accent-soft: #24332A; --ink: #EEF3EC; --on-ink: #121512; }
:root[data-palette="rose"] { --bg: #F7F0EF; --soft: #EFE4E2; --soft-2: #E8D9D6; --line: #EDE0DD; --accent: #BF5F65; --accent-soft: #F7E1E1; --ink: #2A1D1E; --club-a: #2E1D20; --club-b: #8C4A52; }
:root[data-palette="rose"][data-theme="dark"] { --bg: #141010; --card: #1E1818; --soft: #2A2222; --soft-2: #332828; --line: #302626; --accent: #EC9298; --accent-soft: #3B2426; --ink: #F8EEEE; --on-ink: #161112; }
:root[data-palette="graphite"] { --bg: #F2F2F1; --soft: #E8E8E6; --soft-2: #DEDEDC; --line: #E3E3E1; --accent: #2F3130; --accent-soft: #E6E6E4; --ink: #151716; --club-a: #191B1A; --club-b: #4A4D4B; }
:root[data-palette="graphite"][data-theme="dark"] { --bg: #0F0F0F; --card: #191919; --soft: #232323; --soft-2: #2C2C2C; --line: #2A2A2A; --accent: #E8E8E6; --accent-soft: #2E2E2E; --on-accent: #111; --ink: #F2F2F1; --on-ink: #111; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: -.02em; margin: 0; line-height: 1.15; }
p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.view { padding: calc(14px + var(--safe-t)) 0 calc(var(--tabs-h) + 28px + var(--safe-b)); animation: enter .28s ease; }
.view.no-tabs { padding-bottom: calc(120px + var(--safe-b)); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pad { padding-left: 16px; padding-right: 16px; }

/* ---------- кнопки ---------- */
.tap { transition: transform .15s ease, opacity .15s ease, background-color .2s; }
.tap:active { transform: scale(.97); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 22px;
  border-radius: 16px; background: var(--ink); color: var(--on-ink); font-weight: 600; font-size: 16px;
  transition: transform .15s ease, opacity .2s, background-color .2s; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--soft); color: var(--text); }
.btn.line { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.accent { background: var(--accent); color: var(--on-accent); }
.btn.light { background: var(--on-club); color: #1E1A16; }
.btn.sm { height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn.md { height: 46px; padding: 0 18px; border-radius: 14px; font-size: 15px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; display: inline-grid; place-items: center; background: var(--card);
  color: var(--text); box-shadow: var(--shadow); position: relative; flex: none;
}
.icon-btn.flat { box-shadow: none; background: var(--soft); }
.icon-btn.glass { background: rgba(255, 255, 255, .82); color: #1C1F1E; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: none; }
.icon-btn svg, .btn svg { width: 22px; height: 22px; }
.btn.sm svg { width: 18px; height: 18px; }
.badge-dot {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--bg);
}
.bump { animation: bump .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 30% { transform: scale(1.25); } }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- шапка ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 16px 0; }
.hello { font-size: 14px; color: var(--muted); }
.page-title { padding: 10px 16px 0; }
.page-title h1 { font-size: 30px; }
.page-title p { margin-top: 6px; color: var(--muted); }
.title-xl { font-size: 32px; line-height: 1.08; }

/* ---------- поиск ---------- */
.search {
  margin: 16px 16px 0; height: 50px; border-radius: 16px; background: var(--card); display: flex; align-items: center; gap: 10px;
  padding: 0 14px; color: var(--faint); box-shadow: var(--shadow);
}
.search svg { width: 20px; height: 20px; flex: none; }
.search input { flex: 1; border: 0; outline: 0; background: none; height: 100%; font-size: 15px; color: var(--text); min-width: 0; }
.search input::placeholder { color: var(--faint); font-style: italic; }
.search .clear { color: var(--muted); display: grid; place-items: center; }

/* ---------- секции ---------- */
.section { margin-top: 30px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 0 16px 14px; }
.section-head h2 { font-size: 21px; }
.section-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.section-head .more { color: var(--muted); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.section-head .more svg { width: 16px; height: 16px; }

.rail {
  display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 0 16px 6px; scrollbar-width: none;
  scroll-padding: 0 16px;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: none; }

/* ---------- картинки ---------- */
.ph { position: relative; overflow: hidden; background: var(--soft); }
.ph img, .ph video { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.ph img.ok, .ph video { opacity: 1; }
.ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; pointer-events: none; }
.ph.loaded::after { display: none; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.r16x9 { aspect-ratio: 16 / 9; }

/* ---------- баннер ---------- */
.hero { margin: 18px 16px 0; border-radius: var(--r-xl); overflow: hidden; background: var(--card); box-shadow: var(--shadow); position: relative; }
.hero .ph { aspect-ratio: 16 / 9; }
.hero-sheet {
  position: relative; margin-top: -22px; background: var(--card); border-radius: 26px 26px 0 0; padding: 22px 20px 20px; text-align: center;
}
.hero-sheet h2 { font-size: 24px; }
.hero-sheet p { color: var(--muted); margin-top: 8px; font-size: 14px; }
.hero-sheet .btn { margin-top: 16px; }
.hero-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.hero-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--soft-2); transition: width .25s, background .25s; }
.hero-dots i.on { width: 18px; background: var(--ink); }
.banners { display: flex; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.banners::-webkit-scrollbar { display: none; }
.banners > .hero { flex: 0 0 calc(100% - 32px); scroll-snap-align: center; }
.banners > .hero + .hero { margin-left: 0; }

/* ---------- категории ---------- */
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px; }
.cat-tile { border-radius: var(--r-lg); overflow: hidden; background: var(--card); box-shadow: var(--shadow); text-align: left; }
.cat-tile .mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; aspect-ratio: 16 / 10; overflow: hidden; }
.cat-tile .mosaic .ph { height: 100%; }
.cat-tile .cat-img { aspect-ratio: 5 / 4; }
.r5x4 { aspect-ratio: 5 / 4; }
.cat-head { padding: 12px 16px 2px; }
.cat-head button { display: block; width: 100%; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.cat-head p { color: var(--muted); font-size: 13.5px; margin-top: 10px; }
.cat-tile div.t { padding: 12px 14px 14px; }
.cat-tile b { display: block; font-family: var(--display); font-weight: 400; font-size: 15px; letter-spacing: -.01em; }
.cat-tile span { color: var(--muted); font-size: 13px; }

/* ---------- карточки МК ---------- */
.pcard { background: var(--card); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; text-align: left; position: relative; }
.pcard .ph { aspect-ratio: 16 / 9; }
.pcard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard h3 { font-size: 16px; line-height: 1.25; }
.pcard .short { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pcard .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.pcard.wide { width: min(80vw, 330px); }
.pcard.mini { width: 220px; }
.pcard.mini h3 { font-size: 14px; }
.pcard.mini .body { padding: 12px 14px 14px; }
.price { font-weight: 700; font-size: 18px; letter-spacing: -.01em; white-space: nowrap; }
.price s { color: var(--faint); font-weight: 500; font-size: 14px; margin-left: 6px; }
.price.sm { font-size: 15px; }
.tags { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; z-index: 2; }
.tag {
  height: 26px; padding: 0 10px; border-radius: 13px; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  background: rgba(255, 255, 255, .9); color: #1C1F1E; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.tag.hit { background: var(--accent); color: var(--on-accent); }
.tag.new { background: #1E2422; color: #fff; }
.tag.own { background: var(--ok); color: #fff; }
.tag.sale { background: var(--bad); color: #fff; }
.chip { height: 24px; padding: 0 9px; border-radius: 8px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; white-space: nowrap; }
.add-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); color: var(--text); display: grid; place-items: center; flex: none; }
.add-btn svg { width: 20px; height: 20px; }
.add-btn.in { background: var(--ink); color: var(--on-ink); }

.grid { display: grid; gap: 14px; padding: 0 16px; }
.grid.two { grid-template-columns: 1fr 1fr; gap: 12px; }
.grid.two .pcard .body { padding: 10px 12px 12px; gap: 4px; }
.grid.two .pcard h3 { font-size: 13.5px; }
.grid.two .pcard .short, .grid.two .pcard .meta { display: none; }
.grid.two .pcard .price { font-size: 15px; }
.grid.two .add-btn { width: 34px; height: 34px; border-radius: 10px; }
.grid.two .tag { height: 22px; padding: 0 8px; font-size: 11px; }
.grid.two .tags { top: 8px; left: 8px; }

/* ---------- каталог ---------- */
.sticky-tools { position: sticky; top: var(--safe-t); z-index: 20; background: var(--bg); padding-bottom: 6px; transition: transform .28s ease, box-shadow .28s ease; }
.sticky-tools.stuck { box-shadow: 0 8px 18px -10px rgba(30, 24, 18, .25); }
.sticky-tools.away { transform: translateY(calc(-100% - var(--safe-t) - 2px)); box-shadow: none; }
.tabs { display: flex; gap: 22px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; padding: 14px 16px 0; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; padding: 4px 0 12px; color: var(--muted); font-weight: 600; white-space: nowrap; font-size: 15px; }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px; border-radius: 2px; background: var(--ink); }
.toolrow { display: flex; align-items: center; gap: 8px; padding: 12px 16px 4px; }
.sorts { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; flex: 1; }
.sorts::-webkit-scrollbar { display: none; }
.pill { height: 34px; padding: 0 14px; border-radius: 17px; background: var(--card); color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); }
.pill.on { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.count-line { padding: 6px 16px 12px; color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 50px 30px; color: var(--muted); }
.empty .em { font-size: 44px; margin-bottom: 10px; }
.empty h3 { color: var(--text); font-size: 18px; margin-bottom: 8px; }
.empty .btn { margin-top: 18px; }

/* ---------- карточка МК (страница) ---------- */
.pp-gallery { position: relative; background: var(--soft); }
.pp-slides { display: flex; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.pp-slides::-webkit-scrollbar { display: none; }
.pp-slides > .ph { flex: 0 0 100%; aspect-ratio: 16 / 11; scroll-snap-align: center; }
.pp-slides > .ph img { object-fit: cover; }
.pp-nav { position: absolute; top: calc(12px + var(--safe-t)); left: 16px; right: 16px; display: flex; justify-content: space-between; z-index: 3; }
.pp-dots { position: absolute; bottom: 42px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 3; }
.pp-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.6); transition: width .25s, background .25s; }
.pp-dots i.on { width: 18px; background: #fff; }
.play-badge { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.play-badge span { width: 58px; height: 58px; border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; color: #fff; backdrop-filter: blur(6px); }
.pp-sheet { position: relative; margin-top: -28px; background: var(--card); border-radius: 28px 28px 0 0; padding: 12px 18px 8px; z-index: 2; min-height: 50vh; }
.grabber { width: 40px; height: 4px; border-radius: 2px; background: var(--soft-2); margin: 0 auto 16px; }
.pp-sheet h1 { font-size: 25px; }
.pp-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pp-tags .tag { position: static; box-shadow: inset 0 0 0 1px var(--line); }
.pp-short { color: var(--muted); margin-top: 10px; font-size: 15px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.spec { background: var(--soft); border-radius: 14px; padding: 11px 13px; }
.spec small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.spec b { display: block; font-weight: 600; font-size: 14px; margin-top: 2px; }
.block { margin-top: 26px; }
.block h2 { font-size: 18px; margin-bottom: 12px; }
.block p { color: var(--text); }
.block .note { color: var(--muted); font-size: 14px; margin-top: 8px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks li svg { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 1px; }
.material { background: var(--soft); border-radius: 16px; padding: 14px 16px; white-space: pre-line; font-size: 14px; }
.facts { display: grid; gap: 10px; }
.fact { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.fact .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.fact .ic svg { width: 20px; height: 20px; }
.fact b { display: block; font-size: 14px; }
.fact span { color: var(--muted); font-size: 13.5px; }
.reviews .rv { width: 116px; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; }
.video-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--soft); width: 100%; text-align: left; }
.video-card .ic { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; flex: none; }
.video-card .ic svg { width: 20px; height: 20px; }
.video-card b { display: block; }
.video-card span { color: var(--muted); font-size: 13px; }
.parts { display: grid; gap: 10px; }
.part-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); width: 100%; text-align: left; }
.part-row .ph { width: 86px; aspect-ratio: 16 / 10; border-radius: 10px; flex: none; }
.part-row b { display: block; font-size: 14px; }
.club-hint { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 20px; background: linear-gradient(135deg, var(--club-a), var(--club-b)); color: var(--on-club); width: 100%; text-align: left; }
.club-hint .ic { width: 44px; height: 44px; border-radius: 14px; background: rgba(255,255,255,.14); display: grid; place-items: center; flex: none; }
.club-hint .ic svg { width: 22px; height: 22px; }
.club-hint b { display: block; }
.club-hint span { opacity: .8; font-size: 13px; }

/* ---------- нижняя панель покупки ---------- */
.buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--card); box-shadow: var(--shadow-up);
  padding: 14px 16px calc(14px + var(--safe-b)); display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 0 auto;
  border-radius: 24px 24px 0 0; animation: up .3s ease both;
}
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
.buybar.float {
  left: 12px; right: 12px; bottom: calc(var(--tabs-h) + 10px + var(--safe-b)); border-radius: 22px; padding: 10px 10px 10px 18px;
  box-shadow: 0 10px 34px rgba(30, 24, 18, .16); max-width: 536px; animation: pop .3s cubic-bezier(.3,1.4,.5,1) both;
}
.buybar.float .btn { height: 48px; }
.has-float { padding-bottom: calc(var(--tabs-h) + 110px + var(--safe-b)) !important; }
.rail.similar { margin: 0 -18px; padding: 0 18px 18px; scroll-padding: 0 18px; }
.buybar .price { font-size: 24px; font-family: var(--display); font-weight: 400; letter-spacing: -.03em; }
.buybar .price small { display: block; font-family: var(--body); font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.buybar .btn { flex: 1; }
.buybar .icon-btn { box-shadow: inset 0 0 0 1.5px var(--line); background: var(--card); width: 52px; height: 52px; border-radius: 16px; }
.buybar .icon-btn.in { background: var(--ink); color: var(--on-ink); box-shadow: none; }

/* ---------- плашка корзины над вкладками ---------- */
.cartbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + 10px + var(--safe-b)); z-index: 45; max-width: 536px; margin: 0 auto;
  background: var(--ink); color: var(--on-ink); border-radius: 18px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: pop .3s cubic-bezier(.3,1.4,.5,1) both;
}
@keyframes pop { from { transform: translateY(20px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.cartbar .t { flex: 1; min-width: 0; }
.cartbar .t b { display: block; font-size: 14px; }
.cartbar .t span { opacity: .7; font-size: 12.5px; }
.cartbar .btn { height: 42px; background: var(--on-ink); color: var(--ink); border-radius: 12px; font-size: 14px; padding: 0 16px; }

/* ---------- вкладки ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b); max-width: 560px; margin: 0 auto;
}
.tabbar nav { display: grid; grid-template-columns: repeat(4, 1fr); height: var(--tabs-h); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 11px; font-weight: 700; position: relative; }
.tabbar a svg { width: 24px; height: 24px; transition: transform .2s; }
.tabbar a.on { color: var(--text); }
.tabbar a.on svg { transform: translateY(-1px); }
.tabbar a .badge-dot { top: 6px; right: calc(50% - 22px); }

/* ---------- клуб ---------- */
.club-banner { margin: 22px 16px 0; border-radius: var(--r-xl); overflow: hidden; background: linear-gradient(140deg, var(--club-a), var(--club-b)); color: var(--on-club); position: relative; box-shadow: var(--shadow); }
.club-banner .in { padding: 22px 20px 20px; position: relative; z-index: 1; }
.club-banner .kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.club-banner h2 { font-size: 24px; margin-top: 10px; color: var(--on-club); }
.club-banner ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; font-size: 14px; }
.club-banner li { display: flex; gap: 10px; align-items: flex-start; opacity: .92; }
.club-banner li svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.club-banner .foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.club-banner .foot small { opacity: .75; font-size: 12.5px; display: block; }
.club-banner .foot b { font-size: 17px; }
.club-banner .yarn { position: absolute; right: -40px; top: -40px; width: 190px; height: 190px; opacity: .12; color: #fff; }
.club-hero { position: relative; }
.club-hero .ph { aspect-ratio: 16 / 9; width: 100%; }
.club-sheet { position: relative; margin-top: -30px; background: var(--bg); border-radius: 28px 28px 0 0; padding: 12px 0 0; }
.club-sheet .head { padding: 0 16px; }
.club-sheet h1 { font-size: 27px; }
.club-sheet .sub { color: var(--muted); margin-top: 8px; }
.price-note { display: inline-flex; gap: 8px; align-items: center; margin-top: 14px; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13.5px; }
.benefits { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
.benefit { background: var(--card); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); }
.benefit .ic { width: 40px; height: 40px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 12px; }
.benefit .ic svg { width: 22px; height: 22px; }
.benefit b { display: block; font-size: 14.5px; line-height: 1.25; }
.benefit span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; line-height: 1.35; }
.plans { display: grid; gap: 10px; padding: 0 16px; }
.plan { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); text-align: left; width: 100%; position: relative; transition: box-shadow .2s, transform .15s; }
.plan.on { box-shadow: inset 0 0 0 2px var(--ink); }
.plan .radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--soft-2); flex: none; display: grid; place-items: center; transition: box-shadow .2s; }
.plan.on .radio { box-shadow: inset 0 0 0 7px var(--ink); }
.plan .t { flex: 1; min-width: 0; }
.plan .t b { display: block; font-size: 15.5px; }
.plan .t span { color: var(--muted); font-size: 13px; }
.plan .p { text-align: right; }
.plan .p b { display: block; font-size: 17px; }
.plan .p span { color: var(--muted); font-size: 12px; }
.plan .flag { position: absolute; top: -9px; right: 16px; height: 20px; padding: 0 8px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; display: flex; align-items: center; }
.plan.trial { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px transparent; }
.plan.trial.on { box-shadow: inset 0 0 0 2px var(--accent); }
.plan.trial.on .radio { box-shadow: inset 0 0 0 7px var(--accent); }
.status-card { margin: 18px 16px 0; padding: 18px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.status-card .row { display: flex; align-items: center; gap: 16px; }
.ring { width: 64px; height: 64px; flex: none; position: relative; }
.ring svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; font-family: var(--display); font-weight: 400; }
.status-card h3 { font-size: 16px; }
.status-card p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.status-card .actions { display: grid; gap: 8px; margin-top: 16px; }
.pill-ok { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 700; }
.included { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px; }
.included .chip { height: 32px; padding: 0 12px; border-radius: 12px; background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; }
.included .chip.star { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.faq { padding: 0 16px; display: grid; gap: 8px; }
.faq details { background: var(--card); border-radius: 18px; padding: 0 16px; box-shadow: inset 0 0 0 1px var(--line); }
.faq summary { list-style: none; padding: 16px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 20px; height: 20px; flex: none; transition: transform .2s; color: var(--muted); }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq details p { padding: 0 0 16px; color: var(--muted); font-size: 14px; }

/* ---------- моё ---------- */
.profile { display: flex; align-items: center; gap: 14px; padding: 8px 16px 0; }
.avatar { width: 58px; height: 58px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--display); font-size: 22px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile h1 { font-size: 22px; }
.profile p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.list { margin: 0 16px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; width: 100%; text-align: left; position: relative; }
.li + .li::before { content: ""; position: absolute; top: 0; left: 68px; right: 0; height: 1px; background: var(--line); }
.li .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; flex: none; color: var(--text); }
.li .ic svg { width: 20px; height: 20px; }
.li .t { flex: 1; min-width: 0; }
.li .t b { display: block; font-weight: 600; font-size: 15px; }
.li .t span { color: var(--muted); font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li > svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.owned { display: grid; gap: 10px; padding: 0 16px; }
.owned-row { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); }
.owned-row .ph { width: 92px; aspect-ratio: 16 / 10; border-radius: 12px; flex: none; }
.owned-row .t { flex: 1; min-width: 0; }
.owned-row .t b { display: block; font-size: 14.5px; line-height: 1.25; }
.owned-row .t span { color: var(--muted); font-size: 12.5px; }
.orders { display: grid; gap: 10px; padding: 0 16px; }
.order { background: var(--card); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); }
.order .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.order .top small { color: var(--muted); font-size: 12.5px; }
.order .items { margin-top: 6px; font-size: 14px; }
.order .bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; }
.st { height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; }
.st.paid { background: var(--ok-soft); color: var(--ok); }
.st.pending { background: var(--warn-soft); color: var(--warn); }
.st.refunded, .st.cancelled { background: var(--soft); color: var(--muted); }

/* ---------- корзина ---------- */
.cart-items { display: grid; gap: 10px; padding: 0 16px; }
.cart-row { display: flex; gap: 12px; align-items: center; background: var(--card); padding: 10px; border-radius: 18px; box-shadow: var(--shadow); animation: enter .25s ease both; }
.cart-row .ph { width: 104px; aspect-ratio: 16 / 10; border-radius: 12px; flex: none; }
.cart-row .t { flex: 1; min-width: 0; }
.cart-row .t b { display: block; font-size: 14.5px; line-height: 1.25; }
.cart-row .t .price { font-size: 15px; margin-top: 6px; display: block; }
.cart-row .t .warn { color: var(--warn); font-size: 12.5px; font-weight: 600; display: block; margin-top: 4px; }
.cart-row .rm { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); flex: none; }
.cart-row .rm svg { width: 18px; height: 18px; }
.summary { margin: 18px 16px 0; padding: 18px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); }
.sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; color: var(--muted); font-size: 14px; }
.sum-row.total { color: var(--text); font-weight: 700; font-size: 18px; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--line); }
.sum-row.disc { color: var(--ok); }
.promo { display: flex; gap: 8px; margin-top: 12px; }
.promo input { flex: 1; min-width: 0; height: 46px; border-radius: 14px; border: 0; background: var(--soft); padding: 0 14px; outline: 0; text-transform: uppercase; }
.promo input::placeholder { text-transform: none; color: var(--faint); }
.promo-msg { font-size: 13px; margin-top: 8px; }
.promo-msg.ok { color: var(--ok); }
.promo-msg.bad { color: var(--bad); }
.link-btn { color: var(--accent); font-weight: 700; font-size: 14px; }

/* ---------- шторка ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(15, 12, 10, .45); z-index: 90; animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; background: var(--card); border-radius: 28px 28px 0 0; max-width: 560px; margin: 0 auto;
  padding: 10px 18px calc(18px + var(--safe-b)); max-height: 92vh; overflow-y: auto; animation: up .32s cubic-bezier(.2, .9, .3, 1) both;
}
.sheet.out { animation: down .22s ease both; }
.sheet-back.out { animation: fade .22s ease reverse both; }
@keyframes down { to { transform: translateY(100%); } }
.sheet h2 { font-size: 22px; margin-bottom: 4px; }
.sheet .lead { color: var(--muted); font-size: 14px; }
.sheet-items { margin: 16px 0 6px; display: grid; gap: 10px; }
.sheet-item { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.sheet-item span:first-child { min-width: 0; }
.methods { display: grid; gap: 8px; margin-top: 16px; }
.method { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; box-shadow: inset 0 0 0 1.5px var(--line); text-align: left; width: 100%; }
.method.on { box-shadow: inset 0 0 0 2px var(--ink); }
.method .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; flex: none; font-size: 20px; }
.method .ic svg { width: 22px; height: 22px; }
.method .t { flex: 1; }
.method .t b { display: block; font-size: 15px; }
.method .t span { color: var(--muted); font-size: 12.5px; }
.method .radio { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--soft-2); }
.method.on .radio { box-shadow: inset 0 0 0 6px var(--ink); }
.consent { color: var(--faint); font-size: 12px; margin-top: 14px; line-height: 1.5; }
.consent a { color: var(--muted); text-decoration: underline; }
.sheet .btn.block { margin-top: 16px; }
.hint { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--text); font-size: 13px; margin-top: 14px; }
.hint svg { width: 18px; height: 18px; color: var(--warn); flex: none; margin-top: 1px; }

/* ---------- оплата ---------- */
.pay { padding: 40px 24px 0; text-align: center; }
.pay .big { width: 96px; height: 96px; border-radius: 32px; margin: 0 auto 22px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.pay .big svg { width: 44px; height: 44px; }
.pay .big.ok { background: var(--ok-soft); color: var(--ok); animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; }
.pay .big .spinner { width: 40px; height: 40px; border-width: 4px; }
.pay h1 { font-size: 25px; }
.pay > p { color: var(--muted); margin-top: 10px; }
.pay .actions { display: grid; gap: 10px; margin-top: 26px; text-align: left; }
.pay .owned-row { box-shadow: inset 0 0 0 1px var(--line); }
.check-draw path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .2s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .2; } }

/* ---------- просмотр фото ---------- */
.viewer { position: fixed; inset: 0; z-index: 150; background: #000; animation: fade .2s ease both; display: flex; flex-direction: column; }
.viewer .slides { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
.viewer .slides::-webkit-scrollbar { display: none; }
.viewer .slides > div { flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; padding: 60px 0 40px; }
.viewer img, .viewer video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .close { position: absolute; top: calc(14px + var(--safe-t)); right: 14px; z-index: 2; }
.viewer .cnt { position: absolute; top: calc(24px + var(--safe-t)); left: 0; right: 0; text-align: center; color: rgba(255,255,255,.7); font-size: 13px; font-weight: 600; }

/* ---------- уведомление ---------- */
.toast {
  position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 300; background: var(--ink); color: var(--on-ink);
  padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: calc(100% - 32px);
  animation: toast 2.6s ease both; display: flex; align-items: center; gap: 8px;
}
.toast svg { width: 18px; height: 18px; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -12px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8px); } }

/* ---------- загрузка ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.boot .logo { width: 64px; height: 64px; color: var(--accent); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.9) rotate(-8deg); opacity: .6; } }
.skel { background: var(--soft); border-radius: 14px; position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px; }
.trust div { background: var(--card); border-radius: 18px; padding: 14px 10px; text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; box-shadow: var(--shadow); }
.trust svg { width: 24px; height: 24px; color: var(--accent); display: block; margin: 0 auto 6px; }
.footer { text-align: center; color: var(--faint); font-size: 12.5px; padding: 28px 16px 0; }
.footer a { color: var(--muted); font-weight: 600; }

@media (min-width: 520px) {
  .grid.two { grid-template-columns: 1fr 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
