/* REC0DET Learn: preserve the existing first-level category artwork, order, names
   and navigation. Apply compact rows only after category selection.
   Scope deliberately excludes Shop, Jobs, Services, Homes, and every other module. */
body:has(#bottomBar[data-module="education"]) #viewModule {
  --learn-row-border: rgba(215, 167, 68, .31);
  --learn-row-bg: #14120e;
}

/* Keep the category names; remove only redundant numerical/decorative labels. */
body:has(#bottomBar[data-module="education"]) #viewModule .mirrorCodeGrid:not(.mirrorSubGrid) > .mirrorCodeCard .recodetCatBadge,
body:has(#bottomBar[data-module="education"]) #viewModule .mirrorCodeGrid:not(.mirrorSubGrid) > .mirrorCodeCard .recodetCatDivider,
body:has(#bottomBar[data-module="education"]) #viewModule .mirrorHero > span,
body:has(#bottomBar[data-module="education"]) #viewModule .mirrorHero > p,
body:has(#bottomBar[data-module="education"]) #viewModule .mirrorSubHead > div > span,
body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingHead > div > span {
  display: none !important;
}

/* Don't advertise course listing on the learning browse path.
   The existing bottom navigation is left intact. */
body:has(#bottomBar[data-module="education"]) #viewModule .mirrorPageTools,
body:has(#bottomBar[data-module="education"]) #viewModule [data-mirror-list-page] {
  display: none !important;
}

/* Existing subcategory screen already uses a vertical list via universal-interface-v2.
   This only changes the THIRD (course-results) screen from a product grid to rows. */
body:has(#bottomBar[data-module="education"]) #viewModule .gridProd.mirrorProductGrid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 720px !important;
  margin: 8px auto 0 !important;
  padding: 0 0 118px !important;
  align-items: start !important;
}

body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard.shopProductCard {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 61px 34px !important;
  grid-template-rows: auto !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 76px !important;
  padding: 8px 9px !important;
  border: 1px solid var(--learn-row-border) !important;
  border-radius: 13px !important;
  background: linear-gradient(145deg, #19160f, var(--learn-row-bg)) !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard.shopProductCard .shopProductOpen.shopProductOpen {
  display: grid !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  grid-template-columns: 57px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  align-content: center !important;
  align-items: center !important;
  gap: 3px 8px !important;
  min-width: 0 !important;
  width: 100% !important;
  min-height: 57px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  text-align: left !important;
}

body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard.shopProductCard .shopProductOpen.shopProductOpen .shopProductImage {
  display: grid !important;
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  place-items: center !important;
  width: 57px !important;
  min-width: 57px !important;
  height: 57px !important;
  min-height: 57px !important;
  margin: 0 !important;
  padding: 2px !important;
  overflow: hidden !important;
  border-radius: 10px !important;
  background: #201b13 !important;
}

body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard .mirrorListingPhoto {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard .shopProductTitle {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  color: #f8f3e7 !important;
  font-size: 12px !important;
  line-height: 1.22 !important;
  font-weight: 700 !important;
  white-space: normal !important;
  overflow: hidden !important;
}

body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard .shopProductMeta {
  grid-column: 2 !important;
  grid-row: 2 !important;
  display: block !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  color: #b4a78c !important;
  font-size: 9px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard .shopProductBottom {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard .shopProductBottom > strong {
  color: #e6bd5d !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard .shopCartBtn {
  display: inline-flex !important;
  width: 34px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  border-radius: 9px !important;
  align-items: center !important;
  justify-content: center !important;
  color: #1a160d !important;
}

body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard .shopCartBtn span {
  display: none !important;
}

body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard .shopSaveBtn {
  grid-column: 3 !important;
  grid-row: 1 !important;
  position: static !important;
  width: 32px !important;
  height: 32px !important;
  align-self: center !important;
  margin: 0 !important;
  background: #201a11 !important;
  color: #f1d68a !important;
  border: 1px solid rgba(212, 175, 55, .38) !important;
  box-shadow: none !important;
}

@media (max-width: 360px) {
  body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard.shopProductCard {
    grid-template-columns: minmax(0, 1fr) 48px 29px !important;
    gap: 5px !important;
    padding: 7px !important;
  }
  body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard.shopProductCard .shopProductOpen.shopProductOpen {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    gap: 3px 6px !important;
  }
  body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard.shopProductCard .shopProductOpen.shopProductOpen .shopProductImage {
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
  }
  body:has(#bottomBar[data-module="education"]) #viewModule .mirrorListingCard .shopSaveBtn {
    width: 28px !important;
    height: 30px !important;
  }
}
