/* ── Viewport 3D (remplace l'image produit) ─────────────────────────────── */
.cu-gallery-replace {
    width: 100%;
    position: relative;
}
#cu-viewport {
    position: relative;
    background: #f2f3f5;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;   /* carré, comme la galerie WC */
    min-height: 300px;
}
#cu-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
.cu-viewport-hint {
    position: absolute;
    bottom: 10px;
    left: 12px;
    font-size: 11px;
    color: #999;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.cu-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f3f5;
    color: #777;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Panneau configuration ──────────────────────────────────────────────── */
#cu-panel {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}
.cu-section { display: flex; flex-direction: column; gap: 6px; }
.cu-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 2px;
}
.cu-section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.cu-section-title-row .cu-section-title { margin-bottom: 0; }
.cu-add-stage-btn {
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border: 1px solid #378ADD;
    border-radius: 6px;
    background: #f0f6fc;
    color: #1a6daa;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
.cu-add-stage-btn:hover { background: #e0eefa; }

#cu-stages { display: flex; flex-direction: column; gap: 10px; }
.cu-stage {
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fcfcfc;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cu-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cu-stage-title { font-size: 12px; font-weight: 600; color: #444; }
.cu-stage-actions { display: flex; gap: 4px; }
.cu-stage-actions button {
    width: 24px; height: 24px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    background: #fff;
    color: #777;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    font-family: inherit;
    transition: all .15s;
}
.cu-stage-actions button:hover { border-color: #999; color: #333; }
.cu-stage-remove:hover { border-color: #d63638 !important; color: #d63638 !important; background: #fcebec; }
.cu-stage-move-up:disabled,
.cu-stage-move-down:disabled { opacity: .3; cursor: not-allowed; }

.cu-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.cu-field-group { display: flex; flex-direction: column; gap: 4px; }
.cu-field-group label { font-size: 12px; color: #555; }
.cu-field-group select,
.cu-field-group input[type=number] {
    padding: 7px 9px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 13px;
    width: 100%;
    background-color: #fafafa !important;
    color: #1a1a1a !important;
    box-sizing: border-box;
    -webkit-appearance: menulist;
    appearance: menulist;
}
.cu-field-group select option {
    background-color: #fff !important;
    color: #1a1a1a !important;
}
.cu-stage select,
.cu-stage input[type=number] { background: #fff; }

.cu-stage-features {
    border-top: 1px dashed #ddd;
    margin-top: 4px;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cu-features-title {
    font-size: 10.5px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.cu-stage-features .cu-field-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #444;
    cursor: pointer;
}
.cu-stage-features .cu-field-group label input[type=checkbox] {
    width: 14px; height: 14px; cursor: pointer; accent-color: #378ADD; margin: 0;
}
.cu-stage-features select:disabled,
.cu-stage-features input:disabled {
    background: #f2f2f2 !important;
    color: #aaa !important;
    cursor: not-allowed;
}

.cu-qty-row { display: flex; align-items: center; gap: 10px; }
.cu-qty-row input[type=range] { flex: 1; accent-color: #378ADD; }
.cu-qty-row span { font-size: 13px; font-weight: 600; min-width: 40px; text-align: right; }
.cu-estimation {
    background: #f7f7f7;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: .9rem 1rem;
}
.cu-est-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #888;
    margin-bottom: 8px;
}
.cu-est-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 0;
    color: #555;
}
.cu-est-row span:last-child { font-weight: 500; color: #1a1a1a; }
.cu-est-total {
    border-top: 1px solid #ddd;
    margin-top: 5px;
    padding-top: 7px;
    font-weight: 600;
}
.cu-est-total span:last-child { color: #1a6daa !important; font-size: 17px; }
.cu-est-note { font-size: 11px; color: #bbb; margin-top: 7px; }
.cu-add-to-cart {
    width: 100%;
    padding: 13px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s;
    font-family: inherit;
}
.cu-add-to-cart:hover    { background: #333; }
.cu-add-to-cart:disabled { background: #aaa; cursor: not-allowed; }

/* ── Écran de choix initial : upload STEP vs configuration manuelle ──────── */
.cu-mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.cu-mode-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 18px 16px;
    border: 1.5px solid #e2e2e2;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: all .15s;
    color: #1a1a1a;
}
.cu-mode-card svg { color: #378ADD; }
.cu-mode-card:hover {
    border-color: #378ADD;
    background: #f0f6fc;
    transform: translateY(-1px);
}
.cu-mode-card-title { font-size: 14px; font-weight: 600; }
.cu-mode-card-desc { font-size: 12px; color: #777; line-height: 1.4; }

/* ── Bouton retour vers l'écran de choix ──────────────────────────────────── */
.cu-back-row { margin-bottom: 4px; }
.cu-back-btn {
    background: none;
    border: none;
    color: #1a6daa;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
    margin-bottom: 6px;
    display: inline-block;
}
.cu-back-btn:hover { text-decoration: underline; }

/* ── Zone d'upload du fichier STEP ────────────────────────────────────────── */
.cu-dropzone {
    border: 2px dashed #cfd4da;
    border-radius: 10px;
    padding: 26px 16px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    background: #fafbfc;
}
.cu-dropzone:hover,
.cu-dropzone.cu-dropzone-drag {
    border-color: #378ADD;
    background: #f0f6fc;
}
.cu-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 13px;
    line-height: 1.5;
}
.cu-dropzone-content svg { color: #999; }
.cu-dropzone-hint { font-size: 11px; color: #aaa; }

.cu-step-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f0f6fc;
    border: 1px solid #cfe2f3;
    border-radius: 8px;
    font-size: 13px;
    color: #1a1a1a;
    margin-top: 8px;
}
.cu-step-file-info svg { color: #1a6daa; flex-shrink: 0; }
.cu-step-file-info span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cu-step-file-info button {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}
.cu-step-file-info button:hover { color: #d63638; }

.cu-step-error {
    font-size: 12.5px;
    color: #d63638;
    background: #fcebec;
    border: 1px solid #f3c6c8;
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 8px;
}

.cu-step-progress {
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}
.cu-step-progress-bar {
    height: 100%;
    background: #378ADD;
    transition: width .2s;
    width: 0%;
}

.cu-help-inline {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 8px;
}
.cu-dropzone-small { padding: 16px 12px; }
.cu-dropzone-small .cu-dropzone-content { gap: 5px; }
.cu-dropzone-small svg { width: 24px; height: 24px; }
