.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}
.modal-content {
  position: relative;
  max-width: 549px;
  width: 549px;
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  box-sizing: border-box;

  max-height: calc(100% - 16px);
  height: fit-content;
  overflow-y: hidden;
  margin: 8px;
  display: flex;
}

.modal-body {
  overflow-y: hidden;
  display: flex;
  flex: 1 1 auto; 
}

.modal.is-open {
  display: block;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
}

.modal--center .modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -51%);
}
.modal--left .modal-content {
  position: absolute;
  top: 50%;
  left: 0;

  transform: translate(0%, -51%);
}
.modal--right .modal-content {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translate(0, -51%);
}

.modal-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 36px;
  height: 36px;
  padding: 10.5;
  background-color: var(--color-white);
  border: none;
  border-radius: 50%;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {

  .modal--center .modal-content,
  .modal--left .modal-content,
  .modal--right .modal-content {
    position: fixed;
    inset: 0;

    transform: none;
    top: auto;
    left: auto;
    right: auto;
  }

  .modal-content {
    position: fixed;
    inset: 0;

    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;

    margin: 0;
    padding: 16px;

    border-radius: 0;
    transform: none !important;

    overflow-y: auto;
  }

  .modal-close{
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
    width: 48px;
    height: 48px;
    border-radius: 16px;

    left: 50%;
    transform: translateX(-50%);
    top: 8px;
  }
  .modal-close svg{
    width: 10px;
    height: 10px;
  }

  .modal-body {
    margin-top: 56px;
    overflow-y: auto;
    flex: 1 1 auto;
  }

  .modal-overlay {
    display: none; /* overlay не нужен, т.к. экран занят полностью */
  }
}