/* Keep listing cards the same size even when titles and seller details vary. */
body:has(.market-home) .market-home .store-content .grid,
body:has(.buyer-main) .buyer-main .grid {
  align-items: stretch !important;
  grid-auto-rows: 348px !important;
}

body:has(.market-home) .market-home .market-product-card,
body:has(.buyer-main) .buyer-main .market-product-card {
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  height: 348px !important;
  min-height: 348px !important;
  max-height: 348px !important;
  overflow: hidden !important;
}

body:has(.market-home) .market-home .market-product-card .thumb.product-thumb,
body:has(.buyer-main) .buyer-main .market-product-card .thumb.product-thumb {
  box-sizing: border-box !important;
  flex: 0 0 166px !important;
  height: 166px !important;
  min-height: 166px !important;
  max-height: 166px !important;
}

body:has(.market-home) .market-home .market-product-card .cardbody,
body:has(.buyer-main) .buyer-main .market-product-card .cardbody {
  box-sizing: border-box !important;
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  align-items: stretch !important;
  height: 182px !important;
  min-height: 0 !important;
  max-height: 182px !important;
  overflow: hidden !important;
}

body:has(.market-home) .market-home .market-product-card h3,
body:has(.buyer-main) .buyer-main .market-product-card h3 {
  flex: 0 0 39px !important;
  height: 39px !important;
  min-height: 39px !important;
  max-height: 39px !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow-wrap: anywhere !important;
}

body:has(.market-home) .market-home .market-product-description,
body:has(.buyer-main) .buyer-main .market-product-description {
  flex: 0 0 15px !important;
  height: 15px !important;
  min-height: 15px !important;
  margin-bottom: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body:has(.market-home) .market-home .market-product-rating,
body:has(.buyer-main) .buyer-main .market-product-rating {
  box-sizing: border-box !important;
  flex: 0 0 23px !important;
  height: 23px !important;
  min-height: 23px !important;
  margin-top: 5px !important;
  padding-top: 5px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

body:has(.market-home) .market-home .market-product-rating span:last-child,
body:has(.buyer-main) .buyer-main .market-product-rating span:last-child {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body:has(.market-home) .market-home .market-price-row,
body:has(.buyer-main) .buyer-main .market-price-row {
  box-sizing: border-box !important;
  flex: 0 0 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  margin: auto 0 0 !important;
  padding-top: 5px !important;
  align-items: center !important;
}

@media (max-width: 760px) {
  body:has(.market-home) .market-home .store-content .grid,
  body:has(.buyer-main) .buyer-main .grid {
    grid-auto-rows: 310px !important;
  }

  body:has(.market-home) .market-home .market-product-card,
  body:has(.buyer-main) .buyer-main .market-product-card {
    height: 310px !important;
    min-height: 310px !important;
    max-height: 310px !important;
  }

  body:has(.market-home) .market-home .market-product-card .thumb.product-thumb,
  body:has(.buyer-main) .buyer-main .market-product-card .thumb.product-thumb {
    flex-basis: 136px !important;
    height: 136px !important;
    min-height: 136px !important;
    max-height: 136px !important;
  }

  body:has(.market-home) .market-home .market-product-card .cardbody,
  body:has(.buyer-main) .buyer-main .market-product-card .cardbody {
    height: 174px !important;
    max-height: 174px !important;
  }
}

@media (max-width: 420px) {
  body:has(.market-home) .market-home .market-product-card .thumb.product-thumb,
  body:has(.buyer-main) .buyer-main .market-product-card .thumb.product-thumb {
    flex-basis: 126px !important;
    height: 126px !important;
    min-height: 126px !important;
    max-height: 126px !important;
  }

  body:has(.market-home) .market-home .market-product-card .cardbody,
  body:has(.buyer-main) .buyer-main .market-product-card .cardbody {
    height: 184px !important;
    max-height: 184px !important;
  }
}

/* Reserve the same two-line price area for discounted and regular listings. */
body:has(.market-home) .market-home .market-product-card .market-price-stack,
body:has(.buyer-main) .buyer-main .market-product-card .market-price-stack {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-rows: 14px 24px !important;
  align-content: center !important;
  align-items: center !important;
  gap: 0 !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

body:has(.market-home) .market-home .market-product-card .market-price-stack:not(:has(.market-old-price))::before,
body:has(.buyer-main) .buyer-main .market-product-card .market-price-stack:not(:has(.market-old-price))::before {
  content: "";
  display: block;
  height: 14px;
  visibility: hidden;
}

body:has(.market-home) .market-home .market-product-card .market-old-price,
body:has(.buyer-main) .buyer-main .market-product-card .market-old-price {
  order: initial !important;
  height: 14px !important;
  line-height: 14px !important;
  font-size: 11px !important;
  white-space: nowrap !important;
}

body:has(.market-home) .market-home .market-product-card .market-price-stack .price,
body:has(.buyer-main) .buyer-main .market-product-card .market-price-stack .price {
  grid-row: 2 !important;
  display: flex !important;
  align-items: baseline !important;
  gap: 4px !important;
  min-width: 0 !important;
  height: 24px !important;
  line-height: 24px !important;
  white-space: nowrap !important;
}

/* Catalog: keep only the panel entrance and a restrained hover response. */
body:has(.market-home) .market-catalog-scrim,
body:has(.market-home) .market-catalog-sidebar,
body:has(.market-home) .market-catalog-content,
body:has(.market-home) .market-catalog-subcat {
  animation: none !important;
}

body:has(.market-home) .market-catalog-panel {
  animation: catalog-panel-in .2s ease-out both !important;
}

body:has(.market-home) .market-catalog-subcat {
  box-shadow: inset 0 1px #ffffff08, 0 5px 14px #0003 !important;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease !important;
}

body:has(.market-home) .market-catalog-subcat img,
body:has(.market-home) .market-catalog-subcat img[src*="category-types/"] {
  filter: none !important;
  transition: transform .16s ease !important;
}

body:has(.market-home) .market-catalog-subcat-title,
body:has(.market-home) .market-catalog-subcat-brand i {
  color: inherit !important;
}

body:has(.market-home) .market-catalog-subcat:hover {
  transform: translateY(-2px) !important;
  border-color: #626970 !important;
  background: linear-gradient(145deg, #222629, #121517 72%, #0d0f11) !important;
  box-shadow: inset 0 1px #ffffff12, 0 8px 20px #0007 !important;
}

body:has(.market-home) .market-catalog-subcat:hover img {
  transform: scale(1.04) !important;
  filter: none !important;
}
/* Minimal catalog navigation: quiet rows, no neon tiles or hover squares. */
body:has(.market-home) .market-category-menu,
body:has(.market-home) .market-nav-submenu{background:#15191d!important;border-color:#2b3238!important;box-shadow:0 16px 32px #0008!important}
body:has(.market-home) .market-category-menu button,
body:has(.market-home) .market-nav-submenu button{border:0!important;border-radius:5px!important;background:transparent!important;color:#aeb7bf!important;box-shadow:none!important;transition:color .16s ease,padding-left .16s ease!important}
body:has(.market-home) .market-category-menu button:hover,
body:has(.market-home) .market-nav-submenu button:hover,
body:has(.market-home) .market-nav-submenu button.active{background:transparent!important;color:#f2ae57!important;box-shadow:none!important;padding-left:14px!important}
body:has(.market-home) .market-catalog-subcat{border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;transform:none!important;color:#d8dde1!important;transition:color .16s ease,opacity .16s ease!important}
body:has(.market-home) .market-catalog-subcat:hover{border:0!important;background:transparent!important;box-shadow:none!important;transform:none!important;color:#f2ae57!important}
body:has(.market-home) .market-catalog-subcat img,
body:has(.market-home) .market-catalog-subcat img[src*="category-types/"]{background:transparent!important;box-shadow:none!important;filter:none!important;transform:none!important}
body:has(.market-home) .market-catalog-subcat:hover img{box-shadow:none!important;filter:none!important;transform:none!important}
body:has(.market-home) .market-catalog-subcat-title{color:#d8dde1!important;text-shadow:none!important}
body:has(.market-home) .market-catalog-subcat:hover .market-catalog-subcat-title{color:#f2ae57!important}
body:has(.market-home) .market-catalog-subcat-brand i{color:#87929b!important}
