/* ================================================================
   WoT Shop — Основные стили
   Тёмная тема, минималистичный дизайн
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;700;900&family=Inter:wght@300;400;500;600;700;900&display=swap');

/* ── Переменные ──────────────────────────────────────────────── */
:root {
  --bg:           #0a0c0f;
  --bg-card:      #111418;
  --bg-card-hover:#161b21;
  --bg-input:     #0f1318;
  --border:       rgba(255,255,255,0.07);
  --border-focus: rgba(255,180,0,0.4);

  --text:         #e8eaf0;
  --text-muted:   #6b7280;
  --text-dim:     #9ca3af;

  --accent:       rgba(0, 91, 255, 1);
  --accent-dim:   rgba(245,197,24,0.12);
  --accent-hover: rgba(0, 79, 222, 1);
  --danger:       #ef4444;
  --success:      #22c55e;

  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    16px;

  --shadow:       0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg:    0 8px 48px rgba(0,0,0,0.7);

  --font-display: 'Unbounded', sans-serif;
  --font-body:    'Inter', sans-serif;

  --header-h:     64px;
  --transition:   0.2s ease;
  --ease-smooth:  cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  /* iOS: safe area под шторкой должна совпадать с фоном страницы */
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  scrollbar-gutter: stable;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: var(--font-body); }
input, textarea { font-family: var(--font-body); }

/* ── Звёздный фон ────────────────────────────────────────────── */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  /* background задаётся из JS (canvas tile), чтобы не мылить текст на Windows */
}

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(10,12,15,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 0px solid var(--border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Logo always left */
.logo {
  order: 1;
  flex-shrink: 0;
}

/* ── Лого ────────────────────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  order: 1;
}

.logo-icon { font-size: 22px; line-height: 1; }

.logo-text {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo-accent { color: var(--accent); }

/* ── Хлебные крошки ──────────────────────────────────────────── */
.breadcrumb {
  order: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  flex-shrink: 1;
}

.breadcrumb a { color: var(--text-muted); transition: color var(--transition); flex-shrink: 0; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.4; flex-shrink: 0; }
.breadcrumb .current { color: var(--text-dim); }

/* Название лота в крошках — обрезается с ... на мобиле */
.breadcrumb .bc-lot {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Название магазина в крошках — тоже обрезается если нет места */
.breadcrumb .bc-shop {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
  flex-shrink: 1;
}

/* ── Container ───────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  position: relative;
  z-index: 1;
}

/* ── Hero ────────────────────────────────────────────────────── */
.page-hero {
  text-align: center;
  padding: 60px 0 48px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-sub { color: var(--accent); }

.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── Карточки витрин ─────────────────────────────────────────── */
.shops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.shop-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform 0.28s var(--ease-smooth);
  cursor: pointer;
  text-decoration: none;
}

.shop-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(245,197,24,0.25);
  transform: translateY(-2px);
  box-shadow: 0 10px 34px rgba(0,0,0,0.55);
}

.shop-card-icon {
  font-size: 36px;
  line-height: 1;
}

.shop-card-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.shop-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}

.shop-card-meta {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

/* ── Заголовок витрины ───────────────────────────────────────── */
.shop-header {
  padding: 32px 0 28px;
  border-bottom: 0px solid var(--border);
  margin-bottom: 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.shop-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.shop-title span { color: #e1e1e1; }

/* ── Сетка лотов — несколько колонок на ПК ───────────────────── */
.lots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

@media (max-width: 768px) {
  .lots-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
}
@media (max-width: 480px) {
  .lots-grid { grid-template-columns: 1fr 1fr; gap: 5px; }
}

.lot-card {
  background: var(--bg-card);
  border: 0px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform 0.28s var(--ease-smooth);
  text-decoration: none;
  cursor: pointer;
  min-width: 0;
}

.lot-card:hover {
  background: var(--bg-card-hover);
  /*border-color: rgba(245,197,24,0.2);*/
  /*transform: translateY(-3px);*/
  box-shadow: 0 12px 44px rgba(0,0,0,0.62);
}

.lot-card-thumb {
  width: calc(100% - 0px);
  aspect-ratio: 16/12;
  object-fit: cover;
  display: block;
  margin: 0px;
  border-radius: 12px 12px 0 0;
  /*-webkit-mask-image: linear-gradient(180deg, black 60%, transparent 95%);
  clip-path: inset(-1px -1px 3px -1px);*/
}

/* Wrapper around the thumbnail image to allow badge positioning */
.lot-card-thumb-wrap {
  position: relative;
  display: block;
  line-height: 0;
}

/* ── Card hover overlay with action icons ─────────────────────── */
.lot-card-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 0.25s ease;
  border-radius: 0px;
  z-index: 5;
  pointer-events: none;
}
@media (hover: hover) {
  .lot-card-thumb-wrap:hover .lot-card-overlay {
    background: rgb(22 27 33 / 80%);
    pointer-events: auto;
  }
  .lot-card-thumb-wrap:hover .lot-card-overlay .card-action-btn {
    opacity: 1;
  }
}

/* Active fav heart — always visible and clickable, no hover needed */
.card-action-btn.btn-fav.fav-active {
  opacity: 1;
  pointer-events: auto;
}

/* Fav button — top-left corner, always absolute inside overlay */
.card-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #000000c2;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.18s ease, transform 0.18s ease;
  opacity: 0;
  text-decoration: none;
  padding: 0;
  line-height: 0;
  box-sizing: border-box;
}

.card-action-btn:hover {
  background: #64646485;
}

/* Fav button — top-left corner, absolutely positioned inside overlay */
.card-action-btn.btn-fav {
  position: absolute;
  top: 8px;
  left: 8px;
}

/* Centred pair of icons (quickview + buy) */
.lot-card-overlay-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 18px;
}

/* ── Per-icon SVG size controls — adjust to taste ── */
.btn-quickview svg {
  width: 30px;
  height: 30px;
  fill: #aaaaaa;
  flex-shrink: 0;
  transition: fill 0.18s ease;
  display: block;
  margin: 0px 0px 2px 0px;
}
.btn-fav svg {
  width: 27px;
  height: 25px;
  fill: none;
  stroke: #aaaaaa;
  flex-shrink: 0;
  transition: fill 0.18s ease, stroke 0.18s ease;
  display: block;
  margin: 0px -1px 0px 0px;
}
.btn-buy svg {
  width: 24px;
  height: 24px;
  fill: #aaaaaa;
  flex-shrink: 0;
  transition: fill 0.18s ease;
  display: block;
  margin: 0px 0px -4px 0px;
}

.card-action-btn:not(.btn-fav):hover svg {
  fill: #ffffff;
}

.card-action-btn.btn-fav:hover svg {
  fill: none;
  stroke: #ffffff;
}

.card-action-btn.btn-fav.fav-active svg {
  fill: #ff1f1f;
  stroke: #ff1f1f;
}

/* Favourite active hover */
.card-action-btn.btn-fav.fav-active:hover svg {
  fill: #ff3737;
  stroke: #ff3737;
}

/* ── Мобильная кнопка быстрого просмотра (bottom-right, только touch) ── */
@media (hover: none) {
  .btn-quickview {
    position: absolute;
    bottom: 8px;
    right: 8px;
    opacity: 1;
    pointer-events: auto;
    background: #000000c2;
    width: 36px;
    height: 36px;
  }
  /* На тач-устройствах центральный враппер становится прозрачным контейнером,
     чтобы btn-quickview (дочерний элемент) работал с position:absolute */
  .lot-card-overlay-center {
    display: contents;
  }
  /* Скрываем кнопку покупки на мобиле — оставляем только quickview */
  .lot-card-overlay-center .btn-buy {
    display: none;
  }
  /* Оверлей на мобиле не нужен (нет hover), убираем затемнение */
  .lot-card-overlay {
    pointer-events: none;
    background: transparent !important;
  }
  /* Но fav-кнопка должна оставаться кликабельной */
  .card-action-btn.btn-fav.fav-active {
    pointer-events: auto;
  }
}

/* ── Favourite icon in header ─────────────────────────────────── */
.header-fav-btn {
  order: 3;
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 40px;
  height: 40px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: none;
  visibility: hidden;
  pointer-events: none;
}

.header-fav-btn.visible {
  visibility: visible;
  pointer-events: auto;
}

.header-fav-btn svg {
  width: 27px;
  height: 25px;
  fill: #c4c4c4;
  stroke: #c4c4c4;
  transition: fill 0.18s ease, stroke 0.18s ease;
  margin: 0px 0px 2px 0px;
}

.header-fav-btn:hover svg {
  fill: #ffffff;
  stroke: #ffffff;
}

/* Price badge — top-right corner of preview image */
.lot-card-price-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #0000007d;
  color: #e6e6e6;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  padding: 2px 4px 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 4;
  backdrop-filter: blur(4px);
}

/* Badges container — top-right corner of the image, single pill */
/* Row card thumb wrapper (hidden lots table) */
.lot-row-thumb-wrap {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  line-height: 0;
  align-self: center;
}

.lot-card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/12;
  background: linear-gradient(90deg, #232837, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: rgba(255,255,255,0.05);
}

.lot-card-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  margin-top: 0px;
  position: relative;
  z-index: 3;
}

/* Title row: label left, price right */
.lot-card-title-row {
  display: block;
  min-width: 0;
}

.lot-card-price {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  line-height: 1.5;
  margin-top: 2px;
}

.lot-card-price--row {
  font-size: 12px;
  margin-top: 1px;
}

.lot-card-title {
  position: relative;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 6px;
  border-radius: 6px;
  z-index: 0;
  clip-path: inset(-1px 2px -1px -1px);
}

.lot-card-title::before {
  content: '';
  position: absolute;
  top: 0px;
  bottom: 0px;
  left: 0px;
  right: 0px; /* тянем вправо — меняй это значение */
  border-radius: 6px;
  background: linear-gradient(90deg, #30343c, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.lot-card-tanks10 {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0px 4px;
}

/* Allow wrapping when explicitly enabled via admin toggle */
.lot-card-title--wrap {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
  word-break: break-word;
}

.lot-card-tanks10--wrap {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Vehicle stats — wrapper: normal flow, sits below tanks10 */
.lot-card-vstats {
  display: inline-flex;
  flex-direction: row;
  gap: 6px;
  pointer-events: auto;
  z-index: 2;
}

/* Shared badge base */
.vstats__badge {
  display: inline-flex;
  flex-direction: column;
  gap: 0;
  border-radius: 6px;
  padding: 2px 4px 2px 4px;
  /*clip-path: inset(-1px 5px -1px -1px);*/
}

/* Premium badge — gold */
/*.vstats__badge--prem {
  background: linear-gradient(127deg, #3200ff 15%, #f300ff 105%);
}*/

/* Top (tier X) badge — green */
/*.vstats__badge--top {
  background: linear-gradient(90deg, #2c2f36, transparent 90%);
  background: #191b20;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.01) 50%, transparent 85%);
}*/

@keyframes vstats-prem-shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.vstats__line {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #e6e6e6;
  line-height: 1.35;
  white-space: nowrap;
  background: linear-gradient(90deg, #ffea52, #ff4675 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --prem: animated shimmer gradient on text */
.vstats__badge--prem .vstats__line {
  background: linear-gradient(
    90deg,
    #ffea52 0%,
    #ff8c42 25%,
    #ff4675 50%,
    #c844ff 75%,
    #ffea52 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: vstats-prem-shimmer 5s ease-in-out infinite;
}

/* --top: independent text color, separate from --prem */
.vstats__badge--top .vstats__line {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
  color: #c0c0c0;
  font-weight: 400;
}

/* Тонкий вертикальный разделитель перед топом, если он идёт после према */
.vstats__badge--prem + .vstats__badge--top {
  position: relative;
  margin-left: 4px;
}

.vstats__badge--prem + .vstats__badge--top::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 20%;
  height: 60%;
  width: 1px;
  background: rgba(255, 255, 255, 0.15);
  rotate: 15deg;
}

/* Row variant — normal flow, sits below tanks10 in row */
.lot-card-vstats--row {
  gap: 3px;
}

.lot-card-vstats--row .vstats__badge {
  border-radius: 4px;
  padding: 1px 7px 1px 5px;
}

.lot-card-vstats--row .vstats__line {
  font-size: 13px;
}


.lot-card-funpay { display: none; } /* старый класс — не используется */

/* Кнопка FunPay внизу карточки */
.lot-card-footer {
  padding: 0 10px 10px;
}

.lot-card-funpay-btn {
  display: block;
  text-align: center;
  padding: 8px 14px;
  background: rgb(21 124 255);
  border: 0px solid rgba(245,197,24,0.25);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}

.lot-card-funpay-btn:hover {
  background: #59a2ff;
  border-color: rgba(245,197,24,0.4);
}

/* Кнопка FunPay в шапке лота — как на витрине */
.lot-header-funpay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 14px 10px 16px;
  background: var(--accent);
  border: 0px solid rgba(245,197,24,0.25);
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}
.lot-header-funpay-btn:hover {
  background: var(--accent-hover);
  border-color: rgba(245,197,24,0.4);
}

/* Кнопка избранного на странице лота — такой же кружок как на карточке, но всегда виден */
.lot-header-fav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #20262d;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 1;
  position: static;
  padding: 0;
  line-height: 0;
  box-sizing: border-box;
  transition: background 0.18s ease;
  flex-shrink: 0;
}
.lot-header-fav-btn svg {
  width: 27px;
  height: 25px;
  fill: none;
  stroke: #aaaaaa;
  flex-shrink: 0;
  transition: fill 0.18s ease, stroke 0.18s ease;
  display: block;
  margin: 0px -1px 0px 0px;
}
.lot-header-fav-btn:hover {
  background: #64646485;
}
.lot-header-fav-btn:hover svg {
  fill: none;
  stroke: #ffffff;
}
.lot-header-fav-btn.fav-active svg {
  fill: #ff1f1f;
  stroke: #ff1f1f;
}
.lot-header-fav-btn.fav-active:hover svg {
  fill: #ff3737;
  stroke: #ff3737;
}

/* ── "Таблица" лотов (горизонтальные карточки) ────────────────── */
.lots-table-section {
  margin-top: 38px;
  padding-top: 26px;
  border-top: 0px solid var(--border);
}

.lots-table-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.lots-table-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lots-table-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.lots-table-filters {
  border: 0px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0px;
  margin-bottom: 40px;
}

.lots-table-filters .filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lots-table-filters input[type="text"] {
  flex: 1;
  min-width: 220px;
  border-width: 0;
}

.lots-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lot-row-card {
  background: var(--bg-card);
  border: 0px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 5px;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 14px;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform 0.24s var(--ease-smooth);
}

.lot-row-card:hover {
  background: var(--bg-card-hover);
  /*border-color: rgba(245,197,24,0.22);*/
  /*transform: translateY(-2px);*/
  box-shadow: 0 10px 34px rgba(0,0,0,0.55);
}

.lot-row-left {
  display: flex;
  align-items: stretch;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.lot-row-thumb,
.lot-row-thumb-placeholder {
  width: 120px;
  height: 80px;
  border-radius: 10px;
  flex-shrink: 0;
  border: 0px solid var(--border);
  background: #111418;
  object-fit: cover;
  align-self: center;
}

.lot-row-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: rgba(255,255,255,0.06);
  background: linear-gradient(135deg, #111418, #0d1117);
}

.lot-row-mid {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  align-self: stretch;
}

.lot-row-title {
  flex-shrink: 1;
}

.lot-row-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  background: linear-gradient(90deg, #32353d, transparent 70%);
  padding: 2px 6px;
  border-radius: 6px;
}

.lot-row-tanks10 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0px 4px;
}

.lot-tanks10-detail {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.lot-row-tags {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 22px;
  /*margin-top: auto;*/
}

.lot-row-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1;
}

.lot-row-tags-empty {
  font-size: 12px;
  color: var(--text-muted);
}

.lot-row-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  align-self: center;
  gap: 10px;
}

.lot-row-funpay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: rgb(21 124 255);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}

.lot-row-funpay-btn:hover {
  background: rgba(245,197,24,0.2);
  border-color: rgba(245,197,24,0.4);
}

.lot-row-no-funpay {
  font-size: 12px;
  color: var(--text-muted);
  border: 1px dashed rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 8px 10px;
}

@media (max-width: 640px) {
  .lots-table-filters .filter-row { flex-direction: column; align-items: stretch; }
  .lots-table-filters input[type="text"] { min-width: 0; }
  .lot-row-card { flex-direction: column; align-items: stretch; }
  .lot-row-right { justify-content: flex-end; }
  .lot-row-title { white-space: normal; }
}

/* ── FunPay логотип ──────────────────────────────────────────── */
.funpay-logo,
.funpay-logo-footer {
  display: inline-block;
  vertical-align: middle;
  height: 20px;
  width: auto;
  position: relative;
  top: 1px;
  filter: brightness(0) invert(1);
  padding: 0px 0px 0px 3px;
}

.funpay-logo        { margin: 0 4px; }
.funpay-logo-footer { margin: 0 5px; }

/* ── Footer — всегда внизу ───────────────────────────────────── */
main.container { min-height: calc(100vh - 64px - 80px); }

.site-footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.site-footer p {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Заголовок лота ──────────────────────────────────────────── */
.lot-header {
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.lot-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 8px 14px;
}

.lot-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Lot detail page: title + price on same row */
.lot-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.lot-price-badge {
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.price-rub {
  /*opacity: 0.55;
  margin-left: 1px;*/
  font-weight: 600;
}

/* Row title row */
.lot-row-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.funpay-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--accent);
  color: #0a0c0f;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.funpay-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ── Кнопки ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 6px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0a0c0f;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-color: rgba(255,255,255,0.12);
}

.btn-no-border,
.btn-no-border:hover {
  border-color: transparent;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(245,197,24,0.3);
}
.btn-outline:hover {
  background: var(--accent-dim);
  border-color: rgba(245,197,24,0.5);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-full { width: 100%; justify-content: center; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Инпуты ──────────────────────────────────────────────────── */
input[type="text"],
input[type="password"],
input[type="url"],
input[type="email"],
textarea,
select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--border-focus);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

/* ── Спиннер загрузки ────────────────────────────────────────── */
.loading-spinner {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Пустой стейт ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 64px; margin-bottom: 20px; }
.empty-state h2 { font-size: 20px; color: var(--text-dim); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Модалки ─────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
}

.modal-overlay.open { display: block; }

.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 201;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(480px, calc(100vw - 32px));
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.modal.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.modal-sm { width: min(360px, calc(100vw - 32px)); }

/* Длинный текст в confirm не должен создавать скроллбар */
#confirm-text {
  word-break: break-word;
  overflow-wrap: break-word;
  max-height: 120px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.modal-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}

/* Header row: label left, wrap-toggle button right */
.form-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.form-group-header label {
  margin: 0;
}

.wrap-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.18s, background 0.18s, color 0.18s, border-color 0.18s;
  flex-shrink: 0;
}

.wrap-toggle-btn:not([disabled]):hover {
  opacity: 1;
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border-color: rgba(255,255,255,0.22);
}

.wrap-toggle-btn[disabled] {
  cursor: default;
  pointer-events: none;
}

.wrap-toggle-btn.is-active {
  opacity: 1;
  background: rgba(79,84,96,0.5);
  color: var(--text);
  border-color: rgba(255,255,255,0.22);
}


.form-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.form-hint code {
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.status-msg {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: none;
}

.status-msg.visible { display: block; }
.status-msg.ok { background: rgba(34,197,94,0.1); color: var(--success); }
.status-msg.err { background: rgba(239,68,68,0.1); color: var(--danger); }
.status-msg.info { background: rgba(245,197,24,0.1); color: var(--accent); }

/* ── Input with eye button ───────────────────────────────────── */
.input-with-eye {
  position: relative;
  display: flex;
}

.input-with-eye input { padding-right: 44px; }

.eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
}

/* ── Адаптив ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 24px 8px 60px; }
  .header-inner { padding: 0 16px; }
  .page-hero { padding: 40px 0 32px; }
  .shops-grid { grid-template-columns: 1fr 1fr; }
  /* lots-grid адаптив определён выше, не переопределяем */
}

/* ── Анимации появления ──────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-prep {
  opacity: 0;
  transform: translateY(16px);
}

.fade-up {
  animation: fadeUp 0.4s ease both;
}


/* ── Resource icons ──────────────────────────────────────────── */

.resource-icons {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

/* Каждый ресурс: иконка + число с постоянной декоративной подложкой */
.resource-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: relative;
  padding: 1px 8px 1px 6px;
  border-radius: 6px;
}

/* Градиентная подложка через ::before — растворяется вправо */
.resource-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
      background: linear-gradient(to right, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.01) 50%, transparent 85%);
  pointer-events: none;
  clip-path: inset(-1px 5px -1px -1px);
}

.resource-icon-img {
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
}

/* Боны — ×1.5, но не раздувают плашку по высоте */
.resource-icon-img--bonds {
  width: 33px;
  height: 33px;
  margin-top: -5px;
  margin-bottom: -5px;
  margin-right: -6px;
  margin-left: -6px;
}

.resource-value {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 600;
  color: #a5a5a5;
  /*letter-spacing: 0.02em;*/
  white-space: nowrap;
  line-height: 1;
}

/* ── Адаптивный формат чисел в карточках аккаунтов ──────────────
   По умолчанию показываем вариант с дробью (.rv-frac),
   скрываем вариант без дроби (.rv-int).
   При сужении экрана CSS переключает их:
     < 505px → все ресурсы без дробной части                     */
.rv-int { display: none; }
.rv-frac { display: inline; }

/* Карточки аккаунтов (.lot-card-resources) */
@media (max-width: 504px) {
  .lot-card-resources .rv-int  { display: inline; }
  .lot-card-resources .rv-frac { display: none; }
}

/* Таблица (.lot-row-tags) */
@media (max-width: 391px) {
  .lot-row-tags .rv-int--silver  { display: inline; }
  .lot-row-tags .rv-frac--silver { display: none; }
}
@media (max-width: 378px) {
  .lot-row-tags .rv-int--gold  { display: inline; }
  .lot-row-tags .rv-frac--gold { display: none; }
}
@media (max-width: 365px) {
  .lot-row-tags .rv-int--bonds  { display: inline; }
  .lot-row-tags .rv-frac--bonds { display: none; }
}

/* В lot-row-tags */
.lot-row-tags .resource-icons {
  gap: 4px;
}

/* В lot-card-body — блок ресурсов прижат к низу */
.lot-card-body .resource-icons {
  gap: 4px;
}

.lot-card-resources {
  margin-top: auto;
}

/* В больших карточках — компактнее, ресурсы переносятся если не влезают */
.lot-card-resources .resource-icons {
  gap: 4px;
  flex-wrap: wrap;
}

.lot-card-resources .resource-item {
  padding: 1px 6px 1px 5px;
  gap: 3px;
}

.lot-card-resources .resource-icon-img {
  width: 20px;
  height: 20px;
}

.lot-card-resources .resource-icon-img--bonds {
  width: 28px;
  height: 28px;
  margin-top: -4px;
  margin-bottom: -4px;
  margin-right: -4px;
  margin-left: -5px;
}

.lot-card-resources .resource-value {
  font-size: 11px;
}

/* ── Адаптив ресурсов ────────────────────────────────────────── */

/* Планшет / небольшой десктоп */
@media (max-width: 900px) {
  /* Таблица: ресурсы в lot-row-tags чуть компактнее */
  .lot-row-tags .resource-icons { gap: 8px; }
  .lot-row-tags .resource-item  { padding: 2px 5px 2px 4px; gap: 3px; }
  .lot-row-tags .resource-icon-img { width: 20px; height: 20px; }
  .lot-row-tags .resource-icon-img--bonds {
    width: 28px;
    height: 28px;
    margin-top: -4px;
    margin-bottom: -4px;
    margin-right: -4px;
    margin-left: -5px;
  }
  .lot-row-tags .resource-value { font-size: 13px; }

  /* Карточки: ресурсы чуть мельче */
  .lot-card-resources .resource-item { padding: 2px 5px 2px 4px; gap: 2px; }
  .lot-card-resources .resource-icon-img { width: 20px; height: 20px; }
  .lot-card-resources .resource-icon-img--bonds {
    width: 28px;
    height: 28px;
    margin-top: -4px;
    margin-bottom: -4px;
    margin-right: -4px;
    margin-left: -5px;
  }
  .lot-card-resources .resource-value { font-size: 13px; }
}

/* Мобайл — row становится колонкой, ресурсы в таблице могут быть крупнее */
@media (max-width: 640px) {
  .lot-row-tags .resource-icons { gap: 6px; flex-wrap: wrap; }
  .lot-row-tags .resource-item  { padding: 2px 5px 2px 4px; gap: 3px; }
  .lot-row-tags .resource-icon-img { width: 20px; height: 20px; }
  .lot-row-tags .resource-icon-img--bonds {
    width: 28px;
    height: 28px;
    margin-top: -4px;
    margin-bottom: -4px;
    margin-right: -4px;
    margin-left: -5px;
  }
  .lot-row-tags .resource-value { font-size: 13px; }
}

/* Мелкий мобайл */
@media (max-width: 480px) {
  .lot-card-resources { padding: 0; }
  .lot-card-resources .resource-icons { gap: 2px; }
  .lot-card-resources .resource-item  { padding: 1px 4px 1px 3px; gap: 2px; }
  .lot-card-resources .resource-icon-img { width: 20px; height: 20px; }
  .lot-card-resources .resource-icon-img--bonds {
    width: 28px;
    height: 28px;
    margin-top: -4px;
    margin-bottom: -4px;
    margin-right: -4px;
    margin-left: -5px;
  }
  .lot-card-resources .resource-value { font-size: 12px; }

  .lot-row-tags .resource-item  { padding: 1px 4px 1px 4px; gap: 3px; }
  .lot-row-tags .resource-icon-img { width: 20px; height: 20px; }
  .lot-row-tags .resource-icon-img--bonds {
    width: 28px;
    height: 28px;
    margin-top: -4px;
    margin-bottom: -4px;
    margin-right: -4px;
    margin-left: -5px;
  }
  .lot-row-tags .resource-value { font-size: 13px; }
}

/* iPhone 12 Pro (390px) */
@media (max-width: 390px) {
  .lot-card-resources { padding: 0; }
  .lot-card-resources .resource-icons { gap: 2px; }
  .lot-card-resources .resource-item  { padding: 1px 4px 1px 3px; gap: 2px; }
  .lot-card-resources .resource-icon-img { width: 20px; height: 20px; }
  .lot-card-resources .resource-icon-img--bonds {
    width: 28px;
    height: 28px;
    margin-top: -4px;
    margin-bottom: -4px;
    margin-right: -4px;
    margin-left: -5px;
  }
  .lot-card-resources .resource-value { font-size: 12px; }

  .lot-row-tags .resource-item  { padding: 1px 4px 1px 4px; gap: 2px; }
  .lot-row-tags .resource-icon-img { width: 20px; height: 20px; }
  .lot-row-tags .resource-icon-img--bonds {
    width: 28px;
    height: 28px;
    margin-top: -4px;
    margin-bottom: -4px;
    margin-right: -4px;
    margin-left: -5px;
  }
  .lot-row-tags .resource-value { font-size: 13px; }
}


/* ================================================================
   Quick View Modal (quickview.js)
   ================================================================ */

/* ── Блокировка скролла фона (position:fixed — стандарт отрасли).
   body фиксируется на месте, top компенсирует scrollY.
   Ширина 100% предотвращает сжатие контента. ── */
body.qv-open {
  position: fixed;
  top: var(--qv-scroll-top, 0px);
  left: 0;
  right: 0;
  width: 100%;
  overflow-y: scroll; /* держим скроллбар видимым, чтобы не было сдвига */
}

/* Оверлей */
.qv-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  pointer-events: none;
}

.qv-modal--visible {
  pointer-events: auto;
}

/* Фон-затемнение — без blur для сохранения качества текста */
.qv-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 72%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.qv-modal--visible .qv-backdrop {
  opacity: 1;
}

/* iOS 26 Liquid Glass: тинтинг нижней панели управляется через body.style.backgroundColor
   напрямую из JS при открытии/закрытии шторки. Фантомный блок не нужен. */

/* Диалог — фиксированный размер, не зависящий от контента */
.qv-dialog {
  position: relative;
  background: #14181c;
  border: 0px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 16px;
  width: 100%;
  max-width: 1055px;
  height: 604px;       /* фиксированная высота на десктопе */
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateZ(0) scale(0.97);
  transition-property: transform, opacity;
  transition-duration: 200ms;
  transition-timing-function: ease;
  will-change: transform, opacity;
  box-shadow: 0 24px 64px rgb(0 0 0 / 60%);
}

.qv-modal--visible .qv-dialog {
  opacity: 1;
  transform: translateZ(0) scale(1);
}

/* Кнопка закрытия */
.qv-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a1f27;
  border: 0px solid var(--border, rgba(255,255,255,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #dedede;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  line-height: 0;
}

.qv-close:hover {
  background: rgb(255 255 255 / 7%);
  color: #fff;
}

/* Спиннер */
.qv-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  flex: 1;
}

/* qv-content: скрыт но занимает место — нет скачка layout при появлении */
#qv-content.qv-hidden {
  visibility: hidden;
  pointer-events: none;
}

/* qv-error: полностью скрыт когда не нужен */
#qv-error.qv-hidden {
  display: none;
}

/* Ошибка */
.qv-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 280px;
  color: var(--text-muted, #9ca3af);
  font-size: 15px;
  flex: 1;
}

.qv-error .empty-icon {
  font-size: 40px;
}

/* Двухколоночный лейаут */
.qv-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Левая панель: галерея ── */
.qv-gallery {
  flex: 0 0 67%;
  display: flex;
  flex-direction: column;
  background: #111418;
  border-right: 0px solid var(--border, rgba(255,255,255,0.07));
  overflow: hidden;
  border-radius: 16px;
}

.qv-img-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  background: #0d1014;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

.qv-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  position: relative;
  z-index: 3;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
}

/* iOS Safari рисует рамку для img[src=""] — убираем */
.qv-main-img:not([src]), .qv-main-img[src=""] {
  display: none;
}

.qv-main-img.qv-img--ready {
  opacity: 1;
}

.qv-img--loading {
  opacity: 0.15;
}

/* Скелетон поверх img пока грузится */
.qv-img-stage[data-skeleton] > .qv-main-img {
  opacity: 0 !important;
}

/* ── Skeleton для quickview галереи ── */
.qv-img-stage[data-skeleton]::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 16px;
  background: linear-gradient(
    90deg,
    var(--bg-card, #1a1e24) 25%,
    rgba(255,255,255,0.05) 50%,
    var(--bg-card, #1a1e24) 75%
  );
  background-size: 200% 100%;
  animation: qv-shimmer 1.4s ease infinite;
  z-index: 4;
}

.qv-thumb-skeleton {
  flex-shrink: 0;
  width: 68px;
  height: 50px;
  border-radius: 12px;
  background: var(--bg-card, #1a1e24);
  position: relative;
  overflow: hidden;
}

.qv-thumb-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 25%,
    rgba(255,255,255,0.05) 50%,
    transparent 75%
  );
  background-size: 200% 100%;
  animation: qv-shimmer 1.4s ease infinite;
}

@keyframes qv-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Стрелки галереи — 3-зонная логика ──────────────────────── */
/*
   Вся ширина stage делится ровно на 3 зоны (33.33% каждая):
   [  ← зона  |  лупа  |  → зона  ]
   Стрелки занимают левую/правую треть и появляются только при
   наведении на соответствующую зону. Лупа — только в центре.
   Затемнений нет.
*/

/* Базовый стиль стрелки — занимает 1/3 высоты stage */
.qv-arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 33.333%;
  z-index: 5;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s ease;
  padding: 0;
  line-height: 0;
  margin: 0;
  transform: none;
}

/* Стрелки прижаты к краям: prev — иконка у левого края, next — у правого */
.qv-prev { left: 0; justify-content: flex-start; padding-left: 25px; }
.qv-next { right: 0; justify-content: flex-end;  padding-right: 25px; }

/* Стрелка видна только при наведении на свою зону */
.qv-prev:hover,
.qv-next:hover {
  opacity: 1;
  background: transparent;
}

/* SVG-иконка внутри стрелки */
.qv-arrow svg {
  width: 23px;
  height: 23px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7));
  flex-shrink: 0;
}

/* Счётчик */
.qv-counter {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgb(0 0 0 / 55%);
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 20px;
  pointer-events: none;
}

/* Zoom overlay — центральная треть, без затемнений */
.qv-zoom-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 33.333%;
  right: 33.333%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
  z-index: 4;
}

/* Убираем псевдо-затемнение полностью */
.qv-zoom-overlay::before {
  display: none;
}

.qv-zoom-overlay:hover::before {
  background: transparent;
}

.qv-zoom-icon {
  color: #fff;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.18s ease, transform 0.18s ease;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
  pointer-events: none;
}

.qv-zoom-overlay:hover .qv-zoom-icon {
  opacity: 1;
  transform: scale(1);
}

/* Миниатюры */
.qv-arrow:focus-visible,
.qv-close:focus-visible,
.qv-thumb:focus-visible,
.qv-zoom-overlay:focus-visible {
  outline: none;
}

.qv-thumbs {
  display: flex;
  gap: 6px;
  padding: 12px 12px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
  cursor: grab;
}
.qv-thumbs:active { cursor: grabbing; }

/* Webkit scrollbar для .qv-thumbs */
.qv-thumbs::-webkit-scrollbar {
  display: none;
}

.qv-thumb {
  flex-shrink: 0;
  width: 68px;
  height: 50px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  padding: 0;
  background: none;
  transition: border-color 0.12s;
  line-height: 0;
}

.qv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qv-thumb--active {
  border-color: var(--accent, #4e73f8);
}

/* ── Правая панель: инфо ── */
.qv-info {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}

.qv-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text, #e8eaf0);
  margin: 0;
  padding-right: 30px; /* место для кнопки закрытия */
  background: linear-gradient(90deg, #30343c, transparent 70%);
  padding: 2px 46px 2px 8px;
  border-radius: 8px;
}

.qv-price-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qv-price {
  font-size: 22px;
  font-weight: 800;
  color: #e5e5e5;
  letter-spacing: -0.3px;
  background: #2f333b;
  padding: 0px 14px;
  border-radius: 6px;
  position: relative;
}

.qv-price::before,
.qv-price::after {
  content: '';
  position: absolute;
  top: 50%;
  translate: 0 -47%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #14181c;
}

.qv-price::before { left: -6px; }
.qv-price::after  { right: -6px; }

.qv-tanks10-text {
  font-size: 13px;
  color: var(--text-muted, #9ca3af);
  margin: 0;
}

/* Кнопки */
.qv-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.qv-btn-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 14px 18px;
  background: var(--accent, #4e73f8);
  color: #fff;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, transform 0.12s;
  border: none;
  margin: 30px 20px 0px 20px;
}

.qv-btn-buy:hover,
.qv-btn-buy:focus,
.qv-btn-buy:focus-visible {
  background: var(--accent-hover);
  outline: none;
}

.qv-btn-buy img {
  height: 23px;
  margin: 0 4px 1px 0px;
}

.qv-full-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  background: transparent;
  color: var(--text-muted, #9ca3af);
  border: 0px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.qv-full-link:hover {
  color: #dfdfdf;
  border-color: rgba(255,255,255,0.25);
  background: rgb(255 255 255 / 0%);
}

/* ── Мобильный лейаут — единая шторка снизу ── */
@media (max-width: 640px) {
  .qv-modal {
    padding: 0;
    align-items: flex-end;
  }

  /* Шторка — единый вертикальный контейнер со скроллом */
  .qv-dialog {
    border-radius: 20px 20px 0px 0px;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 100dvh;
    transform: translateY(100%);
    opacity: 1;
    /* Открытие: мягкий подброс — быстрый старт, замедление с лёгким зацепом */
    transition: transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
    padding-bottom: env(safe-area-inset-bottom, 16px);
    /* Сам диалог скроллится как единое целое */
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
  }

  .qv-modal--visible .qv-dialog {
    transform: translateY(0);
    opacity: 1;
  }

  /* qv-content — просто вертикальный поток, без flex-панелей */
  .qv-content {
    display: block;
    overflow: visible;
    height: auto;
  }

  /* Галерея — верхняя часть, фиксированная высота, сразу занимает место */
  .qv-gallery {
    display: block;
    width: 100%;
    background: #14181c;
    border-right: none;
    border-radius: 0;
  }

  .qv-img-stage {
    height: 242px;
    background: #0d1014;
    border-radius: 0px 0px 20px 20px;
  }

  /* Фикс 1: главное изображение растягивается по ширине шторки */
  .qv-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Инфо — ниже галереи, обычный поток */
  /* Фикс 2: добавляем отступы в блоке описания */
  .qv-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: visible;
    max-height: none;
    padding: 16px 16px 8px;
  }

  /* На мобиле стрелки всегда видны, маленькие, прижаты к краям как в исходнике */
  .qv-arrow {
    opacity: 1;
    width: 60px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    justify-content: center;
    padding: 0;
  }

  .qv-prev { left: 0; }
  .qv-next { right: 0; }

  .qv-arrow svg {
    width: 22px;
    height: 22px;
  }

  /* Убираем hover-фон со стрелок на мобиле */
  .qv-prev:hover,
  .qv-next:hover {
    background: transparent;
  }

  /* Лупа на мобиле не нужна */
  .qv-zoom-overlay {
    pointer-events: none;
    cursor: default;
  }
  .qv-zoom-icon {
    display: none;
  }

  /* Спиннер на мобиле */
  .qv-spinner {
    min-height: 260px;
  }
}

/* ── Отключаем hover-эффекты на touch-устройствах ────────────── */
/* На мобилке hover не работает корректно, поэтому убираем все
   hover-зависимые стили для qv-img-stage и используем только
   touch-ориентированный UI (стрелки всегда видны — выше в media) */
@media (hover: none) {
  /* zoom-overlay уже отключена в мобильном блоке выше */
  .qv-zoom-overlay { cursor: default; pointer-events: none; }
  .qv-zoom-overlay:hover .qv-zoom-icon { opacity: 0; transform: scale(0.8); }

  /* Карточки витрины / лотов — убираем hover тени и фон */
  .shop-card:hover {
    background: var(--bg-card);
    border-color: var(--border);
    transform: none;
    box-shadow: none;
  }
  .lot-card:hover {
    background: var(--bg-card);
    box-shadow: none;
  }
  .lot-row-card:hover {
    background: var(--bg-card);
    box-shadow: none;
  }
}
