/* Order popup — заявка из кнопки в шапке. */

.order-popup[hidden] { display: none; }

.order-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
}

.order-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(38, 38, 38, 0.5);
}

.order-popup__dialog {
  position: relative;
  z-index: 1;
  margin: auto;
  width: min(440px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--white, #ffffff);
  border-radius: 16px;
  padding: 24px;
}

.order-popup__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.order-popup__title {
  margin: 0;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.1;
  color: var(--text, #262626);
}

.order-popup__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text, #262626);
  cursor: pointer;
}

.order-popup__close svg {
  display: block;
  width: 24px;
  height: 24px;
}

.order-popup__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-popup__input {
  width: 100%;
  height: 52px;
  padding: 8px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: var(--white, #ffffff);
  font-family: inherit;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.4;
  color: var(--text, #262626);
}

.order-popup__input::placeholder { color: #bfbfbf; }
.order-popup__input:focus {
  outline: none;
  border-color: var(--green, #73d13d);
}

/* Состояние ошибки: красная рамка (как в UI-ките). */
.order-popup__input:user-invalid,
.order-popup__input[aria-invalid="true"],
.order-popup__input.is-error {
  border-color: #f5222d;
}

.order-popup__phone { width: 100%; }
.order-popup__phone .iti { width: 100%; display: block; }
.order-popup__phone .iti__selected-flag { background: transparent; }
.order-popup__phone .iti--separate-dial-code .iti__selected-flag { background: transparent; }
.order-popup__phone .iti--separate-dial-code .iti__selected-dial-code {
  color: var(--text, #262626);
  font-size: 16px;
}

.order-popup__submit {
  width: 100%;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 10px;
  background: var(--green, #73d13d);
  color: var(--white, #ffffff);
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  line-height: normal;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.order-popup__submit:hover { background: var(--green-hover, #52c41a); }
.order-popup__submit:disabled { opacity: 0.6; cursor: default; }

.order-popup__consent {
  margin: 0;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text, #262626);
}

.order-popup__consent a { color: #8c8c8c; text-decoration: underline; }

.order-popup__error {
  margin: 0;
  padding: 12px 16px;
  border-radius: 8px;
  background: #fff1f0;
  color: #cf1322;
  font-size: 14px;
  line-height: 1.4;
}

.order-popup__error[hidden] { display: none; }

/* Success state */
.order-popup__success[hidden] { display: none; }

.order-popup__success {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.order-popup__success-icon {
  display: flex;
  justify-content: center;
}

.order-popup__success-icon svg {
  display: block;
  width: 120px;
  height: 120px;
}

.order-popup__success-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.order-popup__success-title {
  margin: 0;
  font-weight: 600;
  font-size: 32px;
  line-height: 1.1;
  color: #1a2d3a;
}

.order-popup__success-sub {
  margin: 0;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: #595959;
}

.order-popup__ok {
  width: 100%;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 10px;
  background: var(--green, #73d13d);
  color: var(--white, #ffffff);
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.order-popup__ok:hover { background: var(--green-hover, #52c41a); }

/* Мобильный: нижний лист. */
@media (max-width: 768px) {
  .order-popup { align-items: flex-end; }

  .order-popup__dialog {
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    animation: order-popup-slide-up 0.25s ease;
  }

  .order-popup__success { padding-block: 16px; }
}

@keyframes order-popup-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
