/* ═══════════════════════════════════════════════════════════════
   KEUZEHULP — STYLING
   Hergebruikt CSS variabelen uit main.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Modal overlay ── */
#keuzehulpOverlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 24px 16px;
}
#keuzehulpOverlay.visible { display: flex; align-items: flex-start; justify-content: center; }

.kh-modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 1400px;
    margin: 24px auto;
    padding: 28px 32px;
    position: relative;
    animation: khFadeIn 0.2s ease;
}

@keyframes khFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.kh-close {
    position: absolute; top: 16px; right: 18px;
    background: none; border: none; font-size: 1.5em; color: var(--text-muted);
    cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: var(--radius-sm);
    transition: var(--transition);
}
.kh-close:hover { background: var(--bg); color: var(--text); }

.kh-modal-title {
    font-size: 1.1em; font-weight: 700; margin-bottom: 20px; color: var(--text);
}

/* ── Startscherm ── */
.kh-home-title {
    font-size: 0.92em; font-weight: 700; color: var(--text); margin-bottom: 12px;
    text-transform: uppercase; letter-spacing: 0.04em;
}

.kh-home-modes {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px;
}

.kh-mode-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 20px 16px; background: var(--surface); border: 2px solid var(--border);
    border-radius: var(--radius); cursor: pointer; transition: var(--transition);
    text-align: center; font-family: inherit;
}
.kh-mode-btn:hover { border-color: var(--primary-border); background: var(--primary-bg); }
.kh-mode-btn.active { border-color: var(--primary); background: var(--primary-bg); }

.kh-mode-icon { font-size: 1.8em; line-height: 1; }
.kh-mode-label { font-size: 0.95em; font-weight: 700; color: var(--text); }
.kh-mode-desc { font-size: 0.78em; color: var(--text-secondary); line-height: 1.3; }

.kh-category-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}

.kh-category-btn {
    display: flex; flex-direction: column; gap: 2px;
    padding: 16px 18px; background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius); cursor: pointer; transition: var(--transition);
    text-align: left; font-family: inherit;
}
.kh-category-btn:hover { border-color: var(--primary); background: var(--primary-bg); }

.kh-cat-label { font-size: 0.92em; font-weight: 700; color: var(--text); }
.kh-cat-sub { font-size: 0.78em; color: var(--text-secondary); }

/* ── Wizard ── */
.kh-wizard { max-width: 600px; margin: 0 auto; }

.kh-progress {
    height: 4px; background: var(--border-light); border-radius: 2px;
    margin-bottom: 6px; overflow: hidden;
}
.kh-progress-bar {
    height: 100%; background: var(--primary); border-radius: 2px;
    transition: width 0.3s ease;
}
.kh-progress-text {
    font-size: 0.75em; color: var(--text-muted); margin-bottom: 20px;
}

.kh-question {
    font-size: 1.05em; font-weight: 700; color: var(--text); margin-bottom: 6px;
}
.kh-sublabel {
    font-size: 0.84em; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.4;
}

.kh-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }

.kh-option {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius); cursor: pointer; transition: var(--transition);
    text-align: left; font-family: inherit; width: 100%;
}
.kh-option:hover { border-color: var(--primary-border); background: var(--primary-bg); }
.kh-option.selected { border-color: var(--primary); background: var(--primary-bg); box-shadow: 0 0 0 1px var(--primary); }

.kh-option-img {
    width: 140px; height: 100px; object-fit: contain;
    background: var(--surface-hover); border: 1px solid var(--border);
    border-radius: var(--radius-sm); flex-shrink: 0; cursor: zoom-in;
    transition: var(--transition);
}
.kh-option-img:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.kh-option-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.kh-option-label { font-size: 0.9em; font-weight: 600; color: var(--text); }
.kh-option-desc { font-size: 0.78em; color: var(--text-secondary); }
.kh-option-price {
    font-size: 0.85em; font-weight: 700; color: var(--primary);
    white-space: nowrap; letter-spacing: 1px;
}

/* ── Navigatie knoppen ── */
.kh-nav { display: flex; align-items: center; gap: 10px; }
.kh-spacer { flex: 1; }

.kh-btn {
    padding: 10px 20px; border: none; border-radius: var(--radius);
    cursor: pointer; font-size: 0.88em; font-weight: 600; font-family: inherit;
    transition: var(--transition); display: inline-flex; align-items: center; gap: 6px;
}
.kh-btn-primary { background: var(--primary); color: #fff; }
.kh-btn-primary:hover { background: var(--primary-light); }
.kh-btn-primary.disabled { opacity: 0.4; cursor: not-allowed; }

.kh-btn-secondary { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.kh-btn-secondary:hover { background: var(--surface-hover); }
.kh-btn-gold { background: linear-gradient(135deg, #c4a47a, #aa8860); color: #fff; border: 1px solid #9a7850; font-weight: 600; }
.kh-btn-gold:hover { background: linear-gradient(135deg, #d4b48a, #b89870); box-shadow: 0 2px 8px rgba(170,136,96,0.3); }

.kh-btn-sm { padding: 6px 14px; font-size: 0.82em; }
.kh-btn-lg { padding: 14px 32px; font-size: 0.95em; }

/* ── Vergelijkingstabel ── */
.kh-table-header {
    display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.kh-table-title {
    font-size: 0.95em; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text);
}

.kh-table-scroll { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }

.kh-table {
    width: 100%; border-collapse: collapse; font-size: 0.84em;
}

.kh-table th, .kh-table td {
    padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border-light);
    white-space: nowrap; vertical-align: top;
}

.kh-th-feature { font-weight: 600; color: var(--text-secondary); min-width: 140px; }
.kh-th-product {
    font-weight: 700; color: var(--text); text-align: center; min-width: 100px;
    position: relative;
}
.kh-product-img {
    display: block; max-width: 80px; max-height: 60px; margin: 0 auto 6px;
    border-radius: 4px; object-fit: contain; cursor: pointer;
}
.kh-product-img-caption {
    display: block; font-size: 0.65em; color: var(--text-muted);
    text-align: center; margin-bottom: 4px; line-height: 1.3;
}
.kh-product-label {
    display: block; text-align: center;
}
.kh-show-more-imgs {
    display: block; margin: 4px auto 0; padding: 2px 10px;
    font-size: 0.65em; color: var(--primary); background: none;
    border: 1px solid var(--primary); border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition);
}
.kh-show-more-imgs:hover { background: var(--primary-bg); }

/* ── Gallery overlay ── */
.kh-gallery-overlay {
    position: fixed; inset: 0; z-index: 2100;
    background: rgba(15,23,42,0.75); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 24px; cursor: pointer;
}
.kh-gallery-modal {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 24px 28px;
    max-width: 800px; width: 100%; max-height: 85vh; overflow-y: auto;
    position: relative; cursor: default;
}
.kh-gallery-close {
    position: absolute; top: 12px; right: 14px;
    background: none; border: none; font-size: 1.4em; color: var(--text-muted);
    cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm);
}
.kh-gallery-close:hover { background: var(--bg); color: var(--text); }
.kh-gallery-title { font-size: 1em; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.kh-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.kh-gallery-item { text-align: center; }
.kh-gallery-img {
    width: 100%; max-height: 160px; object-fit: contain;
    border-radius: var(--radius); border: 1px solid var(--border);
    cursor: pointer; transition: var(--transition);
}
.kh-gallery-img:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.kh-gallery-caption { font-size: 0.8em; color: var(--text-muted); margin-top: 4px; display: block; }

.kh-th-product.kh-aanbevolen {
    background: var(--primary-bg); border-top: 3px solid var(--primary);
}
.kh-th-wensen {
    font-weight: 600; color: var(--text-muted); text-align: center;
    background: var(--border-light); min-width: 100px;
}

.kh-badge {
    display: block; font-size: 0.7em; font-weight: 700; color: var(--primary);
    text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px;
}

.kh-score-row { border-bottom: 2px solid var(--border); }
.kh-score-label { font-weight: 700; color: var(--text); }
.kh-td-score { font-weight: 700; font-size: 1.05em; color: var(--primary); }

.kh-td-label { font-weight: 500; color: var(--text-secondary); }
.kh-td-value { text-align: center; color: var(--text); }
.kh-td-value.kh-aanbevolen { background: var(--primary-bg); }

.kh-td-value.kh-val-yes { color: var(--success); font-weight: 600; }
.kh-td-value.kh-val-no { color: var(--text-muted); }

.kh-td-value.kh-greyed {
    color: var(--text-muted); opacity: 0.5;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        rgba(0,0,0,0.03) 4px,
        rgba(0,0,0,0.03) 8px
    );
}
.kh-td-value.kh-mismatch {
    color: var(--danger); font-weight: 600;
}

.kh-td-wensen {
    text-align: center; color: var(--text-muted); font-style: italic;
    background: var(--border-light);
}
.kh-wens-answer {
    display: block; font-style: normal; color: var(--text); font-weight: 500;
}
.kh-wens-question {
    display: block; font-size: 0.75em; color: var(--text-muted); font-style: italic;
    margin-top: 2px;
}

/* ── Categorie-tabs (vergelijkingstabel) ── */
.kh-cat-tabs {
    display: flex; gap: 4px; margin-bottom: 12px;
    border-bottom: 2px solid var(--border-light); padding-bottom: 0;
}
.kh-cat-tab {
    padding: 8px 18px; border: none; background: none; cursor: pointer;
    font-size: 0.88em; font-weight: 600; font-family: inherit;
    color: var(--text-muted); border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: var(--transition);
}
.kh-cat-tab:hover { color: var(--text); }
.kh-cat-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Uitgebreid toggle ── */
.kh-extended-toggle {
    margin-bottom: 12px; display: flex; justify-content: flex-end;
}
.kh-toggle-label {
    font-size: 0.82em; color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; gap: 6px; font-weight: 500;
}
.kh-toggle-label input[type="checkbox"] { cursor: pointer; }

/* ── Resultaatscherm ── */
.kh-result-nav {
    display: flex; gap: 8px; margin-bottom: 20px;
}

.kh-advies-card {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    color: #fff; padding: 24px 28px; border-radius: var(--radius-lg);
    margin-bottom: 24px; text-align: center;
}
.kh-advies-label {
    font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.08em;
    opacity: 0.7; margin-bottom: 6px;
}
.kh-advies-product { font-size: 1.4em; font-weight: 800; margin-bottom: 2px; }
.kh-advies-cat { font-size: 0.88em; opacity: 0.7; margin-bottom: 8px; }
.kh-advies-reason { font-size: 0.82em; opacity: 0.8; }

.kh-use-product {
    text-align: center; margin-top: 24px; padding-top: 16px;
    border-top: 1px solid var(--border);
}

.kh-empty {
    text-align: center; padding: 40px 20px; color: var(--text-muted);
    font-size: 0.92em; line-height: 2;
}

/* ── Cel-afbeeldingen en opmerking ── */
.kh-cell-imgs {
    display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; margin-top: 4px;
}
.kh-cell-img {
    cursor: pointer; display: inline-block; position: relative;
}
.kh-cell-img img {
    max-width: 80px; max-height: 60px; border: 1.5px solid var(--border);
    border-radius: 4px; opacity: 0.9; transition: var(--transition);
    vertical-align: middle;
}
.kh-cell-img:hover img {
    opacity: 1; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border-color: var(--primary);
}
.kh-cell-img::after {
    content: '\1F50D'; position: absolute; bottom: 2px; right: 2px;
    font-size: 0.65em; background: rgba(255,255,255,0.85); border-radius: 3px;
    padding: 0 3px; opacity: 0; transition: opacity 0.15s;
    pointer-events: none;
}
.kh-cell-img:hover::after { opacity: 1; }
.kh-cell-img-caption {
    display: block; font-size: 0.65em; color: var(--text-muted);
    line-height: 1.2; margin-top: 1px; text-align: center;
    max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kh-cell-remark {
    font-size: 0.75em; color: var(--text-muted); font-style: italic;
    line-height: 1.2; margin-top: 2px;
}

/* ── Lightbox ── */
.kh-lightbox {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 24px; animation: khFadeIn 0.15s ease;
}
.kh-lightbox-box {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); max-width: 90vw; max-height: 90vh;
    overflow: hidden; display: flex; flex-direction: column;
}
.kh-lightbox-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border-light);
    font-size: 0.88em; font-weight: 600; color: var(--text);
}
.kh-lightbox-close {
    background: none; border: none; font-size: 1.4em; color: var(--text-muted);
    cursor: pointer; padding: 2px 8px; border-radius: var(--radius-sm);
    line-height: 1;
}
.kh-lightbox-close:hover { background: var(--bg); color: var(--text); }
.kh-lightbox-img {
    max-width: 85vw; max-height: 80vh; object-fit: contain;
    display: block; padding: 16px;
}
.kh-lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.9); border: 1px solid var(--border);
    border-radius: 50%; width: 36px; height: 36px; font-size: 1.4em;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: var(--transition); line-height: 1;
}
.kh-lightbox-nav:hover { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.kh-lightbox-prev { left: 8px; }
.kh-lightbox-next { right: 8px; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .kh-modal { padding: 20px 16px; margin: 8px; }
    .kh-home-modes { grid-template-columns: 1fr; }
    .kh-category-grid { grid-template-columns: 1fr; }
    .kh-table { font-size: 0.78em; }
    .kh-table th, .kh-table td { padding: 8px 10px; }
    .kh-lightbox { padding: 8px; }
    .kh-lightbox-box { max-width: 98vw; max-height: 95vh; }
    .kh-lightbox-img { max-width: 95vw; max-height: 75vh; padding: 8px; }
    .kh-lightbox-nav { width: 32px; height: 32px; font-size: 1.2em; }
}
