/*
 * Glow compare: the swatch test. Each product stands in an arched mirror frame, like testers lined
 * up on a counter; the rows below read like the label on the back of the box, groups as its
 * headings; where the products differ, a highlighter swipe marks the row.
 */
.compare-page {
  max-width: var(--max);
}
.compare-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
}
.gl-compare-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
}
.gl-compare-slots {
  margin: 0;
  padding: 0.25rem 0.85rem;
  border-radius: var(--pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  color: var(--accent-hover);
  font-family: var(--font-round);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}
.compare-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
main .compare-diff {
  display: inline-flex;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.3rem 1rem;
  border-radius: var(--pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--ink);
  font-weight: 600;
}
main .compare-diff:has(:checked) {
  background: var(--accent-mist);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.compare-tools .share {
  min-height: 2.75rem;
}

/* The label. */
.compare-scroll {
  overflow-x: auto;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--line),
    0 30px 60px -46px rgb(122 40 78 / 0.5);
}
.compare-table {
  width: 100%;
  min-width: calc(8.5rem + var(--cols) * 12rem);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}
.compare-table th,
.compare-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px dashed var(--line-strong);
  text-align: left;
  vertical-align: top;
}
.compare-table thead th,
.compare-table thead td {
  border-bottom: 0;
  padding-top: 1.6rem;
  background: radial-gradient(80% 70% at 50% 0, var(--accent-mist), transparent 70%);
}
.compare-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 8.5rem;
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 700;
}
.compare-corner {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
}
.compare-product {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  text-align: center;
}
/* The tester in its arched mirror. */
.compare-media {
  display: block;
  width: min(100%, 11rem);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 0.35rem solid var(--surface);
  border-radius: 999px 999px var(--r-sm) var(--r-sm);
  background: var(--sunken);
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 20px 30px -22px rgb(122 40 78 / 0.55);
}
.compare-media img,
.compare-media .no-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.compare-title {
  font-family: var(--font-round);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}
.compare-title:hover {
  color: var(--accent-hover);
}
.compare-remove {
  position: absolute;
  top: -0.6rem;
  right: max(0px, calc(50% - 6.6rem));
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--line-strong),
    var(--shadow-sm);
  color: var(--ink-2);
  cursor: pointer;
}
.compare-remove:hover {
  color: var(--danger);
}
.compare-remove .icon {
  width: 1rem;
  height: 1rem;
}
.compare-buy {
  width: 100%;
  max-width: 11rem;
  min-height: 2.75rem;
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
}
.compare-price {
  color: var(--accent-hover);
  font-family: var(--font-round);
  font-size: 1.12rem;
  font-weight: 700;
}
.compare-price s {
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 400;
}
/* A group: the label's heading, with a sparkle. */
.compare-group th {
  padding-block: 0.65rem;
  background: var(--tint);
  color: var(--accent-hover);
  font-family: var(--font-round);
  font-size: 0.95rem;
}
.compare-group th::before {
  content: '✦ ';
  color: var(--accent);
  font-size: 0.75rem;
}
/* Where they differ: a highlighter swipe. */
.compare-table tr.is-different td {
  background: linear-gradient(
      178deg,
      transparent 30%,
      color-mix(in oklab, var(--accent) 12%, transparent) 32% 78%,
      transparent 80%
    )
    0 0 / 100% 100% no-repeat;
}
.is-diff-only tr.is-same {
  display: none;
}
.stock-yes {
  color: var(--success);
  font-weight: 700;
}
.stock-no {
  color: var(--danger);
  font-weight: 700;
}
.compare-none {
  color: var(--line-strong);
}
.compare-note {
  margin-top: 1rem;
}

/* Nothing to compare: two empty swatches waiting for testers. */
.compare-empty {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: clamp(3rem, 8vw, 4.5rem) 1rem;
  border-radius: 2rem;
  background:
    radial-gradient(60% 80% at 50% 0, var(--accent-mist), transparent 70%), var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  text-align: center;
}
.compare-empty p {
  max-width: 30rem;
  margin: 0;
  color: var(--ink-2);
  font-family: var(--font-round);
  font-size: 1.15rem;
}
.gl-test-swatches {
  position: relative;
  display: flex;
  gap: 2.4rem;
}
.gl-test-swatches span {
  width: 3.4rem;
  height: 4.2rem;
  border: 2px dashed var(--accent-line);
  border-radius: 999px 999px 0.6rem 0.6rem;
  background: var(--accent-mist);
}
.gl-test-swatches::after {
  content: '+';
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  color: var(--accent);
  font-family: var(--font-round);
  font-size: 1.6rem;
  font-weight: 700;
}
