/* Catalog visual state contract: neutral surfaces, outline-only selection,
   clipped game icons and stable list-row geometry. */

html body.page-catalog .buyer-catalog {
  --catalog-control-border: #e4e7ec;
  --catalog-control-border-hover: #d0d5dd;
  --catalog-control-selected: #7f56d9;
  --catalog-control-bg: #fff;
  --catalog-control-hover-bg: #f9fafb;
  --catalog-control-text: #344054;
}

html body.page-catalog .buyer-catalog .buyer-catalog__tabs .buyer-catalog__tab.ui-chip {
  box-sizing: border-box !important;
  border: 1.5px solid var(--catalog-control-border) !important;
  background: var(--catalog-control-bg) !important;
  background-image: none !important;
  color: var(--catalog-control-text) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
  transform: none !important;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__tabs .buyer-catalog__tab.ui-chip:not(.is-active):hover {
  border-color: var(--catalog-control-border-hover) !important;
  background: var(--catalog-control-hover-bg) !important;
  color: #101828 !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__tabs .buyer-catalog__tab.ui-chip.is-active,
html body.page-catalog .buyer-catalog .buyer-catalog__tabs .buyer-catalog__tab.ui-chip[aria-current="page"] {
  border: 2px solid var(--catalog-control-selected) !important;
  background: #f2f4f7 !important;
  background-image: none !important;
  color: #101828 !important;
  box-shadow: none !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__tabs .buyer-catalog__tab.ui-chip.is-active:hover {
  border-color: #6941c6 !important;
  background: #f2f4f7 !important;
  color: #101828 !important;
}

/* Applied/removable filters are selections too: brand edge, neutral interior. */
html body.page-catalog .buyer-catalog [data-active-chips] [data-chip-remove] {
  border: 2px solid var(--catalog-control-selected) !important;
  background: #fff !important;
  background-image: none !important;
  color: #101828 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

html body.page-catalog .buyer-catalog [data-active-chips] [data-chip-remove]:hover {
  border-color: #6941c6 !important;
  background: var(--catalog-control-hover-bg) !important;
  color: #101828 !important;
}

/* Desktop catalog quick tabs: Все / Дешевые / Популярные / Новые. */
html body.page-catalog .buyer-catalog .buyer-catalog__collection-tabs--desktop [data-catalog-collection-chip].ui-chip {
  border: 1px solid var(--catalog-control-border) !important;
  background: #f2f4f7 !important;
  background-image: none !important;
  color: var(--catalog-control-text) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__collection-tabs--desktop [data-catalog-collection-chip].ui-chip:not(.is-active):hover {
  border-color: var(--catalog-control-border-hover) !important;
  background: var(--catalog-control-hover-bg) !important;
  color: #101828 !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__collection-tabs--desktop [data-catalog-collection-chip].ui-chip.is-active,
html body.page-catalog .buyer-catalog .buyer-catalog__collection-tabs--desktop [data-catalog-collection-chip].ui-chip[aria-current="page"] {
  border: 1px solid transparent !important;
  background: #7f56d9 !important;
  background-image: none !important;
  color: #fff !important;
  box-shadow: none !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__collection-tabs--desktop [data-catalog-collection-chip].ui-chip.is-active:hover,
html body.page-catalog .buyer-catalog .buyer-catalog__collection-tabs--desktop [data-catalog-collection-chip].ui-chip[aria-current="page"]:hover {
  border-color: transparent !important;
  background: #6941c6 !important;
  color: #fff !important;
}

/* Game/app artwork is always clipped by one rounded owner surface. */
html body.page-catalog .buyer-catalog .buyer-catalog__game-chip-icon,
html body.page-catalog .buyer-catalog .buyer-catalog__headline-logo,
html body.page-catalog .buyer-catalog .quick-game-card__icon img {
  border-radius: 14px !important;
  overflow: hidden !important;
  object-fit: cover !important;
  object-position: center !important;
}

html body.page-catalog .buyer-catalog [data-game-chips] .ui-chip .buyer-catalog__game-chip-icon {
  flex: 0 0 28px !important;
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
}

/* Sidebar game choices are quiet rows; the selected game is marked only by a
   neutral fill, without an outline. */
html body.page-catalog .buyer-catalog [data-game-chips] .ui-chip.is-active,
html body.page-catalog .buyer-catalog [data-game-chips] .ui-chip[aria-current="page"],
html body.page-catalog .buyer-catalog [data-game-chips] a.is-active,
html body.page-catalog .buyer-catalog [data-game-chips] a[aria-current="page"] {
  border: 0 !important;
  background: #f2f4f7 !important;
  color: #101828 !important;
  box-shadow: none !important;
}

html body.page-catalog .buyer-catalog [data-game-chips] .ui-chip:not(.is-active):not([aria-current="page"]),
html body.page-catalog .buyer-catalog [data-game-chips] a:not(.is-active):not([aria-current="page"]) {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html body.page-catalog .buyer-catalog [data-game-chips] .ui-chip:not(.is-active):not([aria-current="page"]):hover,
html body.page-catalog .buyer-catalog [data-game-chips] a:not(.is-active):not([aria-current="page"]):hover {
  border: 0 !important;
  background: var(--catalog-control-hover-bg) !important;
}

/* Catalog game rail reuses the home icon-and-name language and fills the
   available row instead of stopping after six boxed tiles. */
html body.page-catalog .buyer-catalog .buyer-catalog__quick-grid--avatars {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)) !important;
  align-items: start !important;
  gap: 10px 18px !important;
  width: 100% !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__quick-games .quick-game-card {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 88px !important;
  padding: 6px 4px !important;
  display: grid !important;
  grid-template-rows: 54px auto !important;
  justify-items: center !important;
  align-content: start !important;
  gap: 7px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__quick-games .quick-game-card:hover,
html body.page-catalog .buyer-catalog .buyer-catalog__quick-games .quick-game-card:focus-visible {
  border: 0 !important;
  background: var(--catalog-control-hover-bg) !important;
  box-shadow: none !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__quick-games .quick-game-card__icon {
  width: 54px !important;
  height: 54px !important;
  display: grid !important;
  place-items: center !important;
  border: 1.5px solid var(--catalog-control-border) !important;
  border-radius: 14px !important;
  background: #fff !important;
  overflow: hidden !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__quick-games .quick-game-card__icon img,
html body.page-catalog .buyer-catalog .buyer-catalog__quick-games .quick-game-card__fallback {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  border: 0 !important;
  border-radius: inherit !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__quick-games .quick-game-card__meta {
  display: none !important;
}

/* Page-owned create action: same purple control language as Catalog. */
html body.page-catalog .buyer-catalog .buyer-catalog__headline-cta.ui-primary-btn {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  border: var(--ui-border-width) solid #7c3aed !important;
  border-radius: var(--ui-radius-control) !important;
  background: #7c3aed !important;
  background-image: none !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__headline-cta.ui-primary-btn:hover {
  border-color: #6d28d9 !important;
  background: #6d28d9 !important;
  color: #fff !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__headline-cta.ui-primary-btn:focus-visible {
  border: var(--ui-border-width-active) solid #5b21b6 !important;
  background: #7c3aed !important;
  color: #fff !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Delivery type keeps one neutral row surface. Selection is communicated
   only by the checked square, without an outline around the row. */
html body.page-catalog .buyer-catalog .buyer-delivery-radio__item,
html body.page-catalog .buyer-catalog .buyer-delivery-radio__item:hover {
  border: 1px solid #e1e4ea !important;
  background: #eef0f4 !important;
  color: #101828 !important;
  box-shadow: none !important;
}

html body.page-catalog .buyer-catalog .buyer-delivery-radio__item:has(.buyer-delivery-radio__input:checked),
html body.page-catalog .buyer-catalog .buyer-delivery-radio__item:has(.buyer-delivery-radio__input:checked):hover {
  border: 1px solid #e1e4ea !important;
  background: #eef0f4 !important;
  color: #101828 !important;
  box-shadow: none !important;
}

html body.page-catalog .buyer-catalog .buyer-delivery-radio__control,
html body.page-catalog .buyer-catalog .buyer-delivery-radio__input:focus-visible ~ .buyer-delivery-radio__control,
html body.page-catalog .buyer-catalog .buyer-delivery-radio__input:checked ~ .buyer-delivery-radio__control {
  box-shadow: none !important;
  outline: none !important;
}

html body.page-catalog .buyer-catalog .buyer-delivery-radio__input:checked ~ .buyer-delivery-radio__label,
html body.page-catalog .buyer-catalog .buyer-delivery-radio__item:has(.buyer-delivery-radio__input:checked) .buyer-delivery-radio__text,
html body.page-catalog .buyer-catalog .buyer-delivery-radio__item:has(.buyer-delivery-radio__input:checked) .buyer-delivery-radio__icon {
  color: #101828 !important;
}

@media (max-width: 640px) {
  html body.page-catalog .buyer-catalog .buyer-catalog__quick-grid--avatars {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px 4px !important;
  }
}

html body.page-catalog .buyer-catalog .buyer-catalog__headline-logo {
  overflow: hidden !important;
}

/* Price controls stay balanced; they do not consume the entire sidebar row. */
html body.page-catalog .buyer-catalog .buyer-catalog__filter-block .field.field--row:has([data-price-min]) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: min(100%, 320px) !important;
  max-width: 320px !important;
  margin: 0 !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__filter-block [data-price-min],
html body.page-catalog .buyer-catalog .buyer-catalog__filter-block [data-price-max] {
  box-sizing: border-box !important;
  min-width: 0 !important;
  width: 100% !important;
  min-height: 44px !important;
  margin: 0 !important;
  border: 1.5px solid var(--catalog-control-border) !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: none !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__filter-block [data-price-min]:hover,
html body.page-catalog .buyer-catalog .buyer-catalog__filter-block [data-price-max]:hover {
  border-color: var(--catalog-control-border-hover) !important;
  background: var(--catalog-control-hover-bg) !important;
}

html body.page-catalog .buyer-catalog .buyer-catalog__filter-block [data-price-min]:focus,
html body.page-catalog .buyer-catalog .buyer-catalog__filter-block [data-price-max]:focus,
html body.page-catalog .buyer-catalog .buyer-catalog__filter-block [data-price-min]:focus-visible,
html body.page-catalog .buyer-catalog .buyer-catalog__filter-block [data-price-max]:focus-visible {
  border-color: var(--catalog-control-selected) !important;
  background: #fff !important;
  outline: none !important;
  box-shadow: none !important;
}

/* List view stays spatially static; hover changes surface only. */
html body.page-catalog .buyer-catalog #catalog-results[data-view="list"] [data-browse-cards] .listing-card--list,
html body.page-catalog .buyer-catalog #catalog-results[data-view="list"] [data-browse-cards] .listing-card--list:hover {
  transform: none !important;
  animation: none !important;
  box-shadow: none !important;
  transition-property: background-color, border-color !important;
}

html body.page-catalog .buyer-catalog #catalog-results[data-view="list"] [data-browse-cards] .listing-card--list:hover {
  background: #f9fafb !important;
}

html body.page-catalog .buyer-catalog .catalog-cards[data-view="list"] .listing-card__seller-avatar {
  box-sizing: border-box !important;
  flex: 0 0 30px !important;
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  aspect-ratio: 1 / 1 !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  object-fit: cover !important;
  object-position: center !important;
  line-height: 1 !important;
  text-align: center !important;
  box-shadow: none !important;
}

html body.page-catalog .buyer-catalog .catalog-cards[data-view="list"] .listing-card__seller-avatar--fallback {
  background: #e5e7eb !important;
  color: #475467 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

@media (max-width: 700px) {
  html body.page-catalog .buyer-catalog .buyer-catalog__filter-block .field.field--row:has([data-price-min]) {
    width: 100% !important;
    max-width: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
html body.page-catalog .buyer-catalog .buyer-catalog__tab.ui-chip,
html body.page-catalog .buyer-catalog [data-game-chips] .ui-chip {
    transition: none !important;
  }
}


/* Category pills use a neutral fill; mobile collection tabs keep their own segmented treatment. */
html body.page-catalog .buyer-catalog .buyer-catalog__tabs .buyer-catalog__tab.ui-chip:not(.is-active):not([aria-current="page"]) {
  background: #f2f4f7 !important;
}

/* Catalog root stays compact: only the ten highest-ranked popular games are visible. */
html body.page-catalog .buyer-catalog
  .buyer-catalog__quick-games[data-mobile-hidden-section="quick-games"]
  .buyer-catalog__quick-grid > :nth-child(n + 11) {
  display: none !important;
}

/* Desktop sidebar keeps the full game catalogue searchable, but only eight
   42px rows are visible at once; the rest scroll inside the filter. */
@media (min-width: 901px) {
  html body.page-catalog .buyer-catalog .catalog-filter-games-list {
    max-height: 364px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-right: 4px;
  }

  html body.page-catalog .buyer-catalog .catalog-filter-games-list .buyer-catalog__games-list {
    max-height: none !important;
    overflow: visible !important;
  }
}
