@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

/* ==================== GLOBAL STYLES ==================== */

body, html {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0; /* Removed padding-left */
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    overflow: hidden; /* 스크롤바 제거 */
}

#map {
    width: calc(100% - 60px); /* Adjust for sidebar width */
    height: 100%;
    position: absolute;
    top: 0;
    left: 60px; /* Map starts after the sidebar */
    z-index: 0;
}

.central-wrapper {
    position: absolute;
    top: 50%;
    left: calc(50% + 30px); /* This was already correct for centering in the remaining space */
    transform: translate(-50%, -50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px; /* 메인 컨트롤과 서브 컨트롤 간의 간격 */
    width: 380px; /* .controls-container와 동일한 너비 */
    overflow: visible; /* 자동완성 드롭다운이 박스 밖으로 표시되도록 */
}

.controls-container {
    /* position, top, left, transform, right, bottom, z-index 속성 제거됨 */
    width: 100%; /* 부모인 .central-wrapper에 맞춰짐 */
    max-height: calc(100vh - 100px); /* 화면 높이에 따라 유연하게, 서브 컨트롤 높이 고려 */
    overflow: visible; /* 자동완성 드롭다운이 박스 밖으로 표시되도록 */
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
        gap: 10px; /* Changed gap to 10px */
    transition: none;
}

/* ==================== MAIN CONTAINER ==================== */

/* Scrollbar */
.controls-container::-webkit-scrollbar { width: 6px; }
.controls-container::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 3px; }
.controls-container::-webkit-scrollbar-track { background-color: #f0f0f0; }

/* Header */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}

.drag-icon {
    width: 15px;
    height: 15px;
    stroke: #cccccc;
    cursor: move;
    margin-left: -30px;
    margin-top: -60px;
}



.logo {
    width: 120px;
    height: auto;
    margin: 0;
}

#disclaimer-text {
    font-size: 10px;
    color: #6c757d;
    margin-top: -15px;
    margin-bottom: 0;
    line-height: 1.5;
    text-align: left;
}

.logo-and-disclaimer {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

/* ==================== FORM & INPUT STYLES ==================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: visible;
}

.label-group {
    position: relative;
    padding-bottom: 2px;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group input {
    flex-grow: 1;
}

.input-group button {
    width: auto;
    flex-shrink: 0;
    padding: 12px 16px;
    font-size: 14px;
}

/* 검색 입력 래퍼 - 자동완성용 */
.search-input-wrapper {
    position: relative;
}

/* 모바일 검색 S 아이콘 - 데스크탑에서는 숨김 */
.mobile-search-icon-link {
    display: none;
}

.mobile-search-icon {
    display: block;
    width: 28px;
    height: 28px;
}

/* 자동완성 드롭다운 */
.autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 65px; /* 검색 버튼 너비만큼 제외 */
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
}

.autocomplete-item.selected {
    background-color: #f0f0f0;
}

.autocomplete-dropdown.visible {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: #f7f7f7;
}

.autocomplete-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.autocomplete-item-address {
    font-size: 12px;
    color: #888;
}

.autocomplete-item-category {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

.autocomplete-loading {
    padding: 16px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

.autocomplete-empty {
    padding: 16px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

/* ==================== 즐겨찾기 스타일 ==================== */

/* 즐겨찾기 섹션 */
.favorites-section {
    position: relative;
    margin-bottom: 8px;
}

.favorites-list-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: all 0.2s ease;
}

.favorites-list-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.favorites-list-btn .favorites-icon {
    width: 16px;
    height: 16px;
    stroke: #888;
}

/* 즐겨찾기 드롭다운 */
.favorites-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.favorites-dropdown.visible {
    display: block;
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.favorites-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.favorites-close-btn:hover {
    color: #333;
}

/* 즐겨찾기 추가 버튼 */
.add-favorite-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 24px);
    margin: 8px 12px;
    padding: 10px 14px;
    background: #f7f7f7;
    border: 1px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s ease;
}

.add-favorite-btn:hover {
    background: #f0f0f0;
    border-color: #999;
    color: #333;
    transform: none;
    box-shadow: none;
}

.add-favorite-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.add-favorite-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.favorites-list {
    padding: 8px 0;
}

.favorites-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

.favorites-login-required {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

.favorites-login-required a {
    color: #E84A27;
    text-decoration: none;
}

.favorites-login-required a:hover {
    text-decoration: underline;
}

.favorite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    background: none !important;
    border: none;
    width: 100%;
    box-shadow: none;
}

.favorite-item:hover {
    background-color: #f7f7f7 !important;
    transform: none;
}

.favorite-item-info {
    flex: 1;
    min-width: 0;
}

.favorite-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-item-address {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-item-delete {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
    font-size: 16px;
    line-height: 1;
}

.favorite-item-delete:hover {
    color: #E84A27;
}

/* 주소 영역 + 즐겨찾기 버튼 */
.address-with-favorite {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.address-text {
    flex: 1;
    min-width: 0;
}

.address-text p {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 즐겨찾기 토글 버튼 (별 아이콘) */
.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.favorite-btn .favorite-icon {
    width: 20px;
    height: 20px;
    stroke: #ccc;
    fill: none;
    transition: all 0.2s ease;
}

.favorite-btn:hover .favorite-icon {
    stroke: #FFD700;
}

.favorite-btn.is-favorite .favorite-icon {
    stroke: #FFD700;
    fill: #FFD700;
}

label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

input[type="text"],
input[type="number"],
input[type="search"] {
    background-color: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #333;
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    transition: all 0.2s ease-in-out;
    -webkit-appearance: none; /* Hide default arrow for Chrome/Safari */
    -moz-appearance: textfield;    /* Hide default arrow for Firefox */
    appearance: none;         /* Hide default arrow */
    background-image: none;   /* Ensure no custom arrow */
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"]::placeholder {
    font-size: 12px;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="search"]:focus {
    outline: none;
    border-color: #E84A27;
    background-color: #fff;
    box-shadow: none;
}

/* Valid/Invalid state styling to prevent browser defaults */
input:valid,
input:invalid {
    background-color: #f7f7f7; /* Default input background */
    border-color: #ddd; /* Default input border color */
}

.dimension-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dimension-group input {
    flex-grow: 1;
}

.dimension-group button {
    width: auto;
    flex-shrink: 0;
    padding: 12px 16px;
    font-size: 14px;
}

/* ==================== BUTTONS ==================== */

button {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
}

button:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4); }
button:disabled { background: #ccc; cursor: not-allowed; transform: none; box-shadow: none; }

/* Map Type Buttons */
.map-controls {
    position: absolute;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 8px;
}
.map-type-btn {
    background: none; border: none; color: #555; padding: 0;
    font-size: 14px; font-weight: 500; box-shadow: none;
}
.map-type-btn:hover { transform: none; box-shadow: none; color: #1a1a1a; }
.map-type-btn.active { background: none; color: #1a1a1a; font-weight: 700; }

/* ==================== SEARCH RESULTS ==================== */

#search-results-container {
    display: none;
    flex-direction: column;
    gap: 0;
}

#search-results-container.visible {
    display: flex;
}

/* Global hr style for consistent spacing */
hr {
    border: none;
    height: 1px;
    background-color: #e0e0e0;
    margin: 10px 0;
}

#search-results-container hr,
#payment-sample-section hr {
    border: none;
    height: 1px !important;
    background-color: #e0e0e0;
    margin: 8px 0;
}

#address-display p {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

/* Address display margin removed - using default */

#road-address {
    color: #1a1a1a;
    font-weight: 500;
    margin-bottom: 5px;
}

#jibun-address {
    color: #6c757d;
    font-size: 10px;
    margin-bottom: 2px;
}

/* Link Buttons */
.link-buttons {
    display: flex;
    justify-content: space-evenly;
    margin-top: 5px;
}

.link-buttons button {
    flex: 1;
    background: none;
    color: #6c757d;
    font-size: 13px;
    padding: 5px;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.link-buttons button:hover { transform: none; box-shadow: none; color: #333; }
.link-buttons button:active { color: #1a1a1a; transform: none; box-shadow: none; }
.link-buttons button .icon { width: 14px; height: 14px; fill: #6c757d; }
.link-buttons button:active .icon { fill: #1a1a1a; }

/* Loader */
.loader {
    display: none; margin: 15px auto 0; border: 4px solid #e0e0e0;
    border-radius: 50%; border-top: 4px solid #1a1a1a; width: 30px; height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.download-buttons-group {
    display: flex;
    gap: 8px;
}

.download-buttons-group button {
    flex: 1;
    background: none;
    color: #6c757d;
    font-size: 13px;
    padding: 5px;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    font-weight: bold;
}

.download-buttons-group button:hover {
    transform: none;
    box-shadow: none;
    color: #333;
}

.download-buttons-group button:active {
    color: #1a1a1a;
    transform: none;
    box-shadow: none;
}

.download-buttons-group button.active {
    color: #E84A27;
    font-weight: bold;
}

.download-buttons-group button .icon-download {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='currentColor' d='M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z'/><path fill='currentColor' d='M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-right: 5px;
}

.download-buttons-group button:active .icon-download,
.download-buttons-group #download-3dm-btn:hover .icon-download {
    /* The fill color is handled by currentColor in the SVG, so it will inherit from the button's color */
}

.download-buttons-group button:disabled .icon-download {
    /* The fill color is handled by currentColor in the SVG, so it will inherit from the button's color */
}

/* ==================== INTERACTIVE SECTIONS ==================== */

#payment-sample-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.payment-sample-buttons {
    display: flex;
    gap: 8px;
}

.payment-sample-buttons button {
    flex: 1;
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
}

.payment-sample-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
}

.payment-sample-buttons button:active {
    transform: translateY(0);
    background: linear-gradient(135deg, #4b5563, #374151);
}

/* Sample 버튼 hover 텍스트 변경 */
#sample-download-btn .sample-btn-hover {
    display: none;
}

#sample-download-btn:hover .sample-btn-default {
    display: none;
}

#sample-download-btn:hover .sample-btn-hover {
    display: inline;
}

.disclaimer-text {
    font-size: 10px;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
    text-align: left;
}

/* ==================== SUB CONTROLS (SIDEBAR) ==================== */

.sub-controls-container {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 60px; /* Adjust as needed */
    background-color: #f8f9fa; /* Light background for the sidebar */
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0; /* Moved to top */
    gap: 10px;
    z-index: 1000;
}

.sub-control-divider {
    width: 100%;
    height: 1px;
    background-color: #e0e0e0;
    border: none;
    margin: 0;
    transform: scaleY(0.5);
}

.sub-control-button {
    flex: none; /* Override flex: 1 */
    width: 47px; /* Increased button width by 5px */
    height: 47px; /* Increased button height by 5px */
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    font-size: 12px; /* Increased font size */
    word-break: keep-all;
    line-height: 1.2;
    text-decoration: none; /* Remove underline */
    font-weight: bold; /* Make text bold */
    background-color: transparent; /* Changed to transparent */
    color: #333; /* 기본 텍스트 색상: 검은색 */
}

.logo-s-icon {
    width: 47px;
    height: 47px;
}

.logo-button {
    margin-top: 15%;
    cursor: pointer;
}

a.sub-control-button {
    cursor: pointer;
}

.sub-control-button.active {
    color: #1a1a1a; /* Active state text color: black */
}

.map-toggle-button {
    color: #333; /* Default color for map toggle buttons (off state) */
}

.map-toggle-button.active {
    color: #1a1a1a; /* Active color for map toggle buttons (on state) */
}

/* 사이드바 맵 버튼 (즐겨찾기, 위성, 지적) */
.sidebar-map-btn {
    flex-direction: column;
    gap: 2px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent !important; /* 기본 button 스타일 덮어쓰기 */
    box-shadow: none;
}

.sidebar-map-btn span {
    font-size: 12px !important; /* 다른 사이드바 버튼과 동일한 폰트 크기 */
    line-height: 1.2;
}

.sidebar-map-btn .sidebar-icon {
    width: 18px;
    height: 18px;
    stroke: #333; /* 다른 버튼 텍스트 색상과 동일 */
    fill: none;
}

.sidebar-map-btn:hover {
    background: transparent !important;
    box-shadow: none;
    transform: none;
}

.sidebar-map-btn.active {
    background: transparent !important;
    color: #E84A27 !important;
}

/* 사이드바 즐겨찾기 드롭다운 */
.sidebar-favorites-dropdown {
    display: none;
    position: fixed;
    top: 50%;
    left: 70px;
    transform: translateY(-50%);
    width: 280px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1002;
    max-height: 400px;
    overflow-y: auto;
}

.sidebar-favorites-dropdown.visible {
    display: block;
}

/* Mobile: Toggleable sidebar */
@media (max-width: 1024px) {
    .sub-controls-container {
        /* 기본적으로 숨김 (왼쪽으로 이동) */
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 60px;
        background-color: #f8f9fa;
        border-right: 1px solid #e0e0e0;
        flex-direction: column;
        gap: 10px;
        padding-top: 0;
        z-index: 1000;
        transform: translateX(-100%); /* 숨김 */
        transition: transform 0.3s ease;
    }

    .sub-controls-container.is-open {
        transform: translateX(0); /* 보임 */
    }

    .sub-control-button.logo-button {
        margin-top: 15%;
    }

    .logo-s-icon {
        width: 47px;
        height: 47px;
    }

    .sub-control-divider {
        display: block;
        width: 100%;
        height: 1px;
        background-color: #e0e0e0;
        border: none;
        margin: 0;
    }
}



/* 데스크탑에서는 햄버거 버튼 숨기기 */
.hamburger-btn {
    display: none;
}

/* ==================== RESPONSIVE DESIGN (MOBILE) ==================== */

@media (max-width: 1024px) {
    #map {
        width: 100%; /* 전체 너비 */
        left: 0; /* 왼쪽부터 시작 (배너 숨김 상태) */
        transition: left 0.3s ease, width 0.3s ease;
    }

    .central-wrapper {
        width: calc(100% - 30px); /* 좌우 여백만 */
        max-width: 500px; /* 최대 너비 제한 */
        top: 15px; /* 상단 여백 */
        bottom: auto;
        left: 15px; /* 왼쪽 여백 (배너 숨김 상태) */
        transform: none;
        transition: left 0.3s ease;
    }

    .controls-container {
        background-color: #ffffff; /* 흰색 배경 */
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        padding: 10px 10px; /* 상하좌우 동일한 간격 */
        gap: 5px;
        max-height: calc(100vh - 100px); /* 화면 높이 고려 */
        overflow: visible; /* 자동완성 드롭다운이 박스 밖으로 표시되도록 */
    }

    /* 모바일에서 헤더 완전히 숨김 */
    .header {
        display: none;
    }

    /* 모바일에서 S 아이콘 숨김 (햄버거 버튼으로 대체) */
    .mobile-search-icon-link {
        display: none !important;
    }

    /* 모바일에서 빈 label-group 숨김 */
    .label-group {
        display: none;
    }

    /* 모바일에서 form-group gap 제거 */
    .form-group {
        gap: 0;
    }

    /* 모바일에서 검색 입력창 그룹 정렬 */
    .search-input-wrapper {
        align-items: center;
        gap: 8px;
    }

    /* 검색 결과 UI 간격 조정 */
    #search-results-container {
        gap: 0; /* 검색 결과 내부 요소들 수직 간격 최소화 */
    }
    /* Global hr spacing for mobile */
    hr {
        margin: 5px 0;
        height: 1px;
    }

    #search-results-container hr,
    #payment-sample-section hr {
        margin: 3px 0;
        height: 1px !important;
    }

    #address-display p {
        line-height: 1.2; /* 모바일에서 주소 텍스트 줄 간격 추가 축소 */
    }

    /* 주소 결과 및 링크 버튼 폰트/아이콘 크기 축소 */
    #road-address {
        font-size: 12px !important;
        font-weight: bold !important;
    }
    #jibun-address {
        font-size: 11px !important;
        font-weight: 400 !important;
    }

    .link-buttons button {
        font-size: 11px;
    }

    .link-buttons button .icon {
        width: 12px;
        height: 12px;
    }

    /* 모바일에서 폼 요소들 크기 축소 */
    input[type="text"],
    input[type="number"],
    input[type="search"],
    .input-group button,
    .dimension-group button {
        padding-top: 8px;
        padding-bottom: 8px;
        font-size: 12px;
    }

    /* 모바일에서 다운로드 버튼 텍스트 */
    .download-buttons-group button {
        font-size: 12px;
    }

    /* 모바일에서 결제/샘플 버튼 텍스트 */
    .payment-sample-buttons button {
        font-size: 12px;
    }

    /* 모바일에서 안내 텍스트 숨김 */
    #payment-sample-section .disclaimer-text {
        display: none;
    }

    /* 모바일에서 안내 텍스트 숨김 시 상단 hr도 숨김 */
    #payment-sample-section hr:last-of-type {
        display: none;
    }

    /* 모바일에서 햄버거 버튼 표시 (검색창 내부) */
    .hamburger-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3px;
        width: 12px;
        height: 40px;
        min-width: 12px;
        background: transparent;
        border: none;
        border-radius: 0;
        cursor: pointer;
        padding: 0;
        margin: 0;
        flex-shrink: 0;
        box-shadow: none;
        transition: all 0.3s ease;
    }

    /* 모바일에서 검색 입력창과 버튼 높이 동일하게 */
    .search-input-wrapper input[type="search"] {
        height: 40px;
        padding-top: 0;
        padding-bottom: 0;
        box-sizing: border-box;
    }

    .search-input-wrapper #search-btn {
        height: 40px;
        padding-top: 0;
        padding-bottom: 0;
    }

    .hamburger-btn:hover {
        background: #f0f0f0;
        transform: none;
        box-shadow: none;
    }

    .hamburger-btn:active {
        transform: scale(0.95);
    }

    .hamburger-line {
        width: 16px;
        height: 2px;
        background-color: #333;
        transition: all 0.3s ease;
    }

    /* 햄버거 → X 애니메이션 */
    .hamburger-btn.is-open .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }

    .hamburger-btn.is-open .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .hamburger-btn.is-open .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }

    /* 네이버 지도 줌 컨트롤 위치 조정 (햄버거 버튼 위) */
    .map_control_zoom,
    [class*="zoom"],
    [class*="Zoom"] {
        bottom: 120px !important; /* 햄버거 버튼 위 */
        right: 10px !important;
    }

    /* 네이버 지도 API의 줌 컨트롤 구체적 선택 */
    #map > div > div > div[style*="position: absolute"][style*="right"][style*="bottom"] {
        bottom: 120px !important;
        right: 10px !important;
    }

    /* 모바일에서 자동완성 드롭다운 - 입력창 아래에만 표시 */
    .autocomplete-dropdown {
        left: 56px; /* 햄버거 버튼 너비 + gap */
        right: 64px; /* 검색 버튼 너비 + gap */
        max-height: 200px;
    }
}

/* ==================== MAP LAYER CONTROLS (우측 하단 플로팅) ==================== */

.map-layer-controls {
    position: fixed;
    bottom: 80px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.map-layer-btn {
    width: auto;
    padding: 10px 14px;
    background-color: #ffffff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-layer-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.map-layer-btn:hover {
    background-color: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.map-layer-btn.active {
    background-color: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}

/* 모바일에서 지도 레이어 컨트롤 */
@media (max-width: 1024px) {
    .map-layer-controls {
        bottom: 110px;
        right: 10px;
        gap: 6px;
    }

    .map-layer-btn {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 6px;
    }
}

/* ==================== FOOTER ==================== */

.footer {
    position: fixed;
    bottom: 0;
    left: 60px; /* 사이드바 너비만큼 왼쪽 여백 */
    right: 0;
    background-color: rgba(248, 249, 250, 0.95);
    border-top: 1px solid #e0e0e0;
    padding: 10px 20px;
    z-index: 999;
    backdrop-filter: blur(5px);
}

.footer-content {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-line {
    margin: 3px 0;
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}

.footer-copyright {
    margin: 5px 0 0 0;
    font-size: 10px;
    color: #999;
}

.footer-links {
    margin: 5px 0;
    font-size: 11px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #333;
    text-decoration: underline;
}

/* 모바일에서 푸터 조정 */
@media (max-width: 1024px) {
    .footer {
        left: 0; /* 전체 너비 사용 (배너 숨김 상태) */
        padding: 8px 10px;
    }

    .footer-line {
        font-size: 10px;
        line-height: 1.3;
    }

    .footer-copyright {
        font-size: 9px;
    }
}

