/* Proofline shop pages: /shop/, /shop/calculator/, /cart/, /order/complete/.
   Only what site.css doesn't already have. Tokens come from site.css, so light and dark mode
   follow automatically. */

/* ------------------------------------------------------------------ shared bits */
.shop-note {
  margin-top: var(--s-3);
  font-size: var(--text-sm);
  color: var(--ink-2);
}
.shop-note a {
  color: inherit;
}
.shop-msg {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.shop-msg:not(:empty) {
  margin-top: var(--s-3);
}
.shop-msg[data-tone="error"] {
  color: var(--bad);
}
.shop-msg[data-tone="ok"] {
  color: var(--ok);
}
.shop-msg a {
  color: inherit;
  font-weight: 600;
}

/* Wide (16:9) product-card media, e.g. a video still. */
.product-card__media--wide {
  padding: 0;
  background: var(--surface);
}
.product-card__media--wide img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}
.product-card h3 a {
  color: inherit;
  text-decoration: none;
}
/* The whole card is clickable through the title link; the button stays its own target. */
.product-card {
  position: relative;
}
.product-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}
.product-card__body .btn,
.product-card__body a:not(h3 a) {
  position: relative;
  z-index: 1;
}
/* The only product on /shop/: on wide screens the picture sits beside the text. */
@media (min-width: 48rem) {
  .product-card--wide {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }
  .product-card--wide .product-card__media {
    aspect-ratio: auto;
    min-height: 100%;
  }
  .product-card--wide .product-card__body {
    justify-content: center;
    padding: var(--s-6);
  }
  .product-card--wide .product-card__body .btn {
    margin-top: var(--s-3);
    align-self: flex-start;
  }
}
.product-card__unit {
  font: 400 var(--text-sm) / 1.4 var(--font-body);
  color: var(--ink-2);
}
.product-card__body > p {
  color: var(--ink-2);
}
.product-card__body .badge {
  align-self: flex-start;
}
@media (hover: hover) and (pointer: fine) {
  .product-card {
    transition: box-shadow var(--dur-fast) ease;
  }
  .product-card:hover {
    box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-md);
  }
}

/* ------------------------------------------------------------------ product detail */
.pdp {
  display: grid;
  gap: var(--s-7);
  align-items: start;
}
@media (min-width: 60rem) {
  .pdp {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: var(--s-8);
  }
  .pdp__buy {
    position: sticky;
    top: calc(var(--header-h) + var(--s-5));
  }
}

/* Gallery. Without JS every image is shown, one under the other. With JS (data-ready),
   one big image and a row of thumbnails that swap it. */
.gallery__main {
  display: grid;
  gap: var(--s-4);
}
.gallery__slide {
  display: grid;
  place-items: center;
  padding: clamp(var(--s-4), 1rem + 2vw, var(--s-7));
  border-radius: var(--r-lg);
  background: radial-gradient(ellipse 70% 60% at 50% 45%, color-mix(in srgb, var(--ink) 6%, transparent), transparent 70%), var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.gallery__slide picture {
  width: 100%;
}
.gallery__slide img {
  width: 100%;
  max-height: 32rem;
  object-fit: contain;
}
.gallery__slide figcaption {
  margin-top: var(--s-3);
  font: 500 0.8125rem/1.4 var(--font-mono);
  color: var(--ink-2);
  text-align: center;
}
.gallery[data-ready] .gallery__slide {
  aspect-ratio: 1 / 1;
  grid-template-rows: minmax(0, 1fr) auto;
}
.gallery[data-ready] .gallery__slide picture,
.gallery[data-ready] .gallery__slide img {
  height: 100%;
  min-height: 0;
}
.gallery[data-ready] .gallery__slide:not([data-active]) {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .gallery[data-ready] .gallery__slide[data-active] {
    animation: gallery-in var(--dur) var(--ease-out);
  }
}
@keyframes gallery-in {
  from {
    opacity: 0.4;
  }
}
.gallery__thumbs {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.gallery__thumbs[hidden] {
  display: none;
}
.gallery__thumb {
  flex: 0 1 5.5rem;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 44px;
  padding: var(--s-2);
  border: 0;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: box-shadow var(--dur-fast) ease;
}
.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gallery__thumb[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px var(--accent-ink);
}
@media (hover: hover) and (pointer: fine) {
  .gallery__thumb:hover:not([aria-pressed="true"]) {
    box-shadow: inset 0 0 0 1px var(--line-strong);
  }
}

/* The spot for real prototype photos. */
.photo-slot {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  margin-top: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r);
  border: 1.5px dashed var(--line-strong);
  color: var(--ink-2);
  font-size: var(--text-sm);
}
.photo-slot svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--accent-ink);
}
.photo-slot strong {
  display: block;
}

/* Buy box */
.pdp__buy h2 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
}
.pdp__buy .price {
  margin-top: var(--s-4);
}
.pdp__desc {
  margin-top: var(--s-4);
  color: var(--ink-2);
}
.buy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-6);
}
.buy-row[hidden] {
  display: none;
}
.buy-row__label {
  flex-basis: 100%;
  font-weight: 600;
  font-size: var(--text-sm);
}
.buy-actions {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.buy-actions .btn {
  width: 100%;
}
.buy-actions [hidden] {
  display: none;
}
.points {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.points li {
  display: grid;
  grid-template-columns: 1.375rem minmax(0, 1fr);
  gap: var(--s-3);
  color: var(--ink-2);
}
.points svg {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--accent-ink);
}
.points strong {
  color: var(--ink);
}

/* A compact list of facts with a heading on the left (specs summary, plan terms). */
.facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--line);
}
.facts > div {
  display: grid;
  gap: var(--s-1) var(--s-4);
  padding-block: var(--s-4);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 40rem) {
  .facts > div {
    grid-template-columns: 11rem minmax(0, 1fr);
  }
}
.facts dt {
  font: 500 0.8125rem/1.9 var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.facts dd {
  font-weight: 500;
}
.facts dd small {
  display: block;
  margin-top: 0.15rem;
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--ink-2);
}
.more-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-5);
  font-weight: 600;
}
.more-link svg {
  width: 18px;
  height: 18px;
}

/* ------------------------------------------------------------------ cart */
.cart {
  display: grid;
  gap: var(--s-7);
  align-items: start;
}
@media (min-width: 60rem) {
  .cart {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--s-8);
  }
}
.cart[hidden],
.cart-empty[hidden] {
  display: none;
}
.cart-line {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: var(--s-4) var(--s-5);
  align-items: start;
  padding-block: var(--s-5);
  border-block: 1px solid var(--line);
}
@media (min-width: 36rem) {
  .cart-line {
    grid-template-columns: 8rem minmax(0, 1fr) auto;
  }
}
.cart-line__media {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: var(--s-2);
  border-radius: var(--r);
  background: var(--surface);
}
.cart-line__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cart-line h3 {
  font-size: 1.375rem;
}
.cart-line h3 a {
  color: inherit;
  text-decoration: none;
}
.cart-line__unit {
  margin-top: var(--s-1);
  color: var(--ink-2);
  font-size: var(--text-sm);
}
.cart-line__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.cart-line__total {
  grid-column: 2;
  font: 700 1.375rem/1.1 var(--font-display);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 36rem) {
  .cart-line__total {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-2);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--ink-2);
  font: 500 var(--text-sm) / 1 var(--font-body);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.link-btn svg {
  width: 18px;
  height: 18px;
}
@media (hover: hover) and (pointer: fine) {
  .link-btn:hover {
    color: var(--ink);
  }
}
.plan-line {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  margin-top: var(--s-5);
  color: var(--ink-2);
}
.plan-line svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: var(--accent-ink);
}
.plan-line strong {
  color: var(--ink);
}
.summary {
  padding: clamp(var(--s-5), 1rem + 2vw, var(--s-6));
  border-radius: var(--r-lg);
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-md);
}
.summary h2 {
  font-size: 1.5rem;
}
.summary dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-4);
  font-variant-numeric: tabular-nums;
}
.summary dt {
  color: var(--ink-2);
}
.summary dd {
  text-align: right;
  font-weight: 500;
}
.summary .total {
  padding-top: var(--s-3);
  border-top: 1px solid var(--line-strong);
  color: var(--ink);
  font-weight: 600;
}
.summary .btn {
  width: 100%;
  margin-top: var(--s-5);
}
.summary [hidden] {
  display: none;
}
.summary .waitlist {
  margin-top: var(--s-5);
}
.cart-empty {
  max-width: 34rem;
}
.cart-empty h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.25rem);
}
.cart-empty p {
  margin-top: var(--s-3);
  color: var(--ink-2);
}
.cart-empty .btn {
  margin-top: var(--s-5);
}
.cart-notice {
  margin-bottom: var(--s-6);
}
.cart-notice[hidden] {
  display: none;
}

/* Quantity input: no browser spin arrows, the stepper buttons do that. */
.qty input {
  width: 3rem;
  min-height: 44px;
  -moz-appearance: textfield;
  appearance: textfield;
}
.qty input::-webkit-inner-spin-button,
.qty input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.gallery__slide picture {
  display: block;
}

/* Long button labels wrap instead of running off narrow screens. */
.page-hero__actions .btn,
.buy-actions .btn,
.summary .btn {
  white-space: normal;
  text-align: center;
}
