/* ── Edit photos container ────────────────────────────────────────────────── */

.photos-edit {
  position: relative;
  border-radius: 10px;
  padding: 14px 10px;
  min-height: 54px;
  cursor: pointer;
  margin-top: 24px;
  transition: background 150ms ease;
}

.photos-edit.drag-over {
  background: rgba(138, 180, 204, 0.12);
}

.photos-edit-border {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */

.photos-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

.photos-empty-icon {
  display: block;
  opacity: 0.35;
  filter: invert(63%) sepia(20%) saturate(400%) hue-rotate(170deg);
}

.photos-empty-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #8ab4cc;
}

.photos-edit.has-photos .photos-empty-state {
  display: none;
}

/* ── Thumbnail grid ───────────────────────────────────────────────────────── */

.photos-grid {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
}

.photos-edit.has-photos .photos-grid {
  display: flex;
}

/* ── Individual thumbnail ─────────────────────────────────────────────────── */

.photos-thumb {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f0f0;
}

.photos-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 300ms ease;
}

.photos-thumb-img.loaded {
  opacity: 1;
}

/* ── Overlay (loading → uploading → done/error) ───────────────────────────── */

.photos-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  transition: opacity 300ms ease, background 200ms ease;
  pointer-events: none;
}

/* Fade out once image has loaded (normal state — no upload in progress) */
.photos-thumb-img.loaded ~ .photos-thumb-overlay {
  opacity: 0;
}

/* Re-show overlay while uploading */
.photos-thumb--uploading .photos-thumb-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.40);
}

/* Keep overlay visible on done, but very subtle so the image shows through */
.photos-thumb--done .photos-thumb-overlay {
  opacity: 1;
  background: rgba(40, 160, 100, 0.55);
}

/* Red tint on error */
.photos-thumb--error .photos-thumb-overlay {
  opacity: 1;
  background: rgba(200, 40, 40, 0.65);
}

.photos-thumb-spinner {
  width: 22px;
  height: 22px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Remove button ────────────────────────────────────────────────────────── */

.photos-thumb-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 150ms ease, background 150ms ease;
}

.photos-thumb:hover .photos-thumb-remove {
  opacity: 1;
}

.photos-thumb-remove:hover {
  background: rgba(210, 45, 45, 0.88);
}

/* ── "Add more" tile ──────────────────────────────────────────────────────── */

.photos-add-more {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  border: 1.5px dashed #c8dce8;
  background: transparent;
  color: #8ab4cc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.photos-add-more:hover {
  background: rgba(138, 180, 204, 0.12);
  border-color: #8ab4cc;
  color: #5a9ab8;
}

/* ── View photos container ────────────────────────────────────────────────── */

.photos-view {
  position: relative;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: padding 200ms ease;
}

.photos-view-border {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

/* ── View empty state ─────────────────────────────────────────────────────── */

.photos-view-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.photos-view-icon {
  display: block;
  opacity: 0.35;
  filter: invert(63%) sepia(20%) saturate(400%) hue-rotate(170deg);
}

.photos-view-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #8ab4cc;
}

/* ── View image grid (tight, read-only) ───────────────────────────────────── */

.photos-view-grid {
  display: none;
}

.photos-view.has-photos {
  padding: 0;
  overflow: hidden;
}

.photos-view.has-photos .photos-view-border {
  display: none;
}

.photos-view.has-photos .photos-view-empty {
  display: none;
}

.photos-view.has-photos .photos-view-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 3px;
}

.photos-view-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
