:root {
  --pink: #e3197f;
  --pink-soft: #fde8f2;
  --ink: #141414;
  --muted: #8b8790;
  --line: #ece9ee;
  --soft: #f7f5f6;
  --bg: #ffffff;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 15px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: calc(84px + var(--safe-b));
  overflow-x: hidden;
}
body.tg { padding-bottom: 24px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  height: 56px; padding: 0 12px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: baseline; cursor: pointer; user-select: none; }
.logo-g { font-weight: 800; font-size: 26px; letter-spacing: -.5px; color: var(--pink); }
.logo-w { font-family: "Great Vibes", cursive; font-size: 28px; margin-left: -6px; transform: translateY(6px); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn:active { background: var(--soft); }
.back-btn { position: absolute; left: 8px; }
.cart-btn { position: absolute; right: 8px; }
.badge {
  position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
body.tg .back-btn { display: none !important; }

/* ---------- каталог ---------- */
.hero { padding: 22px 16px 6px; }
.hero-kicker { margin: 0; color: var(--pink); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.hero h1 { margin: 6px 0 4px; font-size: 26px; line-height: 1.15; letter-spacing: -.5px; }
.hero-sub { margin: 0; color: var(--muted); font-size: 14px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 20px; border: 1px solid var(--line);
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 10px; padding: 0 16px; }
.card { text-align: left; display: block; min-width: 0; }
.ph {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--soft);
}
.ph img, .ph video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .tag {
  position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 10px;
  background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.ph .play {
  position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.45); display: grid; place-items: center;
}
.ph .play svg { width: 12px; height: 12px; fill: #fff; stroke: none; }
.ph .noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--pink); font-weight: 800; letter-spacing: .1em; }
.card .nm { margin-top: 8px; font-size: 14px; font-weight: 500; }
.card .pr { margin-top: 2px; font-weight: 700; }
.dots { display: flex; gap: 4px; margin-top: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }
.skeleton { aspect-ratio: 3 / 4.6; border-radius: var(--radius); background: linear-gradient(90deg, var(--soft), #fff, var(--soft)); background-size: 200% 100%; animation: sh 1.2s infinite linear; }
@keyframes sh { to { background-position: -200% 0; } }

.info { margin: 32px 16px 0; padding: 18px; border-radius: var(--radius); background: var(--soft); font-size: 14px; }
.info b { display: block; margin-bottom: 6px; }
.info p { margin: 0 0 10px; }
.info .links { display: flex; gap: 8px; flex-wrap: wrap; }
.link-btn { padding: 8px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 500; text-decoration: none; color: inherit; }

/* ---------- карточка товара ---------- */
.gallery { position: relative; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--soft); }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: none; width: 100%; aspect-ratio: 3 / 4; max-height: 70vh; scroll-snap-align: center; position: relative; }
.slide img, .slide video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sound {
  position: absolute; right: 12px; bottom: 12px; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center;
}
.sound svg { width: 18px; height: 18px; }
.pager { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.pager i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.55); transition: width .2s; }
.pager i.on { width: 18px; background: #fff; }

.pd { padding: 18px 16px 8px; }
.pd h2 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.pd .price { margin-top: 6px; font-size: 22px; font-weight: 800; }
.pd .price .hit { margin-left: 8px; vertical-align: middle; font-size: 11px; padding: 3px 8px; border-radius: 10px; background: var(--pink-soft); color: var(--pink); }
.pd .desc { margin: 12px 0 0; color: #45414a; }
.opt { margin-top: 20px; }
.opt-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.opt-head b { font-size: 15px; }
.opt-head .sel { color: var(--muted); font-weight: 400; }
.text-btn { color: var(--pink); font-size: 14px; font-weight: 500; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.sz {
  min-width: 52px; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line);
  font-weight: 600;
}
.sz.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.clr { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 8px; border-radius: 22px; border: 1px solid var(--line); font-weight: 500; }
.clr .dot { width: 26px; height: 26px; }
.clr.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.perks { margin: 22px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.perks li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.perks svg { color: var(--pink); flex: none; }

/* ---------- корзина / оформление ---------- */
.page { padding: 18px 16px; }
.page h2 { margin: 0 0 16px; font-size: 24px; letter-spacing: -.4px; }
.empty { text-align: center; padding: 60px 16px; color: var(--muted); }
.empty .big { font-size: 44px; }
.empty .btn { margin-top: 18px; width: auto; padding: 0 24px; }
.line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line .th { width: 72px; flex: none; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--soft); }
.line .th img { width: 100%; height: 100%; object-fit: cover; }
.line .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.line .meta .nm { font-weight: 600; }
.line .meta .vr { color: var(--muted); font-size: 13px; margin-top: 2px; }
.line .meta .row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; }
.qty button { width: 34px; height: 32px; font-size: 18px; }
.qty span { min-width: 22px; text-align: center; font-weight: 600; }
.rm { color: var(--muted); font-size: 13px; margin-top: 6px; align-self: flex-start; }
.sum { margin-top: 16px; }
.sum div { display: flex; justify-content: space-between; padding: 4px 0; }
.sum .total { font-size: 18px; font-weight: 800; padding-top: 8px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft);
  outline: none; font-size: 16px;
}
.field input:focus, .field textarea:focus { border-color: var(--ink); background: #fff; }
.field textarea { min-height: 76px; resize: vertical; }
.field.err input, .field.err textarea { border-color: var(--pink); }
.sec { margin: 22px 0 10px; font-size: 15px; font-weight: 700; }
.radio { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 8px; }
.radio .rd { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--line); margin-top: 1px; }
.radio.on { border-color: var(--ink); }
.radio.on .rd { border: 6px solid var(--pink); }
.radio b { display: block; font-weight: 600; }
.radio span { font-size: 13px; color: var(--muted); }
.note { padding: 14px; border-radius: 14px; background: var(--pink-soft); font-size: 14px; margin-top: 16px; }

.done { text-align: center; padding: 40px 20px; }
.done .ok { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--pink-soft); color: var(--pink); display: grid; place-items: center; }
.done .ok svg { width: 34px; height: 34px; stroke-width: 2.4; }
.done h2 { margin: 0 0 8px; }
.card-box { margin: 20px 0; padding: 16px; border-radius: 16px; background: var(--soft); text-align: left; }
.card-box .num { font-size: 18px; font-weight: 700; letter-spacing: .04em; margin: 6px 0 10px; word-break: break-word; }

/* ---------- кнопка снизу (вне Telegram), шторка, тост ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px 16px calc(10px + var(--safe-b)); background: rgba(255,255,255,.95); border-top: 1px solid var(--line);
}
.btn { width: 100%; height: 52px; border-radius: 14px; background: var(--pink); color: #fff; font-weight: 700; font-size: 16px; }
.btn:active { opacity: .85; }
.btn:disabled { opacity: .5; }

.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; }
.sheet { width: 100%; background: #fff; border-radius: 20px 20px 0 0; padding: 16px 16px calc(20px + var(--safe-b)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.size-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.size-table th, .size-table td { padding: 9px 4px; text-align: center; border-bottom: 1px solid var(--line); }
.size-table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.size-table td:first-child { font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 22px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; white-space: nowrap;
}
body.tg .toast { bottom: 24px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- шапка: кабинет и админка ---------- */
.admin-btn { position: absolute; left: 8px; }
.profile-btn { position: absolute; right: 50px; }
.sz.off { color: #c9c5cc; border-style: dashed; text-decoration: line-through; cursor: default; }

/* ---------- статусы заказов ---------- */
.st { flex: none; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--soft); }
.st-new { background: #fff4d6; color: #8a5a00; }
.st-paid { background: #e3f5e9; color: #1f7a3f; }
.st-sent { background: #e6efff; color: #2350a8; }
.st-cancel { background: #f1f0f2; color: var(--muted); }
.vr { color: var(--muted); font-size: 13px; margin-top: 2px; }
.oi { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.oi b { flex: none; }
.oi.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; font-weight: 600; }

/* ---------- личный кабинет ---------- */
.my { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.my-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.my .note { margin-top: 10px; }
.steps { display: flex; margin: 14px 0 8px; }
.step { flex: 1; position: relative; text-align: center; font-size: 12px; color: var(--muted); }
.step i { display: block; width: 14px; height: 14px; margin: 0 auto 6px; border-radius: 50%; background: var(--line); position: relative; z-index: 1; }
.step + .step::before { content: ""; position: absolute; top: 6px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.step.ok { color: var(--ink); font-weight: 600; }
.step.ok i, .step.ok::before { background: var(--pink) !important; }

/* ---------- админка ---------- */
.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; height: 38px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.badge-in { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--pink); color: #fff; font-size: 11px; margin-left: 4px; }
.arow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); }
.arow .th { width: 56px; flex: none; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--soft); }
.arow .th img, .arow .th video, .line .th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.arow .meta { flex: 1; min-width: 0; }
.arow .nm { font-weight: 600; }
.arow .chev { color: var(--muted); font-size: 22px; }
.tags { display: flex; gap: 6px; margin-top: 4px; }
.tags i { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 8px; }
.tag-off { background: var(--soft); color: var(--muted); }
.tag-hit { background: var(--pink-soft); color: var(--pink); }
.ord { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
.ord.open { border-color: var(--ink); }
.ord-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; }
.ord-body { padding: 0 14px 14px; }
.od { font-size: 14px; padding: 6px 0; }
.od a { color: var(--pink); text-decoration: none; font-weight: 500; }
.st-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mtile { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--soft); }
.mtile img, .mtile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mtile .play { position: absolute; left: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; }
.mtile .play svg { width: 10px; height: 10px; fill: #fff; stroke: none; }
.madd { border: 1.5px dashed #d6d1d9; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.5; }
.mbtn { position: absolute; top: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 13px; display: grid; place-items: center; }
.mstar { left: 6px; }
.mdel { right: 6px; }
.mcover { position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 8px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; }
.crow { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.crow input[type=color] { width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: none; flex: none; }
.crow input:not([type]) { flex: 1; min-width: 0; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); font-size: 16px; outline: none; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--pink); }
.danger-btn { margin-top: 24px; width: 100%; height: 48px; border-radius: 14px; border: 1px solid #f3c4cf; color: #c0264d; font-weight: 600; }
.page .link-btn { display: inline-block; margin-top: 4px; }
.done .link-btn { margin-top: 4px; }

@media (min-width: 640px) {
  body { max-width: 560px; margin: 0 auto; }
  .top, .bar { max-width: 560px; margin: 0 auto; }
  .bar { left: 50%; transform: translateX(-50%); width: 560px; }
}
