/* =========================================================
   ЯРЛЫК — streetwear. Современный минималистичный UI/UX.
   Мягкие карточки, скругления, деликатные тени, воздух.
   Шрифты: Plus Jakarta Sans (заголовки/UI), Inter (текст).
   ========================================================= */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f2f2;
  --text: #0a0a0a;
  --text-soft: #4a4a4a;
  --muted: #9a9a9a;
  --line: #ececec;
  --accent: #ff6a00;          /* оранжевый — основной акцент */
  --accent-soft: #fff0e6;
  --accent-ink: #ffffff;
  --hot: #ff6a00;             /* плашка HOT — оранжевая */
  --hot-soft: #fff0e6;
  --lime: #c2ff3d;            /* салатовый — кнопки действий */
  --lime-ink: #0a0a0a;
  --lime-glow: rgba(194, 255, 61, 0.75);
  --ok: #16a06a;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.05), 0 0 0 1px rgba(10, 10, 10, 0.06);
  --shadow: 0 8px 28px rgba(17, 17, 20, 0.08);
  --shadow-lg: 0 16px 44px rgba(17, 17, 20, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #000000;
    --surface: #141414;
    --surface-2: #1f1f1f;
    --text: #ffffff;
    --text-soft: #bdbdbd;
    --muted: #7a7a7a;
    --line: #262626;
    --accent: #ff7a1a;
    --accent-soft: #2a1a0c;
    --accent-ink: #0a0a0a;
    --hot: #ff7a1a;
    --hot-soft: #2a1a0c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme='dark'] {
  --bg: #000000;
  --surface: #141414;
  --surface-2: #1f1f1f;
  --text: #ffffff;
  --text-soft: #bdbdbd;
  --muted: #7a7a7a;
  --line: #262626;
  --accent: #ff7a1a;
  --accent-soft: #2a1a0c;
  --accent-ink: #0a0a0a;
  --hot: #ff7a1a;
  --hot-soft: #2a1a0c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.7);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }

h1, h2, h3, .brand__name, .screen-title, .price, .stat__num, button { font-family: 'Plus Jakarta Sans', sans-serif; }
button { cursor: pointer; border: none; background: none; color: inherit; }
svg { display: block; }
input, select, textarea { font-family: inherit; }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 20px 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark {
  width: 34px; height: 34px;
  background: var(--text); color: var(--bg);
  border-radius: 11px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px;
}
.brand__name { font-weight: 800; font-size: 20px; letter-spacing: -0.3px; }

.icon-btn {
  position: relative;
  width: 42px; height: 42px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.icon-btn__badge, .badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--hot); color: #fff;
  border-radius: 10px; font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--bg);
  font-family: 'Plus Jakarta Sans', sans-serif;
}
[data-empty] { display: none !important; }

/* ---------- Контейнер ---------- */
.view { padding: 8px 20px 20px; max-width: 760px; margin: 0 auto; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: 0.2px; }
.screen-title { font-size: clamp(28px, 8vw, 38px); font-weight: 800; letter-spacing: -1px; line-height: 1.05; margin: 6px 0 18px; }

/* ---------- Поиск ---------- */
.searchbar { position: relative; margin-bottom: 16px; }
.searchbar svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchbar input {
  width: 100%;
  border: none;
  background: var(--surface);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px 14px 46px;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
}
.searchbar input:focus { outline: 2px solid var(--accent); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); }

/* ---------- Фильтры ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 -20px 18px; padding-left: 20px; padding-right: 20px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border-radius: 40px;
  padding: 9px 16px;
  font-size: 14px; font-weight: 600;
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.chip.is-active { background: var(--text); color: var(--bg); }
.chip:active { transform: scale(0.95); }

/* ---------- Сетка товаров ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.card:active { transform: scale(0.98); }
@media (hover: hover) { .card:hover { box-shadow: var(--shadow); transform: translateY(-2px); } }

.card__img {
  aspect-ratio: 1 / 1.15;
  position: relative;
  display: grid; place-items: center;
  overflow: hidden;
}
.card__photo, .pdp__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.card__img::after, .pdp__hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 0%, transparent 22%, transparent 72%, rgba(0, 0, 0, 0.12));
}
.card__glyph { position: relative; z-index: 0; font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: clamp(26px, 10vw, 42px); letter-spacing: -1px; color: rgba(255, 255, 255, 0.95); text-align: center; padding: 0 10px; line-height: 1; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.18); }
.badge-hot, .card__fav { z-index: 3; }

/* Галерея фото в карточке товара */
.gallery { position: absolute; inset: 0; z-index: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery__dots { position: absolute; bottom: 12px; left: 0; right: 0; z-index: 3; display: flex; gap: 6px; justify-content: center; }
.gdot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18); transition: width 0.2s ease, background 0.2s ease; }
.gdot.is-on { background: #fff; width: 20px; border-radius: 4px; }
.badge-hot {
  position: absolute; top: 10px; left: 10px;
  background: var(--hot); color: #fff;
  font-family: 'Plus Jakarta Sans'; font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 40px;
}
.card__fav {
  position: absolute; top: 8px; right: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  display: grid; place-items: center; color: #7a7a82;
  transition: transform 0.12s ease;
}
.card__fav svg { width: 18px; height: 18px; }
.card__fav.is-on { color: var(--hot); }
.card__fav.is-on svg { fill: var(--hot); }
.card__fav:active { transform: scale(0.85); }

.card__body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card__cat { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.card__title { font-weight: 600; font-size: 14px; line-height: 1.25; color: var(--text); }
.card__price-row { display: flex; align-items: baseline; gap: 7px; margin-top: 6px; }
.card__price { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: 16px; }
.card__old { font-size: 12px; color: var(--muted); text-decoration: line-through; }

/* ---------- Карточка товара (PDP) ---------- */
.pdp__hero {
  aspect-ratio: 1 / 1.05;
  border-radius: 24px;
  display: grid; place-items: center;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.pdp__hero .card__glyph { font-size: clamp(48px, 20vw, 96px); }
.pdp__cat { color: var(--accent); font-weight: 600; font-size: 13px; margin: 18px 0 4px; }
.pdp__title { font-weight: 800; font-size: clamp(26px, 7vw, 34px); letter-spacing: -0.8px; line-height: 1.08; margin: 0 0 10px; }
.pdp__price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.pdp__price { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: 28px; }
.pdp__old { color: var(--muted); text-decoration: line-through; font-size: 16px; }
.pdp__desc { color: var(--text-soft); line-height: 1.6; margin-bottom: 20px; font-size: 15px; }

.label { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.size {
  min-width: 50px;
  border-radius: 12px;
  padding: 12px; font-weight: 700; font-size: 14px;
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease;
}
.size.is-active { background: var(--text); color: var(--bg); }
.size:active { transform: scale(0.94); }

.spec { background: var(--surface); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; color: var(--text-soft); box-shadow: var(--shadow-sm); }
.spec b { color: var(--text); }

/* ---------- Кнопки ---------- */
.btn {
  width: 100%;
  border-radius: 16px;
  padding: 16px; font-size: 16px; font-weight: 800;
  letter-spacing: 0.2px;
  background: var(--lime); color: var(--lime-ink);
  transition: transform 0.1s ease, opacity 0.15s ease;
  animation: pulse-glow 2.4s ease-in-out infinite;
}
.btn:active { transform: scale(0.98); }
.btn--hot { background: var(--lime); color: var(--lime-ink); } /* действия — те же салатовые */
.btn--accent { background: var(--accent); color: var(--accent-ink); animation: none; box-shadow: var(--shadow-sm); }
.btn--ghost { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); animation: none; }
.btn:disabled { opacity: 0.55; animation: none; }

/* Плавная неоновая пульсация салатовых кнопок (без резких рывков) */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(194, 255, 61, 0.4), 0 0 12px rgba(194, 255, 61, 0.2), 0 3px 12px rgba(0, 0, 0, 0.12);
  }
  50% {
    box-shadow: 0 0 16px rgba(194, 255, 61, 0.85), 0 0 32px rgba(194, 255, 61, 0.5), 0 3px 12px rgba(0, 0, 0, 0.12);
  }
}

.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--text-soft); font-size: 14px; font-weight: 600; padding: 4px 0 14px; }

/* ---------- Позиции (корзина) ---------- */
.line-item {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center;
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.line-item__thumb { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; font-family: 'Plus Jakarta Sans'; font-weight: 800; color: #fff; font-size: 16px; }
.line-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.line-item__title { font-weight: 600; font-size: 14px; line-height: 1.25; }
.line-item__sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.qty { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; background: var(--surface-2); border-radius: 40px; padding: 3px; }
.qty button { width: 28px; height: 28px; border-radius: 50%; background: var(--surface); color: var(--text); font-weight: 700; font-size: 16px; line-height: 1; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.qty span { font-weight: 700; min-width: 20px; text-align: center; font-size: 14px; }
.line-item__price { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: 16px; text-align: right; }
.line-item__del { color: var(--muted); padding: 8px 0 0; display: inline-flex; align-items: center; justify-content: flex-end; }
.line-item__del svg { width: 19px; height: 19px; }
.line-item__del:active { color: var(--hot); transform: scale(0.9); }

.summary { background: var(--surface); border-radius: var(--radius); padding: 18px; margin-top: 4px; box-shadow: var(--shadow-sm); }
.summary__row { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--text-soft); font-size: 14px; }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: 22px; margin: 12px 0 16px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- Форма ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 8px; }
.field input, .field textarea, .field select {
  width: 100%; border: none;
  background: var(--surface); color: var(--text);
  border-radius: 14px; padding: 14px 16px; font-size: 15px;
  box-shadow: var(--shadow-sm);
}
.field textarea { resize: vertical; min-height: 76px; }
.delivery-opts { display: grid; gap: 10px; }
.delivery-opt {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid transparent;
  transition: border-color 0.15s ease;
}
.delivery-opt.is-active { border-color: var(--accent); background: var(--accent-soft); }
.delivery-opt input { accent-color: var(--accent); width: 18px; height: 18px; }
.delivery-opt b { font-weight: 700; font-size: 15px; }

/* ---------- Кабинет ---------- */
.profile-card {
  background: linear-gradient(135deg, var(--accent) 0%, #ff9500 55%, #0a0a0a 100%);
  border-radius: var(--radius); padding: 22px; margin-bottom: 16px; color: #fff;
  box-shadow: var(--shadow);
}
.profile-card__row { display: flex; align-items: center; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); display: grid; place-items: center; font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: 22px; color: #fff; }
.profile-card__name { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: 22px; }
.profile-card__uname { font-size: 13px; opacity: 0.85; margin-top: 2px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.stat { background: var(--surface); border-radius: var(--radius-sm); padding: 16px 10px; text-align: center; box-shadow: var(--shadow-sm); }
.stat__num { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: 26px; }
.stat__label { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 500; }

.order-card { background: var(--surface); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.order-card__head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.order-card__head .status { color: var(--accent); font-weight: 600; }
.order-card__head .date { color: var(--muted); }
.order-card__items { font-size: 13px; color: var(--text-soft); line-height: 1.4; }
.order-card__total { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: 17px; margin-top: 8px; }
.contact-box { background: var(--surface); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; color: var(--text-soft); box-shadow: var(--shadow-sm); line-height: 1.6; }

/* ---------- Пусто ---------- */
.empty { text-align: center; padding: 60px 20px; }
.empty__ico { width: 76px; height: 76px; border-radius: 24px; background: var(--surface); display: grid; place-items: center; margin: 0 auto 18px; color: var(--muted); box-shadow: var(--shadow-sm); }
.empty__text { color: var(--muted); margin: 4px 0 22px; font-size: 15px; line-height: 1.5; }
.empty .btn { max-width: 260px; margin: 0 auto; }

.section-gap { margin-top: 26px; }

/* ---------- Нижняя навигация (плавающая) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 0 16px calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.tabbar__inner {
  pointer-events: auto;
  max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
}
.tab {
  position: relative;
  color: var(--muted);
  padding: 8px 4px; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}
.tab__label { font-size: 11px; font-weight: 600; }
.tab.is-active { color: var(--accent); background: var(--accent-soft); }
.badge { top: 2px; right: calc(50% - 24px); }

/* Пульсация вкладки «Корзина» после добавления товара */
.tab.is-pulsing { color: var(--accent); animation: tab-pulse 1s ease-in-out infinite; }
@keyframes tab-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.16); opacity: 0.75; }
}
@media (prefers-reduced-motion: reduce) { .tab.is-pulsing { animation: none; } }

/* ---------- Тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 12px 20px; border-radius: 40px;
  font-size: 14px; font-weight: 600; z-index: 50;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Анимация появления экранов */
.view > * { animation: fade-up 0.32s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Заглушка вне Telegram ---------- */
.gate-mode { padding-bottom: 0; }
.gate-mode .tabbar, .gate-mode .icon-btn { display: none; }
.gate {
  min-height: calc(100vh - 120px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 24px; max-width: 460px; margin: 0 auto;
}
.gate__badge {
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--accent); background: var(--accent-soft);
  padding: 6px 14px; border-radius: 40px; margin-bottom: 26px;
}
.gate__mark {
  width: 72px; height: 72px; border-radius: 22px;
  background: var(--text); color: var(--bg);
  display: grid; place-items: center;
  font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: 40px;
  margin-bottom: 24px; box-shadow: var(--shadow);
}
.gate__title { font-size: clamp(26px, 8vw, 34px); font-weight: 800; letter-spacing: -0.8px; line-height: 1.12; margin: 0 0 14px; }
.gate__text { color: var(--text-soft); font-size: 16px; line-height: 1.55; margin: 0 0 30px; }
.gate__btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; width: auto; min-width: 240px; padding: 16px 28px;
}
.gate__hint { color: var(--muted); font-size: 13px; margin-top: 18px; }
.gate__hint b { color: var(--text-soft); }
