/* =========================================================
   Калькулятор окупаемости (главная и страница товара)
   ========================================================= */
.calc-section { position: relative; }
.calc-head { display: flex; align-items: center; gap: 136rem; padding-left: 164rem; margin-bottom: 40rem; }
.calc-head .section-title { width: 538rem; margin-bottom: 0; }
.calc-head .section-subtitle { margin-top: 0; margin-bottom: 0; text-align: left; }
.calc-section > .container > form > .section-subtitle { margin-top: 10rem; }

.calc-form { position: relative; }
.calc-wrapper {
  position: relative;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1540 554'%3E%3Cpath d='M0 90A90 90 0 0 1 90 0H1450A90 90 0 0 1 1540 90V400A90 90 0 0 1 1450 490H1115C1098.600 490 1082.500 494.600 1068.500 503.100L1006 541C992 549.500 975.800 554 959.400 554H90A90 90 0 0 1 0 464Z'/%3E%3C/svg%3E") top / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1540 554'%3E%3Cpath d='M0 90A90 90 0 0 1 90 0H1450A90 90 0 0 1 1540 90V400A90 90 0 0 1 1450 490H1115C1098.600 490 1082.500 494.600 1068.500 503.100L1006 541C992 549.500 975.800 554 959.400 554H90A90 90 0 0 1 0 464Z'/%3E%3C/svg%3E") top / contain no-repeat;
  background-color: #fff;
  height: 554rem;
  padding: 82rem 136rem 0;
}
.calc-row { --gap: 58rem; --columns: 3; display: flex; flex-wrap: wrap; gap: var(--gap); row-gap: 40rem; }
.calc-row > * { width: calc(100% / var(--columns) - var(--gap) + var(--gap) / var(--columns)); margin-bottom: 28rem; }

.calc-input label { display: block; color: var(--c-dark); font-family: var(--font-main); font-size: 22rem; line-height: 24rem; margin-bottom: 14rem; text-align: left; }
.calc-input label br { display: none; }
.calc-input input[type=text], .calc-input input[type=number] {
  -webkit-appearance: none;
  appearance: none;
  -moz-appearance: textfield;
  display: block;
  width: 100%;
  height: 72rem;
  margin: 0;
  padding: 0 20rem;
  border-radius: 80px;
  background: var(--c-light);
  border: 2px solid #fff;
  outline: none;
  color: var(--c-dark);
  text-align: center;
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 20rem;
  line-height: 140%;
  cursor: pointer;
}
.calc-input input::-webkit-inner-spin-button, .calc-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.calc-input input:focus-visible, .calc-select__button:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 0; }

/* выпадающий список оборудования */
.calc-select { position: relative; }
.calc-select__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 72rem;
  padding: 0;
  background: var(--c-light);
  border: 2px solid #fff;
  border-radius: 80rem;
  font-family: var(--font-main);
  font-size: 22rem;
  line-height: 24rem;
  color: var(--c-dark);
  position: relative;
}
.calc-select__button::after {
  content: '';
  position: absolute;
  right: 30rem;
  top: 50%;
  margin-top: -14rem;
  width: 28rem;
  height: 28rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28' fill='none'%3E%3Crect width='28' height='28' rx='4' fill='%23E84C61'/%3E%3Cpath d='m21 12-5.600 5.700a2 2 0 0 1-2.800 0L7 12' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .2s;
}
.calc-select.is-open .calc-select__button::after { transform: rotate(180deg); }
.calc-select__list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 5;
  margin: 4rem 0;
  padding: 0;
  list-style: none;
  background: var(--c-light);
  border-radius: 40rem 0 0 40rem;
  max-height: 300rem;
  overflow: auto;
  scrollbar-width: thin;
  display: none;
}
.calc-select.is-open .calc-select__list { display: block; }
.calc-select__list li {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72rem;
  font-family: var(--font-main);
  font-size: 22rem;
  line-height: 24rem;
  color: var(--c-dark);
  cursor: pointer;
}
.calc-select__list li:hover, .calc-select__list li.is-focus { background-color: #E2EAF2; }

/* ползунок */
.calc-range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 20rem;
  margin: 16.5rem 0 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  --p: 0%;
}
.calc-range::-webkit-slider-runnable-track { height: 5rem; border-radius: 10px; background: linear-gradient(to right, #00374D, #E84C61) 0 0 / var(--p) 100% no-repeat, var(--c-light); }
.calc-range::-moz-range-track { height: 5rem; border-radius: 10px; background: linear-gradient(to right, #00374D, #E84C61) 0 0 / var(--p) 100% no-repeat, var(--c-light); }
.calc-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20rem; height: 20rem; margin-top: -7.5rem; border: 0; border-radius: 50%; background: var(--c-accent); }
.calc-range::-moz-range-thumb { width: 20rem; height: 20rem; border: 0; border-radius: 50%; background: var(--c-accent); }

/* количество с кнопками − + */
.calc-number { position: relative; }
.calc-number__control { display: flex; gap: 5rem; position: absolute; right: 20rem; top: 50%; margin-top: -15rem; }
.calc-number__control button { display: block; width: 30rem; height: 30rem; padding: 0; border: 0; border-radius: 5rem; background: var(--c-accent); position: relative; transition: opacity .3s; -webkit-user-select: none; user-select: none; }
.calc-number__control button:hover { opacity: .5; }
.calc-number__control button::before, .calc-number__control button[data-step="1"]::after { content: ''; position: absolute; left: 50%; top: 50%; width: 40%; height: 2px; margin: -1px 0 0 -20%; background: #fff; }
.calc-number__control button[data-step="1"]::after { transform: rotate(90deg); }

.calc-button { text-align: center; position: absolute; right: 138rem; bottom: 0; }

/* ---------- планшет (главная) ---------- */
@media (max-width: 991px) {
  .calc-input--equipment, .calc-input--quantity { order: 0; }
  .calc-input--salary, .calc-input--cost, .calc-input--rent, .calc-input--percent { order: 2; }
  .scale-tablet .calc-head { gap: 78rem; padding-left: 25rem; margin-bottom: 15rem; }
  .scale-tablet .calc-head .section-title { width: auto; }
  .scale-tablet .calc-wrapper {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 646 365'%3E%3Cpath d='M606 0A40 40 0 0 1 646 40V290A30 30 0 0 1 616 320H396C388.300 320 380.900 323 375.300 328.300L345.500 356.700C339.900 362 332.500 365 324.800 365H40A40 40 0 0 1 0 325V40A40 40 0 0 1 40 0Z'/%3E%3C/svg%3E") top / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 646 365'%3E%3Cpath d='M606 0A40 40 0 0 1 646 40V290A30 30 0 0 1 616 320H396C388.300 320 380.900 323 375.300 328.300L345.500 356.700C339.900 362 332.500 365 324.800 365H40A40 40 0 0 1 0 325V40A40 40 0 0 1 40 0Z'/%3E%3C/svg%3E") top / contain no-repeat;
    padding: 26rem 100rem 0;
    height: 365rem;
    aspect-ratio: 646 / 365;
  }
  .scale-tablet .calc-row { row-gap: 20rem; --gap: 46rem; }
  .scale-tablet .calc-row > * { margin-bottom: 0; }
  .scale-tablet .calc-input label { font-size: 14rem; line-height: 16rem; margin-bottom: 6rem; min-height: 18rem; }
  .scale-tablet .calc-input input[type=text], .scale-tablet .calc-input input[type=number] { height: 37rem; font-size: 13rem; padding: 0 6rem; }
  .scale-tablet .calc-select__button { height: 37rem; font-size: 14rem; }
  .scale-tablet .calc-select__button::after { width: 22rem; height: 22rem; right: 20rem; margin-top: -11rem; }
  .scale-tablet .calc-select__list li { height: 30rem; font-size: 14rem; line-height: 16rem; }
  .scale-tablet .calc-range { margin-top: 0; height: 8rem; }
  .scale-tablet .calc-range::-webkit-slider-runnable-track { height: 2rem; }
  .scale-tablet .calc-range::-moz-range-track { height: 2rem; }
  .scale-tablet .calc-range::-webkit-slider-thumb { width: 6rem; height: 6rem; margin-top: -2rem; }
  .scale-tablet .calc-range::-moz-range-thumb { width: 6rem; height: 6rem; }
  .scale-tablet .calc-number__control { margin-top: -11rem; right: 20rem; }
  .scale-tablet .calc-number__control button { width: 22rem; height: 22rem; border-radius: 4rem; }
  .scale-tablet .calc-button { right: 15rem; }
  .scale-tablet .calc-button .btn { font-size: 14rem; }
}

/* ---------- телефон ---------- */
@media (max-width: 767px) {
  .calc-section { margin-bottom: 88rem; }
  .calc-head, .scale-tablet .calc-head { padding: 0; margin: 0; position: absolute; left: 14rem; z-index: 1; gap: 0; }
  .calc-head .section-title { width: auto; }
  .calc-wrapper, .scale-tablet .calc-wrapper {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 296 361'%3E%3Cpath d='M13 23C6.300 23 0 27.300 0 34V327A34 34 0 0 0 34 361H262A34 34 0 0 0 296 327V34A34 34 0 0 0 262 0H136.600C129.300 0 122.800 4.600 120.500 11.500C118.100 18.400 111.600 23 104.300 23Z'/%3E%3C/svg%3E") top / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 296 361'%3E%3Cpath d='M13 23C6.300 23 0 27.300 0 34V327A34 34 0 0 0 34 361H262A34 34 0 0 0 296 327V34A34 34 0 0 0 262 0H136.600C129.300 0 122.800 4.600 120.500 11.500C118.100 18.400 111.600 23 104.300 23Z'/%3E%3C/svg%3E") top / contain no-repeat;
    height: auto;
    padding: 40rem 12rem 0;
    width: 100%;
    aspect-ratio: 296 / 361;
  }
  .calc-row, .scale-tablet .calc-row { --columns: 2; --gap: 8rem; row-gap: 20rem; }
  .calc-row > *, .scale-tablet .calc-row > * { margin-bottom: 10rem; }
  .calc-input label, .scale-tablet .calc-input label { font-size: 10rem; line-height: 12rem; text-align: left; margin-bottom: 6rem; min-height: 23rem; }
  .calc-input label br { display: inline; }
  .calc-input--percent label br { display: none; }
  .calc-input input[type=text], .calc-input input[type=number],
  .scale-tablet .calc-input input[type=text], .scale-tablet .calc-input input[type=number] { height: 30rem; font-size: 12rem; padding: 0 10rem; }
  .calc-select__button, .scale-tablet .calc-select__button { height: 30rem; min-height: 30rem; font-size: 12rem; }
  .calc-select__button::after, .scale-tablet .calc-select__button::after { width: 14rem; height: 14rem; right: 8rem; margin-top: -7rem; }
  .calc-select__list { border-radius: 15rem; }
  .calc-select__list li, .scale-tablet .calc-select__list li { height: 30rem; font-size: 12rem; }
  .calc-range, .scale-tablet .calc-range { margin-top: 7rem; height: 8rem; }
  .calc-range::-webkit-slider-runnable-track { height: 2rem; }
  .calc-range::-moz-range-track { height: 2rem; }
  .calc-range::-webkit-slider-thumb, .scale-tablet .calc-range::-webkit-slider-thumb { width: 8rem; height: 8rem; margin-top: -3rem; }
  .calc-range::-moz-range-thumb, .scale-tablet .calc-range::-moz-range-thumb { width: 8rem; height: 8rem; }
  .calc-number__control, .scale-tablet .calc-number__control { margin-top: -7rem; right: 8rem; }
  .calc-number__control button, .scale-tablet .calc-number__control button { width: 14rem; height: 14rem; border-radius: 3rem; }
  .calc-number__control button:hover { opacity: 1; }
  .calc-button, .scale-tablet .calc-button { position: absolute; right: auto; left: 0; bottom: 0; width: 100%; margin-bottom: -55rem; }
  .scale-tablet .calc-button .btn { font-size: 13rem; }
  .calc-section > .container > form > .section-subtitle { margin-top: -35rem; }
}
