/* ==========================================================
   Got Hot Wheels Auctions - Home Stable No Flicker v62
   Scope: homepage hero buttons + Browse Categories only
   Purpose: stop old delayed patches from fighting on refresh
   ========================================================== */

html body:has(.ghw-ref-hero),
html body.ghw62-home {
  overflow-x: hidden !important;
}

/* ---------------- HERO STABLE BASE ---------------- */
html body:has(.ghw-ref-hero) .ghw-ref-hero,
html body:has(.ghw-ref-hero) .ghw-hero-fixed,
html body.ghw62-home .ghw-ref-hero,
html body.ghw62-home .ghw-hero-fixed {
  position: relative !important;
  height: clamp(325px, 25.5vw, 345px) !important;
  min-height: 325px !important;
  overflow: hidden !important;
  background-color: #000 !important;
}

html body:has(.ghw-ref-hero) .ghw-hero-fixed-bg,
html body.ghw62-home .ghw-hero-fixed-bg {
  background-size: 100% 100% !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  filter: saturate(1.02) brightness(.94) !important;
}

html body:has(.ghw-ref-hero) .ghw-hero-fixed::after,
html body.ghw62-home .ghw-hero-fixed::after {
  background:
    linear-gradient(90deg, rgba(0,0,0,.32) 0%, rgba(0,0,0,.10) 44%, rgba(0,0,0,.12) 100%) !important;
}

html body:has(.ghw-ref-hero) .ghw-hero-fixed-inner,
html body.ghw62-home .ghw-hero-fixed-inner {
  position: relative !important;
  z-index: 2 !important;
  height: 100% !important;
  display: flex !important;
  align-items: flex-start !important;
}

html body:has(.ghw-ref-hero) .ghw-hero-copy,
html body.ghw62-home .ghw-hero-copy {
  width: 530px !important;
  max-width: 530px !important;
  min-width: 530px !important;
  padding-top: 14px !important;
  padding-bottom: 0 !important;
  transform: none !important;
  translate: none !important;
}

html body:has(.ghw-ref-hero) .ghw-hero-copy h1,
html body.ghw62-home .ghw-hero-copy h1 {
  margin: 0 0 10px !important;
  padding: 0 !important;
  line-height: .86 !important;
  overflow: visible !important;
}

html body:has(.ghw-ref-hero) .ghw-hero-copy h1 span,
html body:has(.ghw-ref-hero) .ghw-hero-copy h1 strong,
html body.ghw62-home .ghw-hero-copy h1 span,
html body.ghw62-home .ghw-hero-copy h1 strong {
  font-size: clamp(46px, 3.45vw, 56px) !important;
  line-height: .86 !important;
  overflow: visible !important;
}

html body:has(.ghw-ref-hero) .ghw-hero-copy p,
html body.ghw62-home .ghw-hero-copy p {
  max-width: 410px !important;
  margin: 0 0 13px !important;
  font-size: 15px !important;
  line-height: 1.28 !important;
}

html body:has(.ghw-ref-hero) .ghw-hero-copy .ghw-rating,
html body.ghw62-home .ghw-hero-copy .ghw-rating {
  display: none !important;
}

/* ---------------- HERO BUTTONS: CSS ONLY, NO MUTATION NEEDED ---------------- */
html body:has(.ghw-ref-hero) .ghw-hero-copy .ghw-hero-buttons,
html body.ghw62-home .ghw-hero-copy .ghw-hero-buttons,
html body.ghw62-home .ghw-hero-copy .ghw62-hero-buttons {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 218px 218px !important;
  gap: 12px !important;
  align-items: center !important;
  justify-content: start !important;
  width: 448px !important;
  min-width: 448px !important;
  max-width: 448px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  transform: none !important;
  translate: none !important;
}

html body:has(.ghw-ref-hero) .ghw-hero-copy .ghw-hero-buttons > a,
html body.ghw62-home .ghw-hero-copy .ghw-hero-buttons > a,
html body.ghw62-home .ghw-hero-copy .ghw62-hero-btn {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 218px !important;
  min-width: 218px !important;
  max-width: 218px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 0 16px !important;
  margin: 0 !important;
  border-radius: 8px !important;
  color: #fff !important;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  font-style: normal !important;
  line-height: 1 !important;
  letter-spacing: .025em !important;
  text-transform: uppercase !important;
  text-align: center !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  text-shadow: 0 2px 0 rgba(0,0,0,.72) !important;
  overflow: visible !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  translate: none !important;
}

html body:has(.ghw-ref-hero) .ghw-hero-copy .ghw-hero-buttons > a:first-child,
html body.ghw62-home .ghw-hero-copy .ghw-hero-buttons > a:first-child {
  border: 1px solid rgba(255,48,52,.98) !important;
  background: linear-gradient(180deg, #ff3438 0%, #ec101b 56%, #b50008 100%) !important;
  box-shadow: 0 0 20px rgba(237,17,28,.34), inset 0 1px 0 rgba(255,255,255,.18) !important;
}

html body:has(.ghw-ref-hero) .ghw-hero-copy .ghw-hero-buttons > a:last-child,
html body.ghw62-home .ghw-hero-copy .ghw-hero-buttons > a:last-child {
  border: 2px solid rgba(255,157,0,.98) !important;
  background: linear-gradient(180deg, rgba(18,20,26,.98), rgba(4,6,10,.98)) !important;
  box-shadow: 0 0 18px rgba(255,157,0,.20), inset 0 1px 0 rgba(255,255,255,.08) !important;
}

/* Kill old arrow/badge/pseudo overlays that caused text glitches. */
html body:has(.ghw-ref-hero) .ghw-hero-copy .ghw-hero-buttons > a::before,
html body:has(.ghw-ref-hero) .ghw-hero-copy .ghw-hero-buttons > a::after,
html body:has(.ghw-ref-hero) .ghw-hero-copy .ghw-hero-buttons > a span,
html body.ghw62-home .ghw-hero-copy .ghw-hero-buttons > a::before,
html body.ghw62-home .ghw-hero-copy .ghw-hero-buttons > a::after,
html body.ghw62-home .ghw-hero-copy .ghw-hero-buttons > a span {
  content: none !important;
  display: none !important;
}

/* ---------------- BROWSE CATEGORIES STABLE BASE ---------------- */
html body:has(.ghw-ref-hero) #categories,
html body.ghw62-home #categories {
  position: relative !important;
  isolation: isolate !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 30px 0 35px !important;
  min-height: 232px !important;
  background: #000 !important;
  background-image: none !important;
  border-top: 1px solid rgba(255,255,255,.09) !important;
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}

html body:has(.ghw-ref-hero) #categories::before,
html body.ghw62-home #categories::before {
  content: "" !important;
  position: absolute !important;
  z-index: 0 !important;
  pointer-events: none !important;
  left: 50% !important;
  top: 8px !important;
  bottom: 8px !important;
  width: min(1280px, 100vw) !important;
  transform: translateX(-50%) !important;
  background-image: url('/images/ghw-current-categories-panel-v62.png') !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
  opacity: .99 !important;
}

html body:has(.ghw-ref-hero) #categories::after,
html body.ghw62-home #categories::after {
  content: "" !important;
  position: absolute !important;
  z-index: 1 !important;
  pointer-events: none !important;
  left: 50% !important;
  top: 8px !important;
  bottom: 8px !important;
  width: min(1280px, 100vw) !important;
  transform: translateX(-50%) !important;
  background:
    linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.06) 18%, rgba(0,0,0,.06) 82%, rgba(0,0,0,.55)),
    linear-gradient(180deg, rgba(0,0,0,.16), rgba(0,0,0,.02) 48%, rgba(0,0,0,.24)) !important;
}

html body:has(.ghw-ref-hero) #categories > *,
html body.ghw62-home #categories > * {
  position: relative !important;
  z-index: 3 !important;
}

html body:has(.ghw-ref-hero) #categories .ghw-wrap,
html body.ghw62-home #categories .ghw-wrap {
  width: min(1140px, calc(100% - 42px)) !important;
  margin-inline: auto !important;
}

html body:has(.ghw-ref-hero) #categories .ghw-section-heading-lines,
html body.ghw62-home #categories .ghw-section-heading-lines {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 18px !important;
  width: min(740px, calc(100vw - 64px)) !important;
  margin: 0 auto 16px !important;
  padding: 8px 14px !important;
  border: 1px solid rgba(255,255,255,.11) !important;
  border-radius: 3px !important;
  background: rgba(0,0,0,.74) !important;
  box-shadow: 0 0 22px rgba(0,0,0,.72) !important;
}

html body:has(.ghw-ref-hero) #categories .ghw-section-heading-lines > span,
html body.ghw62-home #categories .ghw-section-heading-lines > span {
  display: block !important;
  flex: 1 1 100px !important;
  max-width: 140px !important;
  height: 2px !important;
  background: linear-gradient(90deg, transparent, #ed111c, #ff9d00) !important;
}

html body:has(.ghw-ref-hero) #categories .ghw-section-heading-lines > span:last-child,
html body.ghw62-home #categories .ghw-section-heading-lines > span:last-child {
  background: linear-gradient(90deg, #ff9d00, #ed111c, transparent) !important;
}

html body:has(.ghw-ref-hero) #categories h2,
html body.ghw62-home #categories h2 {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #ffffff !important;
  background: transparent !important;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', Arial, sans-serif !important;
  font-size: clamp(24px, 2.5vw, 36px) !important;
  font-weight: 900 !important;
  font-style: italic !important;
  line-height: .96 !important;
  letter-spacing: .08em !important;
  text-align: center !important;
  text-transform: uppercase !important;
  text-shadow: 0 2px 0 #000, 0 0 10px rgba(0,0,0,1), 0 0 13px rgba(255,255,255,.20) !important;
}

html body:has(.ghw-ref-hero) #categories .ghw-category-list,
html body.ghw62-home #categories .ghw-category-list {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 12px 18px !important;
  width: min(1100px, calc(100vw - 46px)) !important;
  max-width: 1100px !important;
  margin: 0 auto !important;
  padding: 0 8px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html body:has(.ghw-ref-hero) #categories a.ghw-category,
html body.ghw62-home #categories a.ghw-category {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  width: 104px !important;
  min-width: 104px !important;
  max-width: 104px !important;
  min-height: 108px !important;
  text-align: center !important;
  text-decoration: none !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  transform: none !important;
  transition: filter .15s ease !important;
}

html body:has(.ghw-ref-hero) #categories a.ghw-category:hover,
html body.ghw62-home #categories a.ghw-category:hover {
  transform: none !important;
  filter: brightness(1.1) !important;
}

html body:has(.ghw-ref-hero) #categories .ghw-circle,
html body.ghw62-home #categories .ghw-circle {
  display: grid !important;
  place-items: center !important;
  width: 82px !important;
  height: 82px !important;
  min-width: 82px !important;
  min-height: 82px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 999px !important;
  border: 2px solid rgba(255,157,0,.95) !important;
  background: rgba(0,0,0,.62) !important;
  box-shadow: 0 0 14px rgba(255,157,0,.30), inset 0 0 0 1px rgba(255,255,255,.06) !important;
}

html body:has(.ghw-ref-hero) #categories a.ghw-category:nth-child(even) .ghw-circle,
html body.ghw62-home #categories a.ghw-category:nth-child(even) .ghw-circle {
  border-color: rgba(237,17,28,.95) !important;
  box-shadow: 0 0 14px rgba(237,17,28,.30), inset 0 0 0 1px rgba(255,255,255,.06) !important;
}

html body:has(.ghw-ref-hero) #categories .ghw-circle img,
html body.ghw62-home #categories .ghw-circle img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  padding: 6px !important;
  background: transparent !important;
}

html body:has(.ghw-ref-hero) #categories .ghw-category strong,
html body.ghw62-home #categories .ghw-category strong {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  min-height: 32px !important;
  width: 100% !important;
  color: #fff !important;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', Arial, sans-serif !important;
  font-size: 10.5px !important;
  font-weight: 900 !important;
  line-height: 1.03 !important;
  letter-spacing: .025em !important;
  text-align: center !important;
  text-transform: uppercase !important;
  text-shadow: 0 2px 0 #000, 0 0 8px rgba(0,0,0,.95) !important;
  background: transparent !important;
}

@media (max-width: 900px) {
  html body:has(.ghw-ref-hero) .ghw-ref-hero,
  html body:has(.ghw-ref-hero) .ghw-hero-fixed,
  html body.ghw62-home .ghw-ref-hero,
  html body.ghw62-home .ghw-hero-fixed {
    height: auto !important;
    min-height: 0 !important;
  }

  html body:has(.ghw-ref-hero) .ghw-hero-fixed-inner,
  html body.ghw62-home .ghw-hero-fixed-inner {
    padding: 28px 0 !important;
  }

  html body:has(.ghw-ref-hero) .ghw-hero-copy,
  html body.ghw62-home .ghw-hero-copy {
    width: min(100%, calc(100vw - 30px)) !important;
    min-width: 0 !important;
    max-width: none !important;
    padding-top: 0 !important;
  }

  html body:has(.ghw-ref-hero) .ghw-hero-copy .ghw-hero-buttons,
  html body.ghw62-home .ghw-hero-copy .ghw-hero-buttons {
    grid-template-columns: 1fr !important;
    width: min(320px, 100%) !important;
    min-width: 0 !important;
    max-width: 320px !important;
    gap: 10px !important;
  }

  html body:has(.ghw-ref-hero) .ghw-hero-copy .ghw-hero-buttons > a,
  html body.ghw62-home .ghw-hero-copy .ghw-hero-buttons > a {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}
