/* Root Variables */
.edit-item-page {
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-100: #eff6ff;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #16a34a;
  --radius: 12px;

  background: var(--bg);
  padding: 24px;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  min-height: 100vh;
}

/* Container */
.edit-item-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

/* Card */
.edit-item-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  max-width: 100%;      /* all cards stretch equally */
  margin: 0 auto;       /* center them */
}
.edit-item-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Ensure the form doesn’t shrink inside its card */
.edit-item-form {
  width: 100%;          /* takes full card width */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}



/* Header */
.edit-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 16px;
}

/* Left side (Back + Title/Sub stacked nicely) */
.edit-item-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.edit-item-header-left .back-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}
.edit-item-header-left .back-link:hover {
  text-decoration: underline;
}
.edit-item-header-left .title {
  font-size: 20px;
  font-weight: 700;
}
.edit-item-header-left .sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* Right side (Duplicate + Delete inline) */
.edit-item-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.edit-item-header-actions form {
  margin: 0;
}


/* Form */
.edit-item-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}

/* Section titles */
.edit-item-section {
  grid-column: 1 / -1;
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--brand);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Fields */
.edit-item-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.edit-item-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.edit-item-desc {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

/* Inputs */
.edit-item-input,
.edit-item-select,
.edit-item-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.edit-item-input:focus,
.edit-item-select:focus,
.edit-item-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  outline: none;
}
.edit-item-textarea {
  min-height: 100px;
  resize: vertical;
}

/* Buttons */
.edit-item-btn {
  border-radius: 8px;
  padding: 0 18px;
  height: 42px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.edit-item-btn.primary {
  background: var(--brand);
  color: #fff;
}
.edit-item-btn.primary:hover {
  background: var(--brand-hover);
}
.edit-item-btn.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}
.edit-item-btn.ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.edit-item-btn.danger {
  background: var(--danger);
  color: #fff;
}
.edit-item-btn.danger:hover {
  background: var(--danger-hover);
}

/* Actions */
.edit-item-actions {
  grid-column: 1 / -1;
  margin-top: 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: var(--card);
}

/* Preview */
.edit-item-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.edit-item-tile {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.edit-item-tile strong {
  font-size: 16px;
}
.edit-item-image img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  max-width: 100%;
}

/* Responsive */
@media (max-width: 900px) {
  .edit-item-form {
    grid-template-columns: 1fr;
  }
  .edit-item-preview {
    grid-template-columns: 1fr;
  }
  .edit-item-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
