/* ========== Component 8: 부동산 실거래가 지도 ========== */
:root {
  --main08-honey-1: #f4c542;
  --main08-honey-2: #fee500;
  --main08-honey-3: #ffaa00;
}

.section-main08 {
  position: relative;
  z-index: 10;
  background: #ffffff;
}

.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: row;
  align-items: stretch;
  gap: 20px;
  padding-top: 0;
  min-height: 720px;
  box-sizing: border-box;
}

#main08-map {
  min-height: 750px;
  flex: 2;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--main08-honey-1);
  position: relative;
  touch-action: pan-x pan-y;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

#main08-map:active {
  cursor: grabbing;
}

#main08-sidebar .main08-deal-box {
  margin-top: 12px;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
}

.main08-deal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.main08-deal-list {
  max-height: 220px;
  overflow: auto;
  margin-top: 8px;
}

.main08-deal-item {
  border-bottom: 1px solid #eaeaea;
  padding: 10px 0;
  background: #fdfdfd;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.04);
}

.main08-deal-item:hover {
  background: #f7fbff;
}

.main08-deal-title {
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
  font-size: 14px;
}

.main08-deal-sub {
  color: #555;
  font-size: 12px;
  margin-bottom: 6px;
}

.main08-deal-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #777;
}

#main08-sidebar .main08-biz-box,
#main08-sidebar .main08-flow-box {
  margin-top: 8px;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 12px;
  background: #fffef8;
}

.main08-biz-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.main08-flow-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.main08-biz-card {
  border: 1px solid #eaeaea;
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
  position: relative;
  min-height: 60px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.main08-biz-card:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.main08-biz-card.active {
  border: 2px solid #2563eb;
  background: #eff6ff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.main08-biz-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 10%;
  background: #fff3d6;
  color: #8a5a00;
  font-weight: 600;
  font-size: 11px;
  word-break: keep-all;
  line-height: 1.2;
}

.main08-biz-pill.color-yellow { background: #fff3d6; color: #8a5a00; }
.main08-biz-pill.color-beige  { background: #f5e6d3; color: #6b4e3d; }
.main08-biz-pill.color-blue   { background: #d6e8f5; color: #1e4a6b; }
.main08-biz-pill.color-green  { background: #d6f5e8; color: #1e6b4a; }
.main08-biz-pill.color-pink   { background: #f5d6e8; color: #6b1e4a; }
.main08-biz-pill.color-purple { background: #e8d6f5; color: #4a1e6b; }
.main08-biz-pill.color-orange { background: #ffe6d6; color: #8a3a00; }
.main08-biz-pill.color-red    { background: #f5d6d6; color: #6b1e1e; }
.main08-biz-pill.color-teal   { background: #d6f5f5; color: #1e6b6b; }
.main08-biz-pill.color-gray   { background: #e8e8e8; color: #4a4a4a; }
.main08-biz-pill.color-brown  { background: #e8d6c8; color: #5c3a1e; }

.main08-biz-count {
  font-weight: 700;
  font-size: 14px;
  color: #2c3e50;
  padding: 2px 0;
}

.main08-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.main08-section-title { font-weight: 600; color: #333; }
.main08-section-sub   { font-size: 12px; color: #777; }
.main08-muted         { color: #999; font-size: 13px; margin: 0; }

.main08-store-status { margin-top: 8px; color: #666; font-size: 13px; }
.main08-store-list   { max-height: 200px; overflow: auto; margin-top: 8px; }
.main08-store-list > div { cursor: pointer; }

.main08-apt-status { margin-top: 8px; color: #4a6fa1; font-size: 13px; }
.main08-apt-list   { max-height: 200px; overflow: auto; margin-top: 8px; }
.main08-apt-list > div { cursor: pointer; }

.main08-status-margin { margin-top: 10px; }

#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: relative;
  flex: 1;
  max-width: 520px;
  height: 750px;
  max-height: 750px;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  padding: 14px 18px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid #f1d27a;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

#main08-sidebar .main08-store-box,
#main08-sidebar .main08-apt-box {
  margin-top: 12px;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 12px;
}
#main08-sidebar .main08-store-box { background: #fafafa; }
#main08-sidebar .main08-apt-box   { background: #f7fbff; }
#main08-sidebar .main08-deal-box  { margin-top: 12px; border: 1px solid #f0f0f0; border-radius: 10px; padding: 12px; background: #ffffff; }

#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; }

.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 { max-width: 460px; }
}
@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; }
  #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%; touch-action: pan-x pan-y pinch-zoom; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; overscroll-behavior: contain; position: relative; z-index: 1; }
  #main08-sidebar { position: static; transform: none; flex: none; max-height: none; height: auto; width: 100%; max-width: 100%; padding: 0; background: transparent; border: none; box-shadow: none; gap: 10px; overflow-y: visible; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; z-index: 0; }
  .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%; }
  .main08-biz-cards { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  .section-main08 { padding: 0; }
  .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; touch-action: pan-x pan-y pinch-zoom; -webkit-touch-callout: none; overscroll-behavior: contain; }
  #main08-sidebar { border-radius: 10px; max-height: none; overflow-y: visible; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .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; }
  .main08-biz-cards { grid-template-columns: repeat(4, 1fr); }
  .main08-biz-card { padding: 6px; min-height: 50px; }
  .main08-biz-pill { font-size: 10px; padding: 3px 6px; }
  .main08-biz-count { font-size: 12px; }
}

/* iframe 버전 스타일 */
.main08-container {
  max-width: 1700px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  font-family: 'pretendard', sans-serif;
  box-sizing: border-box;
}
.main08-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.main08-container .main08-header .title-container { margin-bottom: 20px; }
.main08-container .main08-header .title-container h2 { font-size: 36px; font-weight: 600; color: #222222; margin-bottom: 10px; }
.main08-container .main08-header .title-container p  { font-size: 20px; font-weight: 400; color: #555555; margin: 0; }

.main08-iframe-wrap {
  overflow: hidden;
  background: #ffffff;
}
.main08-iframe-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 1024px) {
  .main08-container .main08-header .title-container { margin-bottom: 30px; }
  .main08-container .main08-header .title-container h2 { font-size: 32px; }
  .main08-container .main08-header .title-container p  { font-size: 18px; }
}
@media (max-width: 768px) {
  .main08-container .main08-header .title-container { margin-bottom: 0; }
  .main08-container .main08-header .title-container h2 { font-size: 28px; }
  .main08-container .main08-header .title-container p  { font-size: 16px; }
  .main08-iframe-wrap iframe { height: 560px; }
}
@media (max-width: 480px) {
  .main08-container .main08-header .title-container h2 { font-size: 24px; }
  .main08-container .main08-header .title-container p  { font-size: 14px; }
}