/* ============ FROSTVAILT — темы ============ */
:root {
  /* тёмная тема (по умолчанию) */
  --bg: #0d0e11;
  --card: #16181d;
  --card2: #1e2127;
  --line: #262a32;
  --text: #f4f5f7;
  --muted: #8a90a0;
  --accent: #3d6dff;
  --accent-soft: #1c2946;
  --btn: #ffffff;        /* контрастная кнопка */
  --btn-text: #0d0e11;
  --green: #2fd181;
  --green-soft: #10281c;
  --red: #ff5c5c;
  --red-soft: #2e1616;
  --amber: #f7b64c;
  --amber-soft: #2c2312;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --radius: 16px;
}

body.light {
  --bg: #f2f3f7;
  --card: #ffffff;
  --card2: #f4f5f9;
  --line: #e9ebf1;
  --text: #14161f;
  --muted: #82889b;
  --accent: #3d6dff;
  --accent-soft: #eaf0ff;
  --btn: #14161f;
  --btn-text: #ffffff;
  --green: #0da768;
  --green-soft: #e5f7ee;
  --red: #e5484d;
  --red-soft: #fdecec;
  --amber: #d9840d;
  --amber-soft: #fdf3e2;
  --shadow: 0 1px 4px rgba(20, 22, 31, 0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior: none;
  transition: background 0.25s, color 0.25s;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }

button { font-family: inherit; border: none; cursor: pointer; background: none; color: inherit; }
input, textarea, select {
  font-family: inherit; font-size: 15px; color: var(--text);
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 14px; width: 100%; background: var(--card); outline: none;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }

/* маленькие заголовки-лейблы в стиле маркетплейса */
.lbl {
  font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}

/* ============ служебные экраны ============ */
.screen-center {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 24px; background: var(--bg); z-index: 50;
}
.screen-center h2 { margin-bottom: 8px; }
.err-icon {
  width: 72px; height: 72px; border-radius: 22px; background: var(--card);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); margin-bottom: 16px; box-shadow: var(--shadow);
}
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ шапка ============ */
#header {
  background: var(--card);
  padding: 12px 14px;
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--line);
}
.header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
/* название ужимается под свободное место: сначала мельчает шрифт, потом уходит в многоточие,
   а кнопки справа не сдвигаются никогда */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.logo-sq {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  border: 2px solid var(--text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; letter-spacing: 0.5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
/* аватарка магазина: круглая, без рамки, картинка целиком */
.logo-sq.has-img {
  border: none; border-radius: 50%; overflow: hidden; background: #fff;
  width: 42px; height: 42px;
}
.logo-sq.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-name {
  font-weight: 800; text-transform: uppercase;
  font-size: 15px; letter-spacing: 2px;  /* дальше подгоняется в fitBrandName() */
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; flex: 0 1 auto;
}
.brand-name:empty { display: none; }
.brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 0 1 auto; }
.brand-sub {
  font-size: 9px; letter-spacing: 2.5px; color: var(--muted); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub:empty { display: none; }
.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.hbtn {
  width: 36px; height: 36px; border-radius: 100px; background: var(--card2);
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.hbtn-lang { width: auto; padding: 0 11px; font-weight: 800; font-size: 12px; letter-spacing: 0.5px; }
.hbtn-cart { position: relative; }
.hbtn-cart.has-items { background: var(--accent); color: #fff; }
.cart-badge {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 100px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
/* строка товара в корзине */
.cart-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-of-type { border-bottom: none; }
.cart-thumb {
  width: 46px; height: 46px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--card2); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: var(--muted); font-family: ui-monospace, monospace;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-name { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-step { flex-shrink: 0; }
.cart-step button { width: 32px; height: 32px; font-size: 17px; }
.cart-step span { min-width: 30px; font-size: 15px; }
.balance-pill {
  display: flex; align-items: center; gap: 7px;
  background: var(--card2); color: var(--text);
  border-radius: 100px; padding: 6px 6px 6px 13px;
  font-weight: 700; font-size: 13.5px;
}
.balance-plus {
  background: var(--accent); color: #fff; width: 24px; height: 24px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.search-wrap {
  display: flex; align-items: center; gap: 9px;
  background: var(--card2); border-radius: 12px; padding: 0 13px; color: var(--muted);
}
.search-wrap input { border: none; padding: 11px 0; background: transparent; }

/* ============ контент ============ */
#main { padding: 14px 14px 96px; max-width: 560px; margin: 0 auto; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 10px; }
.section-title { font-size: 16px; font-weight: 800; }
.count-pill {
  background: var(--card); border-radius: 100px; padding: 5px 12px;
  font-size: 11.5px; font-weight: 700; color: var(--muted);
}

/* ============ баннеры ============ */
.banners { position: relative; margin-bottom: 4px; }
.banner-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  border-radius: var(--radius); scrollbar-width: none; gap: 0;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner-slide {
  flex: 0 0 100%; scroll-snap-align: center; cursor: pointer;
  aspect-ratio: 2 / 1; border-radius: var(--radius); overflow: hidden;
}
.banner-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-dots {
  position: absolute; bottom: 10px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 5px; pointer-events: none;
}
.bdot {
  width: 6px; height: 6px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.45); transition: all 0.25s;
}
.bdot.active { width: 18px; background: #fff; }

/* ============ категории (круглые) ============ */
.cats {
  display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 6px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
/* на компьютере полосы листаются мышкой — показываем это курсором */
@media (hover: hover) and (pointer: fine) {
  .cats, .subtabs { cursor: grab; }
  .cats.dragging, .subtabs.dragging { cursor: grabbing; user-select: none; }
  .cats.dragging *, .subtabs.dragging * { pointer-events: none; }
}
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex-shrink: 0; width: 62px; color: var(--muted); font-weight: 600;
}
.cat span {
  font-size: 10.5px; max-width: 62px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.cat-ic {
  width: 54px; height: 54px; border-radius: 50%; overflow: hidden;
  background: var(--card); border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: var(--text);
  transition: border-color 0.15s;
}
.cat-ic img { width: 100%; height: 100%; object-fit: cover; }
.cat.active { color: var(--text); }
.cat.active .cat-ic { border-color: var(--accent); }

/* ============ сетка товаров ============ */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* компактные строки-объявления (услуги: накрутка и т.п.) */
.p-rows { display: flex; flex-direction: column; gap: 8px; }
.p-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--card); border-radius: 12px; padding: 12px 14px;
  box-shadow: var(--shadow); cursor: pointer;
}
.p-row:active { background: var(--card2); }
.p-row-main { min-width: 0; flex: 1; }
.p-row-name {
  font-size: 13.5px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.p-row-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.p-row-ok { color: var(--green); font-weight: 600; }
.p-row-out { color: var(--red); font-weight: 600; }
.p-row-price { flex-shrink: 0; text-align: right; }
.p-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; cursor: pointer; box-shadow: var(--shadow);
}
.p-imgwrap { position: relative; aspect-ratio: 1.15; background: var(--card2); }
.p-imgwrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-mono {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 800; font-size: 30px; letter-spacing: 3px; color: var(--muted);
}
.p-tag {
  position: absolute; top: 8px; left: 8px;
  background: var(--bg); color: var(--text);
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase; font-weight: 800;
  padding: 5px 9px; border-radius: 100px; opacity: 0.92;
}
.p-sale-badge {
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 100px;
  flex-shrink: 0;
}
.p-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.p-name {
  font-size: 13.5px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 35px;
}
/* wrap: при дорогой цене кнопка уходит на строку ниже, а цена остаётся целой */
/* цена сверху, кнопка снизу во всю ширину — одинаково при любой длине цены */
.p-foot { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: auto; }
.p-price-col { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
/* цена всегда одной строкой — «₽» не должен переноситься вниз */
.p-price { font-weight: 800; font-size: 16px; white-space: nowrap; }
.p-old-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.p-old-price { font-size: 11.5px; color: var(--muted); text-decoration: line-through; white-space: nowrap; }
#pr-old.p-old-price { font-size: 16px; }
.p-open {
  background: var(--btn); color: var(--btn-text);
  font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  padding: 9px 14px; border-radius: 100px; flex-shrink: 0; width: 100%;
}
.p-open:disabled { opacity: 0.4; }
.p-stock { font-size: 11px; font-weight: 600; color: var(--muted); }
.p-stock.ok { color: var(--green); }
.p-stock.out { color: var(--red); }

/* компактные строки-объявления (услуги: накрутка и т.п.) */
.p-rows { display: flex; flex-direction: column; gap: 8px; }
.p-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: left; cursor: pointer;
  background: var(--card); border-radius: 12px; padding: 12px 13px;
  box-shadow: var(--shadow); color: var(--text);
}
.p-row:active { transform: scale(0.99); }
.p-row-main { min-width: 0; flex: 1; }
.p-row-name {
  font-size: 13px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.p-row-meta { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.p-row-ok { color: var(--green); }
.p-row-out { color: var(--red); }
.p-row-price { flex-shrink: 0; text-align: right; }

.empty { text-align: center; color: var(--muted); padding: 44px 20px; }
.empty-icon {
  width: 60px; height: 60px; border-radius: 20px; background: var(--card);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; color: var(--muted);
}

/* ============ нижняя навигация (плавающая) ============ */
#navbar {
  position: fixed; bottom: calc(12px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%); z-index: 20;
  background: var(--card); border: 1px solid var(--line);
  display: flex; gap: 2px; padding: 5px;
  border-radius: 100px; box-shadow: var(--shadow);
  max-width: calc(100vw - 24px);
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); font-size: 9.5px; font-weight: 700;
  padding: 7px 15px; border-radius: 100px; transition: all 0.15s;
}
.nav-btn svg { width: 21px; height: 21px; }
.nav-btn.active { color: var(--btn-text); background: var(--btn); }

/* ============ карточки ============ */
.card {
  background: var(--card); border-radius: var(--radius); padding: 15px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.card-inner { background: var(--card2); border-radius: 12px; padding: 13px; box-shadow: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.badge { font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 100px; white-space: nowrap; letter-spacing: 0.3px; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.err { background: var(--red-soft); color: var(--red); }
.badge.info { background: var(--accent-soft); color: var(--accent); }

/* --- панель сортировки/фильтра каталога --- */
.filter-row { display: flex; gap: 8px; margin: 0 0 12px; }
.filter-sel {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 100px;
  background: var(--card2); border: none; color: var(--text);
  font-size: 12.5px; font-weight: 700; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a90a0' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px;
}
.filter-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px;
  padding: 9px 14px; border-radius: 100px; background: var(--card2);
  color: var(--text); font-size: 12.5px; font-weight: 700;
}
.filter-btn.active { background: var(--accent); color: #fff; }
.filter-btn svg { width: 14px; height: 14px; }

/* --- закреплённые товары --- */
.p-pin {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
.p-pin svg { width: 13px; height: 13px; }
.p-pin-inline { color: var(--accent); vertical-align: -1px; }
.p-pin-inline svg { width: 12px; height: 12px; }
.icon-btn.active { background: var(--accent); color: #fff; }

/* --- бейджи доверия на карточке товара --- */
.trust-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.trust-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 5px 9px; border-radius: 8px;
  line-height: 1;
}
.trust-badge svg { width: 13px; height: 13px; }
.tb-fast { background: #fff4d6; color: #9a6b00; }
.tb-guar { background: #e6f6ec; color: #12864a; }
.tb-hit  { background: #ffe4e0; color: #d13b1f; }
.tb-pop  { background: #e7ecff; color: #3a53c4; }
.tb-qual { background: #f0e6ff; color: #7b3fd1; }
body.light .tb-fast { background: #fff4d6; color: #9a6b00; }
/* «куплено N» — огонёк + число */
.sold-count {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: var(--amber);
}
.sold-count.sm { font-size: 11px; }
.sold-count svg { width: 13px; height: 13px; }
.p-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 15px; }

/* --- «как это работает» 1-2-3 --- */
.how-works { margin: 16px 0 4px; }
.how-step {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.how-step:last-child { border-bottom: none; }
.how-num {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.how-ic { color: var(--accent); display: flex; flex-shrink: 0; }
.how-txt { display: flex; flex-direction: column; }
.how-txt b { font-size: 13.5px; }
.how-txt span { font-size: 12px; color: var(--muted); }

/* --- пикер бейджей в форме товара --- */
.badge-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.badge-pick {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card2); border-radius: 9px; padding: 8px 11px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.badge-pick input { width: 16px; height: 16px; accent-color: var(--accent); }

/* метка заказа в списке чатов админа: номер жирным + название с аккуратной обрезкой */
.chat-order-tag { display: flex; align-items: center; gap: 6px; margin-top: 4px; min-width: 0; }
.chat-order-name {
  font-size: 12px; font-weight: 600; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}

/* ============ кнопки ============ */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; border-radius: 13px;
  font-weight: 700; font-size: 15px; transition: transform 0.05s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--btn); color: var(--btn-text); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: var(--card2); color: var(--text); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-sm { width: auto; padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: 0.45; }

/* ============ шторка ============ */
#sheet-overlay {
  position: fixed; inset: 0; background: rgba(5, 6, 10, 0.6); z-index: 30;
  animation: fade 0.2s;
}
#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31;
  background: var(--card); border-radius: 22px 22px 0 0;
  max-height: 90vh; overflow-y: auto;
  padding: 10px 16px calc(22px + env(safe-area-inset-bottom));
  animation: slide-up 0.25s ease;
  max-width: 560px; margin: 0 auto;
}
@keyframes slide-up { from { transform: translateY(60px); opacity: 0.5; } }
@keyframes fade { from { opacity: 0; } }

.sheet-handle { width: 40px; height: 4px; background: var(--line); border-radius: 4px; margin: 4px auto 14px; }
.sheet-title { font-size: 18px; font-weight: 800; margin-bottom: 12px; }

.sheet-imgwrap {
  position: relative; width: 100%;
  border-radius: 14px; overflow: hidden; background: var(--card2); margin-bottom: 14px;
}
/* картинка товара показывается ПОЛНОСТЬЮ (по ширине, высота по пропорции) */
.sheet-imgwrap img { width: 100%; height: auto; max-height: 68vh; object-fit: contain; display: block; }
.sheet-imgwrap .p-mono { aspect-ratio: 1.8; }  /* заглушка без фото сохраняет рамку */
.price-big { font-size: 26px; font-weight: 800; }
.desc { color: var(--muted); font-size: 14px; white-space: pre-wrap; margin: 10px 0 4px; }

/* степпер количества */
.qty-row { display: flex; align-items: center; justify-content: space-between; margin: 14px 0; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--card2); border-radius: 12px; padding: 4px; }
.stepper button {
  width: 38px; height: 38px; border-radius: 9px; background: var(--card);
  font-size: 19px; font-weight: 700; color: var(--text); box-shadow: var(--shadow);
}
.stepper button:disabled { opacity: 0.35; }
.stepper span { min-width: 42px; text-align: center; font-weight: 800; font-size: 17px; }

/* способы оплаты */
.pay-method {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 13px; border-radius: 13px; background: var(--card2);
  margin-bottom: 8px; font-weight: 700; font-size: 14.5px; text-align: left;
  color: var(--text);
}
.pay-method:active { background: var(--accent-soft); }
.pay-method:disabled { opacity: 0.4; }
.pay-icon {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--text); box-shadow: var(--shadow);
}
.pay-sub { font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 1px; }

/* выданный товар */
.item-line {
  display: flex; align-items: center; gap: 8px;
  background: var(--card2); border-radius: 10px; padding: 10px 12px; margin-bottom: 6px;
}
.item-line code {
  flex: 1; font-size: 13px; word-break: break-all;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.copy-btn { color: var(--accent); padding: 4px; display: flex; }
.copy-btn.danger { color: var(--red); }

/* успешная оплата */
.success-icon {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center; margin: 6px auto 12px;
}

/* формы */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 12px; font-weight: 600; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: 12px; margin-top: 10px; }
/* значки доверия к отзывам («только реальные покупатели») */
.verified-note {
  display: flex; align-items: center; gap: 8px; text-align: left; line-height: 1.35;
  background: var(--green-soft); color: var(--text);
  border-radius: 12px; padding: 10px 12px; font-size: 12.5px; margin-top: 10px;
}
.verified-note svg { color: var(--green); flex-shrink: 0; }
.rating-verified {
  display: flex; align-items: center; gap: 5px;
  color: var(--green); font-size: 11px; font-weight: 600; margin-top: 4px;
}
/* розыгрыш */
.giveaway-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: linear-gradient(135deg, #101c7a 0%, #1e3ce0 55%, #2f6bff 100%); color: #fff;
  border: 1px solid rgba(130, 170, 255, 0.45);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; cursor: pointer;
  box-shadow: 0 6px 22px rgba(30, 60, 224, 0.45);
}
.gc-emoji { font-size: 30px; flex-shrink: 0; }
.gc-body { min-width: 0; }
.gc-title { font-weight: 800; font-size: 15px; }
.gc-sub { font-size: 12px; opacity: 0.92; margin-top: 2px; }
.gv-head { text-align: center; }
.gv-emoji { font-size: 42px; line-height: 1; }
.gv-timer { color: var(--muted); font-size: 13px; margin-top: 6px; }
.gv-tickets { text-align: center; background: var(--card); border-radius: 14px; padding: 16px 14px; margin-top: 14px; }
.gv-tk-num { font-size: 42px; font-weight: 800; line-height: 1; color: var(--green); }
.gv-tk-lbl { font-size: 13px; color: var(--muted); margin-top: 3px; }
.gv-tk-break { font-size: 12px; color: var(--muted); margin-top: 10px; }
.gv-block { margin-top: 16px; }
.gv-h { font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.gv-prize { background: var(--card); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 6px; }
.gv-how { font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.gv-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; line-height: 1.45; }

/* быстрые суммы */
.quick-amounts { display: flex; gap: 8px; margin: 10px 0 14px; }
.quick-amounts button {
  flex: 1; background: var(--card2); border-radius: 10px; padding: 10px 0;
  font-weight: 700; font-size: 13.5px; color: var(--text);
}
.quick-amounts button.active { background: var(--accent); color: #fff; }

/* ============ профиль ============ */
.profile-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--btn); color: var(--btn-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 800; flex-shrink: 0;
}
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 13px 14px; box-shadow: var(--shadow); }
.stat-card.inner { background: var(--card2); box-shadow: none; }
.stat-card .v { font-size: 19px; font-weight: 800; }
.stat-card .l { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }

.balance-card { padding: 18px 16px; }
.balance-value { font-size: 30px; font-weight: 800; margin: 3px 0 14px; }

.ref-link {
  display: flex; align-items: center; gap: 8px;
  background: var(--card2); border-radius: 10px; padding: 10px 12px; margin-top: 10px;
}
.ref-link code {
  flex: 1; font-size: 12px; word-break: break-all;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.info-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 2px; border-bottom: 1px solid var(--line);
  font-size: 14.5px; font-weight: 600; text-align: left; color: var(--text);
}
.info-link:last-child { border-bottom: none; }
.info-link .ic { color: var(--muted); display: flex; }
.info-link .arr { margin-left: auto; color: var(--muted); display: flex; }

/* ============ админка ============ */
.subtabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtab {
  flex-shrink: 0; padding: 8px 15px; border-radius: 100px; font-size: 12.5px;
  font-weight: 700; background: var(--card); color: var(--muted); white-space: nowrap;
}
.subtab.active { background: var(--btn); color: var(--btn-text); }

.admin-p-row { display: flex; gap: 10px; align-items: center; }
.admin-p-thumb {
  width: 46px; height: 46px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--card2); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.admin-p-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-p-actions { display: flex; gap: 6px; margin-left: auto; flex-shrink: 0; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; background: var(--card2);
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.icon-btn.danger { color: var(--red); }
.icon-btn.active { background: var(--accent); color: #fff; }
.banner-admin-img { width: 100%; border-radius: 10px; display: block; }

/* режим выбора товаров для массового удаления */
.admin-p-row.selectable { cursor: pointer; user-select: none; -webkit-user-select: none; }
.admin-p-row.sel-on { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.sel-box {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  border: 2px solid var(--line); background: var(--card2);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.admin-p-row.sel-on .sel-box { background: var(--accent); border-color: var(--accent); }
.bulk-bar {
  position: sticky; bottom: 84px; z-index: 6; margin-top: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.bulk-bar .btn-danger { width: auto; padding: 11px 16px; display: flex; align-items: center; gap: 6px; }
.bulk-bar .btn-danger:disabled { opacity: 0.5; }

.cat-admin-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.cat-admin-row:last-child { border-bottom: none; }

/* стрелки перестановки категорий: узкая колонка из двух половинок */
.cat-move { display: flex; flex-direction: column; gap: 3px; flex-shrink: 0; }
.cat-move .icon-btn { width: 26px; height: 19px; border-radius: 6px; }
.cat-move .icon-btn:disabled { opacity: 0.3; }

/* ============ график продаж в админке ============ */
.an-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; padding: 2.5px 0;
}
.an-label { width: 52px; flex-shrink: 0; color: var(--muted); }
.an-track {
  flex: 1; min-width: 0; height: 7px; border-radius: 100px;
  background: var(--card2); overflow: hidden;
}
.an-bar { display: block; height: 100%; border-radius: 100px; background: var(--accent); }
.an-val { width: 62px; flex-shrink: 0; text-align: right; font-weight: 700; }
.an-cnt { width: 20px; flex-shrink: 0; text-align: right; color: var(--muted); }

/* ============ отзывы ============ */
.stars { color: var(--amber); display: inline-flex; gap: 1px; vertical-align: -2px; }
.p-rating {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.star-picker { display: flex; justify-content: center; gap: 8px; padding: 12px 0 2px; }
.star-btn { color: var(--line); padding: 2px; transition: transform 0.1s; }
.star-btn.on { color: var(--amber); }
.star-btn:active { transform: scale(1.15); }
.shop-rating {
  display: flex; align-items: center; width: 100%;
  text-align: left; cursor: pointer; margin-top: 12px;
}
.review { padding: 12px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: none; }
.review-text { font-size: 13.5px; margin-top: 5px; white-space: pre-wrap; }
.review-del { color: var(--red); font-size: 12px; font-weight: 700; margin-top: 6px; }
.mt4 { margin-top: 4px; }

/* ============ чат с продавцом ============ */
.chat-box {
  display: flex; flex-direction: column; gap: 7px;
  height: 46vh; overflow-y: auto; padding: 6px 2px 10px;
  overscroll-behavior: contain;
}
.bubble {
  max-width: 82%; padding: 9px 12px; border-radius: 15px;
  font-size: 14px; line-height: 1.4; word-break: break-word; white-space: pre-wrap;
}
.bubble.me {
  align-self: flex-end; background: var(--accent); color: #fff;
  border-bottom-right-radius: 5px;
}
.bubble.them {
  align-self: flex-start; background: var(--card2); color: var(--text);
  border-bottom-left-radius: 5px;
}
.b-author { font-size: 10.5px; font-weight: 800; color: var(--accent); margin-bottom: 2px; }
.bubble.me .b-time, .bubble.them .b-time {
  font-size: 9.5px; opacity: 0.65; margin-top: 3px; text-align: right;
}
.b-ask {
  font-size: 11.5px; opacity: 0.8; font-weight: 600;
  padding-bottom: 5px; margin-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
.bubble.them .b-ask { border-bottom-color: var(--line); }

.ask-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--card2); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: 12px;
}
.ask-chip .ic { color: var(--accent); display: flex; flex-shrink: 0; }
.ask-chip .txt { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-chip-x { color: var(--muted); flex-shrink: 0; padding: 2px; }

.chat-input-row {
  display: flex; gap: 8px; align-items: center;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.chat-input-row input { flex: 1; border-radius: 100px; padding: 11px 16px; }
.chat-send {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.chat-send:active { transform: scale(0.94); }

/* ============ тост ============ */
#toast {
  position: fixed; left: 50%; bottom: 96px;
  transform: translateX(-50%); z-index: 60;
  background: var(--btn); color: var(--btn-text);
  padding: 11px 18px; border-radius: 100px; font-size: 13.5px; font-weight: 700;
  max-width: 86vw; text-align: center; animation: toast-in 0.25s;
  box-shadow: var(--shadow);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ============ Публичная витрина (сайт вне Telegram) ============
   Показывается в обычном браузере вместо заглушки «Откройте через Telegram».
   Нужна платёжным системам: модератор эквайринга проверяет сайт руками и
   должен увидеть товары с ценами, контакты, реквизиты и условия возврата. */

body.landing-mode { overscroll-behavior: auto; }
body.landing-mode #navbar { display: none; }

#landing { padding-bottom: 0; }
.lp-wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.lp-muted { color: var(--muted); }
.lp-mt { margin-top: 10px; }

/* hero */
.lp-hero {
  padding: 40px 0 46px;
  background: linear-gradient(160deg, var(--accent-soft) 0%, var(--bg) 78%);
  border-bottom: 1px solid var(--line);
}
.lp-brandrow { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.lp-logo { width: 46px; height: 46px; border-radius: 14px; object-fit: cover; flex: none; }
.lp-logo-mono {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 16px; letter-spacing: .5px;
}
.lp-brand { font-size: 17px; font-weight: 800; letter-spacing: .3px; }
.lp-sub { font-size: 11.5px; color: var(--muted); letter-spacing: 1.2px; text-transform: uppercase; }
.lp-h1 { font-size: 30px; line-height: 1.22; font-weight: 800; max-width: 660px; }
.lp-lead { margin-top: 14px; max-width: 620px; color: var(--muted); font-size: 15.5px; }
.lp-rating { margin-top: 16px; font-weight: 700; color: var(--amber); }
.lp-cta {
  display: inline-block; margin-top: 24px; padding: 13px 26px;
  background: var(--accent); color: #fff; text-decoration: none;
  border-radius: 100px; font-weight: 700; font-size: 15px;
}
.lp-cta:hover { opacity: .9; }

/* секции */
.lp-sec { padding: 40px 0; border-bottom: 1px solid var(--line); }
.lp-h2 { font-size: 20px; font-weight: 800; margin-bottom: 16px; }
.lp-h3 { font-size: 15px; font-weight: 700; color: var(--muted); margin: 24px 0 12px; }
.lp-note { margin-top: 20px; font-size: 13px; color: var(--muted); }

/* как это работает */
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lp-step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.lp-stepn {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}
.lp-stept { margin: 10px 0 4px; font-weight: 700; }

/* каталог */
.lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px; }
.lp-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.lp-pimg { width: 100%; aspect-ratio: 1.7; object-fit: cover; display: block; }
.lp-pimg-empty { background: var(--card2); }
.lp-cbody { padding: 13px 14px 15px; display: flex; flex-direction: column; flex: 1; }
.lp-pname { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.lp-pdesc { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.lp-prow { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; }
.lp-in { color: var(--green); font-weight: 700; }
.lp-out { color: var(--red); font-weight: 700; }
.lp-sold { font-size: 12px; }
.lp-price { margin-top: auto; padding-top: 12px; font-size: 17px; font-weight: 800; white-space: nowrap; }
.lp-old {
  font-size: 13px; font-weight: 600; color: var(--muted);
  text-decoration: line-through; margin-left: 6px;
}

/* оплата */
.lp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 100px;
  padding: 8px 15px; font-size: 13.5px; font-weight: 600;
}

/* две колонки: условия, контакты, реквизиты */
.lp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.lp-panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.lp-panel p { color: var(--muted); font-size: 14px; }
.lp-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.lp-dl dt { color: var(--muted); }
.lp-dl dd { font-weight: 600; word-break: break-word; }
.lp-dl a { color: var(--accent); text-decoration: none; }
.lp-dl a:hover { text-decoration: underline; }

/* подвал */
.lp-foot { padding: 28px 0 40px; }
.lp-flinks { display: flex; flex-wrap: wrap; gap: 18px; }
.lp-flinks a { color: var(--accent); text-decoration: none; font-size: 14px; }
.lp-flinks a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .lp-steps, .lp-two { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .lp-h1 { font-size: 24px; }
  .lp-wrap { padding: 0 16px; }
  .lp-sec, .lp-hero { padding: 30px 0; }
  .lp-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}
.lp-count {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 100px;
  background: var(--card2); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 700; color: var(--muted); vertical-align: middle;
}
.lp-more { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* липкая навигация витрины */
/* Фон непрозрачный намеренно: с backdrop-filter на странице такой длины
   браузер срывает отрисовку и куски экрана остаются пустыми. */
.lp-nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.lp-navrow { display: flex; align-items: center; gap: 22px; height: 52px; overflow-x: auto; }
.lp-navrow::-webkit-scrollbar { display: none; }
.lp-navrow a {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600;
  white-space: nowrap; flex: none;
}
.lp-navrow a:hover { color: var(--text); }
.lp-navcta {
  margin-left: auto; color: #fff !important; background: var(--accent);
  padding: 8px 16px; border-radius: 100px; font-size: 13.5px;
}
.lp-navcta:hover { opacity: .9; }
html { scroll-behavior: smooth; }
.lp-sec { scroll-margin-top: 60px; }
@media (max-width: 560px) {
  .lp-navrow { gap: 16px; }
  .lp-navcta { margin-left: 8px; }
}
