/* Мелкие правки поверх Tailwind. */
html { -webkit-text-size-adjust: 100%; }
body { text-rendering: optimizeLegibility; }

select[multiple] { min-height: 3rem; }
select[multiple] option { padding: 3px 6px; border-radius: 6px; }
select:focus, input:focus, textarea:focus { outline: none; }

details > summary::-webkit-details-marker { display: none; }
details > summary { list-style: none; }

/* Горизонтальная прокрутка пилюль брендов */
.aa-scroll::-webkit-scrollbar { height: 6px; }
.aa-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
.aa-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.aa-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }


@keyframes aa-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.overflow-x-auto::-webkit-scrollbar { height: 8px; }
.overflow-x-auto::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }

@media (max-width: 640px) {
  select[multiple] { min-height: 2.5rem; }
}

/* --- Выбор марки: плитки с акцентной обводкой (как на mycarjp, в нашей палитре) --- */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 14rem;
  overflow-y: auto;
  padding: 8px 9px;
  margin: -6px -7px;
}
.brand-tile {
  position: relative;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 9px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #475569;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s, border-color .15s, background .15s, box-shadow .18s, transform .18s;
}
.brand-tile:hover {
  border-color: #c3defd;
  background: #f0f6ff;
  color: #0040cc;
  transform: translateY(-1px);
}
.brand-tile.is-active,
.brand-tile.is-active:hover {
  background: #eff5ff;
  border-color: #bcd7fe;
  color: #003199;
  transform: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(0, 82, 255, .18);
}
.brand-tile:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(0, 82, 255, .22);
}

/* Единая обводка полей фильтров: рамка + мягкое кольцо с отступом */
#filters input:focus,
#filters select:focus,
#filters textarea:focus {
  outline: none;
  border-color: #0052ff;
  box-shadow: 0 0 0 3px rgba(0, 82, 255, .16);
}
/* --- Карточка проданного лота: фото и миниатюры --- */
.lot-thumb {
  width: 40px;
  height: 30px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, .92);
  background-size: cover;
  background-position: center;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .25);
  opacity: .82;
  transition: opacity .15s, border-color .15s, transform .15s;
}
.lot-thumb:hover { opacity: 1; transform: translateY(-1px); }
.lot-thumb.is-active { opacity: 1; border-color: #0052ff; }
/* Кнопки-оценки в фильтрах: выбранное состояние должно быть видно */
.grade-chip.is-active {
  background: #0052ff !important;
  border-color: #0052ff !important;
  color: #fff !important;
  box-shadow: 0 1px 4px rgba(0, 82, 255, .35);
}
.lot-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.lot-card .js-cover { transition: transform .5s ease; }
.lot-card:hover .js-cover { transform: scale(1.04); }
/* Плитки марок на главной: шире экран — больше колонок */
#brandPills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { #brandPills { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { #brandPills { grid-template-columns: repeat(6, minmax(0, 1fr)); max-height: 11rem; } }
/* не даём странице разъезжаться на узких экранах */
/* clip, а не hidden: hidden ломает position: sticky у шапки */
html, body { overflow-x: hidden; overflow-x: clip; }

/* Очень узкие экраны (320-359): прячем второстепенные кнопки шапки, чтобы не резался бургер */
@media (max-width: 359px) {
  .aa-hide-xs { display: none !important; }
}

/* Статьи: типографика тела без Tailwind-классов */.article-body { line-height: 1.75; }.article-body p { margin: 1rem 0; }.article-body h2 { font-size: 1.5rem; font-weight: 800; color: #0f172a; margin: 2.25rem 0 .75rem; line-height: 1.25; }.article-body h3 { font-size: 1.15rem; font-weight: 700; color: #0f172a; margin: 1.75rem 0 .5rem; }.article-body ul, .article-body ol { margin: 1rem 0 1rem 1.25rem; }.article-body ul { list-style: disc; }.article-body ol { list-style: decimal; }.article-body li { margin: .4rem 0; }.article-body a { color: #0040cc; text-decoration: underline; }.article-body table { margin: 1.25rem 0; }.article-body b, .article-body strong { color: #0f172a; font-weight: 700; }

/* Якоря на главной: не заезжаем под липкую шапку */
section[id], main[id], div[id] { scroll-margin-top: 96px; }

/* галерея лота */
.lot-thumb { border: 2px solid transparent; border-radius: .6rem; padding: 0; line-height: 0; }
.lot-thumb.is-active { border-color: #0052ff; }
.lot-lightbox { position: fixed; inset: 0; z-index: 80; display: none; align-items: center;
  justify-content: center; background: rgba(8, 15, 30, .92); padding: 1.5rem; }
.lot-lightbox.is-open { display: flex; }
.lot-lightbox img { max-width: min(1200px, 94vw); max-height: 88vh; object-fit: contain;
  border-radius: .75rem; background: #0f172a; }
.lot-lightbox button { position: absolute; background: rgba(255,255,255,.14); color: #fff;
  border: 0; border-radius: .75rem; cursor: pointer; font-size: 1.6rem; line-height: 1;
  width: 44px; height: 44px; }
.lot-lightbox button:hover { background: rgba(255,255,255,.26); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-note { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.75); font-size: .8rem; }

/* боковая колонка фильтров: свой скролл, страница не дёргается */
.filters-scroll { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.filters-scroll::-webkit-scrollbar { width: 6px; }
.filters-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.filters-scroll::-webkit-scrollbar-track { background: transparent; }
@media (min-width: 1024px) {
  .filters-scroll {
    position: sticky; top: 6rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* --- Живой счётчик лотов: цифры перелистываются, как одометр --- */
.odo { display: inline-flex; align-items: flex-start; font-variant-numeric: tabular-nums; }
.odo-col { position: relative; display: inline-block; width: 1ch; height: 1em; overflow: hidden; }
.odo-strip {
  display: block;
  transition: transform .65s cubic-bezier(.22, .68, .24, 1);
  will-change: transform;
}
.odo-strip > span { display: block; height: 1em; line-height: 1em; }
.odo-gap { display: inline-block; width: .34ch; }
@keyframes odo-flash { 0% { color: #0052ff; } 100% { color: #0f172a; } }
.odo-col.is-tick { animation: odo-flash .9s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .odo-strip { transition: none; }
  .odo-col.is-tick { animation: none; }
}

/* --- Галерея лота: миниатюры переключают фото, клик открывает просмотр --- */
.lot-thumb { border: 2px solid transparent; border-radius: 10px; padding: 0; overflow: hidden; cursor: pointer; background: none; line-height: 0; }
.lot-thumb.is-active { border-color: #2563eb; }
.lot-thumb img { display: block; }
.lot-lightbox { display: none; position: fixed; inset: 0; z-index: 80; background: rgba(15,23,42,.92); align-items: center; justify-content: center; padding: 24px; }
.lot-lightbox.is-open { display: flex; }
.lot-lightbox img { max-width: min(1100px, 92vw); max-height: 84vh; border-radius: 12px; object-fit: contain; }
.lot-lightbox button { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.lot-lightbox button:hover { background: rgba(255,255,255,.3); }
.lot-lightbox .lb-close { top: 20px; right: 20px; }
.lot-lightbox .lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lot-lightbox .lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lot-lightbox .lb-note { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #cbd5e1; font-size: 12px; }
