.csm_form {
  margin: 0 auto;
  outline: none;
  -webkit-box-sizing: content-box;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
}
.form {
  position: relative;
}
.csm_form_header {
  background-color: #3f51b5;
  border-top: 1px solid #7986cb;
  -webkit-border-radius: 3px 3px 0 0;
  -moz-border-radius: 3px 3px 0 0;
  -o-border-radius: 3px 3px 0 0;
  border-radius: 3px 3px 0 0;
  -webkit-box-shadow: 0 6px 3px -3px rgb(63 81 181 / 50%);
  -moz-box-shadow: 0 6px 3px -3px rgba(63, 81, 181, 0.5);
  -o-box-shadow: 0 6px 3px -3px rgba(63, 81, 181, 0.5);
  box-shadow: 0 6px 3px -3px rgb(63 81 181 / 50%);
  display: block;
  position: relative;
}
.csm_form_header p {
  color: #fff;
  margin: 0;
  padding: 30px 25px;
  font-size: 30px;
  text-transform: uppercase;
}
.csm_form_content {
  padding: 25px 25px 0;
}
.form .csm_form_content:after {
  clear: both;
  content: ".";
  display: block;
  height: 0;
  visibility: hidden;
}
.f_row {
  margin: 0 -10px;
}
.form .f_row:after {
  clear: both;
  content: ".";
  display: block;
  height: 0;
  visibility: hidden;
}
.form .span3 {
  width: 25%;
}
.form .span4 {
  width: 33%;
}
.form .span6 {
  width: 50%;
}
.form .span8 {
  width: 66%;
}
.form .span9 {
  width: 75%;
}
.form .span12 {
  width: 100%;
}
.form [class*="span"] {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  float: right;
  padding-left: 10px;
  padding-right: 10px;
  position: relative;
}
.form .active-step .steps {
  /*background-color: #e8eaf6;*/
  border: 1px solid #ff0000;
}
.form .steps {
  border: 1px solid rgba(0, 0, 0, 0.12);
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  -o-border-radius: 3px;
  border-radius: 30px;
  margin-bottom: 25px;
  text-align: center;
  -webkit-transition: all.3s;
  -moz-transition: all.3s;
  -ms-transition: all.3s;
  -o-transition: all.3s;
  transition: all.3s;
}
.form .steps span {
  color: rgba(0, 0, 0, 0.56);
  font-size: 13px;
  height: 13px;
  line-height: 13px;
}
.form .steps p {
  color: rgba(0, 0, 0, 0.56);
  font-size: 16px;
  height: 36px;
  line-height: 36px;
  margin: 0;
  padding: 0;
}
.form .active-step .steps p {
  color: #ff0000;
}
.form .divider {
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  height: 0;
}
.form .divider-text {
  text-align: center;
}
.form .divider,
.form .divider-text {
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  height: 0;
}
.form .divider-text span {
  border: 1px solid rgba(0, 0, 0, 0.12);
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  -o-border-radius: 3px;
  border-radius: 3px;
  background-color: #f9fafd;
  color: #3f51b5;
  font-size: 16px;
  padding: 2px 15px;
  position: relative;
  top: -9px;
  white-space: nowrap;
}
.form .gap-top-20 {
  margin-top: 20px;
}
.form .gap-bottom-25 {
  margin-bottom: 25px;
}
.form .gap-bottom-45 {
  margin-bottom: 45px;
}
.form .f_row:after {
  clear: both;
  content: ".";
  display: block;
  height: 0;
  visibility: hidden;
}
.form fieldset {
  border: none;
  outline: none;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 0;
  left: 0; /* ✅ دیگر مقدار منفی ندارد */
  width: 100%;
  opacity: 0;
  visibility: hidden; /* ✅ به جای بیرون راندن، پنهان می‌کنیم */
  transform: translateY(-4%);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
  box-sizing: border-box;
}

.form fieldset.active-fieldset {
  position: relative;
  left: 0;
  opacity: 1;
  visibility: visible; /* ✅ حالا دیده می‌شود */
  transform: translateY(0);
  transition-delay: 0s; /* انیمیشن بدون تأخیر برای حالت فعال */
}

.form .active-fieldset .csm_unit,
.form .active-fieldset .f_row {
  display: block;
}
.form fieldset .csm_unit,
.form fieldset .f_row {
  display: none;
}
.form .csm_unit {
  position: relative;
  margin-bottom: 25px;
}
.form .input {
  position: relative;
}
.form label {
  display: block;
  color: inherit;
  font-weight: normal;
  text-align: right;
  margin-bottom: 0;
  padding-bottom: 10px;
}
.form .icon-left,
.form .icon-right {
  color: rgba(0, 0, 0, 0.54);
  font-size: 17px;
  height: 38px;
  line-height: 38px !important;
  opacity: 0.6;
  position: absolute;
  text-align: center;
  top: 5px;
  width: 42px;
  z-index: 2;
}
.form .icon-left {
  border-right: 1px solid rgba(0, 0, 0, 0.54);
  left: 3px;
}
.form .icon-right ~ input,
.form .icon-right ~ textarea {
  padding-right: 58px;
}
.form .icon-left ~ input,
.form .icon-left ~ textarea {
  padding-left: 58px;
}
.form input[type="text"],
.form input[type="password"],
.form input[type="email"],
.form input[type="search"],
.form input[type="url"],
.form textarea,
.form select {
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.12);
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  -o-border-radius: 3px;
  border-radius: 3px;
  color: rgba(0, 0, 0, 0.87);
  display: block;
  font-family: inherit;
  font-size: 16px;
  height: 48px;
  padding: 10px 15px;
  width: 100%;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition: all.4s;
  -moz-transition: all.4s;
  -ms-transition: all.4s;
  -o-transition: all.4s;
  transition: all.4s;
}
.form .input textarea {
  height: 112px;
  overflow: auto;
  min-height: 52px;
  resize: vertical;
}
.form input[type="text"]:hover,
.form input[type="password"]:hover,
.form input[type="email"]:hover,
.form input[type="search"]:hover,
.form input[type="url"]:hover,
.form textarea:hover,
.form select:hover {
  border: 2px solid rgba(48, 63, 159, 0.6);
}
.form input[type="text"]:focus,
.form input[type="password"]:focus,
.form input[type="email"]:focus,
.form input[type="search"]:focus,
.form input[type="url"]:focus,
.form textarea:focus,
.form select:focus {
  border: 2px solid rgba(48, 63, 159, 0.9);
}
.form .select i:before {
  border-bottom: 6px solid rgba(0, 0, 0, 0.4);
  top: 3px;
}
.form .select i:after,
.form .select i:before {
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  content: "";
  position: absolute;
  right: 3px;
}
.form .select i:after {
  border-top: 6px solid rgba(0, 0, 0, 0.4);
  bottom: 1px;
}
.form .error-view .icon-left,
.form .error-view .icon-right,
.form span.error-view,
.form .error-message i {
  color: #b71c1c;
}
.form .error-view .icon-left,
.form .error-view .icon-right {
  border-color: #e57373;
}
.form .error-view .checkbox i,
.form .error-view .radio i,
.form .error-view .checkbox-toggle i,
.form .error-view .radio-toggle i,
.form .error-view input,
.form .error-view select,
.form .error-view textarea {
  background: #ffebee !important;
}
.form span.error-view,
.form span.success-view,
.form span.warning-view,
.form span.info-view {
  display: block;
  font-size: 14px;
  height: 14px;
  line-height: 14px;
  margin-top: 5px;
  padding: 0 2px;
}
.form .success-view .icon-left,
.form .success-view .icon-right,
.form span.success-view,
.form .success-message i {
  color: #1b5e20;
}
.form .success-view .icon-left,
.form .success-view .icon-right {
  border-color: #81c784;
}
.form .success-view .checkbox i,
.form .success-view .radio i,
.form .success-view .checkbox-toggle i,
.form .success-view .radio-toggle i,
.form .success-view input,
.form .success-view select,
.form .success-view textarea {
  background: #e8f5e9 !important;
}

.form .primary-btn,
.form .file-button,
.form .secondary-btn,
.csm-map-modal .primary-btn {
  background: #ff0000;
  -webkit-transition: background.2s;
  -moz-transition: background.2s;
  -ms-transition: background.2s;
  -o-transition: background.2s;
  transition: background.2s;
}
.form .primary-btn,
.csm-map-modal .primary-btn {
  position: relative;
}
.form .primary-btn,
.form .secondary-btn,
.csm-map-modal .primary-btn {
  border: none;
  -webkit-border-radius: 18px;
  -moz-border-radius: 18px;
  -o-border-radius: 18px;
  border-radius: 18px;
  color: #fff;
  display: block;
  cursor: pointer;
  float: left;
  height: 36px;
  margin: 10px 20px 10px 0;
  outline: none;
  padding: 0 25px;
  white-space: nowrap;
  font-family: inherit;
}
.form .csm_form_footer:after {
  clear: both;
  content: ".";
  display: block;
  height: 0;
  visibility: hidden;
}
.csm_success_notice {
  position: relative;
  display: flex;
  align-items: stretch;
  flex-direction: column;
}
/* Notification box */
.csm_form_messages {
  margin-top: 20px;
}

/* Notices like WP admin */
.notice {
  position: relative;
  padding: 12px 15px;
  border-right: 4px solid;
  border-radius: 4px;
  margin: 10px 0;
  font-size: 15px;
  line-height: 1.6em;
}

.notice-success {
  background: #edf7ed;
  border-color: #46b450;
  color: #1a472a;
}

.notice-error {
  background: #fcebeb;
  border-color: #dc3232;
  color: #861616;
}

.notice-info {
  background: #e8f4fb;
  border-color: #0073aa;
  color: #004c6d;
}

/* dismiss button */
.notice.is-dismissible {
  padding-left: 40px;
}
.notice.is-dismissible .notice-dismiss {
  position: absolute;
  top: 18px;
  left: 10px;
  transform: translateY(-50%);
  text-decoration: none;
  cursor: pointer;
}
.notice-dismiss:before {
  content: "\00d7";
  font-size: 24px;
  line-height: 20px;
  opacity: 0.5;
}
.notice-dismiss:hover:before {
  opacity: 1;
}

.csm-product {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fafafa;
}
.csm-product .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.csm-remove-product {
  color: #b32d2e;
  background: #fee2e2;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
}
.csm-product-card {
  display: flex;
  gap: 14px;
  padding: 10px;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  background: #fff;
  margin-top: 8px;
}
.csm-product-card img {
  border-radius: 8px;
  max-width: 84px;
  height: auto;
}
.csm-prod-title {
  font-weight: 700;
  margin: 2px 0;
}
.csm-prod-meta {
  font-size: 12px;
  color: #666;
}

/* ---------- مودال انتخاب موقعیت روی نقشه ---------- */
.csm-map-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  font-family: inherit;
  direction: rtl;
}

.csm-map-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.csm-map-dialog {
  position: relative;
  top: 200px;
  max-width: 720px;
  margin: 40px auto;
  background: #fff;
  border-radius: 12px;
  padding: 16px 16px 12px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
}

.csm-map-dialog h3 {
  margin: 0 0 10px;
  font-size: 16px;
  text-align: right;
}

.csm-map-close {
  position: absolute;
  top: 8px;
  left: 10px;
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

#csm_map {
  width: 100%;
  height: 380px;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 8px;
  margin-bottom: 10px;
}

.csm-map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.csm-map-hint {
  font-size: 12px;
  color: #64748b;
}

.csm-location-preview {
  width: 100%;
  height: 200px;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
  position: relative;
}

.csm-preview-placeholder {
  color: #64748b;
  font-size: 13px;
  text-align: center;
  line-height: 200px;
}

/* موبایل */
@media (max-width: 640px) {
  .csm-map-dialog {
    margin: 20px 10px;
    padding: 12px;
  }

  #csm_map {
    height: 280px;
  }
}

@media (max-width: 620px) {
  .csm_form .form [class*="span"] {
    margin-right: 0;
    width: 100%;
  }
}
