/* CF7 Duration Pricing - Multi-file list + Progress bar */

form.wpcf7-form .js-file-list {
  margin-top: 8px;
}

form.wpcf7-form .js-file-list .file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #e3e3e3;
  background: #fafafa;
  border-radius: 6px;
  margin-top: 6px;
}

/* RTL alignment when parent container has cf7-rtl class */
.cf7-rtl form.wpcf7-form .js-file-list .file-item {
  direction: rtl;
  text-align: right;
}

form.wpcf7-form .js-file-list .file-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

form.wpcf7-form .js-file-list .file-remove {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border: 0;
  border-radius: 4px;
  background: #e74c3c;
  color: #fff;
  cursor: pointer;
}

form.wpcf7-form .js-file-list .file-remove:hover {
  background: #c0392b;
}

form.wpcf7-form .js-file-list .progress-wrap {
  flex: 0 0 30%;
  height: 6px;
  background: #e6e6e6;
  border-radius: 4px;
  overflow: hidden;
}

/* Grow to take remaining if remove button hidden in some themes */
form.wpcf7-form .js-file-list .progress-wrap:only-child {
  flex-basis: 40%;
}

form.wpcf7-form .js-file-list .progress-bar {
  width: 0%;
  height: 100%;
  background: #2ecc71;
  transition: width 0.3s linear;
}

/* Animated state before real upload completes */
form.wpcf7-form .js-file-list .progress-bar.uploading {
  position: relative;
  background: linear-gradient(90deg, #27ae60, #2ecc71);
}

/* Error state (e.g., validation failed) */
form.wpcf7-form .js-file-list .progress-bar.error {
  background: #e74c3c;
}



/* چند ستونه کردن در ابعاد مختلف صفحه*/
/* =========================
   CF7 GRID LAYOUT (SAFE)
========================= */

/* پایه: موبایل (1 ستون) */
.cf7dp-wrap .cf7-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* فیلدها */
.cf7dp-wrap .cf7-field {
  width: 100%;
}

/* این باعث میشه سکشن‌های شرطی grid رو نشکنن */
.cf7dp-wrap .js-interpreting-wrap,
.cf7dp-wrap .js-written-wrap {
  display: contents;
}

/* تبلت: 2 ستون */
@media (min-width: 768px) {
  .cf7dp-wrap .cf7-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* دسکتاپ: 3 ستون */
@media (min-width: 1024px) {
  .cf7dp-wrap .cf7-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =========================
   FULL WIDTH ELEMENTS
========================= */

/* textarea ها بهتره تمام عرض باشند */
.cf7dp-wrap .cf7-field textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

/* اگر مرورگر پشتیبانی کند: textarea کل عرض بگیرد */
@supports(selector(:has(*))) {
  .cf7dp-wrap .cf7-field:has(textarea) {
    grid-column: 1 / -1;
  }
}

/* فوتر همیشه فول‌ویدث */
.cf7dp-wrap .cf7-footer {
  grid-column: 1 / -1;
}

/* =========================
   INPUT / SELECT FIX (MODIFIED)
========================= */

/* استایل 100% فقط برای ورودی‌های متنی، ایمیل و غیره اعمال شود (به جز چک‌باکس و رادیو) */
.cf7dp-wrap input:not([type="checkbox"]):not([type="radio"]),
.cf7dp-wrap select,
.cf7dp-wrap textarea {
  width: 100%;
  box-sizing: border-box;
}

/* اطمینان از اینکه چک‌باکس‌ها عرض خودکار دارند و در یک خط قرار می‌گیرند */
.cf7dp-wrap input[type="checkbox"],
.cf7dp-wrap input[type="radio"] {
  width: auto !important;
  display: inline-block;
  margin-left: 5px; /* فاصله برای زبان فارسی */
}

/* اصلاح نمایش لیست چک‌باکس‌های وردپرس */
.cf7dp-wrap .wpcf7-list-item {
  display: inline-block;
  margin-left: 15px;
  margin-right: 0;
}

/* select سفارشی */
.cf7dp-wrap .custom-select {
  width: 100%;
}

/* =========================
   OPTIONAL: بهتر شدن فاصله‌ها
========================= */

.cf7dp-wrap label {
  display: block;
  margin-bottom: 6px;
}

.cf7dp-wrap .cf7-field {
  display: block;
}