/* ==========================================
 * 검색관련
 * ========================================== */

/* map_mode가 있을 때 기본은 3개 */
.map-mode #listCanvas {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

/* map_mode가 있을 때 2000px 이하에서는 2개로 변경 */
@media (max-width: 1999px) {
    .map-mode #listCanvas {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 999px) {
    .map-mode #listCanvas {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Bootstrap col 스타일 무력화 */
.map-mode #listCanvas > [class*="col-"] {
    width: 100%;
    flex: none;
}

/* 공통 스타일 */
.map-label {
    background-color: var(--bs-primary); /* Bootstrap 기본 primary 색상 사용 */
    color: white;
    font-weight: bold;
    font-size: 14px;
    border-radius: 50%;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25); /* 부드러운 입체감 */
    transition: transform 0.2s ease-in-out;
}

.map-label:hover {
    background-color: #fff !important;
    border: 1px solid #333 !important;
    color: #333 !important;
    position: relative;
    z-index: 1000;
}

.map-label.active {
    background-color: #fff !important;
    border: 1px solid #333 !important;
    color: #333 !important;
    position: relative;
    z-index: 1000;
}

.property-search-wrapper .dropdown {
    position: relative;
    max-width: 180px;
}

#section-mobile-more {
    display: none; /* 모바일 기본 숨김 */
}

@media (max-width: 767.98px) {
    #section-mobile-more.mobile-active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 1050;
        background-color: #fff;
        overflow-y: auto;
    }

    .mobile-more-header {
        padding: 15px;
        border-bottom: 1px solid #dee2e6;
    }

    #section-mobile-more.mobile-active #section-mobile-more-body {
        padding: 15px;
    }
}

@media (min-width: 768px) {
    #section-mobile-more {
        display: flex !important;
        gap: 1rem;
        position: static;
        height: auto;
        background: transparent;
    }
}

.mobile-more-header,
.btn-mobile-more {
    display: none;
}

/* 모바일 화면일 경우 50%로 변경 */

@media (max-width: 768px) {
    .property-search-wrapper .dropdown {
        max-width: 100% !important;
        width: 100% !important;
    }

    .property-search-wrapper .position-relative {
        width: 100% !important;
    }

    #mapToggle {
        position: fixed;
        z-index: 1000;
        left: 50%;
        transform: translateX(-50%);
        bottom: 20px;
        top: auto !important; /* 기존 top 값 무효화 */
    }

    .mobile-more-header,
    .btn-mobile-more {
        display: block;
    }
}

.property-search-wrapper .dropdown .dropdown-toggle-box {
    cursor: pointer;

    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.7;

    appearance: none;
    background-color: var(--bs-body-bg);
    background-clip: padding-box;
    border: 1px solid rgb(26, 24, 22);
    border-radius: 0.4rem;
    box-shadow: 0rem 0rem 1.25rem rgba(30, 34, 40, 0.04);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;

    padding-right: 30px;
    color: rgb(26, 24, 22);

    white-space: nowrap;
    /* 줄 바꿈 금지 */
    overflow: hidden;
    /* 넘친 부분 숨김 */
    text-overflow: ellipsis;
    /* 말줄임표(...) 표시 */
}

.property-search-wrapper .dropdown i {
    position: absolute;
    top: 9px;
    right: 5px;
    font-size: 20px;
    color: rgb(26, 24, 22);
}

.property-search-wrapper .dropdown .dropdown-menu {
    min-width: 350px;
    margin-top: 10px !important;
}

#mainprice_slider {
    max-width: 100%;
    height: auto;
}

#subprice_slider {
    max-width: 100%;
    height: 80px;
}

#mapToggle.btn-group > .btn {
    padding: 0.375rem 1.25rem;
}

#mapToggle.btn-group > .btn.active {
    background-color: white;
    border: 1px solid #000;
    color: black;
}

html.map-mode,
body.map-mode {
    overflow: hidden;
    height: 100vh;
}


#mainContent {
    height: auto;
    background-color: #f9f9f9;
}

body.map-mode #mainContent {
    height: calc(100vh - 181px);
    /* 지도 모드일 때만 높이 제한 */
    display: flex;
}

#listPanel {
    width: 100%;
    height: auto;
    overflow: visible;
}

body.map-mode #listPanel {
    width: 50%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    max-width: 100% !important; /* 지도모드에서는 container의 max-width제약을 없앰 */
}

#mapPanel {
    width: 50%;
    height: 100%;
    position: relative;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: block;
    /* 항상 block, 대신 보여짐은 상태로 제어 */
    pointer-events: none;
    /* 비활성화된 상태일 때 클릭 방지 */
}

body.map-mode #mapPanel {
    opacity: 1;
    transform: translateX(0%);
    pointer-events: auto;
}

body.map-mode #mapPanel {
    display: block;
}

#mapCanvas {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

.cursor-pointer {
    cursor: pointer;
}

@media (max-width: 767.98px) {
    /* ✅ 모바일에서는 숨김 */
    body.map-mode #listPanel {
        display: none;
    }
    #mapPanel {
        width: 100%;
    }

    body.map-mode footer {
        display: none;
    }
}

/* 구글지도 인포윈도우 패딩 제거 및 스타일 조정*/
.gm-style .gm-style-iw-c {
    padding: 0px !important;
}
.gm-style .gm-style-iw-d {
    overflow: hidden !important;
}

.gm-style .gm-style-iw-d .mb-4 {
    margin-bottom: 0rem !important;
}

.gm-style-iw-ch {
    display: none;
}
.gm-style-iw-chr {
    position: relative;
}
.gm-style-iw-chr button {
    position: absolute !important;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.gm-ui-hover-effect > span {
    background-color: #fff !important;
}

#mapCanvas > div > div > div > div {
    border: none !important;
}
/* ==========================================
 * 공통 테이블 스타일 (.property-table 등)
 * ========================================== */
.property-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin-bottom: 20px !important;
    border-bottom: 1px solid #ddd !important;
}

.property-th {
    width: 20% !important;
    min-width: 100px !important;
    border-top: 1px solid #dddddd !important;
    border-bottom: 1px solid #dddddd !important;
    padding: 8px !important;
    word-wrap: break-word !important;
    word-break: keep-all !important;
}

.property-th-light {
    background-color: #f9f9f9 !important;
}

.property-th-dark {
    background-color: #0c1427 !important;
    color: #fff !important;
}

.property-td {
    width: 80% !important;
    border-top: 1px solid #dddddd !important;
    border-bottom: 1px solid #dddddd !important;
    padding: 8px !important;
    word-wrap: break-word !important;
    word-break: keep-all !important;
}

/* ==========================================
 * 부동산 상세페이지 테이블 스타일 (.propert-content)
 * ========================================== */

/* 기본 구조 */
.propert-content figure.table {
    width: 100% !important;
    margin: 20px 0 !important;
}

.propert-content figure.table table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin: 0 !important;
    border-bottom: 1px solid #ddd !important;
}

/* 2열 테이블 (건축물대장, 토지정보 등) */
.propert-content figure.table table tbody tr th {
    width: 20% !important;
    min-width: 120px !important;
    border: 1px solid #dddddd !important;
    padding: 10px 8px !important;
    background-color: #f9f9f9 !important;
    font-weight: 600 !important;
    text-align: left !important;
    vertical-align: middle !important;
    word-wrap: break-word !important;
    word-break: keep-all !important;
}

.propert-content figure.table table tbody tr td {
    width: 80% !important;
    border: 1px solid #dddddd !important;
    padding: 10px 8px !important;
    vertical-align: middle !important;
    word-wrap: break-word !important;
    word-break: keep-all !important;
    line-height: 1.4 !important;
}

/* 4열 테이블 (층별 정보 헤더) */
.propert-content figure.table table thead tr th {
    border: 1px solid #dddddd !important;
    padding: 10px 8px !important;
    background-color: #f9f9f9 !important;
    font-weight: 600 !important;
    text-align: left !important;
    vertical-align: middle !important;
    word-wrap: break-word !important;
    word-break: keep-all !important;
}

.propert-content figure.table table thead tr th:nth-child(1) {
    width: 15% !important;
    min-width: 80px !important;
}

.propert-content figure.table table thead tr th:nth-child(2) {
    width: 20% !important;
    min-width: 100px !important;
}

.propert-content figure.table table thead tr th:nth-child(3),
.propert-content figure.table table thead tr th:nth-child(4) {
    width: 32.5% !important;
    min-width: 120px !important;
}

/* 4열 테이블 (층별 정보 내용) */
.propert-content figure.table table:has(thead) tbody tr td {
    border: 1px solid #dddddd !important;
    padding: 8px !important;
    text-align: center !important;
    vertical-align: middle !important;
    word-wrap: break-word !important;
    word-break: keep-all !important;
    line-height: 1.3 !important;
}

.propert-content figure.table table:has(thead) tbody tr td:nth-child(1) {
    width: 15% !important;
    font-weight: 500 !important;
}

.propert-content figure.table table:has(thead) tbody tr td:nth-child(2) {
    width: 20% !important;
    font-weight: 500 !important;
}

.propert-content figure.table table:has(thead) tbody tr td:nth-child(3),
.propert-content figure.table table:has(thead) tbody tr td:nth-child(4) {
    width: 32.5% !important;
    text-align: left !important;
}

/* 제목 스타일 */
.propert-content h3 {
    font-size: 1.3rem !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin: 30px 0 15px 0 !important;
    padding-bottom: 8px !important;
    border-bottom: 2px solid #007bff !important;
}

.propert-content h3:first-of-type {
    margin-top: 20px !important;
}

/* ==========================================
 * 반응형 대응
 * ========================================== */
@media (max-width: 768px) {
    .propert-content figure.table table {
        font-size: 13px !important;
    }

    .propert-content figure.table table th,
    .propert-content figure.table table td {
        padding: 6px 4px !important;
    }

    .propert-content figure.table table tbody tr th {
        min-width: 100px !important;
    }

    .propert-content figure.table table thead tr th:nth-child(1) {
        min-width: 60px !important;
    }

    .propert-content figure.table table thead tr th:nth-child(2) {
        min-width: 80px !important;
    }

    .propert-content figure.table table thead tr th:nth-child(3),
    .propert-content figure.table table thead tr th:nth-child(4) {
        min-width: 100px !important;
    }
}

@media (max-width: 576px) {
    .propert-content figure.table table {
        font-size: 12px !important;
    }

    .propert-content figure.table table th,
    .propert-content figure.table table td {
        padding: 4px 3px !important;
    }

    .propert-content figure.table:has(table thead) {
        overflow-x: auto !important;
    }
}

/* ==========================================
 * 테이블 효과 (hover, 줄무늬 등)
 * ========================================== */
.propert-content figure.table table tbody tr:hover {
    background-color: #f8f9fa !important;
}

.propert-content figure.table table:has(thead) tbody tr:nth-child(even) {
    background-color: #f8f9fa !important;
}

.propert-content figure.table table:has(thead) tbody tr:nth-child(even):hover {
    background-color: #e9ecef !important;
}
