/* ============================================================
   design.css — designmodule: custom producten samenstellen
   (/design/{product}, js/shop-design.js, sessie 47).
   Nabouw van het werkende ontwerp (zie v2/DESIGN-MODULE.md §1.4);
   alle klassen hebben de prefix .dsg- zodat ze niet botsen met
   Bootstrap 3 / style.css.
   ============================================================ */

.dsg {
  --dsg-primary: #98ca3c;
  --dsg-primary-hover: #7da72f;
  --dsg-secondary: #1e60ad;
  --dsg-badge: #e8f5c8;
  --dsg-surface: #f5f5f5;
  --dsg-border: #dddddd;
  --dsg-error: #d9534f;
  --dsg-warning: #f0ad4e;
  --dsg-text: #111827;
  --dsg-muted: #6b7280;
  --dsg-focus: rgba(152, 202, 60, 0.15);
  --dsg-radius: 10px;
  --dsg-radius-sm: 4px;
  --dsg-dur-acc: 400ms;
  color: var(--dsg-text);
  font-size: 14px;
  line-height: 1.5;
  margin: 10px 0 30px;
}
.dsg *, .dsg *::before, .dsg *::after { box-sizing: border-box; }
/* :where() = specificiteit 0, zodat de .dsg-*-klassen hieronder altijd winnen van deze resets */
:where(.dsg) button { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
:where(.dsg) img { max-width: 100%; height: auto; display: block; }

/* ---------- Layout ---------- */
.dsg-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
.dsg-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dsg-right { position: relative; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 1024px) {
  .dsg-layout { grid-template-columns: 5fr 6fr; gap: 32px; }
  .dsg-left { position: sticky; top: 16px; align-self: flex-start; }
}

/* ---------- Kop ---------- */
.dsg-title { color: var(--dsg-secondary); font-size: 24px; font-weight: 600; line-height: 32px; margin: 0; }
.dsg-subtitle { color: var(--dsg-muted); font-size: 14px; line-height: 20px; margin: 0; }
.dsg-reset {
  display: flex; align-items: center; gap: 4px; align-self: flex-end;
  color: var(--dsg-primary); font-weight: 500; font-size: 14px; line-height: 20px;
  transition: color 150ms;
}
.dsg-reset:hover { color: var(--dsg-primary-hover); }
.dsg-reset svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Slider ---------- */
.dsg-slider { position: relative; border-radius: var(--dsg-radius); overflow: hidden; background: var(--dsg-surface); }
.dsg-slider-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.dsg-slider-arrow, .dsg-slider-zoom {
  position: absolute; display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85); color: #333; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: background-color 150ms;
}
.dsg-slider-arrow:hover, .dsg-slider-zoom:hover { background: #fff; }
.dsg-slider-arrow { top: 50%; transform: translateY(-50%); }
.dsg-slider-arrow--prev { left: 12px; }
.dsg-slider-arrow--next { right: 12px; }
.dsg-slider-zoom { left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: var(--dsg-radius-sm); }
.dsg-slider svg, .dsg-zoom svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.dsg-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.dsg-thumb {
  width: 56px; height: 56px; border: 2px solid var(--dsg-border); border-radius: var(--dsg-radius-sm);
  overflow: hidden; padding: 0; transition: border-color 150ms;
}
.dsg-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dsg-thumb:hover, .dsg-thumb.is-active { border-color: var(--dsg-primary); }

/* ---------- Tabs ---------- */
.dsg-tabs { border: 1px solid var(--dsg-border); border-radius: var(--dsg-radius-sm); overflow: hidden; }
.dsg-tabs-nav { display: flex; background: var(--dsg-surface); border-bottom: 1px solid var(--dsg-border); }
.dsg-tab-btn {
  flex: 1; padding: 10px 8px; text-align: center; color: var(--dsg-muted); font-size: 14px;
  border-right: 1px solid var(--dsg-border); transition: color 150ms, background-color 150ms;
}
.dsg-tab-btn:last-child { border-right: 0; }
.dsg-tab-btn:hover { color: var(--dsg-text); }
.dsg-tab-btn.is-active { color: var(--dsg-primary); background: #fff; }
.dsg-tab-panel { display: none; padding: 12px 12px 8px; max-height: 200px; overflow: hidden; }
.dsg-tab-panel.is-active { display: block; }
.dsg-tab-panels.is-expanded .dsg-tab-panel { max-height: none; }
.dsg-tab-panel h1, .dsg-tab-panel h2, .dsg-tab-panel h3 { font-size: 12px; font-weight: 700; color: var(--dsg-text); margin: 0 0 8px; }
.dsg-tab-panel p { margin: 0 0 8px; }
.dsg-tab-panel ul { padding-left: 18px; margin: 0 0 8px; }
.dsg-tab-panel li p { margin: 0 0 4px; }
.dsg-read-more {
  display: none; width: 100%; padding: 6px; text-align: center; color: #fff;
  background: var(--dsg-primary); transition: background-color 150ms;
}
.dsg-read-more:hover { background: var(--dsg-primary-hover); }
.dsg-tabs.has-overflow .dsg-read-more { display: block; }

/* ---------- Accordeons ---------- */
.dsg-accordions { display: flex; flex-direction: column; gap: 8px; }
.dsg-acc {
  border: 2px solid var(--dsg-border); border-radius: var(--dsg-radius); overflow: hidden;
  transition: border-color 120ms; background: #fff;
}
.dsg-acc.is-hidden { display: none; }
.dsg-acc.has-error { border-color: var(--dsg-error); }
.dsg-acc.has-warning:not(.has-error) { border-color: var(--dsg-warning); }
.dsg-acc:not(.has-error):not(.has-warning):hover,
.dsg-acc.is-open:not(.has-error):not(.has-warning) { border-color: var(--dsg-primary); }
.dsg-acc-hdr {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 15px; background: var(--dsg-surface); cursor: pointer; user-select: none;
  font-size: 14px; line-height: 20px;
}
.dsg-acc-title { min-width: 0; }
.dsg-acc-sel { color: var(--dsg-muted); font-size: 12px; }
.dsg-acc-chevron { flex-shrink: 0; width: 20px; height: 20px; transition: transform var(--dsg-dur-acc); }
.dsg-acc-chevron svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dsg-acc.is-open .dsg-acc-chevron { transform: rotate(180deg); }
.dsg-acc-body { display: none; }
.dsg-acc-body-inner { padding: 10px; }
.dsg-acc-error { display: none; color: var(--dsg-error); font-size: 12px; margin: 0 0 8px; }
.dsg-acc-error.is-visible { display: block; }
.dsg-acc-hint { color: var(--dsg-muted); font-size: 12px; margin: 0 0 8px; }

/* ---------- Optiekaarten ---------- */
.dsg-grid { display: grid; gap: 8px; grid-template-columns: repeat(var(--dsg-cols, 3), minmax(0, 1fr)); }
@media (max-width: 480px) {
  .dsg-grid { grid-template-columns: repeat(min(var(--dsg-cols, 3), 3), minmax(0, 1fr)); }
}
.dsg-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 12px 8px; text-align: center; border: 2px solid var(--dsg-border); border-radius: var(--dsg-radius);
  background: #fff; cursor: pointer; user-select: none; transition: border-color 120ms, background-color 120ms;
}
.dsg-card:hover { border-color: var(--dsg-primary); }
.dsg-card.is-active { border-color: var(--dsg-primary); background: var(--dsg-badge); }
.dsg-card.is-unavailable { opacity: 0.4; pointer-events: none; }
.dsg-card.is-gone, .dsg-card.is-overflow { display: none; }
.dsg-card-radio {
  position: absolute; top: 6px; left: 6px; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--dsg-border); background: #fff; transition: border-color 120ms, background-color 120ms;
}
.dsg-card.is-active .dsg-card-radio { border-color: var(--dsg-primary); background: var(--dsg-primary); box-shadow: inset 0 0 0 2px #fff; }
/* Zoals de demo: het radio-rondje alleen op fotokaarten; tekst-/kleurkaarten tonen hun keuze via rand + achtergrond */
.dsg-card--text .dsg-card-radio, .dsg-card--colour .dsg-card-radio { display: none; }
.dsg-card--text { min-height: 48px; }
.dsg-card-img { display: flex; gap: 4px; width: 100%; justify-content: center; align-items: center; }
.dsg-card-img img { max-height: 180px; border-radius: var(--dsg-radius-sm); object-fit: contain; }
.dsg-card-img img + img { max-width: 50%; }
.dsg-card-swatch { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.dsg-card-label { font-size: 12px; line-height: 16px; }
.dsg-card-sub { display: none; font-size: 11px; line-height: 14px; color: var(--dsg-muted); }
.dsg-card-sub.is-visible { display: block; }
.dsg-more {
  display: none; width: 100%; margin-top: 8px; padding: 6px; text-align: center; color: #fff;
  background: var(--dsg-primary); border-radius: var(--dsg-radius-sm); transition: background-color 150ms;
}
.dsg-more:hover { background: var(--dsg-primary-hover); }
.dsg-more.is-visible { display: block; }

/* ---------- Verpakkingsinfo ---------- */
.dsg-pack { display: none; margin-top: 10px; padding: 10px 12px; background: var(--dsg-badge); border-radius: var(--dsg-radius-sm); font-size: 13px; }
.dsg-pack.is-visible { display: block; }
.dsg-pack-title { font-weight: 700; margin: 0 0 4px; }
.dsg-pack table { border-collapse: collapse; }
.dsg-pack td { padding: 1px 12px 1px 0; }

/* ---------- Upload ---------- */
/* (specifieker dan Bootstraps input[type="file"] { display: block }) */
.dsg input[type="file"].dsg-upload-input { display: none; }
.dsg-file-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.dsg-file-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dsg-file-remove { color: var(--dsg-error); font-size: 12px; text-decoration: underline; }

/* ---------- Bestelformulier ---------- */
.dsg-form { display: flex; flex-direction: column; gap: 14px; }
.dsg-field { display: flex; flex-direction: column; gap: 4px; }
.dsg-field--check { flex-direction: row; align-items: center; gap: 8px; }
.dsg-label { color: var(--dsg-primary); font-size: 14px; font-weight: 500; line-height: 20px; }
.dsg-label--inline { cursor: pointer; font-weight: 400; color: var(--dsg-text); }
.dsg-label--inline a { color: var(--dsg-primary); text-decoration: underline; }
.dsg-required { color: var(--dsg-error); margin-left: 3px; }
.dsg-input-wrap {
  display: flex; align-items: stretch; overflow: hidden; border: 1px solid var(--dsg-border);
  border-radius: var(--dsg-radius-sm); background: #fff; transition: border-color 120ms, box-shadow 120ms;
}
.dsg-input-wrap:focus-within { border-color: var(--dsg-primary); box-shadow: 0 0 0 3px var(--dsg-focus); }
.dsg-input-wrap.has-error { border-color: var(--dsg-error); border-width: 2px; }
.dsg-input-wrap--file { cursor: pointer; }
.dsg-input-icon {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px;
  background: var(--dsg-surface); color: #555; border-right: 1px solid var(--dsg-border); user-select: none;
}
.dsg-input-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dsg-input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 8px 10px; font: inherit; color: var(--dsg-text); background: transparent; box-shadow: none; }
.dsg-input-file-btn { padding: 5px 10px; align-self: center; margin-left: 6px; border: 1px solid #bbb; border-radius: 3px; background: #efefef; font-size: 13px; white-space: nowrap; }
.dsg-input-file-name { flex: 1; min-width: 0; padding: 8px 10px; color: var(--dsg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsg-field-error { display: none; color: var(--dsg-error); font-size: 12px; }
.dsg-field.has-error .dsg-field-error { display: block; }
.dsg-check {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; flex-shrink: 0; margin: 0;
  border: 2px solid var(--dsg-border); border-radius: 4px; background: #fff; cursor: pointer; position: relative;
  transition: border-color 120ms, background-color 120ms;
}
.dsg-check:checked { border-color: var(--dsg-primary); background: var(--dsg-primary); }
.dsg-check:checked::after {
  content: ''; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.dsg-field.has-error .dsg-check { border-color: var(--dsg-error); }
.dsg-submit {
  width: 100%; padding: 10px; color: #fff; font-weight: 700; text-align: center;
  background: var(--dsg-primary); border-radius: var(--dsg-radius-sm); transition: background-color 150ms;
}
.dsg-submit:hover { background: var(--dsg-primary-hover); }
.dsg-submit[disabled] { opacity: 0.6; cursor: default; }
.dsg-form-error { display: none; color: var(--dsg-error); font-size: 13px; margin: 0; }
.dsg-form-error.is-visible { display: block; }

/* ---------- Bedankt ---------- */
.dsg-thankyou { padding: 24px; border: 2px solid var(--dsg-primary); border-radius: var(--dsg-radius); background: var(--dsg-badge); }
.dsg-thankyou p:last-child { margin-bottom: 0; }

/* ---------- Overlays (zoom, voorwaarden) ---------- */
.dsg-overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 3100; display: none; align-items: center; justify-content: center; padding: 16px; }
.dsg-overlay.is-open { display: flex; }
.dsg-overlay-backdrop { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0, 0, 0, 0.6); }
.dsg-overlay-panel {
  position: relative; background: #fff; border-radius: var(--dsg-radius); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  max-width: 90vw; max-height: 90vh; overflow: auto; padding: 32px 20px 20px;
}
.dsg-overlay-panel--zoom { width: min(90vw, 1000px); padding: 32px 12px 12px; overflow: hidden; }
.dsg-overlay-panel--terms { width: 42rem; }
.dsg-overlay-close {
  position: absolute; top: 2px; right: 8px; z-index: 1; width: 32px; height: 32px; line-height: 1;
  font-size: 30px; color: #9ca3af; transition: color 150ms;
}
.dsg-overlay-close:hover { color: #374151; }
.dsg-zoom { position: relative; }
.dsg-zoom img { max-height: 80vh; margin: 0 auto; object-fit: contain; }
.dsg-zoom .dsg-slider-arrow { width: 40px; height: 40px; }

/* ---------- Laden / fout ---------- */
.dsg-message { padding: 20px 0; }
