/* t310: catalog Steam banner only — literal copy of the /topup banner as it was before t306.
   Selectors are scoped to .g-mp-catalog-listing so this file cannot change home or /topup. */

/* Desktop: same box as /topup .g-ban (798×180, radius 16). Do not stretch to the 1200px catalog slot. */
/* n7: на десктопе баннер снова на всю ширину каталога, как раньше (картинка 2400x544, высота по пропорции ~272 px).
   Мобилка ниже не меняется */
html body .g-mp-catalog-listing > a.g-ban-w {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 2400 / 544;
  border-radius: 16px;
  overflow: hidden;
  margin: 0;
  padding: 0;
  background: transparent;
}
html body .g-mp-catalog-listing > a.g-ban-w img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
  border-radius: 0;
}

/* Mobile: same image (1008×399), same aspect, height follows the artwork (not the 180px catalog slot). */
html[data-device="mobile"] body .g-mp-catalog-listing > a.g-ban-w {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto !important;
  aspect-ratio: 1008 / 399;
  margin: 0;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
}
html[data-device="mobile"] body .g-mp-catalog-listing > a.g-ban-w img,
html[data-device="mobile"] body .g-mp-catalog-listing > a.g-ban-w > img {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: none;
  aspect-ratio: 1008 / 399;
  object-fit: contain !important;
  object-position: center;
  border-radius: 16px;
}

@media (max-width: 767px) {
  html body .g-mp-catalog-listing > a.g-ban-w {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto !important;
    aspect-ratio: 1008 / 399;
    margin: 0;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
  }
  html body .g-mp-catalog-listing > a.g-ban-w img,
  html body .g-mp-catalog-listing > a.g-ban-w > img {
    display: block;
    width: 100%;
    height: auto !important;
    max-height: none;
    aspect-ratio: 1008 / 399;
    object-fit: contain !important;
    object-position: center;
    border-radius: 16px;
  }
}

/* n7: сетка товаров в каталоге на десктопе тянется на всю ширину колонки. Колонки были жестко по 224 px,
   и справа от последней карточки оставалась пустая полоса ~40 px */
@media (min-width: 768px) {
  html[data-device="desktop"] body .g-mp-catalog-listing .g-cat .g-grid4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  html[data-device="desktop"] body .g-mp-catalog-listing .g-cat .g-grid4 > .pk {
    width: auto;
    min-width: 0;
  }
}
