/* ==========================================
   Product Edit V2 — split editor + preview
   ========================================== */

.edit-v2 {
  display: flex;
  gap: 28px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  font-size: 14px;
  line-height: 1.6;
  align-items: flex-start;
}

/* ── Toolbar (sticky) ── */
.edit-v2-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0c0c0d;
  border-bottom: 1px solid #2a2a2c;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.edit-v2-toolbar h2 {
  font-size: 16px;
  font-weight: 500;
  color: #ddd;
  margin: 0;
}

.edit-v2-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.edit-v2-btn-save {
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.edit-v2-btn-save:hover { background: #2563eb; }

.edit-v2-btn-cancel {
  background: transparent;
  color: #999;
  border: 1px solid #3a3a3c;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.edit-v2-btn-cancel:hover { border-color: #666; color: #ccc; }

/* ── Editor panel (left) ── */
.edit-v2-editor {
  flex: 1 1 580px;
  min-width: 0;
}

.edit-v2-section {
  background: #1a1a1b;
  border: 1px solid #2a2a2c;
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 14px;
}

.edit-v2-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #999;
}
.edit-v2-section-header svg { opacity: 0.5; }

/* ── Form fields ── */
.edit-v2-field {
  margin-bottom: 14px;
}
.edit-v2-field:last-child { margin-bottom: 0; }

.edit-v2-field label {
  display: block;
  font-size: 12px;
  color: #777;
  margin-bottom: 4px;
  font-weight: 500;
}

.edit-v2-field input[type="text"],
.edit-v2-field input[type="number"],
.edit-v2-field textarea,
.edit-v2-field select {
  width: 100%;
  padding: 9px 11px;
  font-size: 14px;
  background: #0c0c0d;
  border: 1px solid #2a2a2c;
  border-radius: 8px;
  color: #ddd;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.edit-v2-field input:focus,
.edit-v2-field textarea:focus,
.edit-v2-field select:focus {
  border-color: #3b82f6;
}

.edit-v2-field textarea {
  min-height: 200px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.5;
}

.edit-v2-field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* ── Field row (side by side) ── */
.edit-v2-row {
  display: flex;
  gap: 12px;
}
.edit-v2-row .edit-v2-field { flex: 1; }

/* ── Flash ── */
.edit-v2-flash {
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 13px;
  margin-bottom: 12px;
}
.edit-v2-flash-error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ── Image cards ── */
.edit-v2-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.edit-v2-image-card {
  background: #0c0c0d;
  border: 1px solid #2a2a2c;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s;
}
.edit-v2-image-card:hover { border-color: #3a3a3c; }
.edit-v2-image-card.is-new { border-style: dashed; border-color: #3b82f6; }

.edit-v2-image-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: #111;
}

.edit-v2-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #555;
  font-size: 12px;
  flex-direction: column;
  gap: 4px;
}

.edit-v2-image-body {
  padding: 10px 12px;
}

.edit-v2-image-body label {
  font-size: 11px;
  color: #666;
  display: block;
  margin-bottom: 3px;
}

.edit-v2-image-body input[type="file"] {
  font-size: 12px;
  color: #aaa;
  width: 100%;
}

.edit-v2-image-body input[type="number"] {
  width: 60px;
  padding: 4px 6px;
  font-size: 12px;
  background: #1a1a1b;
  border: 1px solid #2a2a2c;
  border-radius: 5px;
  color: #ddd;
  text-align: center;
}

.edit-v2-image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #f87171;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.edit-v2-image-remove:hover { background: rgba(239, 68, 68, 0.6); color: #fff; }

.edit-v2-image-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #888;
  margin-top: 6px;
}
.edit-v2-image-check input[type="checkbox"] {
  accent-color: #ef4444;
}

/* ── Add button ── */
.edit-v2-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px dashed #3a3a3c;
  color: #888;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  margin-top: 10px;
}
.edit-v2-add-btn:hover { border-color: #3b82f6; color: #3b82f6; }

/* ── Variant card ── */
.edit-v2-variant-card {
  background: #0c0c0d;
  border: 1px solid #2a2a2c;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
}

.edit-v2-variant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.edit-v2-variant-header span {
  font-size: 13px;
  font-weight: 500;
  color: #bbb;
}

/* ── Preview panel (right) ── */
.edit-v2-preview {
  flex: 0 0 320px;
  position: sticky;
  top: 60px;
}

.edit-v2-preview-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
  margin-bottom: 8px;
}

.edit-v2-preview-card {
  background: #1a1a1b;
  border: 1px solid #2a2a2c;
  border-radius: 14px;
  overflow: hidden;
}

.edit-v2-preview-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: #0c0c0d;
}
.edit-v2-preview-img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0c0c0d;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 13px;
}

.edit-v2-preview-body {
  padding: 16px;
}

.edit-v2-preview-title {
  font-size: 16px;
  font-weight: 600;
  color: #eee;
  margin-bottom: 4px;
}

.edit-v2-preview-game {
  font-size: 12px;
  color: #3b82f6;
  margin-bottom: 8px;
}

.edit-v2-preview-variants {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.edit-v2-preview-variant {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #0c0c0d;
  border-radius: 7px;
  font-size: 13px;
}
.edit-v2-preview-variant-name { color: #bbb; }
.edit-v2-preview-variant-price { color: #3b82f6; font-weight: 500; }

.edit-v2-preview-meta {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: #666;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .edit-v2 { flex-direction: column; }
  .edit-v2-preview {
    flex: 0 0 auto;
    width: 100%;
    position: static;
  }
}
