/* Catalog screen, ported from the prototype (viewCatalog). Shared blocks (.pagehead, .tabs, .toolbar, .hint, .list,
   .empty, .chip, .tile, .skel, .sheet ...) live in common.css; .pager and .search in controls.css. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.scard { display: grid; gap: 2px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--ink); text-decoration: none; }
a.scard:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.scard-img { position: relative; height: 130px; border-radius: 8px; background: var(--img-bg); display: grid; place-items: center; overflow: hidden; margin-bottom: 8px; }
.scard-img > img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; mix-blend-mode: multiply; }
.scard-img.fig { height: 110px; }
.scard-img > svg { width: 32px; height: 32px; color: var(--faint); }
.scard-img .tile { width: 90px; height: 70px; font-size: 14px; }
.scard b { font-weight: 600; }
.scard-nr { font-size: 12px; }
.scard-meta { font-size: 12.5px; }
.scard .chip { justify-self: start; margin-top: 6px; }
.scard.is-skeleton { pointer-events: none; }
.scard.is-skeleton .scard-img { box-shadow: none; }
.catalog-results { scroll-margin-top: 64px; }
.catalog-results[aria-busy="true"] .cards, .catalog-results[aria-busy="true"] .list { opacity: .6; }

.themepick { display: none; }
.themes { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.themelist { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: grid; position: sticky; top: calc(52px + 12px); max-height: calc(100vh - 52px - 24px); overflow-y: auto; }
.themelist button { text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 6px; display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.themelist button:hover { background: var(--surface-2); }
.themelist button.d1 { padding-left: 24px; font-size: 13px; color: var(--muted); }
.themelist button.d2 { padding-left: 38px; font-size: 13px; color: var(--muted); }
.themelist button.d3 { padding-left: 52px; font-size: 13px; color: var(--muted); }
.themelist button.d4, .themelist button.d5 { padding-left: 66px; font-size: 13px; color: var(--muted); }
.themelist button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.themelist.sheetlist { position: static; display: grid; border: 0; padding: 0; max-height: none; overflow: visible; }

/* Minifigure page (prototype viewCatFig) */
.spage.figpage { grid-template-columns: 150px minmax(0, 1fr); }
.spage.figpage.is-error { display: block; padding: 0; }
.bigimg.fig { width: 150px; height: 180px; }
.bigimg.fig > svg { width: 48px; height: 48px; color: var(--muted); }
.figscreen [hidden] { display: none; }
.figscreen .sinfo.is-skeleton { display: grid; gap: 10px; align-content: start; }
.figscreen .list > .mset { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.figscreen .mset.is-skeleton { pointer-events: none; }

/* Part page (prototype viewPart); the set rows (.mset) and the declare bar (.banner.ask) are in common.css */
.parthead { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.parthead.is-error { display: block; padding: 0; }
.parthead .is-skeleton { display: grid; gap: 8px; }
.partinfo { min-width: 0; }
.partimg { position: relative; width: 96px; height: 76px; border-radius: 8px; background: var(--img-bg); padding: 4px; display: grid; place-items: center; }
.partimg > img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; mix-blend-mode: multiply; }
.partimg[data-zoom-src] { cursor: zoom-in; }
.colors { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.colors button:not(.btn) { display: inline-flex; gap: 6px; align-items: center; height: 30px; padding: 0 10px 0 4px; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--surface); font-size: 13px; color: var(--ink); }
.colors button .sw { width: 22px; height: 22px; border-radius: 11px; }
.colors button .sw::before, .colors button .sw::after { display: none; }
.colors button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.part-screen .section h2 .sub { font: 400 14px var(--font-ui); }
.part-screen .section h2 .toggle { margin-left: auto; height: 30px; font: 500 13px var(--font-ui); }
.part-screen .banner.ask { margin: 0 0 12px; }
.part-screen .banner.info { margin: 0; padding: 12px 14px; font-size: inherit; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.part-screen .banner.info p { margin: 0; }
.part-screen .list > .mset { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.part-screen .mset.is-skeleton { pointer-events: none; }
.scard-app { font-size: 12.5px; }

@media (max-width: 760px) {
  .spage.figpage { grid-template-columns: 110px minmax(0, 1fr); }
  .bigimg.fig { width: 110px; height: 140px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .scard-img { height: 96px; }
  .themes { grid-template-columns: minmax(0, 1fr); }
  .parthead { grid-template-columns: 64px minmax(0, 1fr); }
  .partimg { width: 64px; height: 56px; }
  .themes > .themelist { display: none; }
  .themepick { display: flex; width: 100%; justify-content: space-between; height: 40px; margin-bottom: 12px; }
  .themepick svg { width: 16px; height: 16px; color: var(--muted); }
  .toolbar.one { flex-wrap: nowrap; }
  .toolbar.one .search { flex: 1 1 auto; min-width: 0; }
  .toolbar.one .dd { flex: none; width: auto; }
  .toolbar.one .ddbtn { width: auto; }
}
