/* ─── МОДАЛЬНОЕ ОКНО ──────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  /* align-items: center;  ← УБРАТЬ */
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: #1a1a1a;
  border: 2px solid #b84141;
  padding: 40px 32px;
  max-width: 500px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 36px;
  font-weight: bold;
  color: #b84141;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-content h2 {
  color: #b84141;
  font-size: 28px;
  margin-bottom: 28px;
  text-align: center;
  letter-spacing: 0.05em;
}

.form-row {
  margin-bottom: 20px;
}

.form-row label {
  display: block;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.06em;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 2px solid #b84141;
  background: #2a2a2a;
  color: #fff;
  font-family: inherit;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: #fff;
}

.form-row select option {
  background: #2a2a2a;
}

.form-row strong {
  color: #fff;
  font-size: 18px;
}

.submit-btn {
  width: 100%;
  padding: 16px;
  font-size: 20px;
  font-weight: 900;
  background: #b84141;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .12s;
  margin-top: 8px;
  font-family: inherit;
  letter-spacing: 0.08em;
}

.submit-btn:hover {
  background: #8b2f2f;
  transform: scale(1.03);
}

.submit-btn:active {
  transform: scale(0.98);
}

.cdek-link {
  display: inline-block;
  margin-left: 0.5em;
  font-size: 0.75em;
  color: #e8a000;
  text-decoration: none;
  letter-spacing: 0.03em;
}

.cdek-link:hover {
  text-decoration: underline;
}

.price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  font-size: 0.9em;
  color: white;
}

.price-breakdown strong {
  font-size: 1.1em;
  margin-top: 0.2em;
}

.modal-legal {
  margin-top: 14px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  line-height: 1.6;
  text-align: center;
  color: white;
}

.modal-legal a {
  color: rgba(255,255,255,0.6);
  text-decoration: underline;
}

.modal-legal a:hover {
  color: #fff;
}

/* ─── BOTTOM SHEET (до 560px) ─────────────────────────────── */
@media (max-width: 560px) {
   .modal {
    align-items: flex-end;  /* выравниваем контент к низу */
    padding: 0 0 0;         /* убираем паддинги, чтобы не мешали */
  }

  .modal-content {
    padding: 28px 18px;
    max-height: 80vh;       /* чтобы не занимала весь экран */
    margin-top: 20px;    /* ← ВОТ ЭТО опускает блок выше низа */
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .modal-content h2 {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .modal-close {
    font-size: 28px;
    top: 12px;
    right: 16px;
  }
  .form-row input,
  .form-row select,
  .form-row textarea {
    font-size: 16px;
    padding: 10px 12px;
  }

  .submit-btn {
    font-size: 17px;
    padding: 14px;
  }
}

.modal-subtitle {
  margin-top: -10px;
  margin-bottom: 24px;
  font-size: 12px;
  line-height: 1.5;
  color: #ffffff;
  text-align: center;
  letter-spacing: 0.03em;
  opacity: 0.85;
}

/* ─── МАЛЕНЬКИЕ ТЕЛЕФОНЫ (до 360px) ──────────────────────── */
@media (max-width: 360px) {

  .modal {

  }
  .modal-content {
    padding: 20px 12px;
    max-height: 98vh;
  }

  .modal-content h2 {
    font-size: 17px;
    margin-bottom: 14px;
  }

  .form-row {
    margin-bottom: 14px;
  }

  .form-row label {
    font-size: 11px;
  }

  .form-row input,
  .form-row select,
  .form-row textarea {
    padding: 8px 10px;
    font-size: 15px;
  }

  .submit-btn {
    font-size: 15px;
    padding: 12px;
  }

  .modal-close {
    font-size: 24px;
    top: 10px;
    right: 12px;
  }
}

/* ─── ЛАНДШАФТ НА ТЕЛЕФОНЕ ────────────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .modal {
    align-items: center;
    padding: 10px;
  }

  .modal-content {
    max-height: 92vh;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }

  .modal-content h2,
  .submit-btn,
  .form-row:last-of-type {
    grid-column: 1 / -1;
  }

  .modal-content h2 {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .form-row {
    margin-bottom: 10px;
  }

  .form-row input,
  .form-row select,
  .form-row textarea {
    padding: 7px 10px;
    font-size: 14px;
  }

  .form-row textarea {
    height: 36px;
    resize: none;
  }

  .submit-btn {
    font-size: 15px;
    padding: 10px;
    margin-top: 4px;
  }
}
