.map-section {
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.map-container {
  position: relative;
  height: 320px;
  background: #f3f4f6;
  overflow: hidden;
}

.map-fallback {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(132, 204, 22, 0.08), rgba(59, 130, 246, 0.08)),
    #eef2f7;
  overflow: hidden;
}

.kakao-map {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.map-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.map-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.08), rgba(59, 130, 246, 0.08)), #eef2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: #6b7280;
}

.map-loading-overlay.hidden {
  display: none;
}

.map-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 3;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.map-title {
  font-weight: 600;
  color: #374151;
}

.map-subtitle {
  font-size: 0.75rem;
  color: #6b7280;
}

.list-section {
  padding: 1rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.section-count {
  font-size: 0.875rem;
  color: #6b7280;
}

.category-filter {
  margin-bottom: 1rem;
}

.category-checkbox-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background-color: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.category-checkbox input {
  display: none;
}

.category-checkbox:has(input:checked) {
  background-color: #84cc16;
  border-color: #84cc16;
  color: white;
}

.category-checkbox:hover {
  background-color: #f3f4f6;
}

.groupbuy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.groupbuy-card-link {
  text-decoration: none;
  color: inherit;
}

.groupbuy-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.groupbuy-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-image {
  position: relative;
  height: 160px;
  background: #f3f4f6;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.badge-recruiting {
  background: #22c55e;
}

.badge-closing {
  background: #ef4444;
}

.badge-progress {
  background: #9ca3af;
}

.badge-completed {
  background: #3b82f6;
}

.badge-expired {
  background: #6b7280;
}

.card-category {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

.card-content {
  padding: 1rem;
}

.card-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.card-price {
  font-size: 1.125rem;
  font-weight: bold;
  color: #84cc16;
}

.card-participants {
  font-size: 0.875rem;
  color: #6b7280;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.info-distance {
  margin-left: auto;
}

.card-host {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid #f3f4f6;
}

.host-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.host-avatar {
  width: 24px;
  height: 24px;
  background: #d1d5db;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  object-fit: cover;
}

.host-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.load-more-btn {
  padding: 0.75rem 1.5rem;
  border: 1px solid #84cc16;
  border-radius: 0.5rem;
  background: #84cc16;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.load-more-btn:hover {
  background: #65a30d;
}

.search-section {
  width: 100%;
  padding: 1rem 24px;
  text-align: center;
  background-color: #0baa26;
}

.search-section .search-box {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.search-section input {
  flex: 1;
  max-width: 400px;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  font-size: 0.875rem;
  outline: none;
}

.search-section input:focus {
  border-color: #84cc16;
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.2);
}

.search-section button {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid #84cc16;
  background-color: #84cc16;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.search-section button:hover {
  background-color: #65a30d;
  border-color: #65a30d;
}

@media (max-width: 768px) {
  .groupbuy-grid {
    grid-template-columns: 1fr;
  }
}

/* 클러스터 클릭 시 공동구매 목록 모달 */
.cluster-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.cluster-modal.hidden {
  display: none;
}

.cluster-modal-content {
  background: white;
  border-radius: 1rem 1rem 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.cluster-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.cluster-modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.cluster-modal-header button {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #6b7280;
  cursor: pointer;
  line-height: 1;
}

.cluster-modal-list {
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* 클러스터 모달 내 간략 카드 */
.cluster-card {
  padding: 0.875rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: white;
  transition: box-shadow 0.15s;
}

.cluster-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cluster-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.cluster-card-top-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.cluster-card-top-right {
  font-size: 0.85rem;
  color: #6b7280;
  white-space: nowrap;
  flex-shrink: 0;
}

.cluster-card-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  flex-shrink: 0;
}

.cluster-card-title {
  font-weight: 600;
  font-size: 1rem;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cluster-card-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.cluster-card-label {
  font-size: 0.75rem;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.cluster-card-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.cluster-card-count {
  font-size: 0.85rem;
  color: #6b7280;
  white-space: nowrap;
}

/* 행정동 말풍선 마커 — 레벨 7 이상 */
.dong-label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.8rem;
  position: relative;
  transition: box-shadow 0.15s;
}

.dong-label::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid white;
}

.dong-label:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.dong-name {
  font-weight: 600;
  color: #374151;
}

.dong-count {
  font-weight: 500;
  color: #84cc16;
}

/* 녹색 원 클러스터 마커 — 레벨 6 이하 */
.cluster-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #84cc16;
  color: white;
  font-weight: 700;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(132, 204, 22, 0.5);
  transition: background 0.15s, box-shadow 0.15s;
}

.cluster-dot:hover {
  background: #65a30d;
  box-shadow: 0 4px 12px rgba(132, 204, 22, 0.6);
}

.cluster-dot-sm {
  width: 36px;
  height: 36px;
  font-size: 0.8rem;
}

.cluster-dot-md {
  width: 44px;
  height: 44px;
  font-size: 0.875rem;
}

.cluster-dot-lg {
  width: 52px;
  height: 52px;
  font-size: 1rem;
}