/* =============================================================
   AutoBay24 — /auto/ page styles
   Loaded AFTER ab24.css (main). Uses same design tokens.
   ============================================================= */

/* Page header uses global .ab-page-header--catalog from ab24.css */

/* ───── LISTING SECTION ───── */
.ab-listing { padding-top: 16px; padding-bottom: 56px; }
@media (min-width: 992px) { .ab-listing { padding-top: 24px; } }

/* ───── FILTER BOX (desktop sidebar — NOT sticky, full content always visible) ───── */
.ab-filter-box {
  background: var(--ab-surface);
  border: 1px solid var(--ab-line);
  border-radius: var(--ab-radius);
  padding: 18px 18px 20px;
}
/* .ab-filter-box--sticky class stays in HTML but no sticky behavior — by user request */
.ab-filter-box--sticky { position: static; }

/* ───── FILTER FORM ───── */
.ab-filter-form__head {
  display: flex; align-items: center;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--ab-line);
}
.ab-filter-form__title {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: var(--ab-ink); margin: 0;
}
.ab-filter-form__title svg { color: var(--ab-blue); flex-shrink: 0; }

.ab-filter-group { margin-bottom: 12px; }
.ab-filter-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--ab-ink-2); margin-bottom: 6px; letter-spacing: 0.01em;
}
.ab-filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ab-search__field--filter moved to ab24.css (shared with /concessionari/) */

/* Submit */
.ab-filter-form__actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ab-line); }

/* ───── TOOLBAR styles moved to ab24.css (shared with /concessionari/) ───── */

/* ───── ADVANCED FILTERS (collapsable) ───── */
.ab-filter-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 12px; margin: 4px 0 12px;
  font-size: 13px; font-weight: 600; color: var(--ab-blue);
  background: var(--ab-blue-soft); border: 1px solid var(--ab-blue-line);
  border-radius: var(--ab-radius-sm); cursor: pointer;
  transition: background var(--ab-dur) var(--ab-ease);
}
.ab-filter-toggle:hover { background: rgba(15,94,255,0.12); }
.ab-filter-toggle svg { transition: transform var(--ab-dur) var(--ab-ease); }
.ab-filter-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.ab-filter-adv[hidden] { display: none; }
.ab-filter-adv { animation: abSlideDown 0.18s ease-out; }
@keyframes abSlideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ───── ACTIVE FILTER CHIPS ───── */
.ab-chips {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 16px;
}
.ab-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 12px;
  font-size: 12.5px; font-weight: 500; color: var(--ab-blue);
  background: var(--ab-blue-soft);
  border: 1px solid var(--ab-blue-line);
  border-radius: 100px;
  transition: all var(--ab-dur) var(--ab-ease);
}
.ab-chip:hover {
  background: var(--ab-blue); color: #fff; border-color: var(--ab-blue);
}
.ab-chip svg { opacity: 0.7; transition: opacity var(--ab-dur) var(--ab-ease); }
.ab-chip:hover svg { opacity: 1; }
.ab-chips__clear {
  font-size: 12px; color: var(--ab-ink-3);
  text-decoration: underline; text-underline-offset: 3px;
  padding: 5px 6px; margin-left: 4px;
  transition: color var(--ab-dur) var(--ab-ease);
}
.ab-chips__clear:hover { color: var(--ab-ink); }

/* ───── LIST (vertical row of cards) ───── */
.ab-list { display: flex; flex-direction: column; gap: 14px; }

.ab-list-card {
  display: grid; grid-template-columns: 1fr; gap: 0;
  background: var(--ab-surface);
  border: 1px solid var(--ab-line);
  border-radius: var(--ab-radius);
  overflow: hidden;
  transition: border-color var(--ab-dur) var(--ab-ease),
              box-shadow var(--ab-dur) var(--ab-ease),
              transform var(--ab-dur) var(--ab-ease);
  cursor: pointer;
  box-shadow: var(--ab-shadow-card);
}
.ab-list-card:hover {
  border-color: var(--ab-blue-line);
  box-shadow: var(--ab-shadow-card-hover);
  transform: translateY(-2px);
}
@media (min-width: 768px) { .ab-list-card { grid-template-columns: 280px 1fr; } }
@media (min-width: 992px) { .ab-list-card { grid-template-columns: 320px 1fr; } }

.ab-list-card__media {
  position: relative; overflow: hidden; background: var(--ab-bg-2);
  aspect-ratio: 4 / 3;
}
@media (min-width: 768px) {
  .ab-list-card__media { aspect-ratio: 4 / 3; }
}
.ab-list-card__img-link { display: block; width: 100%; height: 100%; }
.ab-list-card__img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s var(--ab-ease);
}
.ab-list-card:hover .ab-list-card__img { transform: scale(1.04); }

/* Photo count badge — bottom-left corner of media */
.ab-list-card__photos {
  position: absolute; bottom: 8px; left: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; font-size: 11.5px; font-weight: 600;
  color: #fff; background: rgba(15,25,35,0.78);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 100px; letter-spacing: 0.01em;
  pointer-events: none;
}
.ab-list-card__photos svg { opacity: 0.9; }

/* ─────────────────────────────────────────────
 *  Card actions row — compare + favorite (autoscout24-style)
 *  Icons only with native tooltip, inline next to price
 * ───────────────────────────────────────────── */
.ab-list-card__head-side {
  display: flex; flex-direction: row; align-items: flex-start; gap: 10px;
  flex-shrink: 0;
}
.ab-list-card__price-wrap {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0;
}
.ab-list-card__iva {
  font-size: 11.5px; color: var(--ab-ink-4); font-weight: 400;
  margin-top: 2px; line-height: 1;
}
.ab-list-card__actions {
  display: inline-flex; align-items: center; gap: 2px;
}
.ab-card-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: 0;
  background: transparent; color: var(--ab-ink-4);
  border-radius: 100px; cursor: pointer;
  transition: all var(--ab-dur) var(--ab-ease);
  flex-shrink: 0;
}
.ab-card-action:hover {
  background: var(--ab-blue-soft); color: var(--ab-blue);
}
.ab-card-action svg { transition: transform var(--ab-dur) var(--ab-ease); }

/* Compare — synced via is-active class from JS */
.ab-card-action--cmp.is-active {
  background: var(--ab-blue); color: #fff;
}
.ab-card-action--cmp.is-active:hover {
  background: var(--ab-blue-hover, #0849d9);
}

/* Favorite — red when active */
.ab-card-action--fav:hover { background: transparent; color: #e63946; }
.ab-card-action--fav.is-active { color: #e63946; }
.ab-card-action--fav.is-active svg { fill: #e63946; stroke: #e63946; animation: abHeartPop 0.35s ease-out; }
@keyframes abHeartPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Mobile: head-side wraps below title if not enough space, actions stay inline with price */
@media (max-width: 575px) {
  .ab-card-action { width: 28px; height: 28px; }
  .ab-list-card__head-side { gap: 8px; }
}

.ab-list-card__body {
  padding: 12px 14px 12px; display: flex; flex-direction: column;
  gap: 10px; min-width: 0;
}
@media (min-width: 992px) {
  .ab-list-card__body {
    padding: 14px 18px 12px; gap: 10px;
    justify-content: space-between;
  }
}

.ab-list-card__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.ab-list-card__title {
  font-size: 16px; font-weight: 500; color: var(--ab-ink-2);
  line-height: 1.3; flex: 1; min-width: 0;
}
.ab-list-card__title a { color: inherit; }
.ab-list-card__title strong { font-weight: 700; color: var(--ab-ink); }
.ab-list-card__equip {
  display: block; font-size: 12.5px; color: var(--ab-ink-4);
  font-weight: 400; margin-top: 2px; line-height: 1.35;
}
.ab-list-card:hover .ab-list-card__title strong { color: var(--ab-blue); }
@media (min-width: 992px) { .ab-list-card__title { font-size: 17px; } }

.ab-list-card__price {
  font-size: 20px; font-weight: 700; color: var(--ab-blue);
  white-space: nowrap; letter-spacing: -0.01em;
}
@media (min-width: 992px) { .ab-list-card__price { font-size: 22px; } }

.ab-list-card__specs {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px 14px;
  font-size: 12.5px; color: var(--ab-ink-2);
  padding: 8px 0;
  border-top: 1px dashed var(--ab-line); border-bottom: 1px dashed var(--ab-line);
}
@media (min-width: 768px) { .ab-list-card__specs { grid-template-columns: repeat(3, 1fr); } }
.ab-list-card__specs li { display: inline-flex; align-items: center; gap: 6px; min-height: 18px; }
.ab-list-card__specs svg { color: var(--ab-ink-4); flex-shrink: 0; }
/* Highlight for specs matching active filter */
.ab-list-card__specs li.is-highlight {
  font-weight: 700; color: var(--ab-ink);
}
.ab-list-card__specs li.is-highlight svg { color: var(--ab-blue); }

.ab-list-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.ab-list-card__dealer {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ab-ink-3); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ab-list-card__dealer svg { color: var(--ab-ink-4); flex-shrink: 0; }
.ab-list-card__cta {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--ab-blue);
  padding: 7px 0; transition: color var(--ab-dur) var(--ab-ease);
}
.ab-list-card__cta:hover { color: var(--ab-blue-hover); }
.ab-list-card__cta svg { transition: transform var(--ab-dur) var(--ab-ease); }
.ab-list-card:hover .ab-list-card__cta svg { transform: translateX(3px); }

/* ───── EMPTY STATE ───── */
.ab-empty-card {
  background: var(--ab-surface);
  border: 1px dashed var(--ab-line-2);
  border-radius: var(--ab-radius);
  padding: 48px 24px; text-align: center;
}
.ab-empty-card svg { color: var(--ab-ink-4); margin-bottom: 12px; }
.ab-empty-card h3 { font-size: 18px; font-weight: 600; color: var(--ab-ink); margin-bottom: 6px; }
.ab-empty-card p { font-size: 14px; color: var(--ab-ink-3); margin-bottom: 18px; }
.ab-empty-card .ab-btn { display: inline-flex; }

/* Smart empty-state: clickable suggestions */
.ab-empty-suggest {
  list-style: none; padding: 0; margin: 0 auto 0; max-width: 480px;
  display: flex; flex-direction: column; gap: 8px;
}
.ab-empty-suggest__item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 12px 16px;
  background: var(--ab-surface); border: 1px solid var(--ab-line-2);
  border-radius: var(--ab-radius-sm); color: var(--ab-ink);
  font-size: 14px; text-align: left;
  transition: all var(--ab-dur) var(--ab-ease);
}
.ab-empty-suggest__item:hover {
  border-color: var(--ab-blue);
  background: var(--ab-blue-soft);
  transform: translateX(2px);
}
.ab-empty-suggest__label {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ab-ink-2);
}
.ab-empty-suggest__label svg { color: #e63946; flex-shrink: 0; }
.ab-empty-suggest__label strong { color: var(--ab-ink); font-weight: 600; }
.ab-empty-suggest__count {
  font-size: 13px; font-weight: 600; color: var(--ab-blue);
  background: var(--ab-blue-soft);
  padding: 3px 10px; border-radius: 100px;
  white-space: nowrap; flex-shrink: 0;
}
.ab-empty-suggest__item:hover .ab-empty-suggest__count {
  background: var(--ab-blue); color: #fff;
}
.ab-link--muted {
  display: inline-block; font-size: 13px; color: var(--ab-ink-3);
  text-decoration: underline;
}
.ab-link--muted:hover { color: var(--ab-blue); }

/* ───── PAGINATION ───── */
.ab-pagination-wrap {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; margin-top: 28px;
}
/* Base .ab-pagination in ab24.css; auto uses .ab-pagination--end modifier */
.ab-pagination__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 10px;
  font-size: 13.5px; font-weight: 500; color: var(--ab-ink-2);
  background: var(--ab-surface); border: 1px solid var(--ab-line-2);
  border-radius: var(--ab-radius-sm);
  transition: all var(--ab-dur) var(--ab-ease);
}
.ab-pagination__btn:hover {
  border-color: var(--ab-blue); color: var(--ab-blue); background: var(--ab-blue-soft);
}
.ab-pagination__btn.is-active {
  background: var(--ab-blue); border-color: var(--ab-blue); color: #fff;
  box-shadow: 0 2px 6px rgba(15,94,255,0.25);
}
.ab-pagination__btn.is-active:hover { background: var(--ab-blue-hover); }
.ab-pagination__dots { color: var(--ab-ink-4); padding: 0 4px; font-weight: 600; }
.ab-pagination__info {
  font-size: 13px; color: var(--ab-ink-3); white-space: nowrap;
}
.ab-pagination__info strong { color: var(--ab-ink); font-weight: 600; }

/* Mobile: stack — info on top, buttons below */
@media (max-width: 575px) {
  .ab-pagination-wrap { flex-direction: column; align-items: center; gap: 10px; }
  .ab-pagination { justify-content: center; margin-left: 0; }
}

/* ───── MOBILE DRAWER (custom, no Bootstrap dep.) ───── */
.ab-drawer {
  position: fixed; inset: 0; z-index: 1050;
  pointer-events: none; visibility: hidden;
  /* Задержка visibility при закрытии — ждём окончания transform панели */
  transition: visibility 0s linear 0.3s;
}
.ab-drawer.is-open {
  pointer-events: auto; visibility: visible;
  transition: visibility 0s linear 0s;
}

/* Overlay убран — drawer на всю ширину, закрывается крестиком или Escape */
.ab-drawer__overlay { display: none; }

.ab-drawer__panel {
  position: absolute; top: 0; left: 0; bottom: 0; right: 0;
  width: 100vw; max-width: 100vw;
  background: var(--ab-surface);
  transform: translateX(-100%);
  transition: transform 0.3s var(--ab-ease);
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 2;
}
.ab-drawer.is-open .ab-drawer__panel { transform: translateX(0); }

.ab-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ab-line);
  flex-shrink: 0;
}
.ab-drawer__title {
  font-size: 16px; font-weight: 600; color: var(--ab-ink);
  letter-spacing: -0.01em;
}
.ab-drawer__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  background: transparent; border: 1px solid var(--ab-line-2);
  border-radius: var(--ab-radius-sm); color: var(--ab-ink-2);
  cursor: pointer; transition: all var(--ab-dur) var(--ab-ease);
  flex-shrink: 0;
}
.ab-drawer__close:hover { border-color: var(--ab-blue); color: var(--ab-blue); }

.ab-drawer__body { padding: 18px 20px; overflow-y: auto; flex: 1; }

/* In the drawer, inner form head duplicates drawer head — hide */
.ab-drawer .ab-filter-form__head { display: none; }