/* =======================
   PDAL Calculator – UI Theme
   فقط UI؛ بدون تغییر منطق
   ======================= */

/* ظرف کلی؛ عرض کل 1000px */
.pdal-scope {
    max-width: 900px;
    margin: 0 auto
}

.pdal-wrap {
    background: #0b4da5;
    border-radius: 22px;
    padding: 24px
}

/* تیتر بالای ویجت */
.pdal-title {
    font-weight: 900;
    color: #fff;
    font-size: 24px;
    line-height: 1.6;
    margin: 2px 0 18px;
    text-align: right;
    display: none;
}

/* گرید دو ستونه (چپ=خروجی، راست=ورودی) — نسبت 40/60 */
@media (min-width: 901px) {
    .pdal-grid {
        display: grid;
        grid-template-columns: 40% 60%;
        gap: 22px;
        align-items: start
    }

    .pdal-col-out {
        grid-column: 1/2
    }

    .pdal-col-in {
        grid-column: 2/3
    }
}

/* موبایل: زیر هم */
@media (max-width:900px) {

    .pdal-col-out,
    .pdal-col-in {
        grid-column: 1/-1
    }
}

/* کارت سفید خروجی (چپ) */
.pdal-output-card {
    background: #fff;
    border-radius: 20px;
    padding: 25px 18px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .06);
    text-align: center
}

.pdal-output-card .pdal-out-row {
    padding: 12px 10px;
    border-bottom: 1px solid #e6eefb
}

.pdal-output-card .pdal-out-row:last-child {
    border-bottom: none
}

.pdal-output-card .lbl {
    opacity: .75;
    font-size: 12px
}

.pdal-output-card .val {
    font-weight: 900;
    font-size: 16px;
    margin-top: 6px;
    color: #0b4da5
}

/* دکمه سفید «درخواست تسهیلات» داخل کارت خروجی */
.pdal-apply-btn {
    display: block;
    text-align: center;
    background: #fff;
    border: 2px solid #0b4da5;
    color: #0b4da5;
    border-radius: 12px;
    font-weight: 900;
    height: 52px;
    line-height: 48px;
    margin-top: 16px
}

.pdal-apply-btn:hover {
    background: #0b4da5;
    color: #fff
}

.pdal-apply-btn.is-disabled {
    pointer-events: none;
    opacity: .5
}

/* فیلدهای ورودی (راست) */
.pdal-field {
    margin-bottom: 32px;
    margin-top: 10px;
}

.pdal-label {
    color: #fff;
    opacity: .9;
    margin-bottom: 8px;
    font-size: 12px
}

/* نسخه inline برای پیش‌پرداخت: لیبل و اینپوت در یک ردیف */
.pdal-field.inline {
    display: flex;
    align-items: center;
    gap: 12px
}

.pdal-field.inline .pdal-label {
    margin: 0;
    white-space: nowrap
}

.pdal-input,
.pdal-output {
    width: 100%;
    height: 52px;
    border-radius: 10px !important;
    border: 2px solid rgba(255, 255, 255, .3) !important;
    background: rgb(255, 255, 255);
    padding: 8px 12px;
    font-weight: 400;
    font-family: 'IRANYekanFN'
}

.pdal-output {
    display: flex;
    align-items: center;
    justify-content: space-between
}

/* قرص‌ها (pill) */
.pdal-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

/* رنجِ RTL با پس‌زمینه پرشونده + حباب ثابت */
.pdal-range-wrap {
    position: relative;
    padding-top: 8px;
}

.pdal-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 12px;
    border-radius: 999px;
    outline: none;
    border: 0 !important;
    box-shadow: none !important;
    background: linear-gradient(to left,
            #1f9d00 0%,
            #1f9d00 var(--p, 0%),
            #e5efff var(--p, 0%),
            #e5efff 100%) !important;
}

/* Webkit track */
.pdal-range::-webkit-slider-runnable-track {
    height: 12px;
    border-radius: 999px;
    border: 0 !important;
    background: linear-gradient(to left,
            #1f9d00 0%,
            #1f9d00 var(--p, 0%),
            #e5efff var(--p, 0%),
            #e5efff 100%) !important;
}

/* Webkit thumb */
.pdal-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1f9d00;
    border: 2px solid #fff;
    box-shadow: 0 0 0 3px rgba(31, 157, 0, .25);
    margin-top: -4px;
    /* وسطِ track */
}

/* Firefox track/progress */
.pdal-range::-moz-range-track {
    height: 12px;
    border-radius: 999px;
    border: 0 !important;
    background: #e5efff !important;
}

.pdal-range::-moz-range-progress {
    height: 12px;
    border-radius: 999px;
    background: #1f9d00 !important;
}

.pdal-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1f9d00;
    border: 2px solid #fff;
    box-shadow: 0 0 0 3px rgba(31, 157, 0, .25);
}

/* حباب عدد */
.pdal-range-value {
    position: absolute;
    top: -35px;
    left: -1px;
    transform: none;
    background: #fff;
    color: #0b4da5;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 900;
    padding: 2px 8px;
    white-space: nowrap;
}

/* دکمه محاسبه (زرد) + حالت لودینگ */
.pdal-btn {
    background: #0b4da5;
    color: #ffffff;
    border: 3px solid #ffffff;
    padding: 15px;
    border-radius: 10px;
    font-weight: 900;
    cursor: pointer;
    width: 100%;
    height: 64px;
    font-size: 22px;
    transition: all .2s;
    font-family: 'IRANYekanXFN'
}

.pdal-btn:hover {
    background: #e59e00;
    color: #fff;
    border-color: #ffc125
}

.pdal-btn.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 1;
    background: #fff;
    color: transparent;
    border-color: #0b4da5;
}

.pdal-btn.is-loading::after {
    /* 3-dot loading (brand color) */
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(11, 77, 165, .2);
    transform: translate(-50%, -50%);
    box-shadow:
        -18px 0 0 rgba(11, 77, 165, .2),
        0 0 0 rgba(11, 77, 165, 1),
        18px 0 0 rgba(11, 77, 165, .2);
    animation: pdal-dots 1s infinite ease-in-out
}

@keyframes pdal-dots {
    0% {
        box-shadow:
            -18px 0 0 rgba(11, 77, 165, .2),
            0 0 0 rgba(11, 77, 165, .2),
            18px 0 0 rgba(11, 77, 165, 1);
    }
    33% {
        box-shadow:
            -18px 0 0 rgba(11, 77, 165, 1),
            0 0 0 rgba(11, 77, 165, .2),
            18px 0 0 rgba(11, 77, 165, .2);
    }
    66% {
        box-shadow:
            -18px 0 0 rgba(11, 77, 165, .2),
            0 0 0 rgba(11, 77, 165, 1),
            18px 0 0 rgba(11, 77, 165, .2);
    }
    100% {
        box-shadow:
            -18px 0 0 rgba(11, 77, 165, .2),
            0 0 0 rgba(11, 77, 165, .2),
            18px 0 0 rgba(11, 77, 165, 1);
    }
}

.pdal-btn[disabled] {
    opacity: .8;
    cursor: not-allowed
}

/* باکس محصولات پیشنهادی */
.pdal-suggest {
    margin-top: 18px
}

.pdal-suggest-box {
    margin-top: 14px;
    background: #0b4da5;
    border-radius: 22px;
    padding: 22px;
    color: #fff
}

.pdal-suggest-title {
    font-weight: 900;
    text-align: center;
    margin-bottom: 12px
}

.pdal-s-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px
}

@media (max-width:900px) {
    .pdal-s-list {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

.pdal-s-item {
    display: block;
    background: #fff;
    border-radius: 14px;
    padding: 10px;
    text-align: center
}

.pdal-s-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 10px
}

.pdal-s-title {
    color: #1c2555;
    font-weight: 400;
    margin: 6px 0 4px;
    font-size: 10px
}

.pdal-s-price {
    color: #0b4da5;
    font-weight: 900
}

.pdal-hidden {
    display: none
}

/* --- قفل قطعی جای ستون‌ها (ورودی چپ، خروجی راست) --- */
.pdal-wrap .pdal-grid {
    direction: ltr !important;
    /* مهم: ستون اول سمت چپ قرار بگیرد */
    display: grid !important;
    grid-template-columns: minmax(0, 40%) minmax(0, 60%) !important;
    /* چپ=ورودی 60%، راست=خروجی 40% */
    gap: 22px;
    align-items: start;
    box-sizing: border-box;
}

.pdal-wrap .pdal-col-in,
.pdal-wrap .pdal-col-out {
    /* جلوی هر override قبلی */
    min-width: 0 !important;
    width: auto !important;
    float: none !important;
    flex: none !important;
    box-sizing: border-box;
    direction: rtl !important;
    /* متن و محتوا RTL بماند */
}

/* ورودی حتماً ستون 1 (چپ)، خروجی حتماً ستون 2 (راست) */
.pdal-wrap .pdal-col-in {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
}

.pdal-wrap .pdal-col-out {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
}

/* ===== Mobile fix: inputs first, outputs second ===== */
@media (max-width: 900px) {
    .pdal-wrap .pdal-grid {
        grid-template-columns: 1fr !important;
        /* یک ستون */
        gap: 16px;
    }

    /* ورودی‌ها (pdal-col-out) ردیف 1 */
    .pdal-wrap .pdal-col-out {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
    }

    /* خروجی‌ها (pdal-col-in) ردیف 2 */
    .pdal-wrap .pdal-col-in {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
    }
}


/* محدود کردن عرض کل افزونه */
.pdal-wrap {
    max-width: 800px !important;
    margin: 0 auto;
    /* وسط‌چین بشه */
    box-sizing: border-box;
}


/* وقتی از scrollIntoView یا لینک لنگر استفاده شد، 50px فاصله از بالا بده */
@media (max-width: 900px) {
    #pdal-results {
        scroll-margin-top: 120px;
    }
}
.pdal-calculator button,
.pdal-calculator [type=button]
{
    background-color: transparent;
    border: 2px solid #ffffff;
    border-radius: 10px;
    color: #ffffff;
    font-size: 20px;
    font-weight: 900;
    text-align: center;
    transition: all .3s;
    user-select: none;
    white-space: nowrap;
    padding: 10px;
    min-width: 55px;
}
.pdal-calculator [type=submit] {
    display: block;
    margin: 0PX 200PX;
    width: 350px;
    max-width: 90%;
    background-color: #ffffff;
    color: #0b4da5;
    border-radius: 15px;
    font-size: 22px;
    font-weight: 900;
    padding: 15px 0;
    border: 2px solid #ffffff;
}
.pdal-calculator button[type=submit]:hover {
    background-color: transparent;
    color: #ffffff;
}
.pdal-50-50 {
    display: flex;
    gap: 16px;
}

.pdal-50-50 .pdal-field {
    width: 50%;
}

/* input with suffix */
.pdal-input-wrap {
    position: relative;
}

.pdal-input-wrap .pdal-input {
    padding-left: 70px;
}

.pdal-input-suffix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #888;
    pointer-events: none;
}
.pdal-multiselect {
  position: relative;
  user-select: none;
}

.pdal-multiselect-head {
  border: 2px solid #fff;
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pdal-multiselect.open .pdal-multiselect-head {
  background: rgba(255,255,255,0.1);
}

.pdal-placeholder {
  opacity: 0.8;
}

.pdal-multiselect-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  background: #fff;
  border-radius: 10px;
  padding: 8px 0;
  display: none;
  z-index: 50;
}

.pdal-multiselect.open .pdal-multiselect-menu {
  display: block;
}

.pdal-multiselect-menu label {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  color: #333;
}

.pdal-multiselect-menu label:hover {
  background: #f3f3f3;
}
/* =========================
   PDAL Pills – Active State
   ========================= */

.pdal-calculator .pdal-pills .pdal-pill {
    cursor: pointer;
    transition: all .2s ease;
}

/* حالت فعال */
.pdal-calculator .pdal-pills .pdal-pill.active {
    background-color: #ffffff !important;
    color: #0A4CA5 !important;
    /* رنگ برندت */
    border-color: #0A4CA5 !important;
}

/* متن داخل pill (اگر span یا i دارد) */
.pdal-calculator .pdal-pills .pdal-pill.active *,
.pdal-calculator .pdal-pills .pdal-pill.active span {
    color: #0A4CA5 !important;
}
/* =========================
   PDAL Pills – Hover State
   ========================= */

.pdal-calculator .pdal-pills .pdal-pill:hover {
    background-color: #ffffff !important;
    color: #0A4CA5 !important;
    border-color: #0A4CA5 !important;
}

/* اگر داخل pill span یا متن جدا دارد */
.pdal-calculator .pdal-pills .pdal-pill:hover *,
.pdal-calculator .pdal-pills .pdal-pill:hover span {
    color: #0A4CA5 !important;
}
.pdal-btn-loader {
    display: none;
    font-size: 28px;
    letter-spacing: 4px;
    color: #0A4CA5;
    /* رنگ سازمانی */
}

.pdal-btn.is-loading .pdal-btn-text {
    display: none;
}

.pdal-btn.is-loading .pdal-btn-loader {
    display: inline-block;
}
