/* SharkNinja brand tokens (from sharkninja.nl) */
:root {
  --color-black: #000;
  --color-white: #fff;
  --color-grey1: #f9f9f9;
  --color-grey2: #eee;
  --color-grey3: #ccc;
  --color-grey4: #999;
  --color-grey5: #666;
  --color-grey6: #444;
  --color-grey7: #222;
  --color-sand: #eeebe6;
  --color-surface: #ecebe8;
  --color-text-secondary: #454545;
  --color-red: #c00;
  --color-error: #b43f28;
  --color-green: #008827;
  --color-green-bg: #e8f5ec;
  --color-red-bg: #fceceb;
  --color-amber-bg: #f7efe6;
  --color-amber: #8a5b14;

  --bg: var(--color-grey1);
  --panel: var(--color-white);
  --text: var(--color-black);
  --muted: var(--color-text-secondary);
  --border: var(--color-grey3);
  --border-light: var(--color-grey2);

  --font-body: "DM Sans", Arial, Helvetica, sans-serif;
  --font-heading: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); }

/* Header — white bar like sn.nl */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--color-white);
  border-bottom: 1px solid var(--border-light);
}

.topbar__brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.topbar__logo {
  display: block;
  height: 28px;
  width: auto;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.topbar__link {
  color: var(--color-grey6);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-bottom: 2px solid transparent;
}

.topbar__link:hover {
  color: var(--color-black);
}

.topbar__link.is-active {
  color: var(--color-black);
  border-bottom-color: var(--color-black);
  font-weight: 700;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.page-head {
  margin-bottom: 1.25rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-grey5);
}

h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.crumb {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  color: var(--color-grey5);
}

.crumb a {
  color: var(--color-grey5);
  text-decoration: none;
}

.crumb a:hover {
  color: var(--color-black);
  text-decoration: underline;
}

.mono {
  font-family: var(--font-heading);
  letter-spacing: -0.5px;
}

.muted { color: var(--muted); }

.pulse {
  color: var(--color-red);
  font-weight: 700;
}

/* Buttons — SN primary = black fill; ghost = outline */
.btn {
  appearance: none;
  border: 1px solid var(--color-black);
  background: var(--color-black);
  color: var(--color-white);
  padding: 10px 24px;
  border-radius: 40px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  background: var(--color-grey7);
  border-color: var(--color-grey7);
}

.btn--ghost {
  background: var(--color-white);
  color: var(--color-black);
  border: 1px solid var(--color-black);
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn--ghost:hover {
  background: var(--color-black);
  color: var(--color-white);
}

/* Insights */
.insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0;
  margin-bottom: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border-light);
}

.insights--compact {
  margin-bottom: 1.5rem;
}

.insight {
  padding: 1rem 1.1rem;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.insight:last-child { border-right: none; }

.insight__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-grey5);
}

.insight__value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
}

.insight__value--ok { color: var(--color-green); }
.insight__value--bad { color: var(--color-red); }
.insight__value--warn { color: var(--color-error); }

.insight__hint {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Attention */
.attention {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 1.25rem;
  background: var(--color-sand);
  border: 1px solid var(--border-light);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.attention__head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.attention__head p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.attention__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.5rem;
}

.attention__item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.65rem 0.75rem;
  text-decoration: none;
  color: inherit;
  background: var(--color-white);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--color-grey3);
}

.attention__item--oos { border-left-color: var(--color-red); }
.attention__item--error { border-left-color: var(--color-error); }

.attention__item:hover {
  border-color: var(--color-black);
}

.attention__label {
  font-size: 0.88rem;
  font-weight: 700;
}

.attention__detail {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--border-light);
}

.table-wrap--flush {
  border: none;
  margin-top: 0.65rem;
}

.grid,
.config-table,
.history {
  width: 100%;
  border-collapse: collapse;
}

.grid th,
.grid td,
.config-table th,
.config-table td,
.history th,
.history td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
}

.grid thead th,
.config-table thead th,
.history thead th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-grey5);
  font-weight: 700;
  background: var(--color-white);
  white-space: nowrap;
  border-bottom: 1px solid var(--color-black);
}

.grid tbody tr:hover,
.config-table tbody tr:hover {
  background: var(--color-grey1);
}

.config-table__row--off td {
  opacity: 0.55;
}

.config-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.config-toolbar__search {
  flex: 1;
  min-width: 12rem;
  max-width: 20rem;
}

.config-toolbar__meta {
  margin: 0;
  font-size: 0.9rem;
}

.config-products {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.config-product {
  background: var(--panel);
  border: 1px solid var(--border-light);
  scroll-margin-top: 5rem;
}

.config-product[hidden] {
  display: none;
}

.config-product__summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
}

.config-product__summary::-webkit-details-marker {
  display: none;
}

.config-product__summary::before {
  content: "";
  flex: 0 0 auto;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid var(--color-grey5);
  border-bottom: 2px solid var(--color-grey5);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.config-product[open] > .config-product__summary::before {
  transform: rotate(45deg);
}

.config-product__code {
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: auto;
}

.config-product__meta {
  font-size: 0.85rem;
}

.config-product__detail {
  color: var(--color-grey5);
  font-size: 0.85rem;
  text-decoration: underline;
}

.config-product__detail:hover {
  color: var(--color-black);
}

.config-product__body {
  border-top: 1px solid var(--border-light);
  padding: 0;
}

.config-table--nested {
  margin: 0;
}

.config-table--nested thead th {
  background: var(--color-grey1);
}

.config-table__site {
  font-weight: 500;
  white-space: nowrap;
  width: 8rem;
}

.config-table__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
  width: 1%;
  min-width: 18rem;
  vertical-align: middle;
}

.config-table__actions .config-form {
  display: inline-flex;
  margin: 0;
}

.config-table__actions .btn {
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
}

.config-table__actions .btn--icon {
  padding: 0.4rem;
  min-width: 2.15rem;
}

.btn--icon svg {
  display: block;
}

.site-card__head-actions .btn--icon {
  padding: 0.4rem;
  min-width: 2.15rem;
}

.config-table__matched {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.grid tbody tr:last-child td,
.config-table tbody tr:last-child td {
  border-bottom: none;
}

.grid__sku-col {
  min-width: 150px;
  position: sticky;
  left: 0;
  background: var(--panel);
  z-index: 1;
}

.grid thead .grid__sku-col {
  background: var(--color-white);
  z-index: 2;
}

.grid tbody tr:hover .grid__sku-col {
  background: var(--color-grey1);
}

.grid__sku-col a,
.config-table__sku a {
  color: var(--color-black);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.grid__sku-col a:hover,
.config-table__sku a:hover {
  text-decoration: underline;
}

.grid__duration {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

.grid__price {
  font-size: 0.88rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

.empty-state {
  color: var(--muted);
  padding: 2.5rem 1rem !important;
  text-align: center;
}

.empty-state code {
  font-size: 0.85em;
  background: var(--color-grey2);
  padding: 0.1rem 0.35rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: 0;
}

.badge--in-stock { background: var(--color-green-bg); color: var(--color-green); }
.badge--out-of-stock { background: var(--color-red-bg); color: var(--color-red); }
.badge--not-carried { background: var(--color-grey2); color: var(--color-grey5); }
.badge--error { background: var(--color-amber-bg); color: var(--color-error); }
.badge--pending { background: var(--color-grey2); color: var(--color-grey5); }

/* Config */
.config-table__sku { white-space: nowrap; min-width: 120px; }

.config-table__search a {
  color: var(--color-black);
  text-decoration: underline;
  font-size: 0.85rem;
  white-space: nowrap;
}

.config-form { margin: 0; }

.config-form__input {
  width: 100%;
  min-width: 220px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--color-white);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.config-form__input:focus {
  outline: none;
  border-color: var(--color-black);
}

.sku-add {
  margin-bottom: 1.5rem;
  max-width: 32rem;
}

.sku-add__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-grey5);
  margin-bottom: 0.4rem;
}

.sku-add__row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.sku-add__row .config-form__input {
  flex: 1;
  min-width: 0;
}

.sku-add__error {
  margin: 0.5rem 0 0;
  color: var(--color-red);
  font-size: 0.9rem;
}

.sku-list__actions {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

/* SKU detail */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.site-card {
  background: var(--panel);
  border: 1px solid var(--border-light);
  padding: 1.1rem 1.15rem;
}

.site-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-light);
}

.site-card__head-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.site-card__head h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.site-card__meta {
  margin: 0.5rem 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.history { font-size: 0.85rem; }

.history th,
.history td {
  padding: 0.4rem 0.5rem;
}

.tweakers-fold {
  background: var(--panel);
  border: 1px solid var(--border-light);
  margin-bottom: 1.25rem;
}

.tweakers-fold__summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.tweakers-fold__summary::-webkit-details-marker {
  display: none;
}

.tweakers-fold__summary::after {
  content: "+";
  font-weight: 700;
  color: var(--color-grey5);
}

.tweakers-fold[open] > .tweakers-fold__summary::after {
  content: "–";
}

.tweakers-fold__title {
  font-family: var(--font-heading);
  letter-spacing: -0.5px;
}

.tweakers-fold__hint {
  font-weight: 500;
  font-size: 0.85rem;
}

.tweakers-fold__body {
  padding: 0 1.1rem 1.1rem;
  border-top: 1px solid var(--border-light);
}

.tweakers-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.85rem 0;
}

.tweakers-panel__head .muted {
  margin: 0;
  font-size: 0.88rem;
}

.tweakers-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--border-light);
  margin-bottom: 0.85rem;
}

.tweakers-stats .insight {
  border-right: 1px solid var(--border-light);
}

.tweakers-stats .insight:last-child {
  border-right: none;
}

.tweakers-chart-wrap {
  position: relative;
  height: 220px;
  margin-bottom: 1rem;
}

.tweakers-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.tweakers-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-grey5);
  margin-bottom: 0.35rem;
}

.tweakers-form__row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.tweakers-form__row .config-form__input {
  flex: 1;
}

.comp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.comp-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.comp-swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border: 1px solid var(--border-light);
}

.comp-swatch--high {
  background: var(--color-red-bg);
  border-color: var(--color-red);
}

.comp-swatch--low {
  background: var(--color-white);
  border-color: var(--color-black);
  border-width: 2px;
}

.comp-matrix th.comp-matrix__sn {
  color: var(--color-black);
}

.comp-matrix__price {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  vertical-align: middle;
}

.comp-matrix__price.is-sn {
  font-weight: 700;
}

.comp-matrix__price.is-high {
  background: var(--color-red-bg);
  color: var(--color-red);
}

.comp-matrix__price.is-best {
  background: var(--color-white);
  box-shadow: inset 0 0 0 2px var(--color-black);
}

.comp-matrix__amount {
  display: block;
}

.comp-matrix__tag {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-white);
  background: var(--color-black);
}

.comp-matrix__price.is-high .comp-matrix__tag {
  background: var(--color-red);
  color: var(--color-white);
}

.comp-matrix__lowest {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 7rem;
  font-weight: 700;
}

.comp-matrix__gap {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 9rem;
}

.comp-gap-text {
  color: var(--color-red);
}

.comp-gap-text--ok {
  color: var(--color-green);
}

.comp-gap-vs {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.grid__sku-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.fav-form {
  display: inline;
  margin: 0;
}

.fav-btn {
  border: 0;
  background: transparent;
  color: var(--color-grey4);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem 0.15rem;
}

.fav-btn:hover {
  color: var(--color-black);
}

.fav-btn.is-on {
  color: #e6a800;
}

.grid__row--fav .grid__sku-col a {
  font-weight: 700;
}

.config-table tr[id] {
  scroll-margin-top: 5rem;
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }

  .topbar__logo { height: 24px; }

  .container {
    padding: 1.15rem 0.9rem 2rem;
  }

  .attention {
    grid-template-columns: 1fr;
  }

  .insight {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }

  .insight:last-child { border-bottom: none; }

  .tweakers-fold__summary {
    flex-wrap: wrap;
  }

  .tweakers-panel__head {
    flex-direction: column;
  }

  .tweakers-stats {
    grid-template-columns: 1fr;
  }

  .tweakers-stats .insight {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }

  .tweakers-form__row {
    flex-direction: column;
    align-items: stretch;
  }
}
