/* ========== Component 8: 부동산 실거래가 지도 ========== */
:root {
  --main08-honey-1: #f4c542;
  --main08-honey-2: #fee500;
  --main08-honey-3: #ffaa00;
}

.section-main08 {
  position: relative;
  z-index: 10;
  background: #fff;
  padding: 80px 20px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.section-main08 .main_re_container {
  max-width: 1700px;
  width: 100%;
  margin: 0 auto;
  font-family: 'pretendard', sans-serif;
}

.section-main08 .main_re_container .sec-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-main08 .main_re_container .title-container {
  margin-bottom: 20px;
}

.section-main08 .main_re_container .title-container h2 {
  font-size: 36px;
  font-weight: 600;
  color: #222222;
  margin-bottom: 10px;
}

.section-main08 .main_re_container .title-container p {
  font-size: 20px;
  font-weight: 400;
  color: #555555;
  margin: 0;
}

/* 지도 페이지 컨테이너 */
.main08-page {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* 지도 레이아웃 */
.main08-layout {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 0;
  min-height: 720px;
  box-sizing: border-box;
}

#main08-map {
  width: 100%;
  /* max-width: 1600px; */
  min-height: 620px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--main08-honey-1);
  position: relative;
  /* 지도 드래그를 위한 터치 액션 설정 */
  touch-action: pan-x pan-y;
  /* 커서 스타일 */
  cursor: grab;
}

#main08-map:active {
  cursor: grabbing;
}

/* Leaflet 지도 컨테이너 내부 링크 클릭 방지 */
#main08-map a,
#main08-map .leaflet-container a {
  pointer-events: auto;
  cursor: pointer;
  /* 링크 클릭 시 상단 이동 방지 */
  text-decoration: none;
}

#main08-map a:focus,
#main08-map .leaflet-container a:focus {
  outline: none;
}

#main08-sidebar {
  position: absolute;
  top: 20px;
  /* left: 50%; */
  right: -15%;
  transform: translateX(-50%);
  z-index: 20;
  /* width: calc(100% - 120px); */
  width: 30%;
  max-width: 1200px;
  background: rgba(255, 255, 255, 0.95);
  padding: 14px 18px;
  overflow: visible;
  border-radius: 12px;
  border: 1px solid #f1d27a;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
/* 리스트 영역 비표시 (검색만 사용) */
#main08-list {
  display: none;
}
.main08-search-box {
  display: flex;
  gap: 8px;
  width: auto;
  flex: 1 1 420px;
  margin-bottom: 0;
  box-sizing: border-box;
}
.main08-search-box input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--main08-honey-1);
  border-radius: 10px;
  background: #fffdf5;
  min-width: 0;
  box-sizing: border-box;
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}
.main08-search-box input:focus {
  outline: none;
  border-color: var(--main08-honey-3);
  box-shadow: 0 0 0 3px rgba(255, 170, 0, 0.2);
}

.main08-search-box button {
  border: none;
  background: var(--main08-honey-3);
  color: #5a3a00;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  font-family: 'pretendard', sans-serif;
  box-shadow: 0 8px 16px rgba(255, 170, 0, 0.2);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
}

.main08-search-box button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(255, 170, 0, 0.28);
  background: #fec64d;
}

.main08-search-box button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(255, 170, 0, 0.2);
}

.main08-search-box button:disabled {
  background: #f1e3b8;
  color: #8a7a4a;
  cursor: not-allowed;
  box-shadow: none;
}
.main08-status {
  text-align: center;
  padding: 10px 12px;
  font-weight: bold;
  background: #fff7c2;
  border-radius: 8px;
  margin: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #7a5200;
  flex: 1;
}
.main08-error {
  color: #e74c3c;
  background: #ffebee;
}

/* Leaflet 팝업 커스텀 스타일 */
.main08-popup .leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 0;
}

.main08-popup .leaflet-popup-content {
  margin: 0;
  padding: 0;
}

.main08-popup .leaflet-popup-tip {
  background: white;
  border: 1px solid #e0e0e0;
}
.main08-loader {
  width: 18px;
  height: 18px;
  border: 3px solid #ffe066;
  border-top-color: var(--main08-honey-3);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.main08-list-item {
  padding: 14px;
  margin-bottom: 8px;
  background: #fafafa;
  border-radius: 8px;
  border-left: 4px solid #3498db;
  cursor: pointer;
}
.main08-list-item:hover {
  background: #f0f8ff;
}
.main08-list-item.main08-sangga {
  border-left-color: #e67e22;
}
.main08-price {
  font-size: 1.3em;
  font-weight: bold;
  color: #27ae60;
}
.main08-sangga .main08-price {
  color: #e67e22;
}
.main08-summary {
  display: none;
}
.main08-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}
.main08-actions button {
  border: none;
  background: var(--main08-honey-3);
  color: #5a3a00;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(255, 170, 0, 0.2);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}
.main08-actions button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(255, 170, 0, 0.28);
  background: #fec64d;
}
.main08-actions button.main08-secondary {
  background: var(--main08-honey-1);
  box-shadow: 0 8px 16px rgba(244, 197, 66, 0.22);
}
.main08-actions button:disabled {
  background: #f1e3b8;
  color: #8a7a4a;
  cursor: not-allowed;
  box-shadow: none;
}

/* 반응형 디자인 */
@media (max-width: 1400px) {
  .section-main08 {
    padding: 60px 20px;
  }

  .main08-layout {
    gap: 18px;
  }

  #main08-sidebar {
    width: 40%;
    right: -18%;
  }
}

@media (max-width: 1024px) {
  .section-main08 {
    padding: 50px 15px;
  }

  .section-main08 .main_re_container .title-container {
    margin-bottom: 30px;
  }

  .section-main08 .main_re_container .title-container h2 {
    font-size: 32px;
  }

  .section-main08 .main_re_container .title-container p {
    font-size: 18px;
  }

  .main08-layout {
    gap: 16px;
    min-height: 620px;
    /* padding-top: 96px; */
  }

  #main08-map {
    min-height: 520px;
  }
}

@media (max-width: 768px) {
  .section-main08 .main_re_container .sec-container {
    gap: 40px;
  }
  .section-main08 {
    padding: 40px 15px;
  }

  .section-main08 .main_re_container .title-container {
    margin-bottom: 0;
  }

  .section-main08 .main_re_container .title-container h2 {
    font-size: 28px;
  }

  .section-main08 .main_re_container .title-container p {
    font-size: 16px;
  }

  .main08-page {
    margin: 0;
  }

  .main08-layout {
    flex-direction: column;
    min-height: auto;
    padding: 0;
    gap: 16px;
    align-items: stretch;
  }

  #main08-map {
    min-height: 400px;
    flex: none;
    width: 100%;
    max-width: 100%;
  }

  #main08-sidebar {
    position: static;
    transform: none;
    flex: none;
    max-height: none;
    width: 100%;
    max-width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    gap: 10px;
  }

  .main08-search-box {
    flex-direction: column;
    width: 100%;
    flex: none;
    margin-bottom: 10px;
  }

  .main08-search-box input {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .main08-search-box button {
    width: 100%;
    flex: none;
  }

  .main08-actions {
    flex-direction: column;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }

  .main08-actions button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .section-main08 {
    padding: 30px 10px;
  }

  .section-main08 .main_re_container .title-container h2 {
    font-size: 24px;
  }

  .section-main08 .main_re_container .title-container p {
    font-size: 14px;
  }

  .main08-layout {
    padding: 0;
    gap: 12px;
  }

  #main08-map {
    min-height: 350px;
    border-radius: 10px;
  }

  #main08-sidebar {
    border-radius: 10px;
    max-height: 350px;
  }

  .main08-status {
    padding: 10px;
    font-size: 14px;
  }

  .main08-search-box {
    flex-direction: column;
    width: 100%;
  }

  .main08-search-box input {
    padding: 8px 10px;
    font-size: 14px;
    width: 100%;
    flex: none;
  }

  .main08-search-box button {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    flex: none;
  }

  .main08-actions button {
    padding: 8px 12px;
    font-size: 14px;
  }

  .main08-summary {
    padding: 12px;
    font-size: 13px;
  }
}
