.map-popup,
.table-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100dvw;
  height: 100dvh;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.map-popup.show,
.table-popup.show {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
}

.map-popup.show {
  z-index: 10000;
}

.table-popup.show {
  z-index: 10010;
}

.map-popup-overlay,
::backdrop {
  background-color: rgba(0, 0, 0, 0.7);
}

.map-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.map-popup-content,
.table-popup-content {
  background-color: #ffffff;
  border-radius: 12px;
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 90%;
  max-height: 90%;
  width: 1000px;
  height: 700px;
  margin: auto;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.map-popup-content {
  z-index: 2;
  position: absolute;
  overscroll-behavior: contain;
}

.map-popup-header,
.table-popup-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f8f9fa;
}

.table-popup-header h3 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
  color: #34404c;
}

.map-popup-apply {
  margin-left: auto;
}

.map-popup-close,
.table-popup-close {
  background: #555;
  border: none;
  font-size: 1.8rem;
  line-height: 3.2rem;
  color: white;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.map-popup-close:hover,
.table-popup-close:hover,
.map-popup-close:active,
.table-popup-close:active {
  background-color: #333;
}

.map-popup-body,
.table-popup-table-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: hidden;
}

.table-popup-table {
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 1.4rem;
}

.table-popup-table-header-cell,
.table-popup-table-body-cell {
  padding: 1.5rem 1rem;
  text-align: center;
  border-bottom: 1px solid rgb(193, 193, 193);
}

.table-popup-table-body-cell:nth-of-type(1) {
  /* padding: 0.5rem; */
  text-align: left;
  text-overflow: ellipsis;
  overflow: hidden;
  width: auto;
}

.table-popup-table-body-cell:nth-of-type(2),
.table-popup-table-body-cell:nth-of-type(3) {
  width: 160px;
}

.yandex-map {
  flex: 1;
  min-height: 400px;
  border: none;
}

.map-selection-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-popup .row {
  margin-bottom: 0;
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.selected-city {
  font-size: 1.7rem;
  color: #34404c;
  font-weight: 600;
}

.selected-project {
  font-size: 1.2rem;
  color: #34404c;
  /* font-weight: 600; */
}

.ymaps-2-1-79-gototech,
.ymaps-2-1-79-gotoymaps {
  display: none !important;
}

@media screen and (max-width: 768px) {
  .map-popup-content,
  .table-popup-content {
    max-width: 100dvw;
    max-height: 100dvh;
    width: 100dvw;
    height: 100dvh;
    border-radius: 0;
    margin: 0;
  }

  .map-popup-header,
  .table-popup-header {
    padding: 15px 20px;
  }

  .table-popup-close,
  .map-popup-close {
    font-size: 1.8rem;
    min-width: 2.8rem;
    width: 28px;
    height: 28px;
  }

  .selected-city {
    font-size: 1.6rem;
  }

  .selected-project {
    font-size: 1.2rem;
  }

  .yandex-map {
    min-height: 300px;
  }

  .table-popup-table-body-cell {
    display: flex;
    padding: 0.75rem !important;
    align-items: flex-start;
    text-align: left;
    border: 0;
    width: 100% !important;
  }

  .table-popup-table-body-cell::before {
    content: attr(label);
    font-weight: bold;
    width: 100px !important;
    min-width: 100px !important;
    text-align: left;
  }

  .table-popup-table-body-cell:first-of-type {
    padding-top: 24px !important;
  }

  .table-popup-table-body-cell:last-of-type {
    padding-bottom: 24px !important;
    border-bottom: 2px solid rgb(193, 193, 193);
  }

  .table-popup-table-body-row:last-of-type
    > .table-popup-table-body-cell:last-of-type {
    border-bottom: 0;
  }

  .table-popup-table-header {
    display: none;
  }
}

@media screen and (max-width: 460px) {
  .map-popup-header,
  .table-popup-header {
    padding: 12px 15px;
  }

  .table-popup-header h3 {
    font-size: 1.4rem;
  }

  .selected-city {
    font-size: 1.5rem;
  }

  .selected-project {
    font-size: 1.1rem;
  }

  .yandex-map {
    min-height: 250px;
  }
}
