/* Carmo Cc: the engine-size bar above the Tuning tile grid.
 * Same look as the Carmo Merkfilter bar (carmo_merkfilter.css), so the two filters read as one family.
 * #ff6600 for fills, #d24600 for text on white (WCAG AA). */

.carmo-ccfilter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #fafafa;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
}

/* display:flex above beats the hidden attribute; the bar stays away until carmo_cc.js has run. */
.carmo-ccfilter[hidden],
.category-listing > [hidden] { display: none !important; }

.carmo-ccfilter__label {
  margin-right: 4px;
  color: #555;
  font-weight: 600;
  white-space: nowrap;
}

.carmo-ccfilter__pill {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 5px 11px;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  background: #fff;
  color: #333;
  font: inherit;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .12s, background-color .12s, color .12s;
}

.carmo-ccfilter__pill:hover,
.carmo-ccfilter__pill:focus {
  border-color: #d24600;
  color: #d24600;
}

.carmo-ccfilter__pill:focus-visible {
  outline: 2px solid #d24600;
  outline-offset: 2px;
}

.carmo-ccfilter__pill.is-active {
  background: #ff6600;
  border-color: #ff6600;
  color: #fff;
  font-weight: 600;
}

.carmo-ccfilter__pill.is-active:hover,
.carmo-ccfilter__pill.is-active:focus { background: #d24600; border-color: #d24600; color: #fff; }

/* The count as a badge: the unit is in the label, so "800–999 [56]" cannot be read as "56 cc". */
.carmo-ccfilter__n {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eee;
  color: #555;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.carmo-ccfilter__pill.is-active .carmo-ccfilter__n { background: #fff; color: #d24600; }

@media (prefers-reduced-motion: reduce) {
  .carmo-ccfilter__pill { transition: none; }
}

@media (max-width: 480px) {
  .carmo-ccfilter { gap: 5px; padding: 9px 10px; font-size: 12px; }
  .carmo-ccfilter__pill { min-height: 44px; padding: 5px 11px; }
  .carmo-ccfilter__label { width: 100%; margin-bottom: 2px; }
}
