/* Scoped to the wizard roots so we do not reset the host theme. */
.aldorr-product-wizard,
.aldorr-keuzehulp,
.apw-popup {
  box-sizing: border-box;
  color: #1a1a1a;
}

.aldorr-product-wizard *,
.aldorr-product-wizard *::before,
.aldorr-product-wizard *::after,
.aldorr-keuzehulp *,
.aldorr-keuzehulp *::before,
.aldorr-keuzehulp *::after,
.apw-popup *,
.apw-popup *::before,
.apw-popup *::after {
  box-sizing: border-box;
}

.apw-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* Progress */
.apw-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 36px;
}
.apw-progress-step {
  flex: 1;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  transition: background 0.3s;
}
.apw-progress-step.done,
.apw-progress-step.active { background: #f5a623; }

/* ── Vraag ── */
.apw-question h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.3;
}
.apw-question h2 .apw-sub {
  font-weight: 400;
  font-size: 16px;
  color: #555;
}
.apw-question .apw-text { margin-bottom: 28px; }
.apw-question .apw-text p {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}
.apw-question .apw-text p + p { margin-top: 8px; }

/* Answer cards */
.apw-options { display: grid; gap: 16px; }
.apw-options.cols-4 { grid-template-columns: repeat(4, 1fr); }
.apw-options.cols-3 { grid-template-columns: repeat(3, 1fr); }
.apw-options.cols-2 { grid-template-columns: repeat(2, 1fr); }

.apw-card {
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  font-family: inherit;
  padding: 0;
}
.apw-card:hover { border-color: #bbb; box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.apw-card:focus-visible { outline: 2px solid #f5a623; outline-offset: 2px; }
.apw-card.selected { border-color: #f5a623; border-width: 2px; }

.apw-card-img {
  width: 100%;
  aspect-ratio: 16/9;   /* overridden per question via imageOrientation */
  overflow: hidden;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.apw-card-img img { width: 100%; height: 100%; object-fit: cover; }
.apw-card-img img.fit { object-fit: contain; padding: 10px; }
.apw-placeholder {
  font-size: 12px;
  color: #aaa;
  text-align: center;
  padding: 12px;
}

.apw-card-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.apw-card.text-only { flex-direction: row; align-items: center; min-height: 56px; }
.apw-card.text-only .apw-card-label { padding: 16px 20px; font-size: 14px; }

.apw-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ccc;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s;
}
.apw-card.selected .apw-radio { border-color: #f5a623; }
.apw-card.selected .apw-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: #f5a623;
  border-radius: 50%;
}

/* Navigation */
.apw-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
}
.apw-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, background 0.2s;
  font-family: inherit;
}
.apw-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.apw-btn-prev { background: #fff; border: 1.5px solid #d0d0d0; color: #444; }
.apw-btn-prev:hover:not(:disabled) { border-color: #999; }
.apw-btn-next { background: #135492; color: #fff; }
.apw-btn-next:hover:not(:disabled) { background: #0f4478; }

/* Results */
.apw-results h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.apw-results > p { font-size: 14px; color: #666; margin-bottom: 28px; }

.apw-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.apw-product {
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.apw-product.best { border-color: #f5a623; border-width: 2.5px; }
.apw-product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #f5a623;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
}
.apw-product-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.apw-product-img img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.apw-product-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.apw-product-name { font-size: 15px; font-weight: 700; margin-bottom: 12px; line-height: 1.4; }

.apw-criteria { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.apw-criterion {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #444;
  line-height: 1.4;
}
.apw-criterion.miss { color: #999; }
.apw-criterion .icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.apw-criterion .icon.match { background: #28a745; }
.apw-criterion .icon.no-match { background: #e0e0e0; }
.apw-criterion .icon svg { width: 10px; height: 10px; }

.apw-product-price { font-size: 20px; font-weight: 700; margin-top: auto; margin-bottom: 12px; }
.apw-product-price .apw-stock {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #28a745;
  margin-top: 2px;
}
.apw-product-price .apw-stock.out { color: #c0392b; }
.apw-product-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #28a745;
  color: #fff;
  padding: 13px 18px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.apw-product-btn:hover { background: #218838; }

.apw-restart { margin-top: 32px; text-align: center; }
.apw-restart button {
  background: none;
  border: 1.5px solid #ccc;
  border-radius: 4px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s;
}
.apw-restart button:hover { border-color: #888; color: #222; }

@media (max-width: 768px) {
  .apw-options.cols-4, .apw-options.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .apw-results-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .apw-options.cols-4, .apw-options.cols-3, .apw-options.cols-2 { grid-template-columns: 1fr; }
}

/* Popup */
.apw-popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.apw-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.apw-popup-panel {
  position: relative;
  background: #f7f7f7;
  border-radius: 10px;
  width: min(1000px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.apw-popup-panel .apw-wrap { padding: 40px 24px 48px; }
.apw-popup-close {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 12px 0 0;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  font-size: 24px;
  line-height: 1;
  color: #444;
  cursor: pointer;
  font-family: inherit;
}
.apw-popup-close:hover { background: #eee; color: #000; }

@media (max-width: 600px) {
  .apw-popup-panel { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
}
