html,
body {
    height: 100%;
    overflow: hidden;
}

#containerPc {
    background-repeat: no-repeat;
    background-size: cover;
}

.main-body {
    margin: 0 auto;
    height: calc(100vh - 90px);
    overflow: hidden;
}

.store-card {
    width: 100%;
    display: block;
    background: #fff;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #d9d9d9;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    height: 140px;
    box-sizing: border-box;
}

.store-card.active {
    border: 2px solid #f6ab00;
}

.store-card img {
    width: 80px;
    height: 80px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
    border-radius: 5px;
}

.store-info {
    font-size: 14px;
}

.pagination {
    display: none;
}

.pagination button {
    background: none;
    border: none;
    font-size: 16px;
    margin: 0 5px;
    cursor: pointer;
    color: #444;
}

/* map.html 전용: 상단 nav 메뉴 텍스트는 항상 검정으로 표시 */
.navbar .nav-menu a {
    color: #000;
}

.pagination button.active {
    font-weight: bold;
    color: orange;
    text-decoration: underline;
}

#search-container {
    width: 520px;
    will-change: transform;
    z-index: 5;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

#search-container.closed {
    display: none;
}

input[type="text"]:focus {
    outline: none;
    background: transparent;
}

.search-title {
    font-size: 36px;
    font-weight: 700;
    margin: 100px 0 30px 0;
}

/* 스크롤바 스타일 */
#search-container::-webkit-scrollbar {
    width: 8px;
}

#search-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#search-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#search-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.custom-marker-label {
    position: absolute;
    bottom: 65px;
    /* 마커 높이가 60px이라서 조금 더 위에 나오도록 설정 */
    left: 50%;
    /* 수평 중앙 */
    transform: translateX(-50%);
    /* 중앙 정렬 보정 */
    padding: 2px 6px;
    font-size: 14px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    z-index: 1;
    /* 마커 위에 표시되도록 */
}

.custom-overlay {
    position: absolute;
    bottom: 65px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    white-space: nowrap;
    z-index: 1;
}

.custom-overlay img {
    width: 230px;
    height: 130px;
    object-fit: cover;
}

.custom-overlay span {
    font-size: 16px;
    font-weight: bold;
    color: #000;
    text-align: center;
}

/* 모바일 */
@media (max-width: 768px) {
    #map-container {
        height: 100vh !important;
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1;
        width: 100% !important;
    }

    #search-container {
        width: 95%;
        margin: 0 auto;
        border: 1px solid #b6b5b5;
        border-bottom: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 80dvh;
        background: white;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(.4, 0, .2, 1);
        z-index: 10;
        flex-direction: column;
        overflow: hidden;
        /* 컨테이너 스크롤 차단 */
        box-sizing: border-box;
        padding: 20px !important;
        gap: 20px;
        /* 내부 요소 간격 */
    }

    /* 검색박스 고정 크기 */
    .search-box {
        height: 60px !important;
        width: 100%;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    /* 목록 영역: 남은 공간 딱 맞춤 */
    #storeList {
        flex: 1;
        /* 남은 공간 정확히 채움 */
        overflow-y: auto;
        /* 세로 스크롤 활성화 */
        overflow-x: hidden;
        /* 가로 스크롤 비활성화 */
        width: 100%;
        box-sizing: border-box;
        min-height: 0;
        /*max-height: calc(100vh - 200px); /* 화면 높이에서 상단 요소들 높이 뺀 값 */
        margin-top: 0;
    }

    /* 페이징 숨김 */
    .pagination {
        display: none;
    }

    /* store-card 높이 제한 */
    .store-card {
        overflow: hidden;
        margin-bottom: 0 !important;
        height: auto !important;
        /* 모바일에서는 높이를 자동으로 조정 */
        min-height: 140px;
        /* 최소 높이 유지 */
    }

    /* 모바일에서 목록 영역 높이 제한 */
    #storeList {
        max-height: calc(100vh - 150px);
        /* 모바일에서 상단 요소 높이 고려 */
    }

    #search-container.open {
        transform: translateY(0);
    }

    #toggle-search-btn {
        display: none;
    }
}