/* =========================================
   CREATE / EDIT LISTING
========================================= */

.create-listing-page {
  max-width: 950px;
  margin: 20px auto 50px;
}

.create-listing-card {
  padding: 38px;

  background-color: #ffffff;

  border: 1px solid var(--border);
  border-radius: var(--radius-large);

  box-shadow: var(--shadow-medium);
}


/* =========================================
   PAGE HEADING
========================================= */

.create-listing-heading {
  margin-bottom: 28px;
}

.create-listing-heading .title {
  margin-bottom: 6px;
}

.create-listing-heading p {
  color: var(--muted);
}


/* =========================================
   FORM FIELDS
========================================= */

.create-listing-card .field {
  margin-bottom: 22px;
}

.create-listing-card .label {
  color: var(--text);
  font-weight: 700;
}


/* =========================================
   FORM SECTIONS
========================================= */

.create-form-section {
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.create-form-section:first-of-type {
  padding-top: 0;
  border-top: none;
}

.create-form-section-heading {
  display: flex;
  align-items: center;

  gap: 11px;

  margin-bottom: 20px;
}

.create-form-section-number {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 30px;
  height: 30px;
  min-width: 30px;

  color: #ffffff;
  background-color: var(--navy);

  border-radius: 50%;

  font-size: 0.78rem;
  font-weight: 800;
}

.create-form-section-heading strong {
  color: var(--navy);

  font-size: 1rem;
}


/* =========================================
   IMAGE UPLOAD
========================================= */

.listing-upload-box {
  padding: 24px;

  background: linear-gradient(
    135deg,
    #f8fafc,
    #fffaf3
  );

  border: 2px dashed var(--border-dark);
  border-radius: var(--radius);

  transition:
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.listing-upload-box:hover {
  background-color: #fffaf3;
  border-color: var(--orange);
}

.listing-upload-heading {
  margin-bottom: 18px;
}

.listing-upload-title {
  margin-bottom: 4px;

  color: var(--navy);

  font-weight: 800;
}

.listing-multi-upload .label {
  margin-bottom: 8px;
}

.listing-multi-upload input[type="file"] {
  display: block;
  max-width: 100%;
}

.listing-required {
  display: inline-block;

  margin-left: 5px;

  color: #c0392b;

  font-size: 0.75rem;
  font-weight: 700;
}

#listingImageCount {
  color: var(--muted);
  font-size: 0.82rem;
}


/* =========================================
   IMAGE PREVIEWS
========================================= */

.listing-image-preview {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fill,
      minmax(120px, 1fr)
    );

  gap: 12px;

  max-width: 650px;
  margin-top: 18px;
}

.listing-image-preview-item {
  position: relative;

  width: 100%;
  max-width: 150px;

  aspect-ratio: 1 / 1;

  overflow: hidden;

  background-color: #f5f7fa;

  border: 1px solid var(--border);
  border-radius: 10px;
}

.listing-image-preview-item img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
}

.listing-image-remove {
  position: absolute;

  top: 6px;
  right: 6px;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 26px;
  height: 26px;

  padding: 0;

  color: #ffffff;
  background-color: rgba(0, 0, 0, 0.72);

  border: none;
  border-radius: 50%;

  font-size: 18px;
  font-weight: 700;

  cursor: pointer;
}

.listing-image-remove:hover {
  background-color: rgba(0, 0, 0, 0.9);
}


/* =========================================
   FORM ACTIONS
========================================= */

.create-listing-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 10px;

  padding-top: 26px;
  margin-top: 6px;

  border-top: 1px solid var(--border);
}


/* =========================================
   MOBILE
========================================= */

@media screen and (max-width: 768px) {

  .create-listing-card {
    padding: 20px;
  }

  .create-listing-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .create-listing-actions .button {
    width: 100%;
  }

  .listing-upload-box {
    padding: 18px;
  }

  .listing-image-preview {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );

    max-width: 100%;
  }

  .listing-image-preview-item {
    max-width: none;
  }
}