﻿/* 지도 영역, 바텀 시트(모바일)/사이드바(데스크탑), 맛집 목록 카드 스타일 */

/* ═════════════════════════════════════════════════════
   지도 영역 (모바일: absolute fill)
═════════════════════════════════════════════════════ */

.map-area {
  position: absolute;
  inset: 0;
}

#map {
  width: 100%;
  height: 100%;
}

/* ── 로딩 오버레이 ── */
.map-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.93);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 50;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ── 현재 위치 FAB ── */
.fab-locate {
  position: absolute;
  bottom: calc(var(--sheet-peek) + 1rem);
  right: 1rem;
  z-index: 21;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-secondary);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.fab-locate:hover {
  box-shadow: var(--shadow-lg);
  transform: scale(1.07);
}

/* ── 카카오맵 InfoWindow 스타일 ── */
.custom-iw {
  padding: 8px 12px;
  background: white;
  border-radius: var(--radius-sm);
  font-family: -apple-system, 'Noto Sans KR', sans-serif;
  max-width: 200px;
  line-height: 1.4;
}

.custom-iw__name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

.custom-iw__category {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.custom-iw__distance {
  font-size: 0.73rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-top: 4px;
}

/* ═════════════════════════════════════════════════════
   바텀 시트 (모바일 기본)
═════════════════════════════════════════════════════ */

.sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 65vh;
  min-height: 320px;
  background: var(--color-white);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  z-index: 20;
  display: flex;
  flex-direction: column;
  /* 접힌 상태: peek 높이만 노움 */
  transform: translateY(calc(100% - var(--sheet-peek)));
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.sheet.open {
  transform: translateY(0);
}

/* ── 드래그 핸들 영역 ── */
.sheet__grip-row {
  flex-shrink: 0;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}

.sheet__grip {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
  transition: background 0.15s;
}

.sheet__grip-row:hover .sheet__grip,
.sheet__grip-row:active .sheet__grip {
  background: #9CA3AF;
}

/* ── 시트 헤더 (항상 보임) ── */
.sheet__peek {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem 1rem;
  gap: 0.75rem;
}

.sheet__info {
  min-width: 0;
}

.sheet__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-secondary);
  line-height: 1.2;
}

.sheet__count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 2px;
}

/* ── 버튼: 뭐먹지? ── */
.btn-recommend {
  flex-shrink: 0;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.35);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn-recommend:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.45);
}

.btn-recommend:active {
  transform: translateY(0);
}

/* ── 맛집 리스트 ── */
.restaurant-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.restaurant-list::-webkit-scrollbar {
  width: 4px;
}

.restaurant-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 160px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* ── 맛집 카드 ── */
.restaurant-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
  -webkit-tap-highlight-color: transparent;
}

.restaurant-card:last-child {
  border-bottom: none;
}

.restaurant-card:hover,
.restaurant-card:active {
  background: #FFF8F5;
}

.restaurant-card.active {
  background: #FFF2ED;
  border-left-color: var(--color-primary);
}

.restaurant-card__index {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: background 0.15s, color 0.15s;
}

.restaurant-card.active .restaurant-card__index {
  background: var(--color-primary);
  color: white;
}

.restaurant-card__body {
  flex: 1;
  min-width: 0;
}

.restaurant-card__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.restaurant-card__category {
  font-size: 0.775rem;
  color: var(--color-text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.restaurant-card__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* ═════════════════════════════════════════════════════
   데스크탑 레이아웃 (768px 이상)
═════════════════════════════════════════════════════ */

@media (min-width: 768px) {
  /* 지도: absolute 해제하고 flex 아이템으로 */
  .map-area {
    position: relative;
    flex: 1;
  }

  /* 바텀 시트 → 우측 사이드바로 전환 */
  .sheet {
    position: relative;
    width: 360px;
    height: 100%;
    min-height: unset;
    border-radius: 0;
    transform: none !important;
    transition: none;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
  }

  /* 데스크탑에서 드래그 핸들 숨김 */
  .sheet__grip-row {
    display: none;
  }

  /* 사이드바 헤더 스타일 */
  .sheet__peek {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
  }

  /* 데스크탑: 위치 버튼은 지도 우측 하단에 */
  .fab-locate {
    bottom: 1.5rem;
    right: 1rem;
  }

  .restaurant-list {
    padding: 0.25rem 0;
  }
}
