/* /cards toolbar and group headers (.prd/20 F1, F2). The page keeps styles.css's look (its panel, buttons and
   inputs); the View / Filter popovers come from /catalog-menus.css, mounted in the page's .catalog-menus box. */

.cards-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  box-shadow: 0 10px 28px rgb(0 0 0 / 18%);
}

.cards-search {
  position: relative;
  flex: 1 1 320px;
  min-width: 0;
}

.cards-search input {
  width: 100%;
  min-height: 38px;
  padding: 0 12px 0 38px;
}

.cards-search .cards-search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.cards-tools {
  display: flex;
  gap: 10px;
}

.cards-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cards-tool svg.lucide {
  width: 16px;
  height: 16px;
}

.cards-tool[aria-expanded="true"] {
  border-color: var(--accent);
}

.cards-tool[aria-expanded="true"] .cards-tool-chevron {
  transform: rotate(180deg);
}

/* styles.css aligns .reset-button to the end of the old filter grid's row. */
.cards-toolbar .reset-button {
  align-self: auto;
}

.card-group-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 6px 0 -8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.card-group-header .card-group-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 820px) {
  .cards-search {
    flex-basis: 100%;
  }

  .cards-tools {
    flex: 1 1 auto;
  }

  .cards-tool {
    flex: 1 1 0;
    justify-content: center;
  }
}

/* A tile never grows past its grid column (.prd/20, 2026-10-07: at 390 the default grid overflowed 10px, every
   printing 24px; 16 showcase tiles were wider than their column at 1920 too). styles.css lets .card-body's one
   grid column size to its content, so a long id and a foil price side by side ("OGN-303a-STAR" + "Foil $2,899.59")
   set it wider than the tile: the column is clamped to the tile, the price wraps under the id (right-aligned)
   instead of cutting either, and a foil-only name (two clamped lines) breaks inside a long word. */
#grid .card-body {
  grid-template-columns: minmax(0, 1fr);
}

#grid .card-footer {
  flex-wrap: wrap;
  row-gap: 2px;
}

#grid .card-footer .card-price {
  margin-left: auto;
}

#grid .card-title strong.foil-only-name {
  overflow-wrap: anywhere;
}
