/* «Arma tu canasta por marca» (canasta-por-marca.js): chain and household pills, then the result as
   ranked rows with bars (.widget-rows in blog.css), the three tier presets, then one row per food (name
   and amount, cost at the chosen tier). A light total sticks to the bottom
   of the screen while the food rows scroll. Three text styles: label, value, meta. */
.cpm-foods { margin-top: 32px; }
.cpm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 8px; }
.cpm-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.cpm-preset {
  -webkit-tap-highlight-color: transparent;
  min-height: 32px; padding: 0 12px; border: 1px solid var(--neutral-300); border-radius: 999px;
  background: transparent; color: var(--neutral-600); font: inherit; font-size: 0.8125rem; font-weight: 500; cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.cpm-preset[aria-pressed="true"] { border-color: var(--green-tint); background: var(--green-tint); color: var(--green); }

/* Food rows: food | cost on one line, the amount under the name. */
.widget .cpm-rows { margin: 0; padding: 0; list-style: none; border-top: var(--rule); }
.widget .cpm-rows li { margin: 0; padding-left: 0; }
.cpm-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "food cost" "qty cost"; align-items: center; column-gap: 16px;
  min-height: 64px; padding: 14px 0; row-gap: 2px; border-bottom: var(--rule);
}
.cpm-food { grid-area: food; font-weight: 600; line-height: 1.3; }
.cpm-detail { display: contents; }
.cpm-qty { grid-area: qty; }
.cpm-cost { grid-area: cost; min-width: 4rem; text-align: right; }

.cpm-preset:focus-visible { outline: 2px solid var(--neutral-800); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .cpm-preset { transition: scale 150ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
  .cpm-preset:active { scale: 0.96; }
}

/* The sticky total: white, a hairline above, no block. */
.cpm-bar {
  position: sticky; bottom: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: var(--rule); background: var(--neutral-100);
}
.widget .cpm-bar-total { display: flex; flex-direction: column; margin: 0; }
.cpm-share { flex: none; }

@media (hover: hover) and (pointer: fine) {
  .cpm-preset:hover { color: var(--neutral-800); }
  .cpm-preset[aria-pressed="true"]:hover { color: var(--green); }
}
@media (max-width: 600px) {
  .cpm-presets { gap: 4px; }
  .cpm-preset { padding: 0 10px; font-size: 0.75rem; }
}
