/* Listing editor styles */

.editor-wrap { max-width: 880px; margin: 0 auto; padding: var(--space-2xl) var(--space-lg); }

.editor-back { color: var(--gray-600); text-decoration: none; font-size: 0.9rem; }
.editor-back:hover { color: var(--accent); }

.editor-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin: var(--space-md) 0 var(--space-2xl);
}
.editor-header h1 { font-size: 1.75rem; flex: 1; }
.save-indicator {
  font-size: 0.85rem;
  color: var(--gray-500);
}
.save-indicator.saving { color: var(--accent); }
.save-indicator.saved  { color: #0a7d3a; }
.save-indicator.error  { color: #b81e1e; }

.editor-section {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}
.editor-section h2 {
  font-size: 1.15rem;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--gray-100);
}
.editor-section h2 .hint {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-left: var(--space-sm);
}

.field { display: block; margin-bottom: var(--space-lg); }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 0.9rem; }
.field .desc { color: var(--gray-500); font-size: 0.82rem; margin-bottom: 6px; }
.field input[type=text],
.field input[type=number],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 68, 255, 0.12);
}
.field .required { color: #c00; }

/* Unit-suffixed input */
.unit-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
}
.unit-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 68, 255, 0.12);
}
.unit-input input {
  border: none !important;
  border-radius: 0 !important;
  flex: 1;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.95rem;
}
.unit-input input:focus { outline: none; box-shadow: none !important; }
.unit-input .unit {
  background: var(--gray-50);
  color: var(--gray-600);
  padding: 10px 14px;
  font-size: 0.9rem;
  border-left: 1px solid var(--gray-200);
  white-space: nowrap;
}

/* Auto-generated subtitle preview */
.subtitle-preview {
  background: var(--gray-50);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-sm);
}
.subtitle-preview__label {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 4px;
}
.subtitle-preview__text {
  font-weight: 500;
  color: var(--dark);
  font-size: 0.95rem;
}
.subtitle-preview__text.empty { color: var(--gray-400); font-weight: 400; }

/* Price-mode radio group */
.price-mode { display: flex; flex-direction: column; gap: var(--space-md); }
.radio-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
}
.radio-row:hover { border-color: var(--accent); background: rgba(0, 68, 255, 0.03); }
.radio-row input[type=radio] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
}
.radio-row input[type=radio]:checked ~ span { color: var(--accent); }
.price-amount-fields {
  padding: var(--space-md) var(--space-md) 0 36px;
  border-left: 2px solid var(--gray-100);
  margin-left: 8px;
}
.price-amount-fields.disabled { opacity: 0.4; pointer-events: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

/* Specs table */
.spec-list { display: grid; gap: 8px; margin-bottom: var(--space-md); }
.spec-row { display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 8px; }
.spec-row input {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
}
.spec-row .remove {
  width: 36px; height: 36px;
  border: none; background: transparent;
  color: var(--gray-400); cursor: pointer;
  font-size: 1.4rem;
  border-radius: var(--radius-md);
}
.spec-row .remove:hover { background: #fee; color: #c00; }
.add-spec-btn {
  background: transparent;
  border: 1px dashed var(--gray-300);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  color: var(--gray-600);
  cursor: pointer;
  width: 100%;
}
.add-spec-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Image uploader */
.dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(0, 68, 255, 0.04);
  color: var(--accent);
}
.dropzone input[type=file] { display: none; }
.dropzone strong { display: block; margin-bottom: 6px; }
.dropzone .help { font-size: 0.85rem; color: var(--gray-500); }

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
.image-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--gray-100);
  cursor: grab;
}
.image-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-tile.primary::after {
  content: "Hauptbild";
  position: absolute;
  top: 6px; left: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
}
.image-tile__remove {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.image-tile__remove:hover { background: #c00; }
.image-tile.uploading { opacity: 0.5; }
.image-tile.uploading::after {
  content: "↑";
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2rem;
  background: rgba(0, 68, 255, 0.5);
}
.image-tile.dragging { opacity: 0.4; }
.image-tile.drag-over { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Editor footer */
.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  flex-wrap: wrap;
}
.editor-footer .left, .editor-footer .right { display: flex; gap: var(--space-sm); }
.editor-footer .btn--danger {
  background: transparent;
  color: #c00;
  border: 1px solid #fcc;
}
.editor-footer .btn--danger:hover { background: #fee; }

.validation-list {
  background: #fff4dd;
  border: 1px solid #ffd980;
  color: #8a5a00;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
}
.validation-list ul { margin: 6px 0 0 var(--space-md); }
