/* Bound only the floor-plan and video cards in listing step 2. */
#listingForm .listing-media-uploader {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

#listingForm .listing-media-uploader > .media-upload-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
}

#listingForm .media-upload-card.has-attached-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-rows: auto auto auto;
  align-content: start;
  align-items: center;
  column-gap: 10px;
  row-gap: 10px;
  min-width: 0;
}

#listingForm .media-upload-card.has-attached-media > .listing-filter-label {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

#listingForm .media-upload-card.has-attached-media > .media-file-dropzone {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#listingForm .media-upload-card.has-attached-media .media-file-dropzone .file-upload-button {
  position: static;
  top: auto;
  right: auto;
  max-width: 100%;
  white-space: nowrap;
}

#listingForm .media-upload-card.has-attached-media > .field-note:not([role="status"]) {
  display: none;
}

#listingForm .media-upload-card.has-attached-media .listing-media-upload-preview {
  position: static;
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  gap: 8px;
}

#listingForm .media-upload-card.has-attached-media .listing-media-upload-preview-visual {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 140px;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

#listingForm .media-upload-card.has-attached-media .listing-media-upload-preview-visual img,
#listingForm .media-upload-card.has-attached-media .listing-media-upload-preview-visual video,
#listingForm .media-upload-card.has-attached-media .listing-media-upload-preview-visual object,
#listingForm .media-upload-card.has-attached-media .listing-media-upload-preview-visual iframe,
#listingForm .media-upload-card.has-attached-media .listing-media-upload-preview-visual embed {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  box-sizing: border-box;
}

#listingForm .media-upload-card.has-attached-media .listing-media-upload-video-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#listingForm .media-upload-card.has-attached-media .listing-media-upload-preview-details {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 10px;
  overflow: hidden;
}

#listingForm .media-upload-card.has-attached-media .listing-media-upload-filename {
  display: block;
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#listingForm .media-upload-card.has-attached-media .listing-media-preview-open {
  flex: 0 0 auto;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#listingForm .media-upload-card.has-attached-media > [role="status"] {
  position: static;
  grid-column: 1 / -1;
  grid-row: 3;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  #listingForm .listing-media-uploader {
    grid-template-columns: minmax(0, 1fr);
  }
}
