/* order-modal.css — модалка "Ваш заказ" для кнопок .tmc-order-btn */

.order-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 10, 16, 0.78);
  backdrop-filter: blur(0px);
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), backdrop-filter 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity, backdrop-filter;
}

.order-modal-overlay.is-open {
  opacity: 1;
  backdrop-filter: blur(6px);
}

.order-modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--silver-box);
  border-radius: var(--cards-radius);
  padding: 14px;
  box-shadow: 0 25px 70px rgba(0,0,0,0.55);
  transform: scale(0.94);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

html.dark .order-modal {
  background-color: #020617;
  background-image: radial-gradient(circle at top, #312e81, transparent 70%), radial-gradient(circle at bottom, #312e81, transparent 70%);
  background-position: top center, bottom center;
  background-size: 100% 50%;
  background-repeat: no-repeat;
}

.order-modal-overlay.is-open .order-modal { transform: scale(1); }

.order-modal-close {
  position: absolute;
  top: 3px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
}

.order-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.order-modal-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-subhead-lg);
  color: var(--text);
  margin: 0;
}

.order-modal-total {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 24px;
  color: var(--text);
  white-space: nowrap;
}
.order-modal-total::after {
  content: ' \20BD';
  font-size: var(--text-body);
  font-weight: 700;
}

.home-tariff-custom .order-modal-total::after {
  content: ' \20BD/\043C\0435\0441.';
  font-size: var(--text-body);
  font-weight: 700;
}

.order-modal-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.order-modal-home-features {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.order-modal-home-features[hidden] { display: none; }

.order-modal-form { display: flex; flex-direction: column; gap: 5px; }

.order-modal-field { display: flex; flex-direction: column; gap: 3px; }

.order-modal-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.order-modal-optional { font-weight: 400; text-transform: none; }

.order-modal-field input,
.order-modal-field textarea {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rounded-md);
  padding: 10px 12px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}


.order-modal-field input::placeholder,
.order-modal-field textarea::placeholder { color: var(--text-dim); }

.order-modal-field input:focus,
.order-modal-field textarea:focus {
  border-color: var(--hue);
  box-shadow: inset 0 0 5px 1px color-mix(in srgb, var(--hue) 100%, transparent);
}
html.dark .order-modal-field input:focus,
html.dark .order-modal-field textarea:focus {
  box-shadow: inset 0 0 5px 1px color-mix(in srgb, var(--hue) 100%, transparent);
}

.order-modal-field textarea { resize: vertical; min-height: 60px; }

.order-modal-submit {
  padding: 8px;
  border: none;
  border-radius: var(--rounded-lg);
  background: var(--hue);
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: filter .2s ease, transform .2s ease;
}
.order-modal-submit:hover { filter: brightness(1.06); transform: translateY(-1px); }

.order-modal-error {
  margin: 0;
  font-size: var(--text-caption);
  color: var(--color-error);
  text-align: center;
}

.order-modal-success {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-success-text);
  text-align: center;
}

.address-suggest-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  max-height: 200px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rounded-md);
  box-shadow: 0 8px 24px var(--shadow-heavy);
}

.address-suggest-item {
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
}

.address-suggest-item:hover,
.address-suggest-item.is-active {
  background: var(--ghost-active);
}

/* ---------- consent checkbox ---------- */
.order-modal-consent { margin: 2px 0 4px; }

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.consent-check input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.consent-check__box {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: var(--rounded-xs);
  border: 1px solid var(--hue);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, border-color .2s ease;
}

.consent-check__box svg {
  width: 11px;
  height: 11px;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s ease, transform .15s ease;
}

.consent-check input:checked ~ .consent-check__box {
  background: var(--hue);
  border-color: var(--hue);
}
.consent-check input:checked ~ .consent-check__box svg {
  opacity: 1;
  transform: scale(1);
}

.consent-check input:focus-visible ~ .consent-check__box {
  outline: 2px solid var(--hue);
  outline-offset: 2px;
}

.consent-check__text {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}
.consent-check__text a {
  color: var(--hue);
  font-weight: 700;
  text-decoration: none;
}
.consent-check__text a:hover { text-decoration: underline; }

.order-modal-consent.has-error .consent-check__box {
  border-color: var(--color-error);
}

@media (max-width: 480px) {
  .order-modal { max-width: 100%; }
}