/* Amazon one-click bundle modal. Shared by Home, Create, and Canvas. */
body.amazon-bundle-modal-open { overflow: hidden; }

.amazon-bundle-overlay {
  --amazon-bg: #0b0e10;
  --amazon-deep: #080a0c;
  --amazon-surface: #121618;
  --amazon-raised: #181d20;
  --amazon-active: #202629;
  --amazon-line: rgba(255,255,255,.11);
  --amazon-line-strong: rgba(255,255,255,.24);
  --amazon-text: #f1f3f2;
  --amazon-muted: #a4acaa;
  --amazon-dim: #7d8784;
  --amazon-action: #f2f2f0;
  --amazon-action-soft: rgba(255,255,255,.055);
  --amazon-success: #71c29a;
  --amazon-error: #ff7464;
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5,6,8,.78);
  backdrop-filter: blur(8px);
  font-family: var(--app-font-ui, "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif);
}

.amazon-bundle-overlay[hidden] { display: none; }

.amazon-bundle-dialog {
  width: min(1040px, 100%);
  max-height: min(900px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--amazon-text);
  background: var(--amazon-surface);
  border: 1px solid var(--amazon-line);
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0,0,0,.58);
  outline: none;
}

.amazon-bundle-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.amazon-bundle-kicker {
  margin: 0 0 6px;
  color: var(--amazon-muted);
  font-size: 11px;
  font-weight: 650;
}

.amazon-bundle-header h2 {
  margin: 0;
  color: var(--amazon-text);
  font-size: 18px;
  font-weight: 760;
  line-height: 1.3;
}

.amazon-bundle-header p:last-child {
  max-width: 62ch;
  margin: 6px 0 0;
  color: var(--amazon-muted);
  font-size: 12px;
  line-height: 1.55;
}

.amazon-bundle-close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--amazon-muted);
  background: rgba(255,255,255,.04);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.amazon-bundle-close:hover,
.amazon-bundle-close:focus-visible {
  border-color: var(--amazon-line-strong);
  color: var(--amazon-text);
  background: var(--amazon-action-soft);
  outline: none;
}

.amazon-bundle-body {
  min-height: 0;
  display: grid;
  gap: 16px;
  overflow: auto;
  padding: 18px 22px;
  scrollbar-color: rgba(255,255,255,.22) transparent;
  scrollbar-width: thin;
}

.amazon-bundle-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr);
  gap: 10px;
}

.amazon-bundle-upload {
  min-height: 96px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  border: 1px dashed rgba(255,255,255,.24);
  border-radius: 6px;
  color: var(--amazon-text);
  background: rgba(255,255,255,.035);
  cursor: pointer;
  text-align: center;
}

.amazon-bundle-upload:hover {
  border-color: rgba(255,255,255,.42);
  background: rgba(255,255,255,.06);
}

.amazon-bundle-upload:focus-visible {
  border-color: var(--amazon-line-strong);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.1);
}

.amazon-bundle-upload input { display: none; }
.amazon-bundle-upload-icon { color: var(--amazon-text); }
.amazon-bundle-upload small { color: var(--amazon-dim); }

.amazon-bundle-source-preview {
  min-height: 96px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 6px;
  background: var(--amazon-deep);
}

.amazon-bundle-source-preview img {
  width: 100%;
  height: 96px;
  object-fit: contain;
}

.amazon-bundle-fields {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 10px;
}

.amazon-bundle-brand-field { grid-template-columns: minmax(0, 1fr); }

.amazon-bundle-intake {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.amazon-bundle-intake-text,
.amazon-bundle-intake-file {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--amazon-line-strong);
  border-radius: 5px;
  color: var(--amazon-muted);
  background: rgba(255,255,255,.025);
  font-size: 11px;
  font-weight: 650;
}

.amazon-bundle-intake-text textarea {
  width: 100%;
  min-height: 72px;
  box-sizing: border-box;
  border: 1px solid var(--amazon-line);
  border-radius: 4px;
  color: var(--amazon-text);
  background: var(--amazon-deep);
  padding: 8px 10px;
  font: 11px/1.45 var(--app-font-ui, "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif);
  resize: vertical;
}

.amazon-bundle-intake-text small,
.amazon-bundle-intake-file small {
  color: var(--amazon-dim);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
}

.amazon-bundle-intake-file {
  justify-content: center;
  align-items: center;
  border-style: dashed;
  text-align: center;
  cursor: pointer;
}

.amazon-bundle-intake-file:hover {
  border-color: var(--amazon-action);
  background: var(--amazon-action-soft);
}

.amazon-bundle-intake-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.amazon-bundle-intake-file-title { color: var(--amazon-text); font-size: 13px; }
.amazon-bundle-intake-file strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--amazon-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amazon-bundle-fields label,
.amazon-bundle-count {
  display: grid;
  gap: 6px;
  color: var(--amazon-muted);
  font-size: 11px;
  font-weight: 650;
}

.amazon-bundle-fields input,
.amazon-bundle-fields textarea,
.amazon-bundle-count select,
.amazon-bundle-review-card select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--amazon-line);
  border-radius: 5px;
  color: var(--amazon-text);
  background: var(--amazon-deep);
  padding: 10px 12px;
  font: inherit;
}

.amazon-bundle-fields input { height: 42px; }
.amazon-bundle-fields textarea { resize: vertical; }

.amazon-bundle-fields input:focus,
.amazon-bundle-fields textarea:focus,
.amazon-bundle-count select:focus,
.amazon-bundle-review-card select:focus,
.amazon-bundle-review-card textarea:focus {
  border-color: var(--amazon-line-strong);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.1);
}

.amazon-bundle-config { padding-top: 0; }

.amazon-bundle-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.amazon-bundle-section-label {
  color: var(--amazon-text);
  font-size: 14px;
  font-weight: 760;
}

.amazon-bundle-config-head p {
  max-width: 68ch;
  margin: 4px 0 0;
  color: var(--amazon-dim);
  font-size: 11px;
  line-height: 1.5;
}

.amazon-bundle-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
}

.amazon-bundle-choice {
  position: relative;
  min-height: 146px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  height: 100%;
  box-sizing: border-box;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--amazon-line);
  border-radius: 5px;
  background: rgba(255,255,255,.025);
  cursor: pointer;
}

.amazon-bundle-choice:hover {
  border-color: rgba(255,255,255,.2);
  background: rgba(255,255,255,.05);
}

.amazon-bundle-choice.is-checked {
  border-color: var(--amazon-line-strong);
  background: var(--amazon-action-soft);
}

.amazon-bundle-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.amazon-bundle-choice-mark {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 2px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 3px;
}

.amazon-bundle-choice.is-checked .amazon-bundle-choice-mark {
  border-color: var(--amazon-action);
  background: var(--amazon-action);
  box-shadow: inset 0 0 0 3px var(--amazon-surface);
}

.amazon-bundle-choice strong,
.amazon-bundle-choice small,
.amazon-bundle-choice-warning { display: block; }

.amazon-bundle-choice-copy {
  min-width: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.amazon-bundle-choice strong {
  color: var(--amazon-text);
  font-size: 12px;
  font-weight: 700;
}

.amazon-bundle-choice small {
  margin-top: 2px;
  color: var(--amazon-dim);
  font-size: 10px;
  line-height: 1.35;
}

.amazon-bundle-choice-warning {
  margin-top: 3px;
  color: #f0a49b;
  font-size: 10px;
}

.amazon-bundle-choice-custom {
  width: 100%;
  min-height: 56px;
  box-sizing: border-box;
  margin-top: auto;
  border: 1px solid var(--amazon-line);
  border-radius: 4px;
  color: var(--amazon-text);
  background: var(--amazon-deep);
  padding: 7px 8px;
  font: 11px/1.4 var(--app-font-ui, "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif);
  resize: vertical;
}

.amazon-bundle-choice-custom::placeholder { color: var(--amazon-dim); }

.amazon-bundle-choice-custom:focus {
  border-color: var(--amazon-line-strong);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.1);
}

.amazon-bundle-choice-file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--amazon-dim);
  font-size: 10px;
}

.amazon-bundle-choice-file span {
  color: var(--amazon-muted);
  font-weight: 650;
}

.amazon-bundle-choice-file input {
  position: static;
  width: 100%;
  min-width: 0;
  height: 24px;
  opacity: 1;
  pointer-events: auto;
  color: var(--amazon-muted);
  font: 10px/1 var(--app-font-ui, "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif);
}

.amazon-bundle-choice-file small {
  grid-column: 1 / -1;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amazon-bundle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--amazon-muted);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.amazon-bundle-switch input {
  position: absolute;
  opacity: 0;
}

.amazon-bundle-switch span {
  width: 30px;
  height: 18px;
  border-radius: 5px;
  background: rgba(255,255,255,.16);
}

.amazon-bundle-switch input:checked + span {
  background: var(--amazon-action);
  box-shadow: inset 14px 0 0 #17191c;
}

.amazon-bundle-aplus-controls {
  display: grid;
  grid-template-columns: auto 90px;
  align-items: center;
  gap: 10px;
}

.amazon-bundle-aplus-controls .amazon-bundle-choice-grid {
  grid-column: 1 / -1;
}

.amazon-bundle-segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 5px;
  background: var(--amazon-deep);
}

.amazon-bundle-segmented button {
  border: 0;
  border-radius: 4px;
  padding: 7px 13px;
  color: var(--amazon-dim);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.amazon-bundle-segmented button:hover {
  color: var(--amazon-text);
  background: rgba(255,255,255,.06);
}

.amazon-bundle-segmented button.is-active {
  color: #fff;
  background: #2a2a2c;
  box-shadow: inset 0 -2px 0 rgba(255,255,255,.8);
}

.amazon-bundle-summary {
  min-height: 20px;
  color: var(--amazon-muted);
  font-size: 11px;
}

.amazon-bundle-review {
  display: grid;
  gap: 12px;
}

.amazon-bundle-review[hidden],
.amazon-bundle-progress[hidden] { display: none; }

.amazon-bundle-review-intro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--amazon-text);
  font-size: 13px;
}

.amazon-bundle-review-intro span {
  color: var(--amazon-muted);
  font-size: 11px;
  text-align: right;
}

.amazon-bundle-review-list {
  display: grid;
  gap: 8px;
}

.amazon-bundle-review-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--amazon-line);
  border-radius: 6px;
  background: var(--amazon-raised);
}

.amazon-bundle-review-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.amazon-bundle-review-card header div { min-width: 0; }
.amazon-bundle-review-card strong,
.amazon-bundle-review-card small { display: block; }
.amazon-bundle-review-card strong { color: var(--amazon-text); font-size: 13px; }
.amazon-bundle-review-card small { margin-top: 3px; color: var(--amazon-dim); font-size: 10px; }

.amazon-bundle-review-card label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--amazon-muted);
  font-size: 11px;
  white-space: nowrap;
}

.amazon-bundle-review-card select {
  width: auto;
  min-height: 34px;
  padding: 6px 9px;
  font-size: 11px;
}

.amazon-bundle-review-card textarea {
  width: 100%;
  min-height: 116px;
  box-sizing: border-box;
  border: 1px solid var(--amazon-line);
  border-radius: 5px;
  color: var(--amazon-text);
  background: var(--amazon-deep);
  padding: 10px;
  font: 12px/1.55 var(--app-font-mono, Consolas, monospace);
  resize: vertical;
}

.amazon-bundle-progress {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  background: rgba(255,255,255,.035);
}

.amazon-bundle-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  color: var(--amazon-text);
  font-size: 12px;
}

.amazon-bundle-progress-head span {
  color: var(--amazon-muted);
  font-size: 11px;
  text-align: right;
}

.amazon-bundle-result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 18px;
}

.amazon-bundle-result-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.amazon-bundle-result-row img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  margin-left: 10px;
  border-radius: 6px;
  object-fit: cover;
}

.amazon-bundle-result-label {
  min-width: 0;
  overflow: hidden;
  color: var(--amazon-text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amazon-bundle-result-state {
  color: var(--amazon-muted);
  font-size: 11px;
  white-space: nowrap;
}

.amazon-bundle-result-state[data-state="uploading"],
.amazon-bundle-result-state[data-state="processing"] { color: var(--amazon-text); }
.amazon-bundle-result-state[data-state="completed"] { color: var(--amazon-success); }
.amazon-bundle-result-state[data-state="failed"] { max-width: 58%; overflow: hidden; color: var(--amazon-error); text-overflow: ellipsis; white-space: nowrap; }

.amazon-bundle-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(255,255,255,.07);
  background: var(--amazon-surface);
}

.amazon-bundle-status {
  flex: 1;
  color: var(--amazon-muted);
  font-size: 11px;
}

.amazon-bundle-back,
.amazon-bundle-cancel,
.amazon-bundle-submit {
  min-height: 42px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.amazon-bundle-back {
  padding: 0 14px;
  border: 1px solid var(--amazon-line);
  color: var(--amazon-muted);
  background: var(--amazon-raised);
}

.amazon-bundle-back[hidden] { display: none; }

.amazon-bundle-back:hover,
.amazon-bundle-cancel:hover {
  border-color: rgba(255,255,255,.24);
  color: var(--amazon-text);
  background: var(--amazon-active);
}

.amazon-bundle-cancel {
  padding: 0 16px;
  border: 1px solid var(--amazon-line);
  color: var(--amazon-muted);
  background: transparent;
}

.amazon-bundle-submit {
  min-width: 154px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid transparent;
  color: #111315;
  background: var(--amazon-action);
}

.amazon-bundle-submit:hover:not(:disabled) {
  background: #fff;
  transform: translateY(-1px);
}

.amazon-bundle-submit:disabled {
  color: rgba(255,255,255,.55);
  background: #3b3e40;
  cursor: wait;
}

.amazon-bundle-submit:focus-visible,
.amazon-bundle-back:focus-visible,
.amazon-bundle-cancel:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.18);
}

@media (max-width: 720px) {
  .amazon-bundle-overlay { padding: 10px; }
  .amazon-bundle-dialog { max-height: calc(100vh - 20px); border-radius: 7px; }
  .amazon-bundle-header,
  .amazon-bundle-body,
  .amazon-bundle-footer { padding-left: 16px; padding-right: 16px; }
  .amazon-bundle-source-row,
  .amazon-bundle-fields,
  .amazon-bundle-intake { grid-template-columns: 1fr; }
  .amazon-bundle-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .amazon-bundle-review-intro { align-items: start; flex-direction: column; gap: 4px; }
  .amazon-bundle-review-intro span { text-align: left; }
  .amazon-bundle-progress-head { align-items: start; flex-direction: column; gap: 4px; }
  .amazon-bundle-progress-head span { text-align: left; }
  .amazon-bundle-config-head { align-items: start; flex-direction: column; }
  .amazon-bundle-footer { flex-wrap: wrap; }
  .amazon-bundle-status { flex-basis: 100%; }
}

@media (max-width: 520px) {
  .amazon-bundle-choice-grid { grid-template-columns: 1fr; }
  .amazon-bundle-review-card header { align-items: stretch; flex-direction: column; }
  .amazon-bundle-review-card label { justify-content: space-between; }
  .amazon-bundle-result-list { grid-template-columns: 1fr; }
  .amazon-bundle-footer { justify-content: stretch; }
  .amazon-bundle-back,
  .amazon-bundle-cancel,
  .amazon-bundle-submit { flex: 1 1 auto; }
}
