* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    padding-top: 0 !important; /* 헤더가 fixed이므로 body 상단 패딩 제거 */
    overflow-x: hidden;
    overflow-y: auto;
    width: 100vw;
    background: #ffffff !important; /* 지도 페이지 전체 배경 순백 (옅은 회색 방지) */
    background-color: #ffffff !important;
}

html {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

.map-header {
    padding: 12px 20px;
    background: #9cee69;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    gap: 15px;
    height: 70px;
    box-sizing: border-box;
    position: fixed; /* 헤더를 고정 위치로 변경 */
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10000; /* 헤더가 지도 위에 표시되도록 */
}

.header-left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1001;
    padding-left: 20px;
}

.header-right {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 1280px 기준으로 헤더 우측 숨김 (body 폭 기준) */
@media (min-width: 1280px) {
    .header-right {
        display: none; /* 1280px 이상에서는 우측 숨김 */
    }
}

.header-search {
    width: 187px;
    height: 36px;
    position: relative;
}

.header-search input {
    width: 100%;
    height: 100%;
    padding: 0 36px 0 12px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 13px;
    box-sizing: border-box;
}

.header-search input:focus {
    outline: none;
    border-color: #2e7d32;
}

.header-search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    pointer-events: none;
    color: #999;
}

/* 1280px 기준으로 헤더 좌측 표시 (body 폭 기준) */
@media (min-width: 1280px) {
    .header-left {
        display: flex;
    }
}

@media (min-width: 769px) and (max-width: 1279px) {
    /* 태블릿에서는 로고 표시 (header.php에서 처리) */
    .header-right {
        right: 15px;
        gap: 10px;
    }
    
    .header-search {
        width: 160px;
        height: 32px;
    }
    
    .header-search input {
        font-size: 12px;
        padding: 0 32px 0 10px;
    }
    
    .header-search-icon {
        width: 16px;
        height: 16px;
        right: 8px;
    }
    
}

/* 추천상품 영역 - 1280px 고정, 가운데 정렬 (min()으로 강제) */
.recommended-products {
    width: 100%;
    min-width: 0;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-top: 1px solid #ddd;
    padding: 30px 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

.recommended-products-inner {
    width: min(100%, 1280px);
    max-width: 1280px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    background: #ffffff !important;
    background-color: #ffffff !important;
}

.recommended-products-list {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

.recommended-products-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.recommended-products-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}
.recommended-products-title-row .recommended-products-title {
    flex: 1;
    min-width: 0;
}

/* 태블릿: 추천 영역 좌우 여백 (좌측 밀림 방지) */
@media (min-width: 769px) and (max-width: 1024px) {
    .recommended-products {
        padding: 30px 24px;
    }
    .recommended-products-inner {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0;
        box-sizing: border-box;
    }
}

.map-close-btn {
    padding: 6px 14px;
    background: #666;
    color: white;
    border: none;
    border-radius: 0;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    margin-left: auto;
}

.map-close-btn:hover {
    background: #333;
}

.map-container {
    width: 100%;
    height: calc(100vh - 70px - 100px); /* 헤더(70px) + 추천상품 영역(100px) 제외 */
    margin-top: 70px; /* 헤더 높이만큼 여백 */
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    position: relative;
    z-index: 1; /* 헤더보다 낮은 z-index로 설정 */
}

#googleMap {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.map-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* 1280px 기준으로 좌측 정렬 */
@media (min-width: 1280px) {
    .map-overlay {
        /* 1280px 기준으로 좌측 정렬: (100vw - 1280px) / 2 + 20px */
        left: calc((100vw - 1280px) / 2);
        top: 20px;
        justify-content: flex-start;
        padding-left: 20px; /* 오버레이 내부 요소만 들여쓰기 */
    }
}

@media (max-width: 1279px) {
    .map-overlay {
        left: 0;
        top: 15px;
        padding-left: 15px; /* 오버레이 내부 요소만 들여쓰기 */
    }
}

.map-overlay-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.map-overlay #citySelectContainer {
    display: block;
    min-width: 200px;
}

.map-overlay #citySelect {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.map-overlay #citySelectContainer.show {
    display: block;
}

/* 골프장 Wish 하트 스타일 */
.golf-wish-heart {
    transition: all 0.2s ease;
}

.golf-wish-heart:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    transform: scale(1.1);
}

.golf-wish-heart svg {
    transition: all 0.2s ease;
}

.golf-wish-heart:hover svg {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    body {
        padding-top: 0 !important; /* body 상단 패딩 제거 */
    }
    
    .map-header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        height: 70px !important;
        padding: 12px 15px !important;
        gap: 10px !important;
        overflow: visible !important;
        position: fixed !important; /* 모바일에서도 헤더 고정 */
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        z-index: 10000 !important; /* 모바일에서 헤더가 지도 위에 표시되도록 */
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        background: #9cee69 !important; /* 배경색 명시 */
    }
    
    .header-right {
        position: absolute !important;
        right: 15px !important;
        left: auto !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
        z-index: 10001 !important; /* 헤더 내부 요소가 더 높은 z-index */
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* 모바일에서도 로고 표시 (header.php에서 처리) */
    
    .map-overlay {
        top: 10px;
        left: 0;
        gap: 8px;
        padding-left: 10px; /* 오버레이 내부 요소만 들여쓰기 */
    }
    
    .map-overlay-title {
        font-size: 14px;
        padding: 6px 10px;
    }
    
    .map-overlay #citySelectContainer {
        width: 100%;
        min-width: 150px;
    }
    
    .map-overlay #citySelect {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .map-close-btn {
        margin-left: 0;
        width: 100%;
    }
    
    .map-container {
        height: calc(100vh - 70px - 150px); /* 모바일에서도 헤더(70px) + 추천상품 영역(150px) 제외 */
        margin-top: 70px; /* 헤더 높이만큼 여백 */
    }
    
    .recommended-products {
        padding: 20px 0;
        display: flex !important;
        visibility: visible !important;
    }
    
    .recommended-products-inner {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .recommended-products-list {
        display: flex !important;
        flex-direction: column !important;
        visibility: visible !important;
    }
    
    .recommended-products-title {
        font-size: 20px;
        margin-bottom: 15px;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* 모바일: 추천 이미지·카드 최대폭(가로 전체), 세로 1개씩, 화살표 숨김 */
    .recommended-city-group {
        padding: 0 !important;
    }
    
    .recommended-city-group .action-arrow {
        display: none !important;
    }
    
    .recommended-golf-grid-wrapper {
        overflow: visible !important;
    }
    
    .recommended-golf-grid {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        overflow: visible !important;
        gap: 16px !important;
    }
    
    .recommended-golf-item {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        border: none !important;
    }
    
    .recommended-golf-image {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .recommended-city-subtitle-row {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .recommended-golf-name {
        font-weight: 700 !important;
    }
}
