.cityoverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.citydialog {
  background: #fff;
  width: 90%;
  max-width: 500px;
  border-radius: 16px;
  padding: 25px 20px 15px 20px;
  animation: fade .25s;
  position: relative;
  max-height: 80%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: scale(.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 5px;
}

.subtitle {
  font-size: 14px;
  margin-bottom: 15px;
  color: #555;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: #888;
}

.close-btn:hover {
  color: #333;
}

.citySearchInput {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
}

.city-list {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-bottom: 5px;
}

.city-item {
  padding: 10px;
  border-radius: 8px;
  background: #f9f9f9;
  text-align: center;
  cursor: pointer;
  transition: .1s;
}

.city-item:hover {
  background: #f0f8ff;
}

.selected {
  background: #d0e7ff;
}

.city-button {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 16px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 999;
}

.city-button:hover {
  background: #0056b3;
}

.cityoverlay.hide {
  animation: fadeOut .25s forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .citydialog {
    width: 95%;
    padding: 20px 15px 10px 15px;
  }

  .title {
    font-size: 20px;
  }

  .subtitle {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .city-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .city-item {
    padding: 8px;
    font-size: 13px;
  }

  .citySearchInput {
    padding: 8px 10px;
    font-size: 13px;
  }
}