/* The pump catalogue: product cards with filters down the side.
   Used by /pumps and the category pages (_pump_catalogue.html).

   Layered on Bootstrap like site.css and product.css - the form controls and
   buttons are Bootstrap's; this is only the grid, the card and the chips,
   which Bootstrap has no answer for. */

.qp-catalogue {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  align-items: start;
}

/* ---- filters ---------------------------------------------------------- */
.qp-filters {
  position: sticky;
  /* Below the sticky site header, which publishes its height. */
  top: calc(var(--qp-header-h, 0px) + 1rem);
  /* Taller than the screen under the header on a small laptop: scroll within
     itself rather than hide its last filters off the bottom. */
  max-height: calc(100vh - var(--qp-header-h, 0px) - 2rem);
  overflow-y: auto;
  padding-right: .25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.qp-label {
  display: block;
  margin-bottom: .4rem;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

/* The groups that fold: a ruled heading with a chevron, and what is chosen in
   it beside the name so a closed group never filters out of sight. */
.qp-fold { border-top: 1px solid var(--bs-border-color); }
.qp-fold + .qp-fold { margin-top: -1.25rem; }
.qp-fold > summary {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin: 0;
  padding: .6rem 0;
  cursor: pointer;
  list-style: none;
}
.qp-fold > summary::-webkit-details-marker { display: none; }
.qp-fold > summary::after {
  content: "";
  margin-left: auto;
  align-self: center;
  width: .45rem;
  height: .45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .15s;
}
.qp-fold[open] > summary::after { transform: rotate(-135deg); }
.qp-fold > summary:hover { color: var(--bs-body-color); }
.qp-fold > summary:focus-visible { outline: 2px solid var(--qp-brand); outline-offset: 2px; }
.qp-fold-chosen {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--qp-header-blue);
}
.qp-fold[open] > .qp-chips { padding-bottom: .75rem; }

/* The duty: flow (with its unit) above head. */
.qp-duty {
  display: grid;
  gap: .375rem;
}

.qp-duty .input-group > .form-control { min-width: 0; }
.qp-duty-unit { flex: 0 0 6.25rem; }
.qp-duty .input-group-text { flex: 0 0 6.25rem; }

.qp-duty-note {
  margin: .4rem 0 0;
  font-size: .75rem;
  color: var(--bs-secondary-color);
}

.qp-duty-note.qp-duty-busy { font-style: italic; }

.qp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
}

.qp-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .75rem;
  font: inherit;
  font-size: .875rem;
  line-height: 1.4;
  color: var(--bs-body-color);
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.qp-chip small { color: var(--bs-secondary-color); }
.qp-chip:hover { border-color: var(--qp-brand); }

.qp-chip[aria-pressed="true"] {
  color: #fff;
  background: var(--qp-brand);
  border-color: var(--qp-brand);
}

.qp-chip[aria-pressed="true"] small { color: var(--qp-on-brand-2); }

/* The submersible / surface switch: radio buttons drawn as chips, one always
   chosen. */
.qp-kind { margin-bottom: 1rem; }
.qp-kind .qp-chip { cursor: pointer; margin: 0; }
.btn-check:checked + .qp-chip {
  color: #fff;
  background: var(--qp-brand);
  border-color: var(--qp-brand);
}
.btn-check:checked + .qp-chip small { color: var(--qp-on-brand-2); }
.btn-check:focus-visible + .qp-chip { outline: 2px solid var(--qp-brand); outline-offset: 2px; }

/* ---- the grid and the card --------------------------------------------- */
.qp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.qp-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--qp-radius-lg);
  transition: border-color .15s, box-shadow .15s;
}

.qp-card[hidden] { display: none; }

.qp-card:hover,
.qp-card:focus-visible {
  color: inherit;
  border-color: var(--qp-brand-line);
  box-shadow: 0 6px 18px var(--qp-brand-shadow);
}

.qp-card:focus-visible { outline: 2px solid var(--qp-brand); outline-offset: 2px; }

/* White behind the photograph, because the shots are on white: a grey panel
   showed every one as a white box pasted on. */
.qp-card-photo {
  position: relative;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .75rem;
  background: #fff;
}

.qp-card-photo img {
  max-width: 85%;
  max-height: 100%;
  object-fit: contain;
}

.qp-outline {
  width: auto;
  height: 118px;
  color: #9fb0c2;
}

/* The grey is the information panel. */
.qp-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: .75rem .875rem .875rem;
  background: var(--qp-panel);
  border-top: 1px solid #e9ecef;
}

.qp-kicker {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

/* One size for every card (Jon, 16 Nov 2026). Names over 14 characters used
   to drop to 1.15rem, so IDROSOM 8/60 and IDROSAND 11/230, or SEMISOM 390 and
   SEMISOM 1100/65, sat side by side at different sizes. Every listed name
   fits one line at 1.5rem from 1024 px up; a long order code may break. */
.qp-card-name {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.05;
  color: var(--bs-emphasis-color);
  overflow-wrap: anywhere;
}

.qp-card:hover .qp-card-name { color: var(--qp-brand); }

.qp-card-match {
  padding: .3rem .5rem;
  font-size: .75rem;
  line-height: 1.3;
  color: var(--qp-brand-dark);
  background: var(--qp-brand-tint);
  border: 1px solid var(--qp-brand-line);
  border-radius: var(--bs-border-radius);
}

/* What the pump does at the duty typed in the filters. */
.qp-card-duty {
  padding: .3rem .5rem;
  font-size: .75rem;
  line-height: 1.3;
  color: #0f5132;
  background: #e8f5ee;
  border: 1px solid #a3cfb4;
  border-radius: var(--bs-border-radius);
}

.qp-card-duty b { font-weight: 700; }

/* A pump shown because its curve runs close, though it falls short. */
.qp-card-duty-short {
  color: #6b3d06;
  background: #fdf3e3;
  border-color: #e8c48d;
}

.qp-card-match b { font-family: var(--bs-font-monospace); font-weight: 600; }

.qp-figs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: auto;
  border-top: 1px solid #e3e7eb;
  border-bottom: 1px solid #e3e7eb;
}

.qp-figs > div {
  padding: .45rem 0;
  text-align: center;
}

.qp-figs > div + div { border-left: 1px solid #e3e7eb; }

/* Control panel cards: three figures, and the motor size the leaflet states
   on a line of its own - as a fourth figure it wrapped ("4.5HP (3.4kW)"). */
.qp-figs-3 { grid-template-columns: repeat(3, 1fr); }
.qp-card-motor { font-size: .8125rem; color: var(--bs-secondary-color); text-align: center; }

.qp-figs b {
  display: block;
  font-family: var(--qp-heading-font);
  font-size: 1.25rem;
  line-height: 1;
  /* The figures in the home banner's blue (Jon, 22 Sep 2026), so they stand
     out from the name above them; the units under them stay grey. */
  color: var(--qp-header-blue);
}

.qp-figs span {
  font-size: .6875rem;
  color: var(--bs-secondary-color);
}

.qp-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.qp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}

.qp-tag {
  padding: 0 .375rem;
  font-size: .75rem;
  color: var(--bs-secondary-color);
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-sm);
  white-space: nowrap;
}

/* Supplies: white on the banner blue (Jon, 22 Sep 2026). 7:1. */
.qp-tag-v {
  font-weight: 600;
  color: #fff;
  background: var(--qp-header-blue);
  border-color: var(--qp-header-blue);
}

.qp-tags-end { justify-content: flex-end; margin-left: auto; }

/* The outlet sits under the name, leaving the foot's width to the voltages. */
.qp-card-outlet { margin-top: .375rem; }

/* ---- narrow screens ----------------------------------------------------- */
@media (max-width: 991.98px) {
  .qp-catalogue { grid-template-columns: 1fr; gap: 0; }
  .qp-filters { position: static; display: none; margin-bottom: 1.5rem; }
  .qp-filters.open { display: flex; }
}

@media (max-width: 575.98px) {
  .qp-grid { grid-template-columns: 1fr 1fr; gap: .625rem; }
  .qp-card-photo { height: 120px; }
  .qp-outline { height: 90px; }
  .qp-card-name { font-size: 1.2rem; }
  .qp-figs b { font-size: 1.05rem; }
  /* Four figures do not fit across a card half a phone wide: two by two. */
  .qp-figs { grid-template-columns: 1fr 1fr; }
  .qp-figs > div:nth-child(3) { border-left: 0; }
  .qp-figs > div:nth-child(n+3) { border-top: 1px solid #e3e7eb; }
}
