/* ivc-calc.css — калькулятор веса отливки, светлая тема "Отливка в ХТС" */
/* Изоляция: все правила под .ivc-calc. К переменным легко перетюнить бренд. */
/* v5: фигуры — Круг, Лист, Втулка (диск убран). */

.ivc-calc {
  --ivc-accent: #2b5f8a;
  --ivc-accent-dark: #1e4a6b;
  --ivc-accent-soft: #eaf1f7;
  --ivc-bg: #ffffff;
  --ivc-surface: #f6f8fa;
  --ivc-border: #dde1e6;
  --ivc-border-strong: #c4cbd2;
  --ivc-radius: 8px;
  --ivc-text: #2a2f35;
  --ivc-text-muted: #5b6470;
  --ivc-shadow: 0 1px 2px rgba(20,40,70,.06), 0 6px 18px rgba(20,40,70,.08);
  --ivc-font: Arial, Helvetica, sans-serif;
  box-sizing: border-box;
  background: var(--ivc-bg);
  border: 1px solid var(--ivc-border);
  border-radius: var(--ivc-radius);
  box-shadow: var(--ivc-shadow);
  padding: 22px;
  font-family: var(--ivc-font);
  color: var(--ivc-text);
  width: 100%;
  max-width: 760px;
}
.ivc-calc *, .ivc-calc *::before, .ivc-calc *::after { box-sizing: border-box; }

.ivc-calc h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ivc-text);
  line-height: 1.35;
}

.ivc-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
}
@media (max-width: 768px) {
  .ivc-grid { grid-template-columns: 1fr; }
}

.ivc-form { display: flex; flex-direction: column; }
.ivc-field { margin-bottom: 12px; }
.ivc-field:last-child { margin-bottom: 0; }

.ivc-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ivc-text);
  margin-bottom: 5px;
}

.ivc-select,
.ivc-dim-input {
  display: block;
  width: 100%;
  padding: 8px 30px 8px 10px;
  border: 1px solid var(--ivc-border);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: var(--ivc-text);
  font-family: inherit;
  line-height: 1.4;
}
.ivc-select:focus,
.ivc-dim-input:focus {
  outline: 2px solid var(--ivc-accent-soft);
  border-color: var(--ivc-accent);
}

.ivc-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235b6470' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

/* Переключатель геометрии — кнопки-пилюли (Круг, Лист, Втулка) */
.ivc-shapes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ivc-shape-btn {
  flex: 1 1 auto;
  min-width: 80px;
  padding: 7px 10px;
  border: 1px solid var(--ivc-border);
  border-radius: 999px;
  background: #fff;
  color: var(--ivc-text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.ivc-shape-btn:hover {
  border-color: var(--ivc-accent);
  color: var(--ivc-accent);
}
.ivc-shape-btn.active {
  background: var(--ivc-accent);
  color: #fff;
  border-color: var(--ivc-accent);
}

/* Поля размеров, которые рендерит JS в .ivc-dims */
.ivc-dims { display: block; }
.ivc-dim-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.ivc-dim-row:last-child { margin-bottom: 0; }
.ivc-dim-field { display: flex; flex-direction: column; }
.ivc-dim-label {
  font-size: 12px;
  color: var(--ivc-text-muted);
  margin-bottom: 3px;
}
.ivc-dim-input {
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 6px;
}

/* Кастомный ползунок припуска */
.ivc-range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ivc-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--ivc-border);
  outline: none;
  cursor: pointer;
  margin: 0;
}
.ivc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ivc-accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  cursor: pointer;
}
.ivc-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ivc-accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  cursor: pointer;
}
.ivc-range-val {
  min-width: 34px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--ivc-accent-dark);
}

/* Правая колонка — результат */
.ivc-result {
  background: var(--ivc-surface);
  border: 1px solid var(--ivc-border);
  border-radius: var(--ivc-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.ivc-result-label {
  font-size: 12px;
  color: var(--ivc-text-muted);
  margin-bottom: 4px;
}
.ivc-result-mass {
  font-size: 32px;
  font-weight: 700;
  color: var(--ivc-text);
  line-height: 1;
}
.ivc-result-unit {
  font-size: 16px;
  color: var(--ivc-text-muted);
  font-weight: 400;
  margin-left: 4px;
}
.ivc-result-divider {
  height: 1px;
  background: var(--ivc-border);
  margin: 12px 0;
}
.ivc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--ivc-text-muted);
  margin-bottom: 6px;
}
.ivc-result-row:last-of-type { margin-bottom: 0; }
.ivc-result-row .ivc-key { padding-right: 8px; }
.ivc-result-row .ivc-val {
  color: var(--ivc-text);
  font-weight: 600;
  white-space: nowrap;
}

/* CTA — стальной синий */
.ivc-cta {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 16px;
  background: var(--ivc-accent);
  color: #fff !important;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.ivc-cta:hover {
  background: var(--ivc-accent-dark);
  box-shadow: 0 2px 8px rgba(43,95,138,.3);
}
.ivc-cta:active { transform: translateY(1px); }
.ivc-cta-note {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ivc-text-muted);
}