* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg-dark: #0a0e14;
  --color-bg-card: #141a22;
  --color-text-primary: #e8e8e8;
  --color-text-secondary: #9a9a9a;
  --color-text-muted: #5a5a5a;
  --color-accent: #e67e22;
  --color-accent-dark: #d67228;
  --color-blue: #4a90a4;
  --color-green: #2ecc71;
  --glass-bg: rgba(20, 26, 34, 0.6);
  --glass-border: rgba(74, 144, 164, 0.1);
  --transition-smooth: 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-bg-dark);
  color: var(--color-text-primary);
  min-height: 100vh;
  padding: 0 2rem 2rem 2rem;
}

.configurator-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn { to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }

.modal-content {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 3rem;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s ease forwards;
}

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

.modal-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--color-accent), #d67228);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 24px rgba(230, 126, 34, 0.3);
}

.modal-icon svg { width: 32px; height: 32px; color: white; }
.modal-title { font-size: 1.8rem; font-weight: 700; text-align: center; margin-bottom: 1rem; }
.modal-text { font-size: 1rem; line-height: 1.7; color: var(--color-text-secondary); text-align: center; margin-bottom: 2rem; }

.modal-button {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-smooth);
  font-family: inherit;
}

.modal-button:hover {
  background: var(--color-accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(230, 126, 34, 0.4);
}

/* HEADER - CLEAN & ZENTRIERT */
.configurator-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: 0.8rem;
}

.configurator-title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 1rem;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.configurator-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* GRID */
.configurator-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  align-items: start;
}

.steps-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* PROGRESS BAR */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), #d67228);
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s ease;
}

/* STEP CARDS */
.step-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 1.8rem;
  transition: all var(--transition-smooth);
  opacity: 0.5;
  pointer-events: none;
}

.step-card.active {
  opacity: 1;
  pointer-events: all;
  border-color: rgba(230, 126, 34, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.step-card.completed {
  opacity: 0.8;
  border-color: rgba(46, 204, 113, 0.3);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.step-number {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-accent), #d67228);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.step-card.completed .step-number {
  background: linear-gradient(135deg, var(--color-green), #27ae60);
}

.step-info h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.3rem; }
.step-info p { font-size: 0.9rem; color: var(--color-text-secondary); }

/* OPTIONS GRID */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.option-card {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.3rem;
  cursor: pointer;
  transition: all var(--transition-smooth);
  text-align: center;
  position: relative;
}

.option-card:hover {
  border-color: rgba(230, 126, 34, 0.3);
  transform: translateY(-3px);
}

.option-card.selected {
  border-color: var(--color-accent);
  background: rgba(230, 126, 34, 0.1);
}

.option-card.selected::before {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.option-icon { margin-bottom: 0.8rem; color: var(--color-accent); display: flex; align-items: center; justify-content: center; }
.option-icon svg { width: 48px; height: 48px; }
.option-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.option-desc { font-size: 0.85rem; color: var(--color-text-secondary); line-height: 1.4; margin-bottom: 0.8rem; }
.option-price { font-size: 0.9rem; font-weight: 600; color: var(--color-accent); }

/* CHECKBOX OPTIONS */
.checkbox-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.checkbox-card {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: all var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.checkbox-card:hover { border-color: rgba(230, 126, 34, 0.3); }
.checkbox-card.selected { border-color: var(--color-accent); background: rgba(230, 126, 34, 0.1); }

.checkbox-icon {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-text-muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkbox-card.selected .checkbox-icon { background: var(--color-accent); border-color: var(--color-accent); }
.checkbox-card.selected .checkbox-icon::after { content: '✓'; color: #fff; font-weight: 700; font-size: 0.9rem; }

.checkbox-content { flex: 1; }
.checkbox-title { font-weight: 700; margin-bottom: 0.3rem; }
.checkbox-desc { font-size: 0.85rem; color: var(--color-text-secondary); }
.checkbox-price { font-weight: 600; color: var(--color-accent); white-space: nowrap; font-size: 0.9rem; }

/* BUTTONS */
.step-navigation {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn {
  padding: 0.9rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-smooth);
  font-family: inherit;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  flex: 1;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-accent-dark);
  transform: translateY(-2px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex: 1;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* SUMMARY SIDEBAR */
.summary-sidebar {
  position: sticky;
  top: 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  height: fit-content;
}

.summary-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-header svg { color: var(--color-accent); }
.summary-title { font-size: 1.3rem; font-weight: 700; }

.summary-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  min-height: 100px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.summary-item-label { font-size: 0.9rem; color: var(--color-text-secondary); margin-bottom: 0.2rem; }
.summary-item-value { font-weight: 600; text-align: right; font-size: 0.9rem; }
.summary-item-price { font-size: 0.85rem; color: var(--color-accent); margin-top: 0.2rem; }

.summary-total {
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(230, 126, 34, 0.15), rgba(230, 126, 34, 0.05));
  border: 2px solid rgba(230, 126, 34, 0.3);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.summary-total-label { font-size: 0.9rem; color: var(--color-text-secondary); margin-bottom: 0.5rem; }
.summary-total-price { font-size: 2.5rem; font-weight: 900; color: var(--color-accent); line-height: 1; }
.summary-total-currency { font-size: 1.2rem; margin-right: 0.3rem; }
.summary-total-note { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 0.8rem; font-style: italic; }

.summary-cta { width: 100%; }
.empty-state { text-align: center; padding: 2rem; color: var(--color-text-muted); font-size: 0.9rem; }

/* FINAL SUMMARY */
.final-summary { padding: 2rem; background: rgba(0, 0, 0, 0.2); border-radius: 12px; margin-bottom: 2rem; }
.final-summary-divider { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }

.final-summary-section {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
}

.final-summary-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid rgba(230, 126, 34, 0.2);
}

.final-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  gap: 1rem;
}

.final-summary-row:last-child { border-bottom: none; }

.final-summary-row.highlight {
  background: rgba(230, 126, 34, 0.08);
  padding: 0.9rem;
  margin: 0.5rem -0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(230, 126, 34, 0.2);
}

.final-summary-row .label { font-size: 0.9rem; color: var(--color-text-secondary); }
.final-summary-row .value { font-size: 0.95rem; font-weight: 600; text-align: right; }
.final-summary-row.highlight .value { color: var(--color-accent); font-weight: 700; }

/* ========== 3D PREVIEW - FESTE GRÖSSE! ========== */
.preview-container {
  background: linear-gradient(135deg, rgba(10, 14, 20, 0.95), rgba(20, 26, 34, 0.95));
  border: 2px solid rgba(74, 144, 164, 0.3);
  border-radius: 16px;
  padding: 1.2rem;
  margin: 1.5rem 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(74, 144, 164, 0.2);
}

.preview-header svg { color: var(--color-blue); flex-shrink: 0; }
.preview-header span {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-blue);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* KRITISCH: Canvas mit MAX-HEIGHT! */
#preview3D {
  width: 100% !important;
  height: 300px !important;
  max-height: 300px !important;
  min-height: 200px !important;
  border-radius: 12px;
  cursor: grab;
  background: radial-gradient(ellipse at center, rgba(74, 144, 164, 0.05), rgba(10, 14, 20, 0.8));
  display: block;
  box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.3);
  object-fit: contain !important;
}

#preview3D:active { cursor: grabbing; }

.preview-controls {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.preview-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(74, 144, 164, 0.1);
  border: 1px solid rgba(74, 144, 164, 0.2);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.preview-hint svg { color: var(--color-blue); flex-shrink: 0; }

/* DIMENSIONS */
.dimensions-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.hint-box {
  background: rgba(74, 144, 164, 0.08);
  border: 1px solid rgba(74, 144, 164, 0.2);
  border-left: 4px solid var(--color-blue);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.hint-box svg { flex-shrink: 0; color: var(--color-blue); margin-top: 0.1rem; }

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.input-group label {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-group label svg { color: var(--color-accent); flex-shrink: 0; }

.input-group input[type="number"] {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--color-text-primary);
  transition: all var(--transition-smooth);
  font-family: inherit;
}

.input-group input[type="number"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.calculation-info {
  background: rgba(230, 126, 34, 0.08);
  border: 1px solid rgba(230, 126, 34, 0.2);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 0.5rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child { border-bottom: none; }
.info-label { font-size: 0.9rem; color: var(--color-text-secondary); font-weight: 500; }
.info-value { font-size: 1rem; color: var(--color-accent); font-weight: 700; }

.materials-container { animation: fadeInUp 0.4s ease; }

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

.summary-total-mobile { display: none; }

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 968px) {
  .configurator-grid { grid-template-columns: 1fr; }
  .summary-sidebar { position: relative; top: 0; order: -1; }
  
  .summary-total-mobile {
    display: block;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.15), rgba(230, 126, 34, 0.05));
    border: 2px solid rgba(230, 126, 34, 0.3);
    border-radius: 12px;
    margin-top: 2rem;
  }
  
  .options-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  body { padding: 0 1rem 1.5rem 1rem; }
  .configurator-container { padding-top: 1.5rem; }
  
  .configurator-header { margin-bottom: 2rem; }
  .section-label { font-size: 0.75rem; }
  .configurator-title { font-size: clamp(1.6rem, 6vw, 2.2rem); }
  .configurator-subtitle { font-size: 0.9rem; }
  
  /* 3D Canvas KLEINER auf Mobile */
  #preview3D {
    height: 220px !important;
    max-height: 220px !important;
    min-height: 180px !important;
  }
  
  .preview-container { padding: 1rem; margin: 1rem 0; }
  .preview-header span { font-size: 0.85rem; }
  .preview-hint { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
  
  /* KLEINERE BOXEN! */
  .step-card { padding: 1.2rem; border-radius: 12px; }
  .option-card { padding: 1rem; }
  .checkbox-card { padding: 0.9rem 1rem; }
  
  .input-group input[type="number"] { padding: 0.75rem 1rem; font-size: 0.95rem; }
  .hint-box { padding: 0.9rem; font-size: 0.85rem; }
  .calculation-info { padding: 0.9rem; }
  
  .step-navigation { flex-direction: column; gap: 0.8rem; }
  .btn { width: 100%; padding: 0.8rem 1.5rem; }
  
  .final-summary-row { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .final-summary-row .value { text-align: left; }
}

@media (max-width: 480px) {
  .configurator-title { font-size: 1.5rem !important; }
  .configurator-subtitle { font-size: 0.85rem; }
  
  /* 3D Canvas NOCH kleiner */
  #preview3D {
    height: 200px !important;
    max-height: 200px !important;
    min-height: 160px !important;
  }
  
  /* NOCH KLEINERE BOXEN! */
  .step-card { padding: 1rem; }
  .option-card { padding: 0.8rem; }
  .checkbox-card { padding: 0.8rem; }
  
  .option-icon svg { width: 40px; height: 40px; }
  .option-title { font-size: 0.9rem; }
  .option-desc { font-size: 0.8rem; }
  
  .summary-total-price { font-size: 1.8rem; }
}