/* 첫 화면(지도)에서만 쓰는 스타일 */

/* 맨 위 바(52px)를 뺀 나머지 높이를 지도와 옆 칸이 나눠 쓴다.
   휴대폰: 위에 지도, 아래에 옆 칸
   데스크톱: 왼쪽에 옆 칸, 오른쪽에 지도 */
.map-layout {
  display: flex;
  flex-direction: column;
  height: calc(100% - 52px);
}

/* 지도가 들어가는 자리 */
#map {
  position: relative;
  flex: 1;
  min-height: 200px;
  background: #f7f7f7;
}

/* 지도가 뜨기 전이나 못 띄웠을 때 나오는 안내 글자. 지도 자리 한가운데에 둔다 */
#map-message {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0 16px;
  transform: translateY(-50%);
  text-align: center;
}

/* 가게 목록이 들어가는 칸. HTML에서는 지도보다 앞에 있지만 휴대폰에서는 지도 아래에 보인다 */
.side-panel {
  order: 2;
  max-height: 45%;
  padding: 16px;
  border-top: 1px solid #e5e5e5;
  overflow-y: auto;
}

.side-panel p:last-child {
  margin-bottom: 0;
}

/* 작은 휴대폰 */
@media (max-width: 360px) {
  .side-panel {
    padding: 12px;
  }
}

/* 휴대폰을 가로로 돌렸을 때: 높이가 낮아서 위아래로 나누면 지도가 너무 작아진다. 좌우로 나눈다 */
@media (min-width: 600px) and (max-height: 500px) {
  .map-layout {
    flex-direction: row;
  }

  .side-panel {
    order: 0;
    width: 280px;
    max-height: none;
    border-top: none;
    border-right: 1px solid #e5e5e5;
  }
}

/* 태블릿 세로: 옆 칸 여백만 넓힌다 */
@media (min-width: 600px) {
  .side-panel {
    padding: 20px 24px;
  }
}

/* 데스크톱: 왼쪽에 옆 칸, 오른쪽에 지도 */
@media (min-width: 900px) {
  .map-layout {
    flex-direction: row;
  }

  .side-panel {
    order: 0;
    width: 360px;
    max-height: none;
    border-top: none;
    border-right: 1px solid #e5e5e5;
  }
}
