/* 지도 화면: 상단 바 + 화면 가득 지도 + 아래 카드 (값은 tokens.css) */
body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);   /* UI-04: 그림자 대신 1px 선 */
  padding: var(--space-2) var(--screen-margin) var(--space-3);
  z-index: 10;
}
.topbar-row { display: flex; align-items: center; gap: var(--space-2); }
.topbar .logo { margin-right: var(--space-1); }

.region-button, .radius-select {
  min-height: var(--touch-min);
  border: 1px solid var(--border-input);
  background: var(--surface);
  border-radius: var(--radius-medium);
  font-size: var(--font-body-small);
}
.region-button {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 320px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
  padding: 0 var(--space-2) 0 var(--space-3);
  font-weight: var(--font-weight-bold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
/* 펼침 표시(▾) 아이콘 */
.region-button::after {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  color: var(--text-subtle);
}
.radius-select { flex: none; padding: 0 var(--space-2); }
.topbar .account { margin-left: auto; }

.chips {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-top: var(--space-3);
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: var(--control-height-small);
  padding: 0 var(--space-4);
  border: 1px solid var(--border-control);
  background: var(--surface);
  border-radius: var(--radius-small);
  font-size: var(--font-body-small);
}
.chip:hover { border-color: var(--action-primary); }
.chip-market { display: inline-flex; align-items: center; gap: var(--space-1); }
.chip-divider { flex: none; width: 1px; align-self: stretch; margin: var(--space-1) 0; background: var(--border-light); }
.chip[aria-pressed="true"] {
  background: var(--action-primary);
  border-color: var(--action-primary);
  color: var(--text-on-primary);
  font-weight: var(--font-weight-bold);
}

.map-area { position: relative; flex: 1; min-height: 0; }
.map-area:focus { outline: none; }
.map { position: absolute; inset: 0; overflow: hidden; background: var(--surface-sunken); }

.list-view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  background: var(--surface);
  padding: var(--space-2) var(--screen-margin) 96px;
  z-index: 5;
}
.list-summary { color: var(--text-subtle); font-size: var(--font-body-small); margin: var(--space-2) 0; }
.store-list { list-style: none; margin: 0; padding: 0; }
.store-list li { border-bottom: 1px solid var(--border-divider); }
.store-list a {
  display: block;
  padding: var(--space-3) 0;
  color: inherit;
  text-decoration: none;
}
.store-list a:hover .name { color: var(--text-link); text-decoration: underline; }
.store-list .name { font-weight: var(--font-weight-bold); margin-right: var(--space-2); }
.store-list .meta { color: var(--text-subtle); font-size: var(--font-body-small); margin-top: var(--space-1); }

.research-button {
  position: absolute;
  top: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  min-height: var(--touch-min);
  padding: 0 var(--space-5);
  border: 1px solid var(--text-body);
  border-radius: var(--radius-medium);
  background: var(--text-body);
  color: var(--surface);
  font-size: var(--font-body-small);
  font-weight: var(--font-weight-bold);
}

.floating {
  position: absolute;
  right: var(--screen-margin);
  bottom: var(--space-4);
  display: flex;
  gap: var(--space-2);
  z-index: 6;
}
.fab {
  min-width: var(--control-height);
  height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-medium);
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text-body);
}
.fab:hover { background: var(--surface-subtle); color: var(--text-body); }
a.fab { text-decoration: none; }
.fab-wide { padding: 0 var(--space-4); font-size: var(--font-body-small); font-weight: var(--font-weight-bold); }

.toast {
  position: absolute;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  background: var(--color-gray-90);
  color: var(--surface);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-medium);
  font-size: var(--font-body-small);
  z-index: 7;
  max-width: calc(100% - 32px);
  text-align: center;
}

/* 아래에서 올라오는 가게 카드 */
.store-card {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-bottom: none;
  border-radius: var(--radius-large) var(--radius-large) 0 0;   /* UI-04: 12px → 8px, 그림자 대신 1px 테두리 */
  padding: var(--space-5) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom));
  max-width: 640px;
  margin: 0 auto;
}
.store-card[hidden] { display: none; }
.store-card .badges { display: flex; gap: var(--space-1); padding-right: var(--control-height); }
.store-card .card-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.store-card h2 { font-size: var(--font-heading-medium); margin: 0; }
.store-card .distance { flex: none; font-size: var(--font-body-small); font-weight: var(--font-weight-bold); color: var(--text-link); }
.store-card .meta { color: var(--text-subtle); font-size: var(--font-body-small); margin: 0; }
.store-card .notice { font-size: var(--font-body-small); color: var(--color-warning-80); margin: 0; }
.card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-2); }
.card-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: var(--control-height);
  height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-medium);
  background: none;
  color: var(--text-subtle);
}
.card-close:hover { background: var(--surface-subtle); color: var(--text-body); }

/* 지역 선택 창 */
.region-dialog {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-large);
  padding: 0;
  width: min(420px, calc(100% - 32px));
  color: var(--text-body);
}
.region-dialog::backdrop { background: var(--dim); }
.region-form { padding: var(--space-6) var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.region-form h2 { margin: 0; font-size: var(--font-heading-medium); }
.region-form .hint { margin: 0; color: var(--text-subtle); font-size: var(--font-body-small); }
.region-form label { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--font-body-small); font-weight: var(--font-weight-bold); }
.region-form select {
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-medium);
  background: var(--surface);
  font-size: var(--font-body-medium);
  font-weight: var(--font-weight-regular);
}
.dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-2); }

@media (min-width: 900px) {
  .store-card { left: var(--space-4); right: auto; bottom: var(--space-4); width: 400px; border-radius: var(--radius-large); border-bottom: 1px solid var(--border-light); }
}

/* 전통시장 (MKT-01) */
.store-list .badge-market { margin-right: var(--space-1); }
.store-card .market-days { margin: 0; font-size: var(--font-body-small); font-weight: var(--font-weight-bold); color: var(--color-primary-70); }
.list-group-title { margin: var(--space-4) 0 0; font-size: var(--font-heading-small); }

/* 온누리상품권 (DATA-04) */
.badge-onnuri { display: inline-block; margin-left: var(--space-1); padding: 1px var(--space-2); border-radius: var(--radius-small); border: 1px solid var(--border-light); background: var(--surface); color: var(--text-body); font-size: var(--font-body-xsmall); font-weight: var(--font-weight-medium); }

/* 로컬크리에이터 지역별 모아 보기로 가는 링크 (LOC-01) */
.chip-link { display: inline-flex; align-items: center; color: var(--text-link); text-decoration: underline; font-weight: var(--font-weight-bold); }

/* 내 위치 점 (LOC-02): 지도 위에만 그린다 */
.here-dot {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1a73e8;
  border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(26, 115, 232, 0.2), 0 1px 3px rgba(0, 0, 0, 0.35);
  /* 카카오 CustomOverlay 가 기본으로 좌표 한가운데에 놓으므로 따로 옮기지 않는다 */
}
.topbar .logo { flex: none; white-space: nowrap; }   /* 좁은 화면에서 '이음'이 두 줄로 꺾이지 않게 */
