/* Price converters: the "اهرم تبدیل" rahn<->ejare slider (.pcs) and the per-meter
   calculator panel (.pc-*). Shared by the public site (main.css tokens) and
   /filing (filing.css tokens); falls back to the same navy + gold palette when
   neither is loaded. */
.pc-toggle,
.pc-panel,
.pcs {
    --pc-navy: var(--navy, var(--f-navy, #14213d));
    --pc-navy-deep: var(--navy-deep, var(--f-navy-deep, #0d1429));
    --pc-gold: var(--gold, var(--f-gold, #c9a44f));
    --pc-muted: #596173;
    --pc-line: #e5e8f0;
    font-family: inherit;
}

/* ======================================================= slider (.pcs) == */
.pcs {
    --pcs-pill: 156px;
    background: #fffdf7;
    border: 1px solid #ecdcae;
    border-inline-start: 4px solid var(--pc-gold);
    border-radius: 14px;
    padding: 18px 22px 18px;
    margin: 16px 0 0;
    max-width: 760px;
    color: var(--pc-navy);
    text-align: right;
    box-shadow: 0 10px 24px 0 rgba(128, 102, 38, 0.07);
}
.pcs[hidden] { display: none !important; }

.pcs-head { margin-bottom: 14px; }
.pcs-title { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--pc-navy); }
.pcs-rate { margin: 0; font-size: 12px; color: var(--pc-muted); }
.pcs-rate strong { color: #8a6d1d; }

/* deposit on the right, rent on the left (page is RTL: first item = right) */
.pcs-values { display: flex; gap: 12px; }
.pcs-val {
    flex: 1 1 0;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--pc-line);
    border-radius: 12px;
    padding: 10px 14px 12px;
}
.pcs-val-label { display: block; font-size: 12px; font-weight: 600; color: var(--pc-muted); margin-bottom: 4px; }
.pcs-val-num { display: block; font-size: 22px; font-weight: 800; line-height: 1.4; color: var(--pc-navy); overflow-wrap: anywhere; }
.pcs-val-rent { color: #8a6d1d; }

/* the track is always laid out left-to-right so "right = more deposit" holds physically */
.pcs-track {
    position: relative;
    height: 60px;
    margin: 14px 0 4px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}
.pcs-rail {
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 10px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: var(--pc-line);
    overflow: hidden;
}
.pcs-fill {
    --pcs-pos: 1;
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: calc(var(--pcs-pill) / 2 + (100% - var(--pcs-pill)) * var(--pcs-pos));
    background: linear-gradient(90deg, #dcc078, var(--pc-gold));
}
.pcs-handle {
    --pcs-pos: 1;
    position: absolute;
    top: 50%;
    left: calc((100% - var(--pcs-pill)) * var(--pcs-pos));
    width: var(--pcs-pill);
    height: 46px;
    transform: translateY(-50%);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    background: var(--pc-navy);
    color: #fff;
    border: 2px solid var(--pc-gold);
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(13, 20, 41, 0.28);
    cursor: grab;
    touch-action: pan-y;
}
.pcs-handle:hover { background: var(--pc-navy-deep); }
.pcs-handle.is-dragging { cursor: grabbing; box-shadow: 0 8px 22px rgba(13, 20, 41, 0.4); background: var(--pc-navy-deep); }
.pcs-handle:focus-visible { outline: 3px solid rgba(201, 164, 79, .55); outline-offset: 3px; }
.pcs-handle-text { font-size: 12px; font-weight: 700; white-space: nowrap; }
.pcs-arrow { color: var(--pc-gold); font-size: 26px; font-weight: 700; line-height: 1; padding-bottom: 3px; }

/* the two reference stops (min deposit end / full deposit end) */
.pcs-ends { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; }
.pcs-end {
    flex: 0 1 46%;
    background: transparent;
    border: 1px dashed #dccb96;
    border-radius: 10px;
    padding: 8px 10px;
    font-family: inherit;
    text-align: center;
    color: var(--pc-navy);
    cursor: pointer;
}
.pcs-end:hover { border-color: var(--pc-gold); background: #fff; }
.pcs-end:focus-visible { outline: 2px solid var(--pc-gold); outline-offset: 2px; }
.pcs-end-dep { display: block; font-size: 13px; font-weight: 800; }
.pcs-end-rent { display: block; font-size: 12px; color: var(--pc-muted); margin-top: 2px; }

.pcs-caption { margin-top: 14px; }
.pcs-sentence { margin: 0; font-size: 14px; font-weight: 800; line-height: 1.9; color: var(--pc-navy); }
.pcs-math { margin: 4px 0 0; font-size: 12px; line-height: 1.9; color: var(--pc-muted); }
.pcs-sentence:empty, .pcs-math:empty { display: none; }

/* public listing page only (pc_rahn_slider(..., ['public' => true])) */
.pcs-note {
    margin: -4px 0 14px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f5f7fa;
    color: var(--pc-muted);
    font-size: 12px;
    line-height: 1.9;
}
.pcs-public .pcs-val-num { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .pcs-reset { min-height: 40px; padding: 8px 16px; } }
.pcs-val-words { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; line-height: 1.7; color: #1e7a3a; }
.pcs-val-words:empty { display: none; }
.pcs-reset {
    margin-top: 10px;
    padding: 6px 14px;
    border: 1px solid var(--pc-gold);
    border-radius: 8px;
    background: #fff;
    color: var(--pc-navy);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.pcs-reset[hidden] { display: none; }

@media (max-width: 600px) {
    .pcs { --pcs-pill: 134px; padding: 16px 14px 16px; }
    .pcs-handle-text { font-size: 11px; }
    .pcs-val { padding: 8px 10px 10px; }
    .pcs-val-num { font-size: 17px; }
    .pcs-val-label { font-size: 11px; }
    .pcs-end { flex-basis: 48%; padding: 6px 6px; }
}

/* ============================================ per-meter button + panel == */
.pc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--pc-gold);
    color: var(--pc-navy-deep);
    border: 1px solid var(--pc-gold);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    vertical-align: middle;
    transition: background .15s, color .15s;
}
.pc-toggle:hover,
.pc-toggle.is-open { background: var(--pc-navy); border-color: var(--pc-navy); color: #fff; }
.pc-toggle:focus-visible { outline: 2px solid var(--pc-navy); outline-offset: 2px; }

.pd-price-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pc-inline-row { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; }
.pc-inline-row .pc-inline-label { font-size: 12px; color: var(--pc-muted); }

.pc-panel {
    background: #fffdf7;
    border: 1px solid #ecdcae;
    border-inline-start: 4px solid var(--pc-gold);
    border-radius: 14px;
    padding: 18px 22px 20px;
    margin: 16px 0 0;
    color: var(--pc-navy);
    text-align: right;
    box-shadow: 0 10px 24px 0 rgba(128, 102, 38, 0.07);
}
.pc-panel[hidden],
.pc-panel [hidden] { display: none !important; }

.pc-head { margin-bottom: 14px; }
.pc-title { margin: 0; font-size: 16px; font-weight: 800; color: var(--pc-navy); }

.pc-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.pc-fields-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.pc-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.pc-field > span { font-size: 12px; font-weight: 600; color: var(--pc-muted); }
.pc-field input {
    width: 100%;
    box-sizing: border-box;
    height: 42px;
    border: 1px solid #dfe3ec;
    border-radius: 10px;
    padding: 0 14px;
    background: #fff;
    color: var(--pc-navy);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-align: right;
}
.pc-field input:focus { outline: none; border-color: var(--pc-gold); box-shadow: 0 0 0 3px rgba(201, 164, 79, .25); }
.pc-field input[readonly] { background: #f3f4f8; color: var(--pc-muted); font-weight: 600; cursor: default; }

.pc-result { margin-top: 14px; padding: 12px 16px; background: #fff; border: 1px solid var(--pc-line); border-radius: 10px; }
.pc-sentence { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.8; color: var(--pc-navy); }
.pc-math { margin: 6px 0 0; font-size: 12px; line-height: 1.9; color: var(--pc-muted); }
.pc-sentence:empty, .pc-math:empty { display: none; }

@media (max-width: 600px) {
    .pc-panel { padding: 16px 14px 18px; }
}

/* Public listing page: keep each figure on one line (it used to break in the
   middle of the number on phones) and scale it to the screen. */
.pcs-public .pcs-val-num { overflow-wrap: normal; white-space: nowrap; font-size: clamp(14px, 4.2vw, 22px); }
@media (max-width: 600px) { .pcs-reset { min-height: 40px; padding: 8px 16px; } }
