/* Polyethylene calculator — page 613 only. */

/* ==================================================
   محاسبه‌گر قیمت لوله پلی اتیلن - نسخه نهایی اصلاح شده
================================================== */

#price-calc {
  --calc-blue: #046bd2;
  --calc-blue-dark: #034ea2;
  --calc-text: #0f172a;
  --calc-muted: #64748b;
  --calc-border: #dbe7f3;

  direction: rtl;
  width: 100% !important;
  max-width: 980px !important;
  margin: 35px auto 55px !important;
  padding: 36px 24px !important;
  box-sizing: border-box !important;
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(4,107,210,.13), transparent 34%),
    linear-gradient(180deg, #f9fcff 0%, #eef6fc 100%);
  border: 1px solid rgba(4,107,210,.14);
  box-shadow: 0 16px 45px rgba(15,23,42,.08);
}

/* مهم: باز کردن عرض کانتینرهای Spectra / UAGB */
#price-calc > .wp-block-uagb-container,
#price-calc .uagb-container-inner-blocks-wrap,
#price-calc .wp-block-uagb-container,
#price-calc .uagb-is-root-container {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}

/* کارت اصلی فرم */
#price-calc #gform_wrapper_4 {
  display: block !important;
  width: 100% !important;
  max-width: 780px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: 34px 32px !important;
  box-sizing: border-box !important;
  border-radius: 28px;
  background: #ffffff;
  border: 1px solid rgba(219,231,243,.95);
  box-shadow: 0 22px 58px rgba(15,23,42,.11);
}

/* اجزای داخلی فرم */
#price-calc #gform_4,
#price-calc .gform_body,
#price-calc .gform_fields {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* عنوان */
#price-calc #gform_wrapper_4::before {
  content: "محاسبه آنلاین قیمت";
  display: table;
  margin: 0 auto 28px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(4,107,210,.08);
  color: var(--calc-blue-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.8;
}

/* گرید فیلدها */
#price-calc .gform_fields {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
  gap: 22px 24px !important;
  list-style: none !important;
  align-items: start !important;
}

/* هر فیلد */
#price-calc .gfield {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  box-sizing: border-box !important;
}

/* خنثی کردن عرض‌های Gravity Forms */
#price-calc .gfield--width-full,
#price-calc .gfield--width-half,
#price-calc .gfield--width-third,
#price-calc .gfield--width-quarter {
  width: 100% !important;
  max-width: 100% !important;
  grid-column: auto !important;
}

/* لیبل‌ها */
#price-calc .gfield_label {
  display: block !important;
  margin: 0 0 9px !important;
  color: var(--calc-text);
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.8 !important;
  text-align: right !important;
}

#price-calc .gfield_label::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--calc-blue);
  box-shadow: 0 0 0 4px rgba(4,107,210,.10);
  vertical-align: middle;
}

/* ورودی‌ها و سلکت‌ها */
#price-calc input[type="text"],
#price-calc input[type="number"],
#price-calc select {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;
  border-radius: 16px !important;
  border: 1px solid var(--calc-border) !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
  color: #1e293b !important;
  font-family: 'PeydaWeb', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 56px !important;
  box-shadow: 0 5px 15px rgba(15,23,42,.035);
  transition: all .2s ease;
}

#price-calc input[type="number"] {
  text-align: center !important;
}

/* فلش سلکت */
/* فلش تمیز و حرفه‌ای select */
#price-calc select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;

  padding-left: 46px !important;
  padding-right: 16px !important;

  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10L12 15L17 10' stroke='%23046bd2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-size: 20px 20px !important;
  background-position: left 16px center !important;

  cursor: pointer;
}

/* حذف فلش پیش‌فرض در بعضی مرورگرها */
#price-calc select::-ms-expand {
  display: none;
}

/* جلوگیری از حذف فلش هنگام hover/focus */
#price-calc select:hover,
#price-calc select:focus {
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10L12 15L17 10' stroke='%23046bd2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-size: 20px 20px !important;
  background-position: left 16px center !important;
}

#price-calc input:hover,
#price-calc select:hover {
  border-color: #b7d3ee !important;
  background: #ffffff !important;
}

#price-calc input:focus,
#price-calc select:focus {
  border-color: var(--calc-blue) !important;
  background: #ffffff !important;
  outline: none !important;
  box-shadow:
    0 0 0 4px rgba(4,107,210,.11),
    0 10px 25px rgba(4,107,210,.10) !important;
}

/* فیلدهای تمام عرض */
#price-calc .gfield_html,
#price-calc .gfield_calculation {
  grid-column: 1 / -1 !important;
}

/* توضیح یا جداکننده */
#price-calc .gfield_html {
  padding: 12px 16px !important;
  border-radius: 16px;
  background: #f5f9fd;
  border: 1px dashed #c6d9ec;
  color: var(--calc-muted);
  font-size: 13px !important;
  line-height: 2 !important;
  text-align: center !important;
}

/* قیمت */
#price-calc .gfield_calculation {
  margin-top: 6px !important;
}

#price-calc .gfield_calculation > .gfield_label {
  display: none !important;
}

#price-calc .ginput_container_product_calculation {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 25px 24px !important;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.16), transparent 30%),
    linear-gradient(135deg, #0b2f72 0%, #045cb4 55%, #046bd2 100%);
  color: #ffffff;
  text-align: center;
  box-shadow: 0 18px 38px rgba(4,92,180,.26);
  overflow: hidden;
}

#price-calc .ginput_product_price_label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255,255,255,.82);
  font-size: 14px !important;
  font-weight: 700 !important;
}

#price-calc .ginput_product_price {
  display: block;
  color: #ffffff !important;
  font-size: 36px !important;
  font-weight: 900 !important;
  line-height: 1.45 !important;
  letter-spacing: -.7px;
  text-shadow: 0 2px 10px rgba(0,0,0,.16);
}

/* موبایل */
@media (max-width: 768px) {
  #price-calc {
    margin: 24px auto 40px !important;
    padding: 18px 10px !important;
    border-radius: 24px;
  }

  #price-calc #gform_wrapper_4 {
    width: 100% !important;
    max-width: 100% !important;
    padding: 22px 16px !important;
    border-radius: 22px;
  }

  #price-calc #gform_wrapper_4::before {
    margin-bottom: 20px;
    font-size: 12px;
  }

  #price-calc .gform_fields {
    grid-template-columns: 1fr !important;
    gap: 17px !important;
  }

  #price-calc input[type="text"],
  #price-calc input[type="number"],
  #price-calc select {
    height: 52px !important;
    min-height: 52px !important;
    font-size: 14px !important;
    line-height: 52px !important;
  }

  #price-calc .ginput_product_price {
    font-size: 29px !important;
  }
}
