/* =====================================================
   MULTI-STEP FORM — Progress & Step Indicators
   ===================================================== */

/*
 * Parent theme (style.css) hides every .add-listing-section when
 * .multi-step-form is present, and only shows .active sections.
 * Our custom step script uses .msf-active-section — override here.
 */
.submit-page.multi-step-form .add-listing-section {
  display: none !important;
}

.submit-page.multi-step-form .add-listing-section.msf-active-section,
.submit-page.multi-step-form .add-listing-section.active {
  display: block !important;
}

.submit-page.multi-step-form .custom-multistep-progress,
.submit-page.multi-step-form .form-progress-container.custom-multistep-progress {
  display: block !important;
}

.form-progress-container.custom-multistep-progress {
  display: block;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 32px;
}

/* Step strip wrapper */
.custom-multistep-steps {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  padding: 0 0 8px;
}

/* Connecting line between steps */
.custom-multistep-steps::before {
  content: "";
  position: absolute;
  top: 18px;
  left: calc(100% / 12);
  right: calc(100% / 12);
  height: 2px;
  background: #e0e0e0;
  z-index: 0;
}

/* Each step pill */
.custom-step-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: opacity 0.2s ease;
}

/* Circle */
.custom-step-item .custom-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #d8d8d8;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #bbb;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Label */
.custom-step-item .custom-step-label {
  font-size: 11px;
  font-weight: 500;
  color: #aaa;
  line-height: 1.3;
  max-width: 90px;
  transition: color 0.2s ease;
  word-break: break-word;
}

/* ---- PENDING state (default, future steps) ---- */
.custom-step-item.is-pending .custom-step-circle {
  border-color: #d8d8d8;
  background: #f9f9f9;
  color: #bbb;
}

.custom-step-item.is-pending .custom-step-label {
  color: #aaa;
}

/* ---- ACTIVE state ---- */
.custom-step-item.is-active .custom-step-circle {
  border-color: #66676b;
  background: #66676b;
  color: #fff;
  box-shadow: 0 4px 14px rgba(102, 103, 107, 0.35);
  transform: scale(1.12);
}

.custom-step-item.is-active .custom-step-label {
  color: #333;
  font-weight: 700;
}

/* ---- COMPLETE state ---- */
.custom-step-item.is-complete .custom-step-circle {
  border-color: #2f8f2f;
  background: #2f8f2f;
  color: #fff;
  box-shadow: 0 2px 8px rgba(47, 143, 47, 0.25);
}

.custom-step-item.is-complete .custom-step-circle span {
  display: none;
}

.custom-step-item.is-complete .custom-step-circle::after {
  content: "\2713";
  font-size: 16px;
  font-weight: 700;
}

.custom-step-item.is-complete .custom-step-label {
  color: #2f8f2f;
}

.custom-step-item.is-complete {
  cursor: pointer;
}

.custom-step-item.is-complete:hover .custom-step-circle {
  background: #246e24;
  border-color: #246e24;
}

/* ---- ERROR notice ---- */
.custom-step-error {
  background: #fff5f5;
  border-left: 3px solid #e74c3c;
  color: #c0392b;
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 18px;
  font-size: 13px;
}

/* =====================================================
   STEP DESCRIPTIONS (under section headings)
   ===================================================== */
.add-listing-section > .listing-step-description {
  width: 100%;
  flex: 0 0 100%;
  max-width: 100%;
  grid-column: 1 / -1;
  font-size: 14px;
  color: #5c5c5c;
  line-height: 1.65;
  margin: 4px 0 22px;
  padding: 12px 16px;
  background: #f7f8fa;
  border-left: 3px solid #f47920;
  border-radius: 0 6px 6px 0;
  word-break: break-word;
}

.add-listing-section.msf-active-section > .listing-step-description {
  margin-top: 0;
  margin-bottom: 24px;
}

.add-listing-section .add-listing-headline {
  width: 100%;
  flex: 0 0 100%;
  max-width: 100%;
}

.add-listing-section.msf-active-section > .listing-step-description,
.add-listing-section.active > .listing-step-description {
  display: block !important;
}

.add-listing-section .add-listing-headline + .listing-step-description {
  clear: both;
}

/* =====================================================
   ACTIVE SECTION CARD
   ===================================================== */
.add-listing-section.msf-active-section {
  background: #ffffff;
  border-radius: 6px;
  padding: 28px 28px 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
  margin-bottom: 20px;
  border: 1px solid #f0f0f0;
}

/* =====================================================
   NAVIGATION BUTTONS
   ===================================================== */
.custom-multistep-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.custom-multistep-nav .button {
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.custom-multistep-nav .btn-preview {
  background: #66676b;
  color: #fff;
  border-color: #66676b;
}

.custom-multistep-nav .btn-preview:hover {
  background: #555;
  border-color: #555;
}

/* =====================================================
   FORM FIELD ERRORS
   ===================================================== */
input.msf-input-error,
select.msf-input-error,
textarea.msf-input-error {
  border-color: #e74c3c !important;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15) !important;
}

.select2-container.msf-input-error .select2-selection {
  border-color: #e74c3c !important;
}


/* Drilldown: Category, Service Categories - highlight menu-toggle only on validation error */
#submit-listing-form .drilldown-menu .menu-toggle.msf-input-error,
#submit-listing-form .drilldown-menu [class*="menu-toggle"].msf-input-error,
.add-listing-section .drilldown-menu .menu-toggle.msf-input-error,
.add-listing-section .drilldown-menu [class*="menu-toggle"].msf-input-error,
.msf-active-section .drilldown-menu .menu-toggle.msf-input-error,
.msf-active-section .drilldown-menu [class*="menu-toggle"].msf-input-error,
.drilldown-menu .menu-toggle.msf-input-error,
.drilldown-menu [class*="menu-toggle"].msf-input-error {
  border: 2px solid #e74c3c !important;
}

/* =====================================================
   PREVIEW POPUP
   ===================================================== */
#preview-popup {
  background: #fff;
  padding: 30px 32px;
  max-width: 820px;
  width: 90vw;
  margin: 40px auto;
  position: relative;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

#preview-popup .small-dialog-header {
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 16px;
  margin-bottom: 24px;
}

#preview-popup .small-dialog-header h3 {
  margin: 0;
  font-size: 20px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-popup-content {
  max-height: 55vh;
  overflow-y: auto;
  margin-bottom: 24px;
  padding-right: 4px;
}

.preview-popup-content::-webkit-scrollbar {
  width: 5px;
}

.preview-popup-content::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 3px;
}

.preview-popup-content table.basic-table {
  width: 100%;
  border-collapse: collapse;
}

.preview-popup-content table.basic-table tr.preview-section-title th {
  background: #f5f6f8;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  color: #66676b;
  border-bottom: 1px solid #ebebeb;
}

.preview-popup-content table.basic-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.5;
}

.preview-popup-content table.basic-table td:first-child {
  width: 38%;
  color: #777;
  font-weight: 500;
}

.preview-popup-content table.basic-table td:last-child {
  color: #333;
}

.preview-popup-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #f0f0f0;
  padding-top: 18px;
}

.btn-confirm-submit {
  background: #2f8f2f !important;
  border-color: #2f8f2f !important;
  color: #fff !important;
  min-width: 160px;
}

.btn-confirm-submit:hover {
  background: #246e24 !important;
  border-color: #246e24 !important;
}

/* =====================================================
   3-COLUMN FIELD GRID LAYOUT
   ===================================================== */

/* Override Listeo's float/flex rows inside active sections */
.msf-active-section .row,
.msf-active-section .with-forms,
.msf-active-section .row.with-forms {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 16px 20px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  float: none !important;
}

/* Make all bootstrap columns reset to grid cells */
.msf-active-section .row>[class*="col-"],
.msf-active-section .with-forms>[class*="col-"],
.msf-active-section .row.with-forms>[class*="col-"],
#add-listing .submit-section [class*="col-"] {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 0% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Textarea fields — span full 3 columns */
.msf-active-section .row [class*="col-"].msf-has-textarea,
.msf-active-section .with-forms [class*="col-"].msf-has-textarea,
.msf-active-section .row.with-forms [class*="col-"].msf-has-textarea,
.msf-active-section .submit-field.msf-has-textarea {
  grid-column: 1 / -1 !important;
}

/* =====================================================
   FIELD BORDER-RADIUS & REDUCED TEXTAREA HEIGHT
   ===================================================== */
.msf-active-section input[type="text"],
.msf-active-section input[type="email"],
.msf-active-section input[type="url"],
.msf-active-section input[type="number"],
.msf-active-section input[type="tel"],
.msf-active-section input[type="password"],
.msf-active-section input[type="search"] {
  border-radius: 7px !important;
}

.msf-active-section select {
  border-radius: 7px !important;
}

.msf-active-section textarea {
  border-radius: 7px !important;
  min-height: 75px !important;
  height: 75px !important;
  resize: vertical;
}

/* Select2 containers */
.msf-active-section .select2-selection--single {
  border-radius: 7px !important;
}

/* =====================================================
   INLINE FIELD ERROR MESSAGES
   ===================================================== */
.msf-field-error-msg {
  color: #e74c3c;
  font-size: 12px;
  margin: 4px 0 0 0;
  padding: 0;
  line-height: 1.4;
  display: block;
}

/* Error notice below nav */
.custom-step-error {
  background: #fff5f5;
  border-left: 3px solid #e74c3c;
  color: #c0392b;
  padding: 10px 14px;
  border-radius: 4px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 500;
}

/* =====================================================
   RESPONSIVE — single column on mobile
   ===================================================== */
@media (max-width: 768px) {
  .custom-multistep-steps::before {
    display: none;
  }

  .custom-step-item .custom-step-label {
    display: none;
  }

  .custom-step-item .custom-step-circle {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .custom-multistep-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .custom-multistep-nav .button {
    min-width: 110px;
  }

  #preview-popup {
    padding: 20px 16px;
    width: 96vw;
  }

  .preview-popup-content table.basic-table td:first-child {
    width: 45%;
  }

  /* Single column on mobile — override 3-col grid */
  .msf-active-section .row,
  .msf-active-section .with-forms,
  .msf-active-section .row.with-forms {
    grid-template-columns: 1fr !important;
  }

  .msf-active-section .row [class*="col-"].msf-has-textarea,
  .msf-active-section .with-forms [class*="col-"].msf-has-textarea,
  .msf-active-section .row.with-forms [class*="col-"].msf-has-textarea,
  .msf-active-section .submit-field.msf-has-textarea {
    grid-column: 1 / -1 !important;
  }
}

.msf-input-error{
  border-width: 1px !important;;
}

