/* ============================================================
   Bauzuschnitt Konfigurator – Frontend Styles
   ============================================================ */

/* Wrapper – bricht aus engen Produkt-Spalten heraus */
.bz-konfigurator-wrapper {
  font-family: inherit;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Konfigurator Body */
.bz-kfg-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0;
  min-height: 480px;
}

@media (max-width: 860px) {
  .bz-kfg-body {
    grid-template-columns: 1fr;
  }
  .bz-kfg-preview-area {
    border-top: 1px solid #e0e0e0;
  }
}

/* Konfigurator-Card */
.bz-kfg-card {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.bz-kfg-header {
  background: linear-gradient(135deg, #1a3a5c 0%, #2563a0 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bz-kfg-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

/* Schritt-Indikator */
.bz-steps {
  display: flex;
  background: #f5f7fa;
  border-bottom: 1px solid #e0e0e0;
  overflow-x: auto;
  padding: 0;
}

.bz-step-item {
  flex: 1;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px 8px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  user-select: none;
}

.bz-step-item:hover {
  background: #eef2f7;
}

.bz-step-item.active {
  border-bottom-color: #2563a0;
  background: #fff;
}

.bz-step-item.done .bz-step-num {
  background: #28a745;
  color: #fff;
}

.bz-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dee2e6;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 4px;
  transition: background 0.2s;
}

.bz-step-item.active .bz-step-num {
  background: #2563a0;
  color: #fff;
}

.bz-step-label {
  font-size: 0.7rem;
  text-align: center;
  color: #666;
  line-height: 1.2;
}

.bz-step-item.active .bz-step-label {
  color: #2563a0;
  font-weight: 600;
}


/* Linke Seite: Formulare */
.bz-kfg-form-area {
  padding: 20px;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  min-width: 0;
  overflow-x: hidden;
}

.bz-kfg-form-area h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1a3a5c;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e8f0fe;
}

/* Rechte Seite: SVG-Vorschau */
.bz-kfg-preview-area {
  background: #f8f9fa;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.bz-preview-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 12px;
}

.bz-svg-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  min-height: 300px;
}

.bz-svg-container svg {
  max-width: 100%;
  max-height: 360px;
}

/* Formular-Elemente */
.bz-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.bz-input-group label {
  min-width: 80px;
  font-size: 0.875rem;
  color: #444;
}

.bz-input-mm {
  width: 100px;
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.875rem;
  transition: border-color 0.15s;
}

.bz-input-mm:focus {
  outline: none;
  border-color: #2563a0;
  box-shadow: 0 0 0 3px rgba(37,99,160,0.15);
}

.bz-input-mm.error {
  border-color: #dc3545;
}

.bz-unit {
  font-size: 0.8rem;
  color: #888;
}

.bz-max-hint {
  font-size: 0.75rem;
  color: #aaa;
}

/* Tabellarische Eingaben (Bohrungen, Gewinde) */
.bz-items-table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.bz-items-table th {
  background: #f0f4f8;
  padding: 6px 8px;
  text-align: left;
  font-weight: 600;
  color: #444;
  border-bottom: 1px solid #dee2e6;
}

.bz-items-table td {
  padding: 4px 8px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.bz-items-table input {
  width: 70px;
  padding: 4px 6px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  font-size: 0.8rem;
}

.bz-items-table select {
  padding: 4px 6px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  font-size: 0.8rem;
}

.bz-btn-add-row {
  background: none;
  border: 1px dashed #2563a0;
  color: #2563a0;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.bz-btn-add-row:hover {
  background: #e8f0fe;
}

.bz-btn-remove {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 1rem;
  line-height: 1;
}

.bz-btn-remove:hover {
  color: #a71d2a;
}

/* Fase: Kanten-Auswahl */
.bz-edge-selector {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 6px;
  max-width: 300px;
  margin: 16px auto;
}

.bz-edge-btn {
  padding: 8px;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  font-size: 0.8rem;
  background: #fff;
  transition: all 0.2s;
}

.bz-edge-btn:hover {
  border-color: #2563a0;
}

.bz-edge-btn.selected {
  border-color: #2563a0;
  background: #e8f0fe;
  color: #2563a0;
  font-weight: 600;
}

.bz-plate-icon {
  grid-column: 2;
  grid-row: 2;
  background: #e0e8f0;
  border: 2px solid #2563a0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #666;
  padding: 12px 6px;
}

/* Preisanzeige */
.bz-price-summary {
  background: #f0f7ff;
  border: 1px solid #b8d4f0;
  border-radius: 6px;
  padding: 16px;
  margin-top: 16px;
}

.bz-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 3px 0;
  color: #555;
}

.bz-price-row.total {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a3a5c;
  border-top: 2px solid #b8d4f0;
  margin-top: 8px;
  padding-top: 8px;
}

.bz-price-note {
  font-size: 0.75rem;
  color: #888;
  margin-top: 6px;
}

/* Navigation Buttons */
.bz-kfg-footer {
  padding: 16px 24px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.bz-btn-nav {
  padding: 9px 20px;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bz-btn-back {
  background: #e9ecef;
  color: #444;
}

.bz-btn-back:hover {
  background: #dee2e6;
}

.bz-btn-next {
  background: #2563a0;
  color: #fff;
}

.bz-btn-next:hover {
  background: #1a4a7a;
}

.bz-btn-cart {
  background: #28a745;
  color: #fff;
  padding: 11px 24px;
  font-size: 1rem;
}

.bz-btn-cart:hover {
  background: #1e7e34;
}

.bz-btn-cart:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

/* Validierungsmeldungen */
.bz-validation-error {
  background: #fff3f3;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #721c24;
  margin-bottom: 12px;
}

.bz-validation-error ul {
  margin: 0;
  padding-left: 18px;
}

/* Meldung wenn kein Konfigurator nötig (Platte passt genau) */
.bz-exact-fit-note {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #155724;
}

/* SVG-Stile (inline, werden von Vue gesetzt) */
.bz-svg-plate-outer   { fill: #e8eef4; stroke: #7a9ab5; stroke-width: 1.5; }
.bz-svg-plate-inner   { fill: #fff; stroke: #2563a0; stroke-width: 2; }
.bz-svg-cut-line      { stroke: #dc3545; stroke-width: 1.5; stroke-dasharray: 6,3; fill: none; }
.bz-svg-fase-line     { stroke: #fd7e14; stroke-width: 2; fill: none; }
.bz-svg-bohrung       { fill: none; stroke: #6f42c1; stroke-width: 1.5; }
.bz-svg-bohrung-cross { stroke: #6f42c1; stroke-width: 1; }
.bz-svg-gewinde       { fill: none; stroke: #e83e8c; stroke-width: 1.5; }
.bz-svg-fraesung      { stroke: #fd7e14; stroke-width: 2; fill: none; stroke-linecap: round; }
.bz-svg-dim-line      { stroke: #888; stroke-width: 1; marker-end: url(#arrowhead); }
.bz-svg-dim-text      { font-size: 10px; fill: #555; font-family: monospace; }

/* Loading-Overlay */
.bz-loading {
  padding: 40px;
}

/* ── Phase 2: Share + Zeichnung + Saved ───────────────────────────────────── */

.bz-btn-share {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  margin-left: 8px;
  flex-shrink: 0;
}
.bz-btn-share:hover      { background: rgba(255,255,255,0.25); }
.bz-btn-share.copied     { background: rgba(40,167,69,0.6); }

.bz-drawing-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bz-btn-drawing {
  flex: 1;
  padding: 8px 14px;
  background: #f0f4f8;
  border: 1px solid #b8cce4;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #1a3a5c;
  cursor: pointer;
  transition: background 0.2s;
}
.bz-btn-drawing:hover    { background: #dce8f4; }
.bz-btn-drawing:disabled { opacity: 0.6; cursor: not-allowed; }

.bz-btn-drawing-dl {
  padding: 8px 14px;
  background: #1a3a5c;
  color: white;
  border-radius: 4px;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.bz-btn-drawing-dl:hover { background: #2563a0; color: white; }

.bz-saved-section {
  border-top: 1px solid #e8e8e8;
  padding-top: 12px;
}

/* ── Responsive / Mobile ─────────────────────────────────────────────────── */


/* Mobile: kompakte Darstellung */
@media (max-width: 600px) {
  .bz-kfg-header h3 {
    font-size: 1rem;
  }

  .bz-kfg-form-area {
    padding: 14px;
  }

  .bz-kfg-preview-area {
    padding: 14px;
  }

  /* Schritte: horizontal scrollbar, Labels kleiner */
  .bz-steps {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .bz-steps::-webkit-scrollbar { display: none; }

  .bz-step-item {
    min-width: 60px;
    padding: 8px 4px 6px;
  }

  .bz-step-label {
    font-size: 0.65rem;
  }

  /* Eingabefelder: volle Breite auf Mobile */
  .bz-input-group {
    flex-wrap: wrap;
  }

  .bz-input-mm {
    width: 100%;
    font-size: 1rem;           /* Verhindert Auto-Zoom auf iOS */
    padding: 10px;
    min-height: 44px;          /* Touch-Target */
  }

  /* Tabellen-Inputs: größer für Touch */
  .bz-items-table input,
  .bz-items-table select {
    width: 60px;
    min-height: 36px;
    font-size: 0.875rem;
    padding: 4px;
  }

  /* Footer-Buttons: full-width auf sehr kleinen Screens */
  .bz-kfg-footer {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
  }

  .bz-btn-nav {
    flex: 1;
    min-width: 100px;
    justify-content: center;
    min-height: 44px;
  }

  .bz-btn-cart {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
  }

  /* Kanten-Auswahl (Fase): kompakter */
  .bz-edge-selector {
    max-width: 260px;
    gap: 4px;
  }

  .bz-edge-btn {
    padding: 6px 4px;
    font-size: 0.75rem;
    min-height: 44px;          /* Touch-Target */
  }

  /* Preiszusammenfassung */
  .bz-price-summary {
    padding: 12px;
  }

  /* Zeichnungs-Buttons */
  .bz-drawing-actions {
    flex-direction: column;
  }
  .bz-btn-drawing, .bz-btn-drawing-dl {
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 44px;
  }
}
