.map-container {
    width: 100%;
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.map-header {
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    background: #fff;
}

.map-search {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
    margin-bottom: 15px;
}

.search-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 검색 입력 요소 공통 스타일 */
.search-select,
#search-input {
    height: 42px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    color: #333;
    background-color: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
}

/* select 스타일 */
.search-select {
    min-width: 150px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8.825L1.175 4 2.05 3.125 6 7.075 9.95 3.125 10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 35px;
}

.search-select:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

/* 검색 입력란 스타일 */
#search-input {
    flex: 1;
    min-width: 200px;
}

#search-input::placeholder {
    color: #999;
}

/* 포커스 스타일 */
.search-select:focus,
#search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
    outline: none;
}

/* 검색 버튼 스타일 */
#search-btn {
    height: 42px;
    padding: 0 20px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#search-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* 검색 초기화 버튼 스타일 */
.btn-reset {
    height: 42px;
    padding: 0 20px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-reset:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.map-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    gap: 5px;
}

.store-list {
    position: relative;
    width: 300px;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    transform: none;
}

.store-list h3 {
    padding: 15px;
    margin: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.store-list-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
    height: 100%;
    overflow-y: auto;
}

.map-wrapper {
    flex: 1;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.loading-indicator {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.store-item {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.store-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.store-item h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.store-item p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.store-item p i {
    color: #3498db;
    font-size: 14px;
    margin-top: 2px;
    width: 16px;
    text-align: center;
}

.store-item .store-address {
    margin-bottom: 5px;
}

.store-item .store-phone {
    color: #3498db;
}

.store-item .store-content {
    margin-top: 5px;
    color: #666;
}

.no-data {
    text-align: center;
    padding: 20px;
    color: #666;
    background: #fff;
    border-radius: 8px;
    margin: 5px;
}

/* 대리점 등록 폼 스타일 */
.layer-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.layer-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.layer-content h3 {
    font-size: 1.5em;
    color: #333;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.content h3 {
    font-size: 2.5em;
    color: #333;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 0.95em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.form-group input:last-child,
.form-group textarea:last-child {
    margin-bottom: 0;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
    outline: none;
}

.form-group input[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.address-input {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.address-input input {
    flex: 1;
    margin-bottom: 0;
}

#store-postcode-input {
    width: 120px;
    flex: none;
    text-align: center;
    font-weight: 500;
}

#store-address-input,
#store-address-detail-input {
    width: 100%;
}

#address-search-btn {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#address-search-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.store-btn-group {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn-submit {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-submit:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-cancel {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.address-select {
    display: flex;
    gap: 10px;
}

.address-select .search-select {
    flex: 1;
    margin-bottom: 0;
}

.mt-2 {
    margin-top: 10px;
}

.store-actions {
    display: flex;
    gap: 5px;
}

.btn-edit,
.btn-delete {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.btn-edit:hover {
    color: #3498db;
}

.btn-delete:hover {
    color: #e74c3c;
}

.btn-edit i,
.btn-delete i {
    font-size: 14px;
}

/* 스크롤바 스타일링 */
.store-list-container::-webkit-scrollbar {
    width: 6px;
}

.store-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.store-list-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.store-list-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.btn-register {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-register:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-register:before {
    content: '+';
    font-size: 1.2em;
    font-weight: bold;
}

.loading-indicator p {
    color: #666;
    font-size: 14px;
}

/* 반응형 스타일 */
@media (max-width: 1024px) {
    .map-content {
        flex-direction: column;
        height: auto;
    }

    .store-list {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        transform: translateY(100%);
        transition: transform 0.2s ease-out;
        z-index: 1000;
        height: 20vh;
        overflow: hidden;
    }

    .store-list.active {
        transform: translateY(0);
    }

    .map-wrapper {
        height: 300px;
    }

    .search-row {
        flex-direction: column;
    }

    .search-select,
    #search-input,
    #search-btn,
    .btn-reset {
        width: 100%;
        min-width: auto;
    }

    .search-select,
    #search-input {
        flex: none;
    }

    .layer-content {
        padding: 20px;
        width: 95%;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group button {
        width: 100%;
    }

    .address-input {
        flex-direction: column;
    }

    #store-postcode-input {
        width: 100%;
    }

    #address-search-btn {
        width: 100%;
    }
}

/* 모바일 스타일 */
@media screen and (max-width: 1024px) {
    .map-container {
        height: 100vh;
    }

    .map-header {
        padding: 10px;
    }

    .map-search {
        padding: 10px;
    }

    .search-row {
        flex-direction: column;
        gap: 10px;
    }

    .search-select,
    #search-input,
    #search-btn,
    .btn-reset {
        width: 100%;
        min-width: auto;
    }

    #search-input {
        flex: none;
    }

    .map-content {
        flex-direction: column;
    }

    .store-list-container {
        height: calc(100% - 50px);
        overflow-y: auto;
    }

    .map-wrapper {
        width: 100%;
        height: calc(100vh - 180px);
    }

    .mobile-menu-btn {
        display: block;
    }

    .store-item {
        padding: 15px;
    }

    .store-item h4 {
        font-size: 16px;
    }

    .store-address,
    .store-phone,
    .store-content {
        font-size: 14px;
    }
}

/* InfoWindow 스타일 */
.infowindow-container {
    position: relative;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 280px;
    max-width: 80vw;
    min-height: 170px;
    transform-style: preserve-3d;
    transition: transform 0.3s;
}

.infowindow-container:hover {
    transform: translateY(-5px);
}

.infowindow-close {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.infowindow-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    padding-right: 20px;
    word-break: break-all;
}

.infowindow-content {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.infowindow-content .infowindow-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
}

.infowindow-content .infowindow-info-item:last-child {
    margin-bottom: 0;
}

.infowindow-content .infowindow-info-item i {
    width: 16px;
    margin-right: 8px;
    color: #3498db;
    font-size: 14px;
    margin-top: 3px;
    flex-shrink: 0;
}

.infowindow-content .infowindow-info-item span {
    flex: 1;
    word-break: break-all;
    overflow-wrap: break-word;
}

.infowindow-arrow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}

/* 카카오맵 InfoWindow 기본 스타일 제거 */
.info-window,
.info-window-content,
.kakao-maps .info-window,
.kakao-maps .info-window-content,
.kakao-maps .info-window-content-wrapper,
.kakao-maps .info-window-content-wrapper > div {
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* InfoWindow 화살표 제거 */
.kakao-maps .info-window-content-wrapper:after,
.kakao-maps .info-window-content-wrapper:before {
    display: none !important;
}

/* 모바일 햄버거 버튼 */
.mobile-menu-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 3;
    display: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn i {
    font-size: 24px;
    color: #333;
}

/* 마커 스타일 */
.marker-container {
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.marker-container:hover {
    transform: rotateY(180deg);
}

.marker-front,
.marker-back {
    backface-visibility: hidden;
    position: absolute;
    width: 100%;
    height: 100%;
}

.marker-back {
    transform: rotateY(180deg);
} 

/* 모바일 리스트 영역 스타일 */
.store-list-container {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 60px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* 스와이프 핸들 */
.swipe-handle {
    width: 100%;
    height: 30px;
    background: #fff;
    border-radius: 20px 20px 0 0;
    position: relative;
    cursor: grab;
    z-index: 1;
    touch-action: none;
    display: none;
}

.swipe-handle::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
}

/* 닫기 버튼 */
.close-btn {
    position: fixed;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.close-btn i {
    font-size: 14px;
}

/* 모바일 햄버거 버튼 */
.mobile-menu-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 3;
    display: none;
    border: none;
    cursor: pointer;
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .store-list.active + .map-wrapper .mobile-menu-btn {
        display: none;
    }
}

@media (max-width: 1024px) {
    .swipe-handle {
        display: block;
    }
}

@media screen and (max-width: 1024px) {
    .infowindow-container {
        max-width: 80vw;
        min-width: 280px;
    }
    
    .infowindow-title {
        font-size: 14px;
    }
    
    .infowindow-content {
        font-size: 12px;
    }
    
    .infowindow-content .info-item i {
        font-size: 12px;
    }
}