/* Bas-CSS för produkt-motorn. Token-driven: varje sajt sätter --pg-* + ev. överstyrningar. */
.pg {
  --pg-red: #AE171A; --pg-fg: #2F383C; --pg-bg: #FFFFFF; --pg-muted: #6b7378;
  --pg-line: #e4e6e7; --pg-card-bg: #fff; --pg-radius: 10px;
  --pg-font: "Open Sans", system-ui, sans-serif; --pg-mono: "IBM Plex Mono", ui-monospace, monospace;
  --pg-gap: 18px;
  color: var(--pg-fg); font-family: var(--pg-font);
}
.pg *, .pg *::before, .pg *::after { box-sizing: border-box; }
.pg a { color: inherit; text-decoration: none; }
.pg .mono { font-family: var(--pg-mono); }

/* Familjegrid (6 plattor) */
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--pg-gap); }
.pg-grid--cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.pg-tile { display: flex; flex-direction: column; background: var(--pg-card-bg); border: 1px solid var(--pg-line); border-radius: var(--pg-radius); overflow: hidden; transition: border-color .15s, transform .15s; }
a.pg-tile:hover { border-color: var(--pg-red); transform: translateY(-2px); }
.pg-tile__media { aspect-ratio: 4/3; background: #f4f5f5; display: flex; align-items: center; justify-content: center; }
.pg-tile__media img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.pg-tile__body { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.pg-tile__label { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.pg-tile__sub { font-size: 13px; color: var(--pg-muted); }
.pg-tile__count { margin-top: 8px; font-family: var(--pg-mono); font-size: 12.5px; color: var(--pg-red); }
.pg-tile--static { cursor: default; }
.pg-tile--static:hover { transform: none; border-color: var(--pg-line); }

/* Maskinkort */
.pg-card { display: flex; flex-direction: column; background: var(--pg-card-bg); border: 1px solid var(--pg-line); border-radius: var(--pg-radius); overflow: hidden; transition: border-color .15s, transform .15s; }
.pg-card:hover { border-color: var(--pg-red); transform: translateY(-2px); }
.pg-card__media { aspect-ratio: 1/1; background: #f4f5f5; display: flex; align-items: center; justify-content: center; }
.pg-card__media img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.pg-card__noimg { font-size: 12px; color: var(--pg-muted); font-family: var(--pg-mono); }
.pg-card__body { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.pg-card__model { font-weight: 700; font-size: 15px; }
.pg-card__spec { font-size: 12.5px; color: var(--pg-muted); font-family: var(--pg-mono); }
.pg-card__spec b { color: var(--pg-fg); font-weight: 600; }

/* Huvud / back / subbar */
.pg-head { margin-bottom: 20px; }
.pg-back { font-family: var(--pg-mono); font-size: 13px; color: var(--pg-red); display: inline-block; margin-bottom: 10px; }
.pg-head h3 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; margin: 0 0 4px; }
.pg-head__n { font-size: 14px; color: var(--pg-muted); font-weight: 400; }
.pg-head p { color: var(--pg-muted); margin: 0; }
.pg-subbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pg-sub { font: inherit; font-size: 13px; padding: 7px 13px; border: 1px solid var(--pg-line); background: var(--pg-bg); border-radius: 99px; cursor: pointer; color: var(--pg-fg); }
.pg-sub.is-on { background: var(--pg-fg); color: #fff; border-color: var(--pg-fg); }

/* Maskindetalj (produktsida) */
.pg-detail { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.pg-detail__media { background: #f4f5f5; border-radius: var(--pg-radius); aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; }
.pg-detail__media img { width: 100%; height: 100%; object-fit: contain; padding: 24px; }
.pg-detail__fam { color: var(--pg-red); font-size: 13px; letter-spacing: .12em; margin: 0 0 6px; }
.pg-detail__model { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; margin: 0 0 12px; letter-spacing: -.01em; }
.pg-detail__tag { color: var(--pg-muted); line-height: 1.5; margin: 0 0 20px; }
.pg-keyspec { display: grid; gap: 8px; margin: 0 0 24px; }
.pg-keyspec > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--pg-line); }
.pg-keyspec dt { color: var(--pg-muted); margin: 0; }
.pg-keyspec dd { margin: 0; font-family: var(--pg-mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.pg-detail__cta { display: flex; gap: 10px; flex-wrap: wrap; }
.pg-btn { font: inherit; font-size: 14px; font-weight: 600; padding: 12px 20px; border-radius: calc(var(--pg-radius) - 4px); }
.pg-btn--primary { background: var(--pg-red); color: #fff; }
.pg-btn--ghost { border: 1px solid var(--pg-line); color: var(--pg-fg); }
.pg-btn:hover { opacity: .92; }

.pg-detail__full { margin-top: clamp(32px, 5vw, 56px); }
.pg-detail__full h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--pg-muted); margin: 0 0 14px; }
.pg-spectable { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(24px, 4vw, 56px); margin: 0; }
.pg-spectable > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--pg-line); font-size: 13.5px; }
.pg-spectable dt { color: var(--pg-muted); margin: 0; }
.pg-spectable dd { margin: 0; font-family: var(--pg-mono); font-variant-numeric: tabular-nums; text-align: right; }

.pg-note { margin-top: 20px; font-size: 13px; color: var(--pg-muted); }
.pg-note a, .pg-detail__full + .pg-note a { color: var(--pg-red); }

:focus-visible { outline: 2px solid var(--pg-red); outline-offset: 2px; }

@media (max-width: 760px) {
  .pg-detail { grid-template-columns: 1fr; }
  .pg-spectable { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  a.pg-tile:hover, .pg-card:hover { transform: none; }
  .pg { scroll-behavior: auto; }
}
