/* ===== Модуль «Калькулятор ремонта» ===== */
:root {
  --primary: #3579c9;
  --primary-2: #2a5f9e;
  --primary-soft: #e8f0fa;
  --ink: #242a33;
  --muted: #84909c;
  --line: #e6ebf0;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(36,42,51,.07);
  --shadow-hover: 0 18px 44px rgba(42,95,158,.18);
  --grad: linear-gradient(135deg, #3a83d6, #2a5f9e);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1100px 500px at 100% -10%, #eef4fc, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #f2f6fb, transparent 55%),
    #f7f9fc;
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.rp-wrap { min-height: 100vh; }

.rp-header { background: rgba(255,255,255,.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(230,235,240,.8); position: sticky; top: 0; z-index: 50; }
.rp-header-inner { max-width: 1100px; margin: 0 auto; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; }
.rp-brand { display: flex; align-items: center; gap: 12px; }
.rp-brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; box-shadow: 0 6px 16px rgba(42,95,158,.28); }
.rp-brand-name { font-weight: 700; font-size: 19px; letter-spacing: -.2px; }
.rp-phone { color: var(--primary-2); text-decoration: none; font-size: 15px; font-weight: 600; }

.rp-main { max-width: 1100px; margin: 0 auto; padding: 32px 24px 70px; }
.rp-intro { text-align: center; margin-bottom: 28px; }
.rp-intro h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -.5px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rp-intro p { margin: 0; color: var(--muted); font-size: 15.5px; max-width: 620px; margin-inline: auto; }

.rp-layout { display: grid; grid-template-columns: 1fr 330px; gap: 26px; align-items: start; }

/* --- Категория --- */
.rp-cat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; box-shadow: var(--shadow); }
.rp-cat__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: linear-gradient(180deg, #fbfcfe, #f5f8fb); border-bottom: 1px solid var(--line); }
.rp-cat__icon { font-size: 22px; }
.rp-cat__title { margin: 0; font-size: 17px; font-weight: 700; flex: 1; }
.rp-cat__total { font-size: 14px; font-weight: 700; color: var(--primary-2); background: var(--primary-soft); padding: 4px 10px; border-radius: 8px; }

.rp-items { padding: 6px 0; }
.rp-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-top: 1px solid #f0f3f7; }
.rp-item:first-child { border-top: none; }
.rp-item__info { flex: 1; }
.rp-item__name { font-weight: 600; font-size: 14.5px; }
.rp-item__hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.rp-item__price { font-size: 13px; color: var(--primary-2); font-weight: 600; margin-top: 5px; }

.rp-item__qty { display: flex; align-items: center; gap: 8px; }
.rp-qty { width: 74px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 15px; font-weight: 700; text-align: center; }
.rp-qty:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(53,121,201,.12); }
.rp-unit { font-size: 12.5px; color: var(--muted); }
.rp-item__subtotal { min-width: 92px; text-align: right; font-weight: 700; font-size: 14px; color: var(--ink); }

/* --- Панель итога --- */
.rp-total { position: sticky; top: 90px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.rp-total__head { font-weight: 700; font-size: 16px; margin-bottom: 12px; }
.rp-total__list { max-height: 260px; overflow: auto; margin-bottom: 12px; }
.rp-total__line { font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.rp-total__line span { color: var(--muted); }
.rp-total__line b { float: right; }
.rp-total__empty { color: var(--muted); font-size: 13px; }
.rp-total__row { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.rp-total__row b { color: var(--primary-2); }
.rp-total__row.rp-total__discount { font-weight: 400; font-size: 14px; color: #2e7d4f; border-top: none; padding-top: 4px; }
.rp-total__actions { margin-top: 14px; }
.rp-submit { width: 100%; padding: 13px; background: var(--grad); color: #fff; border: none; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 22px rgba(42,95,158,.3); transition: transform .15s, box-shadow .2s, filter .2s; }
.rp-submit:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: 0 12px 28px rgba(42,95,158,.36); }
.rp-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.rp-total__note { font-size: 12px; color: var(--muted); margin: 14px 0 0; line-height: 1.4; }

/* --- Модалка --- */
.rp-modal { position: fixed; inset: 0; background: rgba(36,42,51,.5); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; backdrop-filter: blur(4px); }
.rp-modal.open { display: flex; }
.rp-modal__box { background: #fff; border-radius: 22px; padding: 28px; width: 100%; max-width: 440px; position: relative; box-shadow: 0 30px 70px rgba(36,42,51,.3); max-height: 90vh; overflow: auto; }
.rp-modal__close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--muted); line-height: 1; }
.rp-modal__box h2 { margin: 0 0 6px; font-size: 20px; }
.rp-modal__summary { background: #f6f8fb; border-radius: 12px; padding: 14px; margin: 14px 0; font-size: 14px; }
.rp-modal__summary .rp-ms-line { display: flex; justify-content: space-between; padding: 3px 0; }
.rp-modal__summary .rp-ms-total { border-top: 1px solid #dfe6ee; margin-top: 6px; padding-top: 8px; font-weight: 700; color: var(--primary-2); }
.rp-frow { margin-bottom: 14px; }
.rp-frow label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.rp-frow input, .rp-frow textarea { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 11px; font-size: 15px; font-family: inherit; }
.rp-frow input:focus, .rp-frow textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(53,121,201,.12); }
.rp-send { width: 100%; padding: 13px; background: var(--grad); color: #fff; border: none; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; }

@media (max-width: 900px) {
  .rp-layout { grid-template-columns: 1fr; }
  .rp-total { position: static; }
}
@media (max-width: 480px) {
  .rp-item { flex-direction: column; align-items: flex-start; gap: 10px; }
  .rp-item__qty { width: 100%; }
  .rp-header-inner { padding: 12px 16px; }
  .rp-main { padding: 24px 16px 60px; }
}