/* See js/45-buy-everywhere.js. Green marks a checked price or an action. Selectors are repeated
   under .wp-block-post-content where prose-link rules would otherwise win. */

/* ── 1. Comparison tables ───────────────────────────────────────────── */
.et-compare table th.lb-pricecol,
.et-compare table td.lb-pricecol,
.et-band--prose table .lb-pricecol { white-space: nowrap; }

a.lb-tbuy,
.wp-block-post-content a.lb-tbuy {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  box-sizing: border-box;
  border-radius: 999px;
  background: transparent;
  border: 2px solid var(--lb-live, #02BA7B);
  color: var(--lb-live-deep, #018257) !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none !important;
  white-space: nowrap;
}
a.lb-tbuy::after { content: "↗"; content: "↗" / ""; font-size: 0.9em; }
a.lb-tbuy:hover, a.lb-tbuy:focus-visible,
.wp-block-post-content a.lb-tbuy:hover {
  background: var(--lb-live, #02BA7B);
  color: #06281C !important;
}
a.lb-tbuy:focus-visible { outline: 3px solid var(--lb-voltage, #241647); outline-offset: 2px; }
/* The table's winner gets the solid button. */
.et-compare tr.is-winner a.lb-tbuy,
.wp-block-post-content .et-compare tr.is-winner a.lb-tbuy {
  background: var(--lb-live, #02BA7B);
  color: #06281C !important;
}

/* Phones: the model column stays put while the specs scroll sideways. */
@media (max-width: 48rem) {
  .et-compare table th[scope="row"],
  .et-compare table thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 1px 0 0 rgb(36 22 71 / 12%), 6px 0 10px -8px rgb(36 22 71 / 35%);
  }
  .et-compare table thead th:first-child { background: var(--lb-voltage, #241647); z-index: 3; }
  .et-compare table tbody th[scope="row"] { background-color: #fff; min-width: 7.5rem; }
  .et-compare table tbody tr:nth-child(odd) th[scope="row"] {
    background-image: linear-gradient(rgb(36 22 71 / 3%), rgb(36 22 71 / 3%));
  }
  .et-compare table tbody tr.is-winner th[scope="row"] { background-color: #F2F1F4; background-image: none; }
}

/* ── 2. Pick cards on phones: photo beside the name, price button next ── */
.lb-pick__more { margin: 0.75rem 0 0; }
.lb-pick__more a.et-buy--ghost,
.wp-block-post-content .lb-pick__more a.et-buy--ghost {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  box-sizing: border-box;
}

@media (max-width: 40rem) {
  .et-pick .et-pick__cols {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    grid-template-areas:
      "media name"
      "media specs"
      "buys  buys"
      "verdict verdict"
      "more  more";
    column-gap: 0.9rem;
    row-gap: 0.55rem;
    align-items: start;
  }
  .et-pick .et-pick__body { display: contents; }
  .et-pick .et-pick__body > * { grid-column: 1 / -1; }
  .et-pick .et-pick__media { grid-area: media; }
  .et-pick .et-pick__media img { width: 100%; height: 6.5rem; object-fit: contain; display: block; }
  .et-pick .et-pick__media figure { margin: 0; }
  .et-pick .et-pick__body > .et-pick__name { grid-area: name; align-self: end; margin: 0; }
  .et-pick .et-pick__body > .et-pick__specs { grid-area: specs; margin: 0; line-height: 1.45; }
  .et-pick .et-pick__body > .et-pick__buys { grid-area: buys; margin: 0.35rem 0 0; }
  .et-pick .et-pick__body > .et-pick__verdict { grid-area: verdict; margin: 0.4rem 0 0; }
  .et-pick .et-pick__body > .lb-pick__more { grid-area: more; margin: 0; }
  /* Cards without a photo: name and specs take the full width. */
  .et-pick .et-pick__cols:not(:has(.et-pick__media img)) {
    grid-template-areas: "name name" "specs specs" "buys buys" "verdict verdict" "more more";
  }
  .et-pick .et-pick__cols:not(:has(.et-pick__media img)) .et-pick__media { display: none; }
}

/* Long pick labels ("Box och installation i samma order") wrap instead of
   pushing the score badge past the screen edge on phones. */
.et-pick .et-pick__label-row { flex-wrap: wrap; gap: 0.4rem 0.75rem; }
.et-pick .et-pick__label-row .et-chip { white-space: normal; min-width: 0; max-width: 100%; }
