/*
 * Grocery compare: today's market-rate board (bazar dor). A balance scale beside the title; the
 * products head the board in chalk, their pictures in round frames; the rows are a printed rate
 * list on paper with dotted rules, the prices on yellow shelf labels, each group on a kraft strip.
 * An empty compare: the scale's pans hang empty.
 */
.compare-page {
  padding-top: clamp(1.25rem, 3vw, 2.5rem);
}
.compare-head {
  align-items: flex-end;
}
.compare-head .gx-count {
  display: inline-flex;
  margin: 0 0 0.5rem;
  padding: 0.1rem 0.7rem;
  border-radius: 6px;
  background: var(--sun);
  color: var(--memo-ink);
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
}
.compare-head .gx-title.gp-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.gx-scale {
  flex: none;
  width: 3.2rem;
  height: 2.7rem;
  fill: none;
  stroke: var(--kraft-deep);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gx-scale .gx-pan {
  fill: var(--sun);
}
.compare-diff {
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 1.5px dashed var(--kraft-deep);
  border-radius: 6px;
  background: #fbf3e2;
  color: var(--kraft-ink);
  font-weight: 700;
}
.compare-diff:has(:checked) {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* ── The board ── */
.compare-scroll {
  border: 0.55rem solid #8a6238;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 22px 36px -28px rgb(20 33 24 / 0.7);
}
.compare-table th,
.compare-table td {
  border-bottom: 1.5px dotted #cfc4ab;
  font-size: 0.95rem;
}
.compare-table thead th,
.compare-table thead .compare-corner {
  padding-top: 1.2rem;
  padding-bottom: 1.1rem;
  border-bottom: 0;
  background: var(--chalk);
}
.compare-corner {
  background: var(--chalk);
}
.compare-media {
  width: min(100%, 9rem);
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow:
    0 0 0 3px var(--chalk),
    0 0 0 5px var(--sun);
}
.compare-product {
  justify-items: center;
  text-align: center;
}
.compare-title {
  color: var(--chalk-ink);
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}
.compare-title:hover {
  color: #fff;
}
.compare-remove {
  top: 0;
  right: 0;
  width: 2.75rem;
  height: 2.75rem;
  background: rgb(255 255 255 / 0.92);
}
.compare-buy {
  min-height: 2.75rem;
}
.compare-product .button.secondary {
  border-color: rgb(244 241 228 / 0.5);
  background: transparent;
  color: var(--chalk-ink);
}
.compare-table tbody th {
  background: var(--paper);
  color: var(--ink-2);
  font-weight: 700;
}
/* The prices: yellow shelf labels. */
.compare-price {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 800;
}
.compare-table td.compare-price {
  background: color-mix(in oklab, var(--sun) 35%, var(--paper));
  color: var(--memo-ink);
}
.compare-price s {
  font-family: var(--font);
  font-weight: 500;
}
.compare-table .stock-yes,
.compare-table .stock-no {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
}
.compare-table .stock-yes::before,
.compare-table .stock-no::before {
  content: '';
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: currentColor;
}
/* Each group on a kraft strip. */
.compare-group th {
  padding-block: 0.65rem;
  border-bottom: 0;
  background:
    repeating-linear-gradient(0deg, rgb(91 60 23 / 0.05) 0 2px, #0000 2px 5px), var(--kraft);
  color: var(--kraft-ink);
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 800;
}
.compare-table tr.is-different td {
  background: color-mix(in oklab, var(--sun) 18%, transparent);
  font-weight: 700;
}

/* ── Nothing to compare: the scale's pans hang empty ── */
.compare-empty {
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3rem) 1.5rem;
  border: 2px dashed var(--kraft-deep);
  border-radius: 14px;
  background: #fbf3e2;
  color: var(--kraft-ink);
}
.compare-empty::before {
  content: '';
  width: 6rem;
  height: 5rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 40' fill='none' stroke='%23b58b55' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M24 4v31M14 37h20M8 9h32'/%3E%3Ccircle cx='24' cy='4' r='2.5'/%3E%3Cpath d='m8 9-6 13h12zM40 9l-6 13h12z'/%3E%3Cpath d='M2 22a6 4 0 0 0 12 0zM34 22a6 4 0 0 0 12 0z' fill='%23fffaf0'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.compare-empty > .icon {
  display: none;
}
.compare-empty p {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
}
