:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --bg2: var(--tg-theme-secondary-bg-color, #f2f3f5);
  --text: var(--tg-theme-text-color, #111111);
  --hint: var(--tg-theme-hint-color, #8a8f98);
  --accent: var(--tg-theme-button-color, #111111);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --sale: #ff3b30;
  --radius: 14px;
  /* безопасные зоны: вырез/статус-бар телефона + плавающие кнопки Telegram в полноэкранном режиме */
  --safe-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-b: max(env(safe-area-inset-bottom, 0px), calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px)));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", sans-serif;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.brandbar {
  text-align: center; font-weight: 900; font-size: 22px; letter-spacing: .04em; line-height: 1;
  text-transform: uppercase; margin: 2px 0 12px;
}
header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  padding: calc(10px + var(--safe-t)) 12px 8px;
  transition: box-shadow .2s;
}
header.shadow { box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 6px 16px rgba(0,0,0,.04); }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg2); border-radius: 12px; padding: 0 12px; height: 42px;
}
.search .ico { width: 18px; height: 18px; fill: var(--hint); flex: none; }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: 16px;
}
.search input::placeholder { color: var(--hint); }
.search input::-webkit-search-cancel-button { display: none; }
.qclear { width: 22px; height: 22px; border-radius: 50%; background: var(--hint); color: var(--bg); font-size: 11px; line-height: 22px; }

.suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 2px; }
.suggest .s-label { width: 100%; font-size: 12px; color: var(--hint); }
.suggest button { background: var(--bg2); border-radius: 10px; padding: 5px 10px; font-size: 13px; }

.chips {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  overflow-x: auto; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding: 0 12px;
}
.chips::-webkit-scrollbar { display: none; }
.brand-chips { display: flex; gap: 6px; }
.chip {
  flex: none; white-space: nowrap; height: 32px; padding: 0 12px; border-radius: 16px;
  background: var(--bg2); font-size: 14px; transition: background .15s, color .15s;
}
.chip.on { background: var(--accent); color: var(--accent-text); }
.chip-vint:not(.on) { box-shadow: inset 0 0 0 1.5px #c9a46a; color: #c9a46a; }
.chip .caret { font-size: 10px; opacity: .7; }
.sep { flex: none; width: 1px; height: 20px; background: var(--hint); opacity: .3; }

/* ---------- grid ---------- */
main { padding: 4px 10px calc(20px + var(--safe-b)); }
.info { font-size: 13px; color: var(--hint); padding: 2px 4px 8px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 10px; }
.card { display: block; text-align: left; cursor: pointer; -webkit-user-select: none; user-select: none; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 16px; }
/* фото в карточке листаются пальцем */
.card-track {
  display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x pan-y;
}
.card-track::-webkit-scrollbar { display: none; }
.card.anim { animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }
.card-img {
  position: relative; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden;
  background: var(--bg2);
}
.card-img::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); pointer-events: none; }
.card-img img { flex: none; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .25s;
  scroll-snap-align: start; scroll-snap-stop: always; }
.card-img img.loaded { opacity: 1; }
.badge {
  position: absolute; left: 8px; top: 8px; background: var(--sale); color: #fff;
  font-size: 12px; font-weight: 600; border-radius: 8px; padding: 2px 6px;
}
.card-dots { position: absolute; bottom: 7px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; pointer-events: none; }
.card-dots i { width: 5px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.55); box-shadow: 0 0 2px rgba(0,0,0,.35); transition: width .2s, background .2s; }
.card-dots i.on { width: 12px; background: #fff; }
.card-body { padding: 9px 2px 0; }
.price { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.price s { font-weight: 400; color: var(--hint); font-size: 13px; margin-left: 4px; }
.price .sale { color: var(--sale); }
.card-title { font-size: 14px; line-height: 1.3; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title { font-weight: 500; }
.card-sizes { display: flex; gap: 4px; margin-top: 7px; overflow: hidden; }
.card-sizes span {
  flex: none; font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 7px; border-radius: 7px;
  background: var(--bg2); color: var(--text); opacity: .85;
}
.skeleton .card-img { animation: pulse 1.2s ease-in-out infinite; }
.skeleton .line { height: 12px; border-radius: 6px; background: var(--bg2); margin-top: 8px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
mark { background: none; color: inherit; font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); }

.empty { text-align: center; padding: 60px 20px; }
.empty-emoji { font-size: 48px; }
.empty-title { font-size: 18px; font-weight: 600; margin-top: 8px; }
.empty-text { color: var(--hint); margin: 6px 0 16px; }

/* ---------- buttons ---------- */
.btn-primary, .btn-secondary {
  height: 48px; border-radius: 12px; font-weight: 600; padding: 0 18px; font-size: 16px;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:disabled { opacity: .45; }
.btn-secondary { background: var(--bg2); }

/* ---------- product ---------- */
.product {
  position: fixed; inset: 0; z-index: 30; background: var(--bg);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: slideIn .22s ease backwards;  /* не both: иначе transform ломает position:fixed у кнопки «Заказать» */
}
@keyframes slideIn { from { transform: translateX(30%); opacity: 0; } }
.gallery-wrap { position: relative; }
.gallery {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  aspect-ratio: 3 / 4; background: var(--bg2);  /* фото из канала вертикальные 3:4 — без обрезки */
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; scroll-snap-stop: always; }
.counter {
  position: absolute; right: 12px; bottom: 10px; background: rgba(0,0,0,.45); color: #fff;
  font-size: 12px; border-radius: 10px; padding: 3px 8px;
}
.dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.55); transition: all .2s; box-shadow: 0 0 2px rgba(0,0,0,.3); }
.dots i.on { width: 16px; background: #fff; }
.close-btn {
  position: absolute; left: 12px; top: calc(12px + var(--safe-t)); width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff; font-size: 18px;
}
body.tg .close-btn { display: none; }
.product .gallery-wrap { border-radius: 0 0 22px 22px; overflow: hidden; }
.p-body { padding: 18px 16px calc(100px + var(--safe-b)); }
.p-brand { color: var(--hint); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.p-name { font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; margin: 6px 0 10px; }
.p-sku { color: var(--hint); font-size: 13px; margin: -4px 0 8px; }
.p-price { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.p-price s { font-size: 16px; font-weight: 400; color: var(--hint); margin-left: 8px; }
.p-price .sale { color: var(--sale); }
.p-price .off { font-size: 14px; background: var(--sale); color: #fff; border-radius: 8px; padding: 2px 6px; margin-left: 6px; vertical-align: middle; }
.p-section-title { font-weight: 700; font-size: 17px; margin: 22px 0 10px; }
.p-sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.p-sizes button, .sheet-sizes button {
  min-width: 56px; height: 44px; border-radius: 12px; background: var(--bg2); font-weight: 600;
  border: 2px solid transparent; transition: all .12s;
}
.p-sizes button.on, .sheet-sizes button.on { border-color: var(--accent); background: var(--bg); }
.p-desc { white-space: pre-wrap; color: var(--text); background: var(--bg2); border-radius: 14px; padding: 12px 14px; line-height: 1.45; }
.similar { display: grid; grid-auto-flow: column; grid-auto-columns: 42%; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.similar::-webkit-scrollbar { display: none; }
.order-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; padding: 10px 16px calc(10px + var(--safe-b));
  background: var(--bg); box-shadow: 0 -1px 0 rgba(0,0,0,.06);
}
.order-bar .btn-primary { width: 100%; }
body.tg .order-bar { display: none; }

/* ---------- viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 50; background: #000; }
.viewer-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-track img { flex: none; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; scroll-snap-stop: always; }
.viewer-counter { position: absolute; top: calc(16px + var(--safe-t)); left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; }
.viewer-close { position: absolute; top: calc(10px + var(--safe-t)); right: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; }

/* ---------- sheets ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.4); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--bg);
  border-radius: 18px 18px 0 0; padding: 8px 16px calc(16px + var(--safe-b));
  max-height: calc(100vh - var(--safe-t) - 40px); overflow-y: auto; animation: up .22s ease both;
}
@keyframes up { from { transform: translateY(100%); } }
.sheet-handle { width: 36px; height: 5px; border-radius: 3px; background: var(--hint); opacity: .4; margin: 0 auto 10px; }
.sheet-title { font-size: 18px; font-weight: 700; }
.sheet-sizes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sheet-sizes button { min-width: 0; }
.sheet-sizes button small { display: block; font-size: 10px; font-weight: 400; color: var(--hint); }

.sort-list button { display: flex; justify-content: space-between; width: 100%; padding: 14px 4px; font-size: 16px; border-bottom: 1px solid var(--bg2); }
.sort-list button.on::after { content: "✓"; color: var(--accent); font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); z-index: 60;
  background: rgba(20,20,20,.9); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px;
  animation: fade .2s both; max-width: 90%; text-align: center;
}

/* десктопный Telegram / широкие экраны */
header, main, .product, .sheet, .order-bar { max-width: 560px; margin-left: auto; margin-right: auto; }
.product { right: 0; left: 0; }

/* категории и бренды */
#catChips { margin-top: 8px; }
#catChips + .chips { margin-top: 6px; }
#catChips .chip { font-weight: 600; }
#chips .chip { height: 30px; font-size: 13px; }
.sheet-brands { display: flex; flex-direction: column; }
.sheet-brands button {
  display: flex; justify-content: space-between; align-items: center; padding: 13px 4px;
  font-size: 16px; border-bottom: 1px solid var(--bg2); text-align: left;
}
.sheet-brands button small { color: var(--hint); font-size: 13px; }
.sheet-brands button.on span::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.sheet-sizes button { font-size: 14px; }
.p-sizes button { padding: 0 12px; }

.chip .cnt { opacity: .55; font-weight: 500; margin-left: 2px; }

/* ---------- админка ---------- */
.admin-chip.on { background: #ff9500; color: #fff; }
.adm-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 2px 2px 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,149,0,.12); font-size: 13px; }
.adm-banner .chip { height: 28px; font-size: 13px; }
.card.is-hidden .card-img, .card.is-hidden .card-body { opacity: .45; }
.badge.hidden-badge { left: auto; right: 8px; background: rgba(0,0,0,.65); }
.adm-bar { display: grid; grid-template-columns: 1fr 44px; gap: 6px; margin-top: 8px; }
.adm-bar button { height: 34px; border-radius: 10px; background: var(--bg2); font-size: 13px; font-weight: 600; }
.adm-bar button.danger, .adm-actions .danger { color: var(--sale); }
.admin-panel { background: rgba(255,149,0,.08); border: 1px solid rgba(255,149,0,.35); border-radius: 16px;
  padding: 12px; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.adm-head { font-weight: 700; font-size: 15px; }
.admin-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--hint); flex: 1; min-width: 0; }
.admin-panel input, .admin-panel select, .admin-panel textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1px solid var(--bg2);
  border-radius: 10px; padding: 9px 10px; width: 100%; outline: none; }
.admin-panel input:focus, .admin-panel textarea:focus, .admin-panel select:focus { border-color: var(--accent); }
.adm-row { display: flex; gap: 8px; }
.adm-actions { display: grid; grid-template-columns: 1fr auto 48px; gap: 8px; }
.adm-actions button { height: 44px; padding: 0 12px; }
.order-bar.adm-off { display: none; }

/* ---------- окна фильтров: кнопка «Показать» всегда видна ---------- */
.sheet { display: flex; flex-direction: column; overflow: hidden; }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; min-height: 28px; }
.sheet-reset { color: var(--hint); font-size: 15px; padding: 4px 0 4px 12px; }
.sheet-reset:active { opacity: .6; }
.sheet-search { flex: none; margin-bottom: 8px; }
.sheet-search input { width: 100%; height: 40px; border: 0; outline: 0; border-radius: 10px; background: var(--bg2);
  color: var(--text); font-size: 16px; padding: 0 12px; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  margin: 0 -16px; padding: 2px 16px 8px; }
.sheet-foot { flex: none; padding-top: 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  box-shadow: 0 -1px 0 var(--bg2); background: var(--bg); }
.sheet-foot .btn-primary { width: 100%; }

/* ---------- избранное ---------- */
.fav-btn { position: absolute; top: 6px; right: 6px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,.28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: grid; place-items: center; transition: transform .15s; }
.fav-btn::before { content: "♡"; color: #fff; font-size: 19px; line-height: 1; margin-top: 1px; }
.fav-btn.on::before { content: "♥"; color: #ff3b5c; }
.fav-btn:active { transform: scale(.85); }
.fav-btn.pop { animation: favpop .3s ease; }
@keyframes favpop { 50% { transform: scale(1.3); } }
.g-fav { top: calc(12px + var(--safe-t)); right: 12px; width: 40px; height: 40px; }
.g-fav::before { font-size: 22px; }
.fav-chip.on { background: #ff3b5c; color: #fff; }
.fav-chip.on .cnt { color: #fff; opacity: .85; }
.fav-chip .fav-ico { font-size: 15px; }
.fav-chip .sold-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--sale); margin-left: 3px; vertical-align: 1px; }
body.fav-mode #catChips, body.fav-mode #filterChip, body.fav-mode #sortChip, body.fav-mode #activeFilters { display: none !important; }
body.fav-mode #favChip { color: #ff3b5c; }
.card.is-sold .card-img img { filter: grayscale(1); opacity: .55; }
.card.is-sold .card-body { opacity: .55; }
.badge.sold-badge { left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(20,20,20,.78);
  font-size: 14px; padding: 6px 12px; border-radius: 10px; white-space: nowrap; }
.badge.hidden-badge { left: 8px; right: auto; top: auto; bottom: 22px; }

#sortChip b { font-weight: 600; }
.sort-list button { font-size: 16px; }

/* ---------- фильтр ---------- */
.chip-ico { width: 14px; height: 14px; fill: currentColor; vertical-align: -2px; margin-right: 2px; }
.fcnt:not(:empty) { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 9px; background: var(--accent-text); color: var(--accent); font-size: 11px; font-weight: 700; }
.active-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 8px -12px 0; padding: 0 12px; }
.active-filters::-webkit-scrollbar { display: none; }
.pill { flex: none; height: 28px; padding: 0 10px; border-radius: 14px; font-size: 13px; white-space: nowrap;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.pill span { opacity: .55; margin-left: 2px; }
.pill-reset { background: none; border-color: transparent; color: var(--hint); }
.sheet-tall { height: calc(100vh - var(--safe-t) - 40px); }
.f-sec { padding: 14px 0; border-bottom: 1px solid var(--bg2); }
.f-sec:last-child { border-bottom: 0; }
.f-title { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.f-title small { font-weight: 400; font-size: 12px; color: var(--hint); margin-left: 6px; }
.f-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.f-pills button, .f-sizes button { height: 38px; padding: 0 14px; border-radius: 12px; background: var(--bg2); font-size: 14px;
  font-weight: 500; border: 2px solid transparent; transition: all .12s; }
.f-pills button small, .f-sizes button small { color: var(--hint); font-size: 11px; margin-left: 3px; }
.f-pills button.on, .f-sizes button.on { border-color: var(--accent); background: var(--bg); font-weight: 600; }
.f-pills button.dim, .f-sizes button.dim { opacity: .4; }
.f-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.f-sizes button { padding: 0 4px; display: flex; flex-direction: column; justify-content: center; align-items: center; height: 46px; line-height: 1.1; }
.f-sizes button small { margin: 0; }
.f-price { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.f-price i { color: var(--hint); font-style: normal; }
.f-price label { flex: 1; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px; border-radius: 12px;
  background: var(--bg2); border: 2px solid transparent; }
.f-price label:focus-within { border-color: var(--accent); }
.f-price label span { color: var(--hint); font-size: 14px; }
.f-price input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; font-weight: 600; }
.f-search { width: 100%; height: 40px; border: 0; outline: 0; border-radius: 10px; background: var(--bg2); color: var(--text);
  font-size: 16px; padding: 0 12px; margin-bottom: 6px; }
.f-list { display: flex; flex-direction: column; }
.f-list button { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; font-size: 16px;
  border-bottom: 1px solid var(--bg2); text-align: left; }
.f-list button span::before { content: ""; display: inline-block; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--hint);
  margin-right: 10px; vertical-align: -4px; opacity: .6; }
.f-list button.on span::before { background: var(--accent); border-color: var(--accent); opacity: 1;
  box-shadow: inset 0 0 0 3px var(--bg); }
.f-list button small { color: var(--hint); font-size: 13px; }
.f-list .f-more { justify-content: center; color: var(--accent); border-bottom: 0; font-weight: 600; }
.f-empty { color: var(--hint); font-size: 14px; }
#fApply:disabled { opacity: .5; }

.f-price label { min-width: 0; }
.f-price { width: 100%; }

/* шторки: смахивание вниз (анимация появления не должна перебивать transform при перетаскивании) */
.sheet { animation: up .22s ease backwards; will-change: transform; }
.sheet-handle { width: 40px; height: 5px; margin: 0 auto 12px; position: relative; }
.sheet-handle::after { content: ""; position: absolute; inset: -14px -60px; }  /* большая зона захвата */

/* ---------- шапка (макет: название + значки, поиск, разделы, «N товаров · Сначала новые») ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 12px; }
.topbar .brandbar { text-align: left; margin: 0; font-size: 26px; font-weight: 800; letter-spacing: .01em; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-icons { display: flex; align-items: center; gap: 4px; flex: none; margin-right: -6px; }
.icon-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--text); }
.icon-btn:active { background: var(--bg2); }
.icon-btn svg { width: 26px; height: 26px; }
.i-heart { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.icon-btn.has .i-heart { fill: currentColor; }
.i-line { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-badge:empty { display: none; }
.icon-badge { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--text); color: var(--bg); font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
#filterChip.on .icon-badge { background: #ff9500; color: #fff; }
#favChip .sold-dot { position: absolute; bottom: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--sale);
  box-shadow: 0 0 0 2px var(--bg); margin: 0; }
.admin-chip.on { background: #ff9500; color: #fff; }
.search { height: 46px; border-radius: 14px; }
.search input { font-size: 16px; }
/* разделы — крупные «таблетки», выбранная выделена инверсией */
.cat-tabs { margin-top: 12px; gap: 8px; }
.cat-tabs .chip { height: 38px; padding: 0 18px; border-radius: 19px; font-size: 15px; font-weight: 500; }
.cat-tabs .chip.on { background: var(--text); color: var(--bg); font-weight: 700; }
#catChips + .chips, #catChips { margin-top: 12px; }
/* строка над каталогом */
.listbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 10px; }
.count-label { color: var(--hint); font-size: 15px; }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 500; color: var(--text); padding: 4px 0 4px 8px; }
.i-chev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- строка разделов: таблетки слева, ♡ и фильтр справа ---------- */
.cat-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.cat-row #catChips { flex: 1; min-width: 0; margin: 0 0 0 -12px; padding-left: 12px; }
.cat-row #catChips[hidden] + .row-icons { margin-left: auto; }
.row-icons { flex: none; display: flex; gap: 2px; margin-right: -6px; }
.row-icons .icon-btn svg { width: 25px; height: 25px; }
body.fav-mode .row-icons { margin-left: auto; }
/* ---------- уведомления ---------- */
.foot-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.foot-row .btn-secondary[hidden] + .btn-primary { grid-column: 1 / -1; }
#fSubscribe { padding: 0 16px; white-space: nowrap; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 16px; line-height: 1.35; cursor: pointer; }
.switch-row input { display: none; }
.switch { flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--bg2); position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch-row input:checked + .switch { background: #34c759; }
.switch-row input:checked + .switch::after { transform: translateX(20px); }
.subs-list { display: flex; flex-direction: column; gap: 8px; }
.sub-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: var(--bg2); font-size: 15px; }
.sub-item button { color: var(--hint); font-size: 15px; padding: 2px 6px; }
