/* AURA VAPOR LOUNGE — стили мини-аппа каталога.
   Цвета берём из темы Telegram, с собственным тёмным фолбэком. */

:root {
  --bg:        var(--tg-theme-bg-color, #0f0b1a);
  --bg-soft:   var(--tg-theme-secondary-bg-color, #171227);
  --text:      var(--tg-theme-text-color, #f4f1fb);
  --hint:      var(--tg-theme-hint-color, #9c93b8);
  --accent:    #a855f7;
  --accent-2:  #22d3ee;
  --danger:    #f87171;
  --line:      rgba(255, 255, 255, .09);
  --radius:    16px;
  --safe-b:    env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Обязательно выше остальных правил: у .age-gate и .sheet-backdrop задан свой
   display, и без !important он перебивает браузерное [hidden]. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(24px + var(--safe-b));
  overscroll-behavior-y: contain;
}
/* вне Telegram нижняя кнопка своя и занимает место */
body.no-tg { padding-bottom: calc(92px + var(--safe-b)); }

h1, h2 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
button { font: inherit; cursor: pointer; border: 0; }

.view { padding: 0 14px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------------- шапка */
.hero { position: relative; padding: 22px 4px 16px; overflow: hidden; }
.hero-glow {
  position: absolute; inset: -60% 20% auto -20%; height: 220px;
  background: radial-gradient(closest-side, rgba(168, 85, 247, .45), transparent 70%);
  filter: blur(10px); pointer-events: none;
}
.hero h1 {
  position: relative; font-size: 24px;
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { position: relative; margin: 4px 0 12px; color: var(--hint); font-size: 13px; }

.chips-info { position: relative; display: flex; gap: 6px; flex-wrap: wrap; }
.chip-info {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 11px; font-size: 12px; color: var(--hint);
}

/* ------------------------------------------------------------ категории */
.cats {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 12px;
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(var(--bg) 72%, transparent);
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: 0 0 auto; padding: 9px 15px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: transform .12s ease;
}
.cat:active { transform: scale(.95); }
.cat.active {
  background: linear-gradient(92deg, var(--accent), #7c3aed);
  border-color: transparent; color: #fff;
}

/* --------------------------------------------------------------- товары */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.card {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .12s ease; cursor: pointer;
}
.card:active { transform: scale(.97); }
.card.out { opacity: .55; }

.thumb {
  aspect-ratio: 1 / 1; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(168,85,247,.28), rgba(34,211,238,.18));
  font-size: 34px; font-weight: 700; color: rgba(255,255,255,.85); position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
  position: absolute; top: 8px; left: 8px; background: var(--accent);
  color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 999px; text-transform: uppercase; letter-spacing: .04em;
}
.badge.out { background: #444; }

.card-body { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.card-meta { font-size: 11px; color: var(--hint); }
.card-bottom { margin-top: auto; }
.price { font-size: 15px; font-weight: 700; }
.price s { color: var(--hint); font-size: 11px; font-weight: 400; margin-left: 4px; }

.empty { grid-column: 1 / -1; text-align: center; color: var(--hint); padding: 50px 0; }

/* ------------------------------------------------------------ шторка */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; animation: fade .18s ease;
}
.sheet {
  width: 100%; max-height: 88vh; overflow-y: auto;
  background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(24px + var(--safe-b));
  animation: rise .24s cubic-bezier(.2, .8, .3, 1);
}
body.no-tg .sheet { padding-bottom: calc(92px + var(--safe-b)); }
@keyframes rise { from { transform: translateY(100%); } }
.sheet-handle {
  width: 38px; height: 4px; border-radius: 4px; background: var(--line);
  margin: 4px auto 14px;
}
.sheet-thumb {
  height: 220px; border-radius: var(--radius); margin-bottom: 14px; position: relative;
  display: grid; place-items: center; font-size: 44px; font-weight: 700;
  background: linear-gradient(135deg, rgba(168,85,247,.3), rgba(34,211,238,.2));
  overflow: hidden;
}
.sheet-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sheet h3 { margin: 0 0 4px; font-size: 19px; }
.sheet-price { font-size: 20px; font-weight: 700; margin: 0 0 10px; }
.sheet-price s { color: var(--hint); font-size: 13px; font-weight: 400; margin-left: 6px; }
.sheet .desc { color: var(--hint); font-size: 13.5px; margin: 0 0 14px; }
.stock-note {
  background: rgba(248,113,113,.12); color: var(--danger);
  border-radius: 12px; padding: 10px 12px; font-size: 13px; margin: 0 0 14px;
}
.opt-title { font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.opt-hint { font-size: 11.5px; color: var(--hint); margin: 0 0 9px; }
.opts { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 6px; }
.opt {
  padding: 8px 13px; border-radius: 11px; font-size: 13px;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--text);
}
.opt.active { border-color: var(--accent); background: rgba(168,85,247,.18); }
.opt:disabled { opacity: .35; text-decoration: line-through; cursor: default; }

/* --------------------------------------------------------------- кнопки */
.btn { padding: 13px 18px; border-radius: 13px; font-size: 14px; font-weight: 600; }
.btn-primary { background: linear-gradient(92deg, var(--accent), #7c3aed); color: #fff; }
.btn-ghost { background: var(--bg-soft); border: 1px solid var(--line); color: var(--text); }
.btn:active { opacity: .8; }

/* нижняя кнопка «Написать менеджеру» вне Telegram (в Telegram — нативная MainButton) */
.action-bar {
  position: fixed; left: 14px; right: 14px; z-index: 70;
  bottom: calc(14px + var(--safe-b));
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}

.foot { margin: 26px 0 10px; display: flex; flex-direction: column; gap: 9px; }
.note-box {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 14px; font-size: 13px; color: var(--hint);
}
.note-box p { margin: 3px 0; }
.legal { color: var(--hint); font-size: 11px; text-align: center; margin: 12px 0 0; line-height: 1.5; }

/* -------------------------------------------------------- 18+ и тосты */
.age-gate {
  position: fixed; inset: 0; z-index: 90; background: var(--bg);
  display: grid; place-items: center; padding: 22px;
}
.age-card { text-align: center; max-width: 320px; }
.age-emoji { font-size: 54px; margin-bottom: 10px; }
.age-card h2 { font-size: 21px; margin-bottom: 8px; }
.age-card p { color: var(--hint); font-size: 13.5px; margin: 0 0 22px; }
.age-actions { display: flex; flex-direction: column; gap: 9px; }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%);
  background: rgba(20, 16, 34, .96); border: 1px solid var(--line); color: var(--text);
  padding: 11px 18px; border-radius: 999px; font-size: 13px; z-index: 80;
  animation: fade .18s ease; box-shadow: 0 8px 26px rgba(0,0,0,.45);
}

.skeleton { height: 190px; border-radius: var(--radius); background: var(--bg-soft);
            animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
