/* ============================================================
   CSJ Shop Core — set configurator (type `set`).
   Builds on pdp-single.css; token-driven so it adapts per skin.
   ============================================================ */

/* Two-column layout: sticky gallery left (52%) + configurator right,
   matching the prototype ProductPage. (single/box get their own rule in
   pdp-single.css; the set type was missing one and stacked full-width.) */
body.csj-type-set .site-content,
body.csj-type-set .content-area { background: var(--color-bg, #faf5ee); }

body.csj-type-set div.product {
  display: grid;
  grid-template-columns: 52% 1fr;
  gap: 56px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px 56px;
  align-items: start;
}
body.csj-type-set div.product > .csj-pdp__backlink { grid-column: 1 / -1; }
body.csj-type-set .csj-gallery { position: sticky; top: 96px; }

/* Gallery stage — rounded + soft drop shadow (prototype). */
body.csj-type-set .csj-gallery__stage {
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(42, 26, 14, 0.20);
}

/* Eyebrow: room in brand terra, mood stays muted (prototype). */
body.csj-type-set .csj-pdp__eyebrow > span:first-child { color: var(--color-terra-500, #b85440); }

/* Title 42px on desktop (30px on mobile below). */
body.csj-type-set .csj-pdp__title { font-size: 2.625rem; }

.csj-set__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.csj-set__title { font-family: var(--font-display, serif); font-size: var(--text-xl, 1.25rem); font-weight: var(--weight-semibold, 600); margin: 0; }
.csj-set__reset { background: none; border: none; cursor: pointer; font-size: var(--text-sm, 0.8125rem); color: var(--color-text-muted, #8a7b69); text-decoration: underline; }
.csj-set__help { font-size: var(--text-sm, 0.8125rem); color: var(--color-text-muted, #8a7b69); margin: 0 0 14px; }

.csj-set__list { display: grid; gap: 2px; margin-bottom: 20px; }

.csj-set__row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border, #e8d4bf);
}
.csj-set__thumb { width: 56px; height: 56px; border-radius: 4px; overflow: hidden; background: var(--color-surface-warm, #f2e6d6); }
.csj-set__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.csj-set__name { display: flex; flex-direction: column; gap: 2px; font-size: var(--text-base, 1rem); }
.csj-set__name a { color: var(--color-text, #2a1a0e); text-decoration: none; }
.csj-set__name a:hover { text-decoration: underline; }
.csj-set__unit { font-size: var(--text-sm, 0.8125rem); color: var(--color-text-muted, #8a7b69); }

/* Stepper */
.csj-set__stepper { display: inline-flex; align-items: center; border: 1px solid var(--color-border-strong, #b8a08a); border-radius: 3px; }
.csj-set__stepper button { width: 34px; height: 36px; background: none; border: none; font-size: 16px; cursor: pointer; color: var(--color-text, #2a1a0e); }
.csj-set__stepper input { width: 40px; height: 36px; text-align: center; border: none; background: none; font-size: var(--text-base, 1rem); -moz-appearance: textfield; }
.csj-set__stepper input::-webkit-outer-spin-button, .csj-set__stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Add-on rows: show "+ Toevoegen" until active, then reveal the stepper. */
.csj-set__addbtn {
  padding: 8px 16px; border: 1px solid var(--color-border-strong, #b8a08a); border-radius: 3px;
  background: none; cursor: pointer; font-size: var(--text-sm, 0.8125rem);
  font-weight: var(--weight-medium, 500); letter-spacing: var(--tracking-wide, 0.06em);
  text-transform: uppercase; color: var(--color-text, #2a1a0e); white-space: nowrap;
}
.csj-set__addbtn:hover { border-color: var(--color-accent, #b85440); }
.csj-set__row--addon .csj-set__stepper { display: none; }
.csj-set__row--addon.is-active .csj-set__stepper { display: inline-flex; }
.csj-set__row--addon.is-active .csj-set__addbtn { display: none; }
.csj-set__row--addon.is-zero .csj-set__thumb,
.csj-set__row--addon.is-zero .csj-set__name { opacity: 0.7; }

/* Availability. Two lines: what is in stock, and — only when it applies — why
   the customer may add fewer than that. */
.csj-set__stock { display: block; font-size: var(--text-sm, 0.8125rem); color: var(--color-text-muted, #8a7b69); }
.csj-set__stock.is-low { color: var(--color-accent, #b85440); font-weight: var(--weight-semibold, 600); }
.csj-set__stock--cart { font-style: italic; }
/* Deeper than .is-zero (0.7) so "cannot have it" reads apart from "not chosen". */
.csj-set__row.is-oos .csj-set__thumb,
.csj-set__row.is-oos .csj-set__name { opacity: 0.55; }
.csj-set__stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.csj-set__stepper.is-disabled { border-color: var(--color-border, #e8d4bf); }
.csj-set__addbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.csj-set__sumstock { font-size: var(--text-sm, 0.8125rem); color: var(--color-accent, #b85440); }

.csj-set__addonhead { margin: 6px 0 8px; }
.csj-set__addonhead h4 { font-family: var(--font-display, serif); font-size: var(--text-lg, 1.125rem); font-weight: var(--weight-semibold, 600); margin: 0 0 2px; }
.csj-set__addonhead p { font-size: var(--text-sm, 0.8125rem); color: var(--color-text-muted, #8a7b69); margin: 0; }

/* Live summary */
.csj-set__summary { margin-top: 18px; padding: 20px; background: var(--color-bg-warm, #f2e6d6); border-radius: 6px; }
.csj-set__sumrow { display: flex; justify-content: space-between; font-size: var(--text-sm, 0.8125rem); color: var(--color-text-muted, #8a7b69); margin-bottom: 8px; }
/* An author `display` beats the UA rule for [hidden], so the JS toggling
   `hidden` on the collectievoordeel row was a no-op: below the threshold the
   row stayed visible showing −€ 0,00 next to an undiscounted total. */
.csj-set__summary [hidden] { display: none; }
.csj-set__discount { color: var(--color-accent, #b85440); font-weight: var(--weight-semibold, 600); }
.csj-set__sumhint { font-size: var(--text-xs, 0.6875rem); color: var(--color-text-muted, #8a7b69); margin-bottom: 10px; min-height: 1em; }
.csj-set__total { display: flex; align-items: baseline; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--color-border, #e8d4bf); margin-bottom: 14px; }
.csj-set__total-label { font-size: var(--text-base, 1rem); }
.csj-set__total-amount { font-family: var(--font-display, serif); font-size: var(--text-3xl, 1.875rem); font-weight: var(--weight-semibold, 600); }
.csj-set__add { width: 100%; }
.csj-set__add[disabled] { opacity: 0.5; cursor: not-allowed; }
.csj-set__trust { text-align: center; font-size: var(--text-xs, 0.6875rem); color: var(--color-text-muted, #8a7b69); margin: 10px 0 0; }

/* Offscreen fields WooPayments' BNPL messaging listens on (see pdp-set.php). */
.csj-bnpl-proxy { display: none; }

/* Cart: group set lines visually */
.woocommerce-cart-form .csj-set-line td { background: var(--color-bg-warm, #f7f2ea); }

@media (max-width: 820px) {
  .csj-set__row { grid-template-columns: 48px 1fr auto; gap: 10px; }
  .csj-set__thumb { width: 48px; height: 48px; }
  body.csj-type-set div.product { grid-template-columns: 1fr; gap: 28px; padding: 20px 16px 44px; }
  body.csj-type-set .csj-gallery { position: static; }
  body.csj-type-set .csj-pdp__title { font-size: var(--text-3xl, 1.875rem); }
}

/* ---- Mobile refinements -------------------------------------------------
   The object rows carried a three-column grid whose third column held a
   nowrap "+ Toevoegen"; at 360px that squeezed the product name to a sliver.
   On phones the control moves to its own line under the name. */
@media (max-width: 820px) {
  .csj-set__row {
    grid-template-columns: 64px 1fr;
    row-gap: 10px;
    align-items: start;
    padding: 14px 0;
  }
  .csj-set__thumb { grid-row: span 2; width: 64px; height: 64px; }
  .csj-set__stepper,
  .csj-set__addbtn { grid-column: 2; justify-self: start; }

  .csj-set__stepper button { width: 44px; height: 44px; font-size: 18px; }
  .csj-set__stepper input { width: 48px; height: 44px; font-size: 16px; }
  .csj-set__addbtn { min-height: 44px; padding: 10px 18px; }
  .csj-set__reset { display: inline-flex; align-items: center; min-height: 44px; }
  /* The object name is the only link in the row, so it has to be tappable. */
  .csj-set__name > a { display: inline-flex; align-items: center; min-height: 44px; }

  /* Room for the sticky buy bar that this product type now also gets. */
  body.csj-type-set { padding-bottom: 84px; }
  .csj-pdp__mobilebar--set .csj-pdp__mobilebar-add { min-width: 140px; }
}
