.modal {
    display: none;
    position: fixed;
    align-items: center;
    justify-content: center;
    inset: 0;
    z-index: 1050;
    background: rgba(16,29,25, 0.8);
    transition: background 0.3s ease;
    scrollbar-width: none;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 90%;
    width: auto;
    height: auto; /* высота по контенту */
    max-height: 90vh;
    margin: 0;
    padding: 0;
    transform: translateY(100vh);
    overflow: hidden auto;
    /* стартовое положение для анимации */
    transition: transform 0.3s ease;
    scrollbar-width: none;
    align-self: center;
}
/* Кнопка закрытия для десктопа */
.close-desktop {
  padding: 0;
    position: fixed;
  background: transparent;
  border: none;
  cursor: pointer;
  top: calc(50% - var(--modal-height) / 2);
  right: calc(50% - var(--modal-width) / 2 - 43px);
  z-index: 1100;
  display: none;
}

.close-desktop svg {
  display: block;
  width: 25px;
  height: 25px;
}

/* Мобильная шапка */
.modal-header-mobile {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    gap: 30px;
}

.modal-header-mobile button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.modal-header-mobile h2 {
    margin: 0;
    font-size: 16px;
    text-align: center;
    flex: 1;
}
.modal-exit__svg_arrow {
    display: none;
}
.modal-body {
    padding: 20px;
}

/* Анимации */
.show .modal-content {
    transform: translateY(0);
}

.hide .modal-content {
    transform: translateY(100vh);
}

@media (max-width: 767px) {
    .modal-content {
        max-height: 90dvh;
        max-width: 96%;
    }
    .close-desktop {
        display: none;
    }
    .modal-exit__svg_arrow {
        display: block;
        width: 19px;
        height: 14px;
    }
    .modal-body {
        padding: 10px;
    }
    .modal-header-mobile {
        display: flex;
    }
}
@media (max-width: 370px) {
    .modal-body {
        width: 100%;
    }
    .modal-content {
        max-width: 98vw;
        width: 98vw;
    }
}