/* ============================================================
   Mode C — Quick batch from photos
   Page-specific styles for seller/products-import-photos.html
   Imports css/product-shared.css for shared form controls.
   ============================================================ */

/* ---- Stage machine ---- */
.stage { display: none; }
.stage.active { display: block; animation: stageIn 0.25s ease-out; }

@keyframes stageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ---- Drop zone (Stage A) ---- */
#dropZone.is-dragover {
  border-color: #6366F1;
  background: #EEF2FF;
  transform: scale(1.005);
}

#dropZone:focus-visible {
  outline: 2px solid #6366F1;
  outline-offset: 2px;
}

/* ---- Group row (Stage B) ---- */
.group-row {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  align-items: center;
}

.group-row__thumbs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}

.group-row__thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #fff center/cover no-repeat;
  border: 1px solid #E2E8F0;
  flex-shrink: 0;
  position: relative;
}

.group-row__thumb.is-primary::after {
  content: 'PRIMARY';
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 7px;
  font-weight: 800;
  background: #6366F1;
  color: #fff;
  padding: 1px 4px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.group-row__thumb-more {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #E2E8F0;
  color: #475569;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.group-row__body {
  flex: 1;
  min-width: 0;
}

.group-row__title {
  font-size: 14px;
  font-weight: 700;
  color: #1E293B;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-row__meta {
  font-size: 12px;
  color: #64748B;
  margin: 2px 0 0;
}

@media (max-width: 480px) {
  .group-row { padding: 10px; gap: 10px; }
  .group-row__thumb,
  .group-row__thumb-more { width: 44px; height: 44px; border-radius: 8px; }
}

/* ---- Editor (Stage D) ---- */
#editorImages {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.editor-img-strip {
  position: absolute;
  inset: 0;
  display: flex;
  transition: transform 0.25s ease-out;
  will-change: transform;
}

.editor-img-strip > img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-img-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 2;
}

.editor-img-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease;
}

.editor-img-dot.is-active {
  background: #fff;
  width: 16px;
  border-radius: 3px;
}

.editor-img-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  z-index: 2;
}

/* swipe-card animation when advancing */
#editorCard.is-leaving {
  animation: cardLeave 0.18s ease-in forwards;
}

#editorCard.is-entering {
  animation: cardEnter 0.22s ease-out;
}

@keyframes cardLeave {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-20px); }
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0);    }
}

/* ---- Toast ---- */
#toast {
  transition: opacity 0.2s ease;
}

#toast.is-visible {
  opacity: 1;
}

/* ---- Inline error state on inputs ---- */
.ns-input.is-error {
  border-color: #EF4444;
  background: #FEF2F2;
}

/* ---- Sticky action row on tiny viewports ---- */
@media (max-width: 480px) {
  /* Ensure the editor card's action row is reachable above mobile chrome */
  #stage-editor #editorCard .border-t {
    position: sticky;
    bottom: 0;
    z-index: 5;
  }
}

/* ---- Reduce motion ---- */
@media (prefers-reduced-motion: reduce) {
  .stage.active,
  #editorCard.is-leaving,
  #editorCard.is-entering,
  .editor-img-strip {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================
   Baseline form controls — wrapped in :where() so worker-8's
   css/product-shared.css always wins on specificity. These exist
   only so the page renders cleanly if product-shared.css has not
   landed yet. Remove later once t-008 is on disk.
   ============================================================ */
:where(.ns-input) {
  width: 100%;
  appearance: none;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: #1E293B;
  min-height: 44px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
:where(.ns-input:focus) {
  outline: none;
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.15);
}
:where(.ns-input::placeholder) { color: #94A3B8; }

:where(.ns-error) {
  margin-top: 6px;
  font-size: 12px;
  color: #DC2626;
  font-weight: 600;
}

/* Visually-hidden helper used by file inputs */
:where(.sr-only) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
