/* Price calculator (Module kit). Mechanics live here; a Demo site restyles it only by setting the
   --pc-* tokens on the module or an ancestor. Markup and token list: kit/README.md. */
[data-module="price-calculator"] {
  display: grid;
  gap: var(--pc-space, 16px);
  padding: calc(var(--pc-space, 16px) * 1.5);
  border-radius: var(--pc-radius, 12px);
  background: var(--pc-bg, #fff);
  color: var(--pc-fg, #1b1b1b);
  font-family: var(--pc-font, inherit);
}

/* Stays hidden until price-calculator.js has valid price data: no data, no calculator. */
[data-module="price-calculator"][hidden] { display: none; }

[data-module="price-calculator"] > :is(h2, h3, p) { margin: 0; }

.pc__list { display: grid; }

.pc__row {
  display: grid;
  grid-template-columns: 1.25rem 1fr auto;
  align-items: center;
  gap: calc(var(--pc-space, 16px) * 0.75);
  min-height: 48px; /* the whole row is the tap target */
  padding: calc(var(--pc-space, 16px) / 2) 0;
  border-bottom: 1px solid var(--pc-line, rgb(0 0 0 / 0.12));
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pc__row--unit { grid-template-columns: 1fr auto 4.5rem; cursor: default; }

.pc__check {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--pc-accent, #0b5394);
  cursor: pointer;
}

.pc__price { font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0.8; }

.pc__qty {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid var(--pc-line, rgb(0 0 0 / 0.12));
  border-radius: calc(var(--pc-radius, 12px) / 2);
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pc__check:focus-visible,
.pc__qty:focus-visible {
  outline: 3px solid var(--pc-accent, #0b5394);
  outline-offset: 2px;
}

.pc__total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 1rem;
}

.pc__sum {
  font-family: var(--pc-total-font, inherit);
  font-size: 1.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--pc-accent, #0b5394);
}
