.catalog-page {
  background: #ffffff;
  color: #17191d;
}

html.catalog-page-document,
body.catalog-page {
  min-width: 0;
}

.catalog-page .site-header {
  background: #171b1e;
}

.catalog-page__main {
  min-height: calc(100vh - 78px);
  padding: 20px 0 34px;
  background: #ffffff;
}

.catalog-layout {
  width: calc(100% - 96px);
  margin: 0 auto;
}

.catalog-layout__toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 262px;
  gap: 16px;
  align-items: center;
}

.catalog-layout h1,
.catalog-layout h2 {
  margin: 0;
  color: #17191d;
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.1;
}

.catalog-search,
.catalog-sort {
  height: 49px;
  border: 1px solid #dfe1e4;
  border-radius: 6px;
  background: #ffffff;
}

.catalog-search {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 15px;
}

.catalog-search svg {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  fill: none;
  stroke: #2a2d32;
  stroke-linecap: round;
  stroke-width: 1.65;
}

.catalog-search input,
.catalog-sort select,
.filter-price input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #202328;
  font: inherit;
}

.catalog-search input {
  width: 100%;
  font-size: 15px;
}

.catalog-search input::placeholder,
.filter-price input::placeholder {
  color: #777d86;
  opacity: 1;
}

.catalog-sort {
  position: relative;
}

.catalog-sort::after {
  position: absolute;
  top: 50%;
  right: 17px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #25282d;
  border-bottom: 1.5px solid #25282d;
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.catalog-sort select {
  width: 100%;
  height: 100%;
  padding: 0 43px 0 15px;
  appearance: none;
  font-size: 15px;
}

.catalog-layout__content {
  display: grid;
  grid-template-columns: 249px minmax(0, 1fr);
  gap: 16px;
  margin-top: 17px;
}

.catalog-filters {
  --filter-section-spacing: 16px;
  --filter-heading-line-offset: 16px;
  --filter-heading-height: 15px;
  --filter-heading-content-gap: 12px;
  align-self: start;
  padding: 14px 16px 12px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  background: #ffffff;
}

.catalog-filters__reset {
  width: 100%;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #24272c;
  border-radius: 5px;
  background: #fff;
  color: #24272c;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.catalog-filters__reset:hover,
.catalog-filters__reset:focus-visible {
  background: #24272c;
  color: #fff;
}

.filter-group {
  min-width: 0;
  margin: 0;
  padding: 0 0 var(--filter-section-spacing);
  border: 0;
  border-bottom: 1px solid #e5e7e9;
}

.filter-group + .filter-group {
  padding-top: var(--filter-section-spacing);
}

/* Fieldset legends are positioned before the fieldset padding. Keep every
   non-category heading optically centered between the preceding divider and
   its first control without shifting the controls themselves. */
.filter-group:not(.filter-group--brands) + .filter-group:not(.filter-group--brands) > legend,
.filter-group--brands + .filter-group:not(.filter-group--brands) > legend {
  position: relative;
  top: var(--filter-heading-line-offset);
}

.filter-group--brands > legend {
  position: absolute;
  width: 1px;
  min-width: 1px;
  max-width: 1px;
  height: 1px;
  min-height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.filter-group__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: var(--filter-heading-height);
  padding: 0;
  border: 0;
  background: transparent;
  color: #24272c;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-align: left;
}

.filter-group__toggle svg {
  width: var(--filter-heading-height);
  height: var(--filter-heading-height);
  flex: 0 0 var(--filter-heading-height);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  transition: transform 160ms ease;
}

.filter-group__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.filter-group__toggle:focus-visible {
  outline: 2px solid #ef1824;
  outline-offset: 3px;
  border-radius: 3px;
}

.filter-brand-list {
  max-height: 140px;
  margin-top: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c5c9ce transparent;
  scrollbar-width: thin;
  touch-action: pan-y;
}

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

.filter-brand-list::-webkit-scrollbar {
  width: 5px;
}

.filter-brand-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c5c9ce;
}

.filter-group--last {
  padding-bottom: 0;
  border-bottom: 0;
}

.catalog-category-filters {
  display: grid;
  gap: 18px;
  padding-top: var(--filter-section-spacing);
}

.catalog-category-filter-block {
  overflow: hidden;
  border: 1px solid #e5e7e9;
  border-radius: 6px;
  background: #fafbfc;
}

.catalog-category-filter-block > h3 {
  margin: 0;
  padding: 13px 14px 11px;
  color: #1a1c1f;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.catalog-category-filter-block .filter-group {
  padding: 13px 14px;
  border-bottom: 1px solid #e5e7e9;
}

.catalog-category-filter-block .filter-group:last-child {
  border-bottom: 0;
}

.catalog-category-filter-block .filter-group + .filter-group {
  padding-top: 13px;
}

.catalog-category-filter-block .filter-group > legend {
  top: auto;
}

.filter-group legend {
  width: 100%;
  min-height: var(--filter-heading-height);
  margin: 0 0 var(--filter-heading-content-gap);
  padding: 0;
  color: #24272c;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
  color: #42464d;
  font-size: 14px;
  line-height: 1.2;
}

.filter-group input[type="checkbox"] {
  position: relative;
  width: 19px;
  height: 19px;
  margin: 0;
  appearance: none;
  border: 1px solid #bfc4ca;
  border-radius: 4px;
  background: #ffffff;
}

.filter-group input[type="checkbox"]:checked {
  border-color: #ef1824;
  background: #ef1824;
}

.filter-group input[type="checkbox"]:checked::after {
  position: absolute;
  top: 3px;
  left: 6px;
  width: 4px;
  height: 8px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  content: "";
  transform: rotate(45deg);
}

.filter-price {
  display: grid;
  grid-template-columns: 1fr 12px 1fr;
  gap: 6px;
  align-items: center;
}

.filter-price input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d6d9dd;
  border-radius: 5px;
  font-size: 13px;
}

.filter-price > span {
  color: #777d86;
  text-align: center;
}

.filter-price__track {
  position: relative;
  height: 3px;
  margin: 17px 4px 0;
  background: #ef1824;
}

.filter-price__track::before,
.filter-price__track::after {
  position: absolute;
  top: 50%;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ef1824;
  content: "";
  transform: translateY(-50%);
}

.filter-price__track::before { left: -4px; }
.filter-price__track::after { right: -4px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-rows: max-content;
  align-self: start;
  align-items: start;
  gap: 12px;
}

/* The snowmobile category is available for navigation while its individual
   product cards remain intentionally unpublished. */
.product-grid[data-empty-category="snowmobile"]::before {
  display: block;
  padding: 32px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  color: #5f656d;
  content: "В категории «Снегоходы» товаров пока нет.";
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}

@media (min-width: 768px) and (max-width: 1199px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1199px) {
  .catalog-layout {
    width: calc(100% - 64px);
  }
}

@media (max-width: 767px) {
  .catalog-page__main {
    padding-top: 16px;
  }

  .catalog-layout {
    width: calc(100% - 32px);
  }

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

  .catalog-layout__toolbar {
    gap: 12px;
  }

  .catalog-layout__content {
    gap: 16px;
    margin-top: 16px;
  }

  .catalog-filters {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .catalog-search {
    gap: 10px;
    padding: 0 12px;
  }

  .catalog-search input,
  .catalog-sort select {
    font-size: 14px;
  }

  .product-card {
    height: 420px;
  }

  .product-card__body {
    padding-right: 14px;
    padding-left: 14px;
  }
}

.product-card {
  display: flex;
  min-width: 0;
  height: 420px;
  align-self: start;
  flex: 0 0 436px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e1e3e5;
  border-radius: 6px;
  background: #ffffff;
}

.product-card[hidden] {
  display: none;
}

.product-card__media {
  height: 214px;
  flex: 0 0 auto;
  box-sizing: border-box;
  background: #ffffff;
}

.product-card__media--image {
  /* The PNGs are cropped to the visible vehicle. Keep one safe visual area for every category. */
  padding: 12px 14px;
  background-origin: content-box;
  background-clip: content-box;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* These near-square and portrait source photos retain extra transparent safety margins.
   Use that margin to give their visible vehicle the same visual weight as neighbouring cards. */
.product-card[data-sku="1XCHU1000"] .product-card__media--image,
.product-card[data-sku="MOKEN300"] .product-card__media--image,
.product-card[data-sku="SIDECAR06"] .product-card__media--image,
.product-card[data-sku="QUATRO650"] .product-card__media--image,
.product-card[data-sku="SHARK"] .product-card__media--image {
  padding: 6px 10px;
  background-size: auto 105%;
}

.product-card[data-sku="SEQWAY"] .product-card__media--image {
  /* Keep the wide Segway source fully inside the media box at every card width. */
  padding: 12px 14px;
  background-size: contain;
  overflow: hidden;
}

.product-card__body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  padding: 12px 16px 16px;
}

.product-card h2,
.product-card h3,
.product-card__sku {
  margin: 0;
}

.product-card h2,
.product-card h3 {
  margin-top: 0;
  color: #17191d;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.35px;
  line-height: 1.08;
}

.product-card__specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
  min-height: 42px;
  max-height: 42px;
  overflow: hidden;
}

.product-card__specs div {
  min-width: 0;
  overflow: hidden;
}

.product-card__specs dt {
  color: #7b818a;
  font-size: 11px;
  line-height: 1.1;
}

.product-card__specs dd {
  margin: 4px 0 0;
  color: #25282d;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* ATV cards deliberately omit wheels. Use only the columns that contain
   visible facts so the remaining specifications stay evenly distributed. */
.product-card--atv.product-card--atv-specs-2 .product-card__specs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-card--atv.product-card--atv-specs-1 .product-card__specs {
  grid-template-columns: minmax(0, 1fr);
}

.product-card--scooter.product-card--scooter-specs-2 .product-card__specs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-card--scooter.product-card--scooter-specs-1 .product-card__specs {
  grid-template-columns: minmax(0, 1fr);
}

/* The SNOW1934 type description is intentionally complete. Keep its value in
   one full-width column and let it wrap instead of clipping it like compact facts. */
.product-card[data-sku="SNOW1934"] .product-card__specs {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.product-card[data-sku="SNOW1934"] .product-card__specs div,
.product-card[data-sku="SNOW1934"] .product-card__specs dd {
  overflow: visible;
}

.product-card[data-sku="SNOW1934"] .product-card__specs dd {
  display: block;
  -webkit-line-clamp: unset;
  white-space: normal;
}

.product-card__prices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding: 12px 0 0;
  border-top: 1px solid #e0e3e6;
}

.product-card__prices span {
  display: flex;
  box-sizing: border-box;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 5px;
  color: #7b818a;
  font-size: 11px;
  line-height: 1;
  white-space: normal;
}

.product-card__prices span + span {
  padding-left: 10px;
  border-left: 1px solid #e0e3e6;
}

.product-card__prices b {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  color: #17191d;
  font-size: 18px;
  line-height: .6;
  text-align: right;
  white-space: nowrap;
}

.product-card__button {
  width: 100%;
  height: 36px;
  margin-top: auto;
  border: 0;
  border-radius: 5px;
  background: #ef1824;
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
}

.product-card__button:disabled { cursor: default; opacity: 1; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* On compact screens filters are a focused panel, while the desktop sidebar
   keeps its existing persistent layout. */
.catalog-filter-toggle,
.catalog-filters__mobile-header,
.catalog-filters-backdrop {
  display: none;
}

@media (max-width: 1024px) {
  .catalog-layout__toolbar {
    grid-template-columns: minmax(0, 1fr) 262px auto;
  }

  .catalog-filter-toggle {
    display: inline-flex;
    min-height: 49px;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 1px solid #17191d;
    border-radius: 6px;
    background: #17191d;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
  }

  .catalog-filter-toggle:focus-visible,
  .catalog-filters__close:focus-visible {
    outline: 3px solid rgba(239, 24, 36, .35);
    outline-offset: 3px;
  }

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

  .catalog-filters {
    position: fixed;
    z-index: 1001;
    top: 8px;
    right: 8px;
    bottom: 8px;
    width: min(390px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    box-sizing: border-box;
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .24);
    transform: translateX(calc(100% + 24px));
    visibility: hidden;
    pointer-events: none;
    transition: transform .2s ease, visibility .2s ease;
  }

  .catalog-filters.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .catalog-filters__mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    margin: -2px 0 14px;
    color: #17191d;
    font-size: 20px;
    font-weight: 700;
  }

  .catalog-filters__close {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    margin-right: -4px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: #f1f2f3;
    color: #17191d;
    cursor: pointer;
    font-size: 27px;
    line-height: 1;
  }

  .catalog-filters-backdrop {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(20, 22, 25, .46);
    cursor: pointer;
  }

  .catalog-filters-backdrop[hidden] {
    display: none;
  }

  body.catalog-filters-open {
    overflow: hidden;
  }
}

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

  .catalog-search {
    grid-column: 1 / -1;
  }

  .catalog-filter-toggle {
    width: 100%;
  }
}

/* Keep the shared header usable on phones. The primary actions stay in the
   top row; only the navigation moves below it when there is not enough room. */
@media (max-width: 600px) {
  .catalog-page .site-header {
    display: grid;
    grid-template-columns: clamp(96px, 31vw, 126px) minmax(0, 1fr) 42px;
    grid-template-areas:
      "brand consultation cart"
      "nav nav nav";
    min-height: 0;
    padding: 12px var(--header-gutter) 14px;
    column-gap: clamp(5px, 2vw, 12px);
    row-gap: 12px;
  }

  .catalog-page .site-header .brand,
  .catalog-page .site-header .brand img {
    width: clamp(96px, 31vw, 126px);
  }

  .catalog-page .site-header .brand {
    grid-area: brand;
    min-width: 0;
    flex-basis: auto;
  }

  .catalog-page .site-header .cart-toggle {
    grid-area: cart;
    justify-self: end;
    margin: 0;
  }

  .catalog-page .site-header .consultation-link {
    grid-area: consultation;
    width: auto;
    min-width: 0;
    height: 44px;
    margin: 0;
    padding-inline: clamp(4px, 2.4vw, 16px);
    justify-self: end;
    font-size: clamp(10px, 3vw, 13px);
  }

  .catalog-page .site-header .site-nav {
    grid-area: nav;
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 14px;
    overflow: visible;
  }

  .catalog-page .site-header .site-nav a {
    font-size: 14px;
  }
}

/* Prices such as 126 000 ₽ need their own row on narrow product cards.
   This prevents text from being cropped while preserving the desktop layout. */
@media (max-width: 480px) {
  .product-card {
    height: auto;
    min-height: 420px;
  }

  .product-card__prices {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 14px;
  }

  .product-card__prices span {
    min-width: 0;
  }

  .product-card__prices span + span {
    padding: 8px 0 0;
    border-top: 1px solid #e0e3e6;
    border-left: 0;
  }

  .product-card__button {
    flex-shrink: 0;
    margin-top: 16px;
  }
}
