/* ============================================================
   iStore — creditCalculator.css
   Кнопка-триггер на странице товара + модалка калькулятора рассрочки.
   Зависит от theme.css.
   ============================================================ */

/* ---------- кнопка-триггер ---------- */
.pv-calc-link {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
    background: none; border: 0; padding: 0; cursor: pointer;
    font-size: 13.5px; font-weight: 600; color: var(--accent);
}
.pv-calc-link svg { flex: none; }
.pv-calc-link:hover { text-decoration: underline; }

/* ---------- модалка ---------- */
.calc-modal {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.calc-modal[hidden] { display: none; }
body.calc-noscroll { overflow: hidden; }

.calc-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }

.calc-modal__dialog {
    position: relative; z-index: 1;
    width: 100%; max-width: 680px;
    background: var(--surface); color: var(--text);
    border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.35);
    display: flex; flex-direction: column; max-height: 90vh; overflow: hidden;
}

.calc-modal__head {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.calc-modal__title { font-size: 19px; font-weight: 600; }
.calc-modal__close {
    border: 0; background: none; font-size: 28px; line-height: 1;
    color: var(--muted); cursor: pointer; padding: 0 4px;
}
.calc-modal__close:hover { color: var(--text); }

.calc-modal__body { padding: 24px; overflow-y: auto; }

.calc-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; align-items: end;
}
.calc-field { display: flex; flex-direction: column; gap: 7px; }
.calc-field label { font-size: 13px; color: var(--muted); }
.calc-field input {
    height: 46px; padding: 0 14px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-size: 15px; width: 100%;
}
.calc-field input:focus { outline: none; border-color: var(--accent); }
/* убираем стрелки у input[type=number] */
.calc-field input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.calc-field input[type="number"]::-webkit-outer-spin-button,
.calc-field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.calc-field--btn { justify-content: flex-end; }
.calc-btn {
    height: 46px; width: 100%; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--accent); color: var(--accent-text); font-size: 15px; font-weight: 600;
}
.calc-btn:hover { opacity: .92; }

.calc-modal__foot {
    padding: 18px 24px; border-top: 1px solid var(--border);
    text-align: right; font-size: 16px; color: var(--muted);
}
.calc-result-value { color: var(--accent); font-weight: 700; margin: 0 2px; }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
    .calc-grid { grid-template-columns: 1fr; gap: 14px; }
    .calc-modal__foot { text-align: center; }
    .calc-modal__dialog { border-radius: 14px; }
}