/* Всплывающая форма «Заказать оборудование».
   Переменные (--firmennyy-siniy, --zelenyy, --krasnyy, --siniy, --font-family,
   --second-family) приходят из style.css шаблона.
   Классы .modal, .modal--visible, .modal__btn-close — те же, что ждёт script.js темы. */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 28, 48, .55);
  overflow-y: auto;
}
.modal--visible { display: flex; }

.order-modal__box {
  position: relative;
  width: 100%;
  max-width: 720px;
  background: #fff;
  border: 1px solid var(--siniy);
  box-shadow: 0 18px 50px rgba(16, 28, 48, .25);
  padding: 30px 34px 34px;
  font-family: var(--font-family);
  margin: auto;
}

.order-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: #2464b9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s ease;
}
.order-modal__close:hover { color: var(--firmennyy-siniy); }
.order-modal__close svg { width: 18px; height: 18px; fill: currentColor; }

.order-modal__title {
  font-family: var(--second-family);
  font-weight: 700;
  font-size: 28px;
  line-height: 105%;
  text-transform: uppercase;
  color: #000;
  margin: 0 40px 22px 0;
}

/* ------------------------------------------------------------------ форма */
.order-form__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.order-form__field { display: flex; flex-direction: column; gap: 5px; }
.order-form__input,
.order-form__textarea {
  width: 100%;
  font-family: inherit;
  font-weight: 400;
  font-size: 14px;
  line-height: 114%;
  color: #000;
  border: 1px solid #d1d7e0;
  border-radius: 6px;
  padding: 14px 15px;
  background: #fff;
  transition: border-color .2s ease;
}
.order-form__textarea { min-height: 96px; resize: vertical; line-height: 140%; }
.order-form__input::placeholder,
.order-form__textarea::placeholder { color: #737d8b; }
.order-form__input:hover,
.order-form__textarea:hover { border-color: #737d8b; }
.order-form__input:focus,
.order-form__textarea:focus { border-color: var(--firmennyy-siniy); outline: none; }
.order-form__field--error .order-form__input,
.order-form__field--error .order-form__textarea { border-color: var(--krasnyy); background: #fffafa; }
.order-form__error { font-size: 11px; line-height: 130%; color: var(--krasnyy); }

.order-form__bottom {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.order-form__submit {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .5);
  background: var(--zelenyy);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  line-height: 114%;
  padding: 15px 34px;
  cursor: pointer;
  transition: filter .2s ease;
  min-width: 150px;
}
.order-form__submit:hover { filter: brightness(1.12); }
.order-form__submit[disabled] { opacity: .55; cursor: not-allowed; filter: none; }

.order-form__checks { display: flex; flex-direction: column; gap: 6px; flex: 1 1 0; min-width: 0; }
.order-form__check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 130%;
  color: #494c50;
  cursor: pointer;
}
.order-form__check input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  border: 1px solid #d5d5d5;
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
  position: relative;
  top: 1px;
}
.order-form__check input:checked {
  background: var(--firmennyy-siniy);
  border-color: var(--firmennyy-siniy);
}
.order-form__check input:checked:after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.order-form__check--error { color: var(--krasnyy); }
.order-form__check--error input { border-color: var(--krasnyy); }
.order-form__check a { color: var(--firmennyy-siniy); text-decoration: underline; text-underline-offset: 2px; }

/* поле-приманка для роботов: человек его не видит и не заполняет */
.order-form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.order-form__note {
  margin-top: 16px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 145%;
  border: 1px solid var(--siniy);
  background: var(--svetlosiniy);
  color: var(--firmennyy-siniy);
}
.order-form__note--error { border-color: var(--krasnyy); background: #fdeaea; color: var(--krasnyy); }

/* ------------------------------------------------------------------ успех */
.order-modal__done { text-align: center; padding: 18px 0 6px; }
.order-modal__done-ico {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--zelenyy);
  display: flex;
  align-items: center;
  justify-content: center;
}
.order-modal__done-ico svg { width: 26px; height: 26px; fill: #fff; }
.order-modal__done-title { font-weight: 600; font-size: 18px; color: #000; margin-bottom: 8px; }
.order-modal__done-text { font-size: 14px; line-height: 150%; color: #494c50; }

@media (max-width: 767px) {
  .order-modal__box { padding: 24px 18px 26px; }
  .order-modal__title { font-size: 24px; margin-right: 34px; }
  .order-form__row { grid-template-columns: 1fr; }
  .order-form__bottom { gap: 16px; }
  .order-form__submit { width: 100%; }
}

/* Кнопка «Заказать» в карточке товара.
   Это <button>, а не ссылка, чтобы у страницы не появлялся адрес с #order-modal.
   В отличие от <a>, кнопка в флекс-контейнере сжимается ниже своего содержимого,
   поэтому возвращаем ей нижнюю границу по содержимому. */
.product-card__btns .product__btn-modal { min-width: fit-content; }
