/* «Barata, intermedia y cara, lado a lado» (tres-marcas.js): food selector with a shuffle link, chain
   pills, then a ranked list: one row per tier with the brand, a bar of the price per kilo or litre
   (against the dearest of the three) and that price. Bars use the article chart's green ramp
   (portadas/marca-barata-o-cara-canasta.html). Three text styles: label, value, meta. */
.tm-controls { margin: 0 0 20px; }
.tm-pick { display: flex; align-items: center; gap: 16px; }
.tm-select {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--neutral-300); border-radius: 10px;
  background: var(--neutral-100); color: var(--neutral-800); font: inherit; font-size: var(--fs-small);
}
.tm-select:focus-visible, .tm-shuffle:focus-visible, .tm-brand:focus-visible { outline: 2px solid var(--neutral-800); outline-offset: 2px; }
.tm-shuffle {
  flex: none; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--green);
  font: inherit; font-size: var(--fs-small); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

.widget .tm-rows { margin: 8px 0 0; padding: 0; list-style: none; }
.widget .tm-rows li { margin: 0; padding-left: 0; }
.widget .tm-rows li::before { content: none; }
.tm-row {
  display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr) 7.5rem; align-items: center; gap: 16px;
  padding: 16px 0; border-top: var(--rule);
}
.tm-row:last-child { border-bottom: var(--rule); }
.tm-who, .tm-price { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tm-meta { color: var(--neutral-600); font-size: 0.8125rem; line-height: 1.35; font-variant-numeric: tabular-nums; }
.tm-brand { color: var(--neutral-800); font-weight: 600; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere; }
.tm-out { margin-left: 4px; color: var(--neutral-600); font-weight: 400; }
.widget .tm-price { margin: 0; text-align: right; }
.tm-value { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.tm-track { height: 20px; }
.tm-fill { display: block; width: 100%; height: 100%; clip-path: inset(0 100% 0 0); }
.tm-fill-0 { background: #86b898; }
.tm-fill-1 { background: #3f7f5b; }
.tm-fill-2 { background: var(--green); }

@media (hover: hover) and (pointer: fine) {
  .tm-brand:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
  .tm-shuffle:hover { color: #022e19; }
}
@media (max-width: 600px) {
  /* Who and price on the first line, the bar full width under them. */
  .tm-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
  .tm-track { grid-column: 1 / -1; grid-row: 2; }
}
/* Switching food or supermarket morphs the bars (BacanWidgets.bar sets the clip). */
@media (prefers-reduced-motion: no-preference) {
  .tm-fill { transition: clip-path 240ms var(--ease-in-out); }
}
