body.page-catalog {
  background: #fff;
}

.page-catalog .site-header {
  position: relative;
  color: var(--color-text-primary);
  background: #fff;
}

.page-catalog .logo-light {
  display: block;
  filter: brightness(0);
}

.page-catalog .logo-dark {
  display: none;
}

body.search-open.page-catalog .logo-light {
  display: none;
  filter: none;
}

body.search-open.page-catalog .logo-dark {
  display: block;
}

.page-catalog .nav-link,
.page-catalog .city__btn {
  color: var(--color-text-primary);
}

.page-catalog .nav-link:hover {
  background: var(--color-gray-50);
}

.page-catalog .site-header .city__btn img {
  filter: none;
}

.catalog {
  padding-top: 40px;
}

.catalog__crumbs {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 14px;
  line-height: 24px;
}

.catalog__crumbs a {
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.catalog__crumbs span[aria-current="page"] {
  color: var(--color-text-accent);
}

.catalog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: 20px;
}

.catalog__head h1 {
  font-size: 36px;
  line-height: 48px;
  font-weight: 600;
}

.catalog__count {
  display: none;
  margin: 8px 0 0;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 24px;
}

.filter-bar,
.filters__head {
  display: none;
}

.filter-bar__track {
  display: flex;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.filter-bar__track::-webkit-scrollbar {
  display: none;
}

.filter-bar__sort {
  position: relative;
  flex: 0 0 auto;
}

.filter-bar__icon,
.filter-bar__chip,
.sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--color-border-outline);
  border-radius: var(--radius-3xl);
  background: #fff;
  box-shadow: var(--shadow-xs);
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 24px;
  font-weight: 500;
  white-space: nowrap;
}

.filter-bar__icon,
.sheet-close {
  width: 32px;
  height: 32px;
  padding: 0;
}

.sheet-close {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.filter-bar__chip {
  height: 32px;
  padding: 4px 16px;
}

.filter-bar__chip > img {
  margin-right: 4px;
}

.filter-bar__chip[data-filters-open] {
  gap: 4px;
  padding: 4px 16px 4px 12px;
}

.filter-bar__chip[data-filters-open] > img {
  margin-right: 0;
}

.filter-bar__count,
.filter-bar__x {
  display: none;
}

.filter-bar__count {
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: var(--radius-3xl);
  background: #fff;
  color: var(--color-text-primary);
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
}

.filter-bar__x {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

.filter-bar__x img {
  display: block;
  width: 20px;
  height: 20px;
}

.filter-bar__chip.is-on {
  border-color: transparent;
  background: var(--color-bg-button-primary);
  box-shadow: none;
  color: #fff;
}

.filter-bar__chip.is-on:hover {
  background: var(--color-bg-button-primary-hover);
}

.filter-bar__chip.is-on img {
  filter: brightness(0) invert(1);
}

.filter-bar__chip.is-on .filter-bar__count,
.filter-bar__chip.is-on .filter-bar__x {
  display: inline-flex;
}

.filter-bar__chip[data-filters-open].is-on {
  padding: 4px 4px 4px 12px;
}

.filter-bar__chip[data-range-open].is-on {
  gap: 4px;
  padding: 4px 12px 4px 16px;
}

.page-catalog:not(.page-used) .filter-bar__chip--mileage,
body.page-catalog:not(.page-used) .filter-bar__chip--mileage {
  display: none;
}

.filter-bar__menu {
  position: fixed;
  z-index: 40;
  min-width: 220px;
  max-height: 240px;
  margin: 0;
  padding: 8px 0;
  overflow: auto;
  list-style: none;
  background: var(--surface-overlay);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-overlay);
}

.filter-bar__menu[hidden] {
  display: none;
}

.filter-bar__menu button,
.filter-bar__menu a {
  display: block;
  width: 100%;
  padding: 4px 16px;
  border-radius: 0;
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 24px;
  font-weight: 400;
  white-space: nowrap;
  text-align: left;
  text-decoration: none;
}

.filter-bar__menu button.is-on,
.filter-bar__menu button[aria-selected="true"],
.filter-bar__menu a.is-on,
.filter-bar__menu a[aria-selected="true"] {
  background: var(--color-gray-50);
}

.range-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
}

.range-sheet[hidden] {
  display: none;
}

.range-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(18, 18, 23, 0.34);
}

.range-sheet__panel {
  position: relative;
  width: 100%;
  padding: 0 20px 24px;
  border-radius: 36px 36px 0 0;
  background: #fff;
  box-shadow: 0 -4px 36px rgba(0, 0, 0, 0.25);
}

.range-sheet__handle {
  width: 40px;
  height: 4px;
  margin: 16px auto;
  border-radius: 100px;
  background: var(--color-text-button-disabled);
}

.range-sheet__head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  min-height: 44px;
}

.range-sheet__head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 32px;
  font-weight: 600;
  text-align: center;
}

.range-sheet__fields {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.range-sheet__field {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  padding: 8px;
  border: 1px solid var(--color-border-outline);
  border-radius: var(--radius-3xl);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.range-sheet__field span,
.range-sheet__field input {
  padding: 0 8px;
  font-size: 14px;
  line-height: 24px;
}

.range-sheet__field input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  color: var(--color-text-primary);
}

.range-sheet__field input::placeholder {
  color: var(--color-text-secondary);
}

.range-sheet__apply {
  width: 100%;
  margin-top: 18px;
}

body.filters-open {
  overflow: hidden;
}

.brand-picker {
  display: none;
}

.brand-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
}

.brand-sheet[hidden] {
  display: none;
}

.brand-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(18, 18, 23, 0.34);
}

.brand-sheet__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(680px, 100%);
  border-radius: 36px 36px 0 0;
  background: #fff;
  box-shadow: 0 -4px 36px rgba(0, 0, 0, 0.25);
}

.brand-sheet__search {
  display: flex;
  align-items: center;
  gap: 0;
  width: calc(100% - 40px);
  margin: 8px 20px 16px;
  min-height: 40px;
  padding: 8px;
  border: 1px solid var(--color-border-outline);
  border-radius: var(--radius-3xl);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.brand-sheet__search img {
  margin-left: 4px;
}

.brand-sheet__search input {
  width: 100%;
  min-width: 0;
  padding: 0 8px;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  font-size: 14px;
  line-height: 24px;
  color: var(--color-text-primary);
}

.brand-sheet__search input::placeholder {
  color: var(--color-text-secondary);
}

.brand-sheet__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 20px 8px;
}

.brand-sheet__list .check[hidden] {
  display: none;
}

.brand-sheet__foot {
  padding: 12px 20px 24px;
  background: #fff;
  box-shadow: 0 -4px 18px rgba(18, 18, 23, 0.12);
}

.brand-sheet__foot .btn {
  width: 100%;
}

.sort {
  position: relative;
}

.sort__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 24px;
  font-weight: 500;
}

.sort__btn span {
  padding-inline: var(--space-1);
}

.sort__btn:focus-visible {
  outline: none;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--color-red-500);
}

.sort__btn img {
  transition: transform 0.2s ease;
}

.sort__btn[aria-expanded="true"] img {
  transform: rotate(180deg);
}

.sort__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  left: auto;
  min-width: 220px;
  max-height: 240px;
  margin: 0;
  padding: 8px 0;
  overflow: auto;
  background: var(--surface-overlay);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-overlay);
}

.sort__menu button {
  display: block;
  width: 100%;
  padding: 4px 16px;
  border-radius: 0;
  text-align: left;
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 24px;
  font-weight: 400;
}

.sort__menu button:hover,
.sort__menu button[aria-selected="true"] {
  background: var(--color-gray-50);
}

.catalog__body {
  display: grid;
  grid-template-columns: 326px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  margin-top: var(--space-6);
}

.filters__body {
  display: contents;
}

@media (min-width: 769px) {
  .filters {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    overflow: hidden;
  }

  .filters__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--space-4);
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
    padding-bottom: 120px;
  }

  .filter-card--result {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    width: auto;
    margin: 0;
    box-shadow: 0 -4px 18px rgba(18, 18, 23, 0.12);
  }

  .filter-card--result.is-offscreen {
    visibility: hidden;
  }
}

.catalog__body > * {
  min-width: 0;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.filter-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--space-4);
  background: var(--color-gray-50);
}

.filter-card--result {
  align-items: center;
  gap: var(--space-3);
  background: #fff;
}

.filter-card--result p {
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 24px;
}

.filter-card__actions {
  display: flex;
  gap: var(--space-2);
  width: 100%;
}

.filter-card__actions .btn {
  flex: 1 1 0;
}

.seg {
  display: flex;
  gap: var(--space-2);
}

.seg button,
.seg a {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  color: var(--color-text-tab);
  font-size: 14px;
  line-height: 24px;
  white-space: nowrap;
  text-decoration: none;
}

.seg button span,
.seg a span {
  padding-inline: var(--space-1);
}

.seg button:hover:not(.is-on),
.seg a:hover:not(.is-on) {
  background: var(--color-gray-50);
  color: var(--color-text-primary);
}

.seg button.is-on,
.seg a.is-on {
  background: #121217;
  color: #fff;
  font-weight: 500;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.filter-field__label {
  font-size: 14px;
  line-height: 24px;
  font-weight: 500;
}

.filter-field__label span {
  font-weight: 400;
  color: var(--color-text-secondary);
}

.filter-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pill {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 7px var(--space-2);
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-3xl);
  background: var(--color-bg-input);
  box-shadow: var(--shadow-xs);
}

.pill select,
.pill input {
  width: 100%;
  min-width: 0;
  padding: 0 var(--space-2);
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  font-size: 14px;
  line-height: 24px;
  color: var(--color-text-primary);
}

.pill select {
  -webkit-appearance: none;
  appearance: none;
  background: url("../images/icons/chevron-down.svg") right 4px center / 24px 24px no-repeat;
  padding-right: 28px;
}

.pill select:invalid,
.pill input::placeholder {
  color: var(--color-text-secondary);
}

.pill--disabled {
  background: var(--color-gray-50);
  box-shadow: none;
}

.pill--disabled select,
.pill--disabled select:invalid {
  color: var(--color-text-button-disabled);
}

.pill__suffix {
  flex: 0 0 auto;
  padding-inline: var(--space-2);
  font-size: 14px;
  line-height: 24px;
}

.pill input.is-muted {
  color: var(--color-text-secondary);
}

.pair {
  display: flex;
  align-items: stretch;
  min-height: 40px;
  overflow: hidden;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-3xl);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.pair input {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px var(--space-4);
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  font-size: 14px;
  line-height: 24px;
  color: var(--color-text-primary);
}

.pair input + input {
  border-left: 1px solid var(--color-gray-100);
}

.pair input::placeholder {
  color: var(--color-text-secondary);
}

.filters .check {
  align-items: center;
}

.range {
  display: block;
  width: 100%;
  height: 8px;
  margin: 0;
  border-radius: var(--radius-3xl);
  background:
    linear-gradient(var(--color-red-500), var(--color-red-500)) left center / calc(10px + (100% - 20px) * var(--ratio, 0)) 100% no-repeat,
    var(--color-gray-100);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.range:disabled {
  background:
    linear-gradient(var(--color-gray-200), var(--color-gray-200)) left center / calc(10px + (100% - 20px) * var(--ratio, 0)) 100% no-repeat,
    var(--color-gray-100);
  cursor: default;
}

.range::-webkit-slider-runnable-track {
  height: 8px;
  border: 0;
  background: transparent;
}

.range::-webkit-slider-thumb {
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  margin-top: -6px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 1px var(--color-border-outline),
    0 1px 2px rgba(18, 18, 23, 0.06),
    0 1px 3px rgba(18, 18, 23, 0.1);
  -webkit-appearance: none;
  appearance: none;
}

.range:active::-webkit-slider-thumb,
.range:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 0 0 1px var(--color-red-500),
    0 1px 2px rgba(18, 18, 23, 0.06),
    0 1px 3px rgba(18, 18, 23, 0.1);
}

.range::-moz-range-thumb {
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 1px var(--color-border-outline),
    0 1px 2px rgba(18, 18, 23, 0.06),
    0 1px 3px rgba(18, 18, 23, 0.1);
}

.range:active::-moz-range-thumb,
.range:focus-visible::-moz-range-thumb {
  box-shadow:
    0 0 0 1px var(--color-red-500),
    0 1px 2px rgba(18, 18, 23, 0.06),
    0 1px 3px rgba(18, 18, 23, 0.1);
}

.range::-moz-range-track {
  height: 8px;
  border: 0;
  background: transparent;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-3xl);
  background: var(--color-gray-50);
  color: #3f3f50;
  font-size: 14px;
  line-height: 20px;
}

.chip.is-on {
  border-color: var(--color-red-500);
  background: var(--color-red-500);
  color: var(--color-text-white);
}

.chip:hover:not(.is-on) {
  border-color: var(--color-border-accent);
  background: var(--color-bg-accent);
  color: var(--color-text-accent);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.catalog-grid .card {
  flex: initial;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.catalog-grid .card__body {
  flex: 1;
}

.catalog-grid .card__actions {
  margin-top: auto;
}

.page-all .catalog-grid .card:not(.card--used) .card__specs {
  margin-top: auto;
}

.page-all .catalog-grid .card:not(.card--used) .card__actions {
  margin-top: 0;
}

.catalog-grid .card__actions .btn {
  height: 40px;
  border-width: 0;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  margin-top: 20px;
}

.pager button {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-3xl);
  font-size: 14px;
  line-height: 24px;
  font-weight: 500;
}

.pager button span {
  padding-inline: var(--space-2);
}

.pager button.is-on {
  background: var(--color-red-500);
  color: var(--color-text-white);
}

.pager__next {
  padding: var(--space-2);
}

.page-catalog .map-block {
  margin-top: 40px;
}

@media (max-width: 1280px) {
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .page-catalog .logo-light {
    display: none;
    filter: none;
  }

  .page-catalog .logo-dark {
    display: block;
  }

  .catalog__head,
  .catalog__body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .catalog__head h1 {
    font-size: 30px;
    line-height: 32px;
    letter-spacing: 0;
  }

  .catalog__count {
    display: block;
  }

  .sort {
    display: none;
  }

  .filter-bar {
    display: block;
    margin-top: 16px;
    margin-right: calc(var(--layout-gutter) * -1);
    margin-left: calc(var(--layout-gutter) * -1);
  }

  .filter-bar__track {
    padding-inline: var(--layout-gutter);
  }

  .filters {
    display: none;
  }

  .filters.is-open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 80;
    gap: 0;
    margin: 0;
    overflow: auto;
    padding-bottom: 132px;
    background: #fff;
  }

  .filters.is-open .filters__head {
    display: grid;
    position: sticky;
    top: 0;
    z-index: 1;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    padding: 8px 20px;
    background: #fff;
  }

  .filters.is-open .filters__head h2 {
    margin: 0;
    font-size: 18px;
    line-height: 32px;
    font-weight: 600;
    text-align: center;
  }

  .filters.is-open .filter-card {
    gap: 16px;
    padding: 12px 20px;
    border-radius: 0;
    background: transparent;
  }

  .filters.is-open .filter-card--result {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    width: auto;
    margin: 0;
    padding: 12px 20px 24px;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 -4px 18px rgba(18, 18, 23, 0.12);
  }

  .pill:has([data-brand]) select {
    display: none;
  }

  .brand-picker {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0 28px 0 8px;
    overflow: hidden;
    border: 0;
    background: transparent url("../images/icons/chevron-down.svg") right 4px center / 24px 24px no-repeat;
    font: inherit;
    font-size: 14px;
    line-height: 24px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-primary);
  }

  .brand-picker.is-placeholder {
    color: var(--color-text-button-disabled);
  }

  .catalog-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sort {
    align-self: flex-end;
  }
}

.sort__menu button:hover,
.sort__menu button:focus-visible,
.sort__menu button[aria-selected="true"],
.filter-bar__menu button:hover,
.filter-bar__menu button:focus-visible,
.filter-bar__menu a:hover,
.filter-bar__menu a:focus-visible {
  background: var(--color-gray-50);
  outline: none;
}

.pill.has-dropdown {
  position: relative;
  overflow: visible;
}

.has-dropdown.is-set .dropdown__btn {
  color: var(--color-text-primary);
}

.has-dropdown .dropdown__btn:disabled {
  color: var(--color-text-button-disabled);
  background: var(--color-gray-50);
  box-shadow: none;
  opacity: 1;
  cursor: default;
}

@media (min-width: 769px) {
  .pill.has-dropdown {
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .pill.has-dropdown > select {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 768px) {
  .pill.has-dropdown:not(:has([data-brand])) {
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .pill.has-dropdown:not(:has([data-brand])) > select {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
  }

  .pill.has-dropdown:has([data-brand]) > .dropdown__btn,
  .pill.has-dropdown:has([data-brand]) > .dropdown__menu {
    display: none;
  }

  .pill:has([data-brand]) {
    border-color: var(--color-border-outline-disabled);
  }
}

.pager a,
.pager > span {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-3xl);
  color: inherit;
  font-size: 14px;
  line-height: 24px;
  font-weight: 500;
  text-decoration: none;
}

.pager a span,
.pager > span span {
  padding-inline: var(--space-2);
}

.pager > span.is-on,
.pager a.is-on {
  background: var(--color-red-500);
  color: var(--color-text-white);
}

.sort__menu a {
  display: block;
  padding: 8px 16px;
  color: inherit;
  text-decoration: none;
}

.sort__menu a:hover,
.sort__menu a.is-on {
  background: var(--color-gray-50);
}
