* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: var(--tg-theme-bg-color, #fff);
  --bg2: var(--tg-theme-secondary-bg-color, #f4f4f7);
  --text: var(--tg-theme-text-color, #111);
  --hint: var(--tg-theme-hint-color, #888);
  --btn: var(--tg-theme-button-color, #2a8cf0);
  --btn-text: var(--tg-theme-button-text-color, #fff);
  --danger: #ef4444;
  --ok: #22c55e;

  --radius: 14px;
  --radius-lg: 20px;
  --border: rgba(0,0,0,.08);
  --shadow-card: 0 12px 32px rgba(0,0,0,.18);

  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);

  --cw: 300px;
  --cgap: 10px;
}

[data-scheme="dark"] {
  --border: rgba(255,255,255,.12);
  --shadow-card: 0 12px 32px rgba(0,0,0,.5);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.4;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body { padding-bottom: calc(100px + var(--sab)); }

.hidden { display: none !important; }

/* ═══ ШАПКА ═══ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + var(--sat)) 12px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar-title {
  flex: 1; min-width: 0;
  font-size: 17px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-wrap { flex: 2; min-width: 0; }
.search-wrap .search { width: 100%; }
.search {
  padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg2); color: var(--text);
  font-size: 14px; outline: none;
}
.search:focus { border-color: var(--btn); }

.icon-btn {
  position: relative;
  width: 38px; height: 38px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg2); color: var(--text);
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.icon-btn:active { transform: scale(.94); }

.badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--danger); color: #fff;
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ═══ СТРАНИЦЫ ═══ */
.page { animation: fadein .25s ease; }

@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }


/* ═══ СЕКЦИИ ═══ */
.section { padding: 8px 0 4px; }
.section-title {
  display: block;
  width: fit-content;
  margin: 4px auto 14px;
  padding: 8px 24px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
/* ═══ КАРУСЕЛЬ ═══ */
.carousel {
  display: flex;
  gap: var(--cgap, 10px);
  overflow-x: auto;
  overflow-y: visible;
  padding: 8px 0 12px;
  padding-inline: max(16px, calc(50% - var(--cw) / 2));
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 50%;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.carousel::-webkit-scrollbar { display: none; }

.carousel-item {
  scroll-snap-align: center;
  scroll-snap-stop: always;
  flex: 0 0 var(--cw);
  width: var(--cw);
  aspect-ratio: 1 / 1;
  scroll-snap-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg2);
  cursor: pointer;
  transform: scale(.82);
  opacity: .55;
  transition: transform .3s ease, opacity .3s ease, box-shadow .3s ease;
  will-change: transform, opacity;
}
.carousel-item.active {
  transform: scale(1);
  opacity: 1;
  box-shadow: var(--shadow-card);
}
.carousel-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.carousel-img img { width: 100%; height: 100%; object-fit: cover; }
.carousel-img .placeholder { font-size: 40px; color: var(--hint); }
.carousel-empty {
  width: 100%; padding: 30px 16px;
  text-align: center; color: var(--hint);
}

/* ═══ КНОПКА НА ГЛАВНОЙ ═══ */
.home-actions {
  padding: 4px 16px 20px;
}

/* ═══ ФИЛЬТРЫ ═══ */
.filters { padding: 10px 12px 4px; }
.chips {
  display: flex; gap: 6px;
  overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg2); color: var(--text);
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.chip.active { background: var(--btn); color: var(--btn-text); border-color: var(--btn); }
.sorts { padding: 4px 0; }
.sort-select {
  padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg2); color: var(--text);
  font-size: 13px; outline: none;
}

/* ═══ СЕТКА ═══ */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 10px 12px 24px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--bg2); border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
  transition: transform .15s;
  animation: pop .3s ease both;
}
.card:active { transform: scale(.97); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) } }

.card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg);
  overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img .placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--hint); font-size: 30px;
}
.card-owned {
  position: absolute; top: 6px; left: 6px;
  padding: 3px 8px;
  background: var(--ok); color: #fff;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
}

.card-body { padding: 8px 10px 10px; }
.card-title {
  font-size: 13px; font-weight: 600; line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}
.card-price { font-size: 14px; font-weight: 700; color: var(--btn); margin-top: 4px; }

/* ═══ СКЕЛЕТОНЫ ═══ */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--bg2); border-radius: var(--radius);
  aspect-ratio: 1 / 1;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%) } }

/* ═══ СЛУЖЕБНЫЕ ═══ */
.loader, .empty {
  text-align: center; padding: 30px 16px;
  color: var(--hint); font-size: 14px;
}
.load-more {
  display: block; margin: 0 auto 30px;
  padding: 10px 20px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg2); color: var(--text);
  font-size: 14px; font-weight: 600; cursor: pointer;
}

/* ═══ МОДАЛКИ ═══ */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  animation: fadein .2s;
}
.modal-body {
  position: relative;
  width: 100%; max-height: 92vh;
  background: var(--bg);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  overflow-y: auto;
  animation: slideup .25s cubic-bezier(.2,.7,.3,1);
}
@media (min-width: 640px) {
  .modal { align-items: center; justify-content: center; }
  .modal-body { max-width: 460px; border-radius: var(--radius-lg); max-height: 88vh; }
}
@keyframes slideup { from { transform: translateY(30px) } to { transform: none } }

.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 34px; height: 34px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.modal-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
}
.modal-image img { width: 100%; height: 100%; object-fit: cover; }
.modal-image .placeholder { font-size: 60px; color: var(--hint); }
.modal-owned {
  position: absolute; top: 12px; left: 12px;
  padding: 6px 12px;
  background: var(--ok); color: #fff;
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
}

.modal-info { padding: 16px 18px 8px; }
.modal-cat { display: inline-block; font-size: 12px; color: var(--hint); margin-bottom: 4px; }
.modal-title { font-size: 20px; font-weight: 700; line-height: 1.25; margin-bottom: 8px; }
.modal-desc { font-size: 14px; color: var(--hint); margin-bottom: 10px; white-space: pre-wrap; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.modal-tags .tag {
  font-size: 12px; padding: 4px 10px;
  background: var(--bg2); border-radius: 999px; color: var(--hint);
}
.modal-footer {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 18px calc(16px + var(--sab));
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.modal-price { font-size: 22px; font-weight: 800; }
.modal-price-sub { font-size: 12px; color: var(--hint); }

/* ═══ КНОПКА ═══ */
.btn-buy {
  padding: 12px 22px;
  border: none; border-radius: 12px;
  background: var(--btn); color: var(--btn-text);
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: transform .15s, opacity .15s;
}
.btn-buy:active { transform: scale(.97); }
.btn-buy:disabled { opacity: .5; cursor: default; }
.btn-buy.big { width: 100%; padding: 16px; font-size: 17px; }

/* ═══ СПИСКИ ═══ */
.sheet-header { padding: 18px 18px 8px; }
.sheet-header h2 { font-size: 20px; font-weight: 700; }
.sheet-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.sheet-empty {
  padding: 40px 20px; text-align: center;
  color: var(--hint); line-height: 1.6;
}
.empty-icon { font-size: 40px; opacity: .5; margin-bottom: 10px; }
.link-btn {
  border: 0; background: none; color: var(--btn);
  font-size: 14px; font-weight: 600; cursor: pointer; padding: 6px;
}
.sheet-footer {
  padding: 16px 18px calc(16px + var(--sab));
  border-top: 1px solid var(--border);
  background: var(--bg);
  position: sticky; bottom: 0;
}
.sheet-total {
  display: flex; justify-content: space-between;
  align-items: baseline; font-size: 16px; margin-bottom: 4px;
}
.sheet-total strong { font-size: 22px; font-weight: 800; }
.sheet-subtotal { font-size: 13px; color: var(--hint); text-align: right; margin-bottom: 12px; }
.sheet-note { font-size: 12px; color: var(--hint); text-align: center; margin-top: 8px; }

/* ═══ АЙТЕМ ═══ */
.item {
  display: flex; gap: 12px; align-items: center;
  padding: 8px; background: var(--bg2); border-radius: 12px;
}
.item-img {
  width: 60px; height: 60px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--hint);
}
.item-img img { width: 100%; height: 100%; object-fit: cover; }
.item-info { flex: 1; min-width: 0; }
.item-title {
  font-size: 14px; font-weight: 600; line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-meta { font-size: 12px; color: var(--hint); margin-top: 2px; }
.item-price { font-size: 13px; font-weight: 700; color: var(--btn); margin-top: 4px; }

.item-remove {
  padding: 8px 10px;
  border: none; background: transparent;
  font-size: 18px; cursor: pointer; color: var(--danger);
  flex-shrink: 0;
}
.item-download {
  padding: 8px 14px;
  border: none; border-radius: 10px;
  background: var(--btn); color: var(--btn-text);
  font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  flex-shrink: 0;
}
.item-download:disabled {
  background: var(--bg); color: var(--hint); cursor: default;
}

/* ═══ ПРОФИЛЬ ═══ */
.profile-content { padding: 8px 18px 24px; }
.profile-head {
  display: flex; align-items: center; gap: 14px;
  padding: 18px;
  background: var(--bg2);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.profile-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--btn); color: var(--btn-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
  flex-shrink: 0;
}
.profile-name { font-size: 18px; font-weight: 700; }
.profile-sub { font-size: 13px; color: var(--hint); margin-top: 2px; }
.profile-level {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--btn);
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  padding: 14px;
  background: var(--bg2);
  border-radius: 12px;
  text-align: center;
}
.stat-value { font-size: 22px; font-weight: 800; color: var(--btn); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--hint); margin-top: 4px; }
.profile-fav {
  padding: 14px;
  background: var(--bg2);
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 14px;
}
.profile-fav strong { color: var(--btn); }
.profile-share {
  width: 100%;
  padding: 14px;
  border: none; border-radius: 12px;
  background: var(--btn); color: var(--btn-text);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.profile-share:active { transform: scale(.98); }

/* ═══ ТАББАР ═══ */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 14px 10px calc(14px + var(--sab));
  gap: 10px;
}

.tab {
  display: flex; align-items: center; justify-content: center;
  padding: 14px 10px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .18s, transform .12s, opacity .18s;
  backdrop-filter: blur(4px);
  white-space: nowrap;
  min-width: 0;
}

.tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab:active {
  transform: scale(.96);
}

.tab.active {
  background: var(--btn);
  color: var(--btn-text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

/* Иконки в таббаре больше не нужны — скрыть, если где-то остались */
.tab-icon { display: none; }

/* ═══ ТОСТЫ ═══ */
.toast-host {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(80px + var(--sab));
  z-index: 200;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  max-width: 420px;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 14px; font-weight: 500;
  background: #1c1c1e; color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  animation: toast-in .22s ease;
}
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) } }

/* ═══ АДМИН-ФОРМА ═══ */
.admin-form {
  padding: 8px 18px calc(24px + var(--sab));
  display: flex; flex-direction: column; gap: 6px;
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
  margin-top: 10px;
}
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg2); color: var(--text);
  font-size: 15px; font-family: inherit;
  outline: none;
}
.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
  border-color: var(--btn);
}
.admin-form input[type="file"] {
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--bg2);
  font-size: 14px;
  cursor: pointer;
}
.admin-form textarea { resize: vertical; min-height: 70px; }

.admin-preview {
  margin-top: 6px;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  max-height: 260px;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
}
.admin-preview img {
  width: 100%; height: 100%;
  object-fit: contain;
}

.admin-status {
  font-size: 13px;
  color: var(--hint);
  text-align: center;
  margin-top: 6px;
  min-height: 1.2em;
}
.admin-status.ok { color: var(--ok); }
.admin-status.error { color: var(--danger); }

/* ═══ СЕКЦИЯ «В РАЗРАБОТКЕ» ═══ */
.section-dev {
  padding: 20px 0 8px;
  opacity: .55;
}

.section-title-dev {
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, .85);
  font-size: 13px;
}

.dev-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 16px 12px;
  scrollbar-width: none;
}
.dev-carousel::-webkit-scrollbar { display: none; }

.dev-card {
  flex-shrink: 0;
  width: 140px;
  aspect-ratio: 1 / 1;
  background: var(--bg2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  padding: 12px;
  position: relative;
  color: var(--hint);
}

.dev-card-icon { font-size: 32px; }
.dev-card-text {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.dev-card-badge {
  position: absolute;
  top: 8px; right: 8px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ═══ КНОПКА РЕДАКТИРОВАНИЯ В КАРТОЧКЕ ═══ */
#modal-edit-btn {
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
}
#modal-edit-btn:active { transform: scale(.98); }

/* ═══ ИЗБРАННОЕ ═══ */

/* Кнопка ♥ в модалке товара */
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fav-toggle {
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg2);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .15s, background .15s, color .15s, border-color .15s;
}
.fav-toggle:active { transform: scale(.94); }
.fav-toggle.active {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

/* Позиция ♥ в item строке */
.item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.item-fav-remove {
  padding: 8px 10px;
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: var(--danger);
  flex-shrink: 0;
}

/* ═══ ТАББАР: 4 вкладки ═══ */
.tabbar {
  display: flex;
}
.tabbar .tab {
  flex: 1;
  min-width: 0;
  padding: 12px 6px;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.tabbar .tab.hidden { display: none; }

/* ═══ СТРАНИЦА ОТЗЫВОВ ═══ */
.reviews-stats {
  padding: 16px 16px 8px;
  text-align: center;
}
.reviews-stats-inner {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: var(--bg2);
  border-radius: var(--radius);
}
.reviews-stats-avg {
  font-size: 32px;
  font-weight: 800;
  color: var(--btn);
  line-height: 1;
}
.reviews-stats-block { text-align: left; }
.reviews-stats-stars {
  font-size: 16px;
  color: #f5a623;
  letter-spacing: 2px;
  line-height: 1;
}
.reviews-stats-count {
  font-size: 12px;
  color: var(--hint);
  margin-top: 2px;
}

.reviews-list {
  padding: 8px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg2);
  border-radius: var(--radius);
}
.review-card-thumb {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hint);
  font-size: 22px;
}
.review-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.review-card-body { flex: 1; min-width: 0; }
.review-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.review-card-author {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.review-card-stars {
  font-size: 13px;
  color: #f5a623;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.review-card-text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  word-break: break-word;
  margin-bottom: 6px;
}
.review-card-cover {
  font-size: 12px;
  color: var(--hint);
  cursor: pointer;
  display: inline-block;
}
.review-card-cover:hover { color: var(--btn); }
.review-card-date {
  font-size: 11px;
  color: var(--hint);
  margin-top: 4px;
}

/* ═══ СРЕДНИЙ РЕЙТИНГ В КАРТОЧКЕ ТОВАРА ═══ */
.modal-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--hint);
}
.modal-rating-stars {
  color: #f5a623;
  letter-spacing: 1px;
}

/* ═══ МОЙ ОТЗЫВ В КАРТОЧКЕ ═══ */
.my-review-box {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg2);
  border-radius: 12px;
  border-left: 3px solid var(--btn);
}
.my-review-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--hint);
  font-weight: 700;
  margin-bottom: 4px;
}
.my-review-stars {
  color: #f5a623;
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.my-review-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}

/* ═══ ФОРМА ОТЗЫВА ═══ */
.review-form {
  padding: 8px 18px calc(24px + var(--sab));
}
.review-cover-preview {
  width: 120px;
  height: 120px;
  margin: 0 auto 8px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.review-cover-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.review-cover-name {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--hint);
}

.rating-input {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 0 16px;
}
.rating-input .star {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  font-size: 34px;
  line-height: 1;
  color: rgba(0,0,0,.15);
  cursor: pointer;
  transition: color .15s, transform .12s;
  padding: 0;
}
[data-scheme="dark"] .rating-input .star {
  color: rgba(255,255,255,.2);
}
.rating-input .star.active {
  color: #f5a623;
}
.rating-input .star:active {
  transform: scale(.9);
}

/* ═══ АРХИВ ═══ */
.purchase-card {
  position: relative;
}
.purchase-stars-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 3px 8px;
  background: rgba(0,0,0,.65);
  color: #f5a623;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  pointer-events: none;
}

.archive-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.archive-image img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.archive-stars {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  background: rgba(0,0,0,.65);
  color: #f5a623;
  border-radius: 999px;
  font-size: 15px;
  letter-spacing: 2px;
  font-weight: 700;
}

.archive-my-review {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg2);
  border-radius: 12px;
  border-left: 3px solid var(--btn);
}
.archive-my-review-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--hint);
  font-weight: 700;
  margin-bottom: 4px;
}
.archive-my-review-text {
  font-size: 13px;
  line-height: 1.4;
}

/* Отзывы-кнопка в purchases */
.item-review-hint {
  font-size: 11px;
  color: var(--btn);
  margin-top: 2px;
  cursor: pointer;
}

.card-rating {
  position: absolute;
  bottom: 6px;
  right: 6px;
  padding: 3px 8px;
  background: rgba(0,0,0,.65);
  color: #f5a623;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  pointer-events: none;
}

/* ═══ СЕГМЕНТ-КОНТРОЛ ═══ */
.segmented {
  display: flex;
  gap: 4px;
  padding: 10px 12px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }

.seg-item {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.seg-item.active {
  background: var(--btn);
  color: var(--btn-text);
  border-color: var(--btn);
}
.seg-item:active { transform: scale(.96); }

/* ═══ БЕЙДЖ «ПРОДАНО» ═══ */
.card-sold {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 3px 10px;
  background: rgba(0, 0, 0, .75);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  pointer-events: none;
}

/* ═══ ЗАТЕМНЕНИЕ ПРОДАННОГО ═══ */
.card-img.sold::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  pointer-events: none;
}

/* ═══ КНОПКА «ПРОДАНО» В КАРТОЧКЕ ТОВАРА ═══ */
.modal-footer .btn-buy.sold-btn {
  background: var(--bg2);
  color: var(--hint);
  cursor: default;
  border: 1px solid var(--border);
}
.modal-footer .btn-buy.sold-btn:active { transform: none; }

/* Бейдж «Продано» в модалке товара */
.modal-sold {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 14px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}