/* Keep every catalog category visible while the filter stays below the sticky header. */
.category-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  overflow: visible;
  padding: 8px 16px 10px;
}

.tabs { top: var(--portal-header-height, 59px); }

.category-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 7px 5px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.2;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  font-size: 12px;
}

.category-tabs button.active {
  border-color: var(--teal-dark);
  background: var(--teal-tint);
  box-shadow: inset 0 -2px var(--teal);
}

.category-tabs button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* The retail headings use the wordmarks embedded in the practice's product sheet. */
.group-marks img[src*="/retail-marks/"] {
  max-width: min(330px, 85%);
  max-height: 49px;
}

@media (max-width: 900px) {
  .category-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .tabs {
    display: flex;
    overflow: visible;
    padding-left: 0;
  }
  .tabs button {
    flex: 1 1 0;
    min-width: 0;
    padding: 7px 3px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.2;
    font-size: 10px;
  }
  .category-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 -12px 13px;
    padding: 6px 12px 9px;
  }
  .category-tabs button { min-height: 48px; font-size: 10px; }
  .group-marks img[src*="/retail-marks/"] { max-width: 85%; max-height: 42px; }
}

/* A compact toolbar stays available without pinning every category on phones. */
.catalog-controls { position: sticky; top: calc(var(--portal-header-height, 59px) + var(--portal-nav-height, 44px)); z-index: 12; background: var(--cream); padding: 8px 0; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.catalog-controls .category-tabs { position: static; margin: 0; padding: 6px 0 0; }
.catalog-controls .field { margin: 0; }
.catalog-category-select { display: none; }
.catalog-search input { width: 100%; }
.training-resume-row { border-top: 1px solid var(--border); padding: 12px 0; }
.training-resume-row h3 { margin: 0; }
.training-resume-row p { margin: 6px 0; }
@media (max-width: 650px) {
  .catalog-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(105px, .62fr); gap: 8px; padding: 8px 0; }
  .catalog-controls .category-tabs { display: none; }
  .catalog-category-select { display: flex; min-width: 0; }
  .catalog-controls .field input, .catalog-controls .field select { width: 100%; min-width: 0; font-size: 16px; min-height: 44px; padding: 8px; }
  .catalog-controls .field label { font-size: 9px; letter-spacing: .025em; }
  .catalog-controls .catalog-search input::placeholder { font-size: 13px; }
  #trainingBanner { position: static !important; }
}
