/* Product catalogs flow with the document so the page has one obvious vertical scroll. */
.ags-games-catalog .ags-games-grid,
.ags-dlc-games-directory .ags-dlc-game-grid,
.ags-dlc-game-results .ags-dlc-results-grid,
.ags-market-inv-grid,
.ags-sub-v3-featured-grid,
.ags-sub-v3-services .ags-sub-v3-grid,
.ags-gift-platform-grid-large,
.ags-gift-product-grid {
  max-height: none !important;
  overflow: visible !important;
  overscroll-behavior: initial !important;
  scrollbar-width: auto !important;
  -ms-overflow-style: auto !important;
  -webkit-overflow-scrolling: auto !important;
}

/* Gift-card region and amount choices can also grow into long lists. */
.ags-platform-region-choice,
.ags-platform-amount-choice,
.ags-region-choice,
.ags-amount-choice {
  max-height: 40vh !important;
  max-height: min(40vh, 360px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior-y: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(74, 190, 220, .62) rgba(5, 17, 25, .72) !important;
  -ms-overflow-style: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scroll-padding-block: 10px;
}

.ags-platform-region-choice::-webkit-scrollbar,
.ags-platform-amount-choice::-webkit-scrollbar,
.ags-region-choice::-webkit-scrollbar,
.ags-amount-choice::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
}
.ags-platform-region-choice::-webkit-scrollbar-track,
.ags-platform-amount-choice::-webkit-scrollbar-track,
.ags-region-choice::-webkit-scrollbar-track,
.ags-amount-choice::-webkit-scrollbar-track {
  border-radius: 999px !important;
  background: rgba(5, 17, 25, .72) !important;
}
.ags-platform-region-choice::-webkit-scrollbar-thumb,
.ags-platform-amount-choice::-webkit-scrollbar-thumb,
.ags-region-choice::-webkit-scrollbar-thumb,
.ags-amount-choice::-webkit-scrollbar-thumb {
  border: 1px solid rgba(122, 226, 244, .24) !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, rgba(89, 208, 229, .78), rgba(40, 127, 153, .78)) !important;
}

.ags-catalog-scrollable { box-shadow: none !important; }
.ags-catalog-scrollable:focus-visible {
  outline: 2px solid rgba(72, 210, 239, .78);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .ags-platform-region-choice,
  .ags-platform-amount-choice,
  .ags-region-choice,
  .ags-amount-choice {
    max-height: 38vh !important;
    max-height: min(38vh, 320px) !important;
    max-height: min(38svh, 320px) !important;
  }
}

/* Keep form option lists scrollable; product galleries themselves use page scroll. */
.ags-platform-region-choice::-webkit-scrollbar,
.ags-platform-amount-choice::-webkit-scrollbar,
.ags-region-choice::-webkit-scrollbar,
.ags-amount-choice::-webkit-scrollbar {
  display: block !important;
}

/* Marketplace results use the document scroll; a clipped nested grid hides items and feels sticky. */
.ags-marketplace-page .ags-market-grid{
  max-height:none!important;
  overflow:visible!important;
  overflow-x:visible!important;
  overflow-y:visible!important;
  overscroll-behavior:initial!important;
  scrollbar-width:auto!important;
  -ms-overflow-style:auto!important;
  -webkit-overflow-scrolling:auto!important;
  box-shadow:none!important;
}

/* More items fit in the viewport without shrinking the artwork to thumbnails. */
.ags-marketplace-page .ags-m2-grid:not(.compact) .ags-m2-card .ags-m2-art{
  height:146px!important;
  min-height:0!important;
  aspect-ratio:auto!important;
}
.ags-marketplace-page .ags-m2-grid{gap:11px!important;margin-top:10px!important}
.ags-marketplace-page .ags-m2-grid .ags-m2-card-body{padding:10px!important}
.ags-marketplace-page .ags-m2-grid .ags-m2-card h3{min-height:34px!important;margin:4px 0 6px!important;font-size:14px!important}
.ags-marketplace-page .ags-m2-grid .ags-cs2-card-preview{gap:5px!important;margin:6px 0 7px!important;padding:7px 8px!important}
.ags-marketplace-page .ags-m2-grid .ags-m2-price{margin-top:7px!important;padding-top:7px!important}
.ags-marketplace-page .ags-m2-grid .ags-m2-card-foot{margin-top:7px!important}

/* Dota inventory icons use the same safe contain fit as the other Steam art. */
.ags-marketplace-page .ags-m2-grid .ags-m2-card[data-market-category="dota2"] .ags-m2-art{
  height:164px!important;
  background:radial-gradient(circle at 50% 52%,rgba(112,65,129,.17),transparent 62%),linear-gradient(145deg,#0a1420,#070d16)!important;
}
.ags-marketplace-page .ags-m2-grid .ags-m2-card[data-market-category="dota2"] .ags-m2-art>img{transform:translateY(-27%) scale(1.12)!important}
.ags-marketplace-page .ags-m2-grid .ags-m2-card[data-market-category="dota2"]:hover .ags-m2-art>img{transform:translateY(-27%) scale(1.16)!important}
.ags-marketplace-page .ags-m2-grid .ags-m2-card[data-market-category="dota2"] .ags-m2-cooldown-badge{top:11px!important;right:auto!important;bottom:auto!important;left:11px!important}

.ags-market-scroll-hint{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:14px!important;
  margin:12px 0 10px!important;
  padding:10px 14px!important;
  border:1px solid rgba(75,203,233,.2)!important;
  border-radius:14px!important;
  background:linear-gradient(110deg,rgba(8,34,47,.86),rgba(8,15,27,.92))!important;
  color:#b8d5e1!important;
  box-shadow:inset 0 1px rgba(255,255,255,.025)!important;
}
.ags-market-scroll-hint-copy{display:flex!important;align-items:center!important;gap:10px!important;min-width:0!important}
.ags-market-scroll-hint-icon{display:grid!important;place-items:center!important;flex:0 0 28px!important;width:28px!important;height:28px!important;border-radius:9px!important;background:rgba(63,204,238,.12)!important;color:#5de1fb!important;font-size:18px!important;animation:ags-market-scroll-hint-bob 1.7s ease-in-out infinite}
.ags-market-scroll-hint-copy strong{display:block!important;color:#e2f8ff!important;font-size:12px!important;line-height:1.6!important}
.ags-market-scroll-hint-copy small{display:block!important;margin-top:1px!important;color:#7f9daa!important;font-size:10px!important;line-height:1.5!important}
.ags-market-scroll-hint button{flex:0 0 auto!important;padding:7px 11px!important;border:1px solid rgba(73,203,235,.25)!important;border-radius:999px!important;background:rgba(36,166,201,.11)!important;color:#8cecff!important;font:inherit!important;font-size:10px!important;font-weight:700!important;cursor:pointer!important}
.ags-market-scroll-hint button:hover{background:rgba(36,166,201,.2)!important;border-color:rgba(73,203,235,.5)!important}

@keyframes ags-market-scroll-hint-bob{0%,100%{translate:0 -2px}50%{translate:0 3px}}

@media(max-width:760px){
  html body.ags-mobile-ui .ags-page-content .ags-marketplace-page .ags-m2-grid:not(.compact) .ags-m2-card .ags-m2-art{
    height:132px!important;
    min-height:0!important;
    aspect-ratio:auto!important;
  }
  html body.ags-mobile-ui .ags-page-content .ags-marketplace-page .ags-m2-grid .ags-m2-card-body{padding:9px!important}
  html body.ags-mobile-ui .ags-page-content .ags-marketplace-page .ags-m2-grid .ags-m2-card[data-market-category="dota2"] .ags-m2-art{height:148px!important}
  .ags-market-scroll-hint{gap:8px!important;padding:9px 10px!important}
  .ags-market-scroll-hint-copy{gap:7px!important}
  .ags-market-scroll-hint-copy strong{font-size:11px!important}
  .ags-market-scroll-hint-copy small{font-size:9px!important}
  .ags-market-scroll-hint button{padding:7px 8px!important;font-size:9px!important}
}
@media(max-width:420px){.ags-market-scroll-hint-copy small{display:none!important}}
@media(prefers-reduced-motion:reduce){.ags-market-scroll-hint-icon{animation:none!important}}

/* Clear StatTrak callout on CS2 listing artwork. */
.ags-marketplace-page .ags-m2-grid .ags-m2-card .ags-m2-art>.ags-cs2-stattrak-badge{
  position:absolute!important;top:41px!important;right:11px!important;left:auto!important;bottom:auto!important;z-index:5!important;
  display:inline-flex!important;align-items:center!important;gap:6px!important;padding:5px 8px!important;
  border:1px solid rgba(255,179,78,.72)!important;border-radius:9px!important;
  background:linear-gradient(145deg,rgba(61,36,13,.96),rgba(25,19,15,.96))!important;
  color:#ffd18d!important;font-size:9px!important;font-weight:900!important;line-height:1!important;letter-spacing:.01em!important;
  box-shadow:0 5px 16px rgba(0,0,0,.42),inset 0 1px rgba(255,255,255,.14),0 0 18px rgba(255,160,56,.14)!important;
  pointer-events:none!important;white-space:nowrap!important;backdrop-filter:blur(8px)
}
.ags-marketplace-page .ags-m2-grid .ags-m2-card .ags-cs2-stattrak-badge>b{
  display:grid!important;place-items:center!important;min-width:18px!important;height:18px!important;padding:0 3px!important;
  border:1px solid rgba(255,221,165,.36)!important;border-radius:5px!important;
  background:linear-gradient(145deg,#ffc96c,#d9822c)!important;color:#26170a!important;
  font-size:8px!important;font-weight:1000!important;letter-spacing:.02em!important;text-shadow:none!important
}

/* Let the product catalogs use the full desktop canvas across every store section. */
@media(min-width:1000px){
  html body .ags-page-content:has(.ags-games-catalog),
  html body .ags-page-content:has(.ags-games-page-shell),
  html body .ags-page-content:has(.ags-dlc-game-results),
  html body .ags-page-content:has(.ags-gift-page),
  html body .ags-page-content:has(.ags-sub-page-v3){
    width:min(calc(100% - 32px),1800px)!important;
    max-width:1800px!important;
    margin-inline:auto!important;
  }

  html body .ags-page-content .ags-games-catalog,
  html body .ags-page-content .ags-games-page-shell,
  html body .ags-page-content .ags-dlc-games-directory,
  html body .ags-page-content .ags-dlc-game-results,
  html body .ags-page-content .ags-gift-page,
  html body .ags-page-content .ags-sub-page-v3{
    width:100%!important;
    max-width:none!important;
    margin-inline:0!important;
    box-sizing:border-box!important;
  }

  html body .ags-page-content .ags-games-catalog .ags-games-grid,
  html body .ags-page-content .ags-dlc-games-directory .ags-dlc-game-grid,
  html body .ags-page-content .ags-dlc-game-results .ags-dlc-results-layout,
  html body .ags-page-content .ags-dlc-game-results .ags-dlc-results-grid,
  html body .ags-page-content .ags-gift-page .ags-gift-platform-grid-large,
  html body .ags-page-content .ags-gift-page .ags-gift-product-grid,
  html body .ags-page-content .ags-sub-page-v3 .ags-sub-v3-featured-grid,
  html body .ags-page-content .ags-sub-page-v3 .ags-sub-v3-services .ags-sub-v3-grid{
    width:100%!important;
    max-width:none!important;
    justify-content:stretch!important;
    justify-items:stretch!important;
    box-sizing:border-box!important;
  }
}
