/* ============================
  공통 섹션 스타일
============================ */
section {
  /* margin-bottom: 2rem; */
  padding-bottom: 1rem;
}

/* ============================
편의 서비스
============================ */
.convenience-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.convenience.fade-in {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.vehicle-manage-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.25);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.5s ease, transform 0.5s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.vehicle-manage-btn.visible {
  opacity: 1;
  transform: translateY(0);
}

.vehicle-manage-btn:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.vehicle-manage-btn:active {
  transform: scale(0.98);
  box-shadow: var(--shadow);
}

.vehicle-manage-btn.highlight {
  animation: manageHighlight 0.6s ease forwards;
}

@keyframes manageHighlight {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }
  60% {
    transform: scale(1.08);
    opacity: 1;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(16, 185, 129, 0);
  }
}

.convenience {
  padding: 1.5rem;
  background: var(--bg);
}

.convenience-section-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.convenience-locked {
  background: var(--card);
  border-radius: 20px;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  margin-top: 1rem;
  font-weight: 500;
}

.convenience-locked p {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.convenience-btn-login {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
}

.convenience-btn-register {
  background: var(--brand);           /* 브랜드 초록색 */
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.convenience-btn-register:hover {
  background: var(--brand-hover);           /* hover 시 진한 초록 */
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.convenience-btn-register:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}


/* ============================
제어항목 관련
============================ */ 
.convenience-slider {
  display: flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 1rem;
  -webkit-overflow-scrolling: touch;
}
.convenience-slider::-webkit-scrollbar {
  display: none;
}

.convenience-page {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 120px);
  gap: 1rem;
  flex: 0 0 100%;
  scroll-snap-align: start;
}

/* 페이지네이션 */
.convenience-pagination {
  text-align: center;
  margin-top: 0.5rem;
}
.convenience-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #d1d5db;
  border-radius: 50%;
  margin: 0 4px;
  transition: all 0.3s ease;
}
.convenience-dot.active {
  background: #10b981;
  transform: scale(1.3);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

/* 개별 카드 */
.convenience-card {
  flex: 0 0 150px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  scroll-snap-align: start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeSlideIn 0.6s ease forwards;
}
.convenience-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 상단 (아이콘 좌, 버튼 우) */
.convenience-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 하단 (이름) */
.convenience-card-bottom {
  margin-top: 1rem;
  text-align: left;
  padding-left: 0.2rem;
}

/* 아이콘 */
.convenience-card-icon {
  width: 40px;
  height: 40px;
  display: inline-block;
  background-color: var(--icon-color); /* ← 색은 토큰으로 제어 */
  -webkit-mask: center / contain no-repeat;
          mask: center / contain no-repeat;
}

/* 개별 마스크 소스 지정 */
.icon-indoor {
  -webkit-mask-image: url("../assets/icons/convenience/indoor_light.png");
          mask-image: url("../assets/icons/convenience/indoor_light.png");
}
.icon-underbody {
  -webkit-mask-image: url("../assets/icons/convenience/underbody_light.png");
          mask-image: url("../assets/icons/convenience/underbody_light.png");
}
.icon-door {
  -webkit-mask-image: url("../assets/icons/convenience/door_open_check.png");
          mask-image: url("../assets/icons/convenience/door_open_check.png");
}
.icon-sensor {
  -webkit-mask-image: url("../assets/icons/convenience/sensor.png");
          mask-image: url("../assets/icons/convenience/sensor.png");
}
.icon-extra {
  -webkit-mask-image: url("../assets/icons/favicon.png");
          mask-image: url("../assets/icons/favicon.png");
}

/* (선택) 카드 hover 시 아이콘 컬러 강조 */
.convenience-card:hover .convenience-card-icon {
  background-color: var(--brand);
}


/* 이름 */
.convenience-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

/* 전원버튼 */
.convenience-card-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.convenience-card-btn:hover {
  transform: scale(1.1);
}

/* 전원 아이콘 기본 상태 (OFF) */
.power-icon {
  width: 30px;
  height: 30px;
  color: #9ca3af; /* 회색 (OFF) */
  stroke-width: 3;
  transition: color 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

/* ON 상태 */
.convenience-card-btn.active .power-icon {
  color: #10b981; /* 초록색 (ON) */
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.5));
  transform: scale(1.15);
  animation: powerPulse 1.4s ease-in-out infinite;
}

/* 추가된 부분: 문 관련 버튼 경고 색깔 */
.convenience-card-btn.warning .power-icon {
  color: #ef4444; /* 경고를 상징하는 선명한 레드 */
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.6)); /* 색상에 맞춘 그림자 효과 */
  transform: scale(1.15);
  animation: powerPulse 1.4s ease-in-out infinite;
}

/* Glow 애니메이션 */
@keyframes powerPulse {
  0% {
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.3));
    transform: scale(1.08);
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(16, 185, 129, 0.8));
    transform: scale(1.2);
  }
  100% {
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.3));
    transform: scale(1.08);
  }
}

/* ============================
거리센서 관련
============================ */ 
.speed-sensor-section {
  margin: 24px 0;}

.distance-accordion-section {
  padding: 1.5rem;
  background: var(--bg);
}

.distance-accordion-item {
  width: 100%;
}

.distance-accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}

.distance-accordion-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.distance-accordion-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
}

.distance-accordion-toggle:active {
  opacity: 0.7;
}

.distance-accordion-icon {
  width: 24px;
  height: 24px;
  stroke: var(--text);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}

/* 열렸을 때 화살표 위로 */
.distance-accordion-item.active .distance-accordion-icon {
  transform: rotate(180deg);
}

.distance-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

/* 열렸을 때 */
.distance-accordion-item.active .distance-accordion-content {
  max-height: 2000px;
}

.distance-sensor-section {
  margin: 12px 0;
}

.speed-card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 3px 0;
  scroll-snap-align: start;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease,
    box-shadow 0.25s ease;
  will-change: transform, box-shadow;
  transform: translateY(20px);
  animation: fadeSlideIn 0.6s ease forwards;
}

.speed-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.speed-icon {
  width: 24px;
  height: 24px;
  color: #667eea;
}

.speed-title {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0;
  color: var(--text);
}

/* 속도 값 */
.speed-value-container {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin: 10px 0;
}

.speed-value {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.speed-unit {
  color: var(--text);
  font-size: 14px;
  margin-left: 8px;
}

.speed-status {
  text-align: center;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 15px;
}

.status-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.status-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.status-good {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-safe {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

/* 속도 프로그레스 바 */
.speed-progress {
  width: 100%;
  height: 6px;
  background: var(--bar);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1px;
}

.speed-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  transition: width 0.3s ease, background 0.3s ease;
  border-radius: 3px;
}

/* 거리 프로그레스 바 스타일 (이름을 distance로 변경) */
.distance-progress {
  width: 100%;
  height: 6px;
  background: var(--bar);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 20px; /* 속도 정보와 거리 정보 사이 간격 */
  margin-bottom: 1px;
}

.distance-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  transition: width 0.3s ease, background 0.3s ease;
  border-radius: 3px;
}

/* 텍스트 그라데이션 수정: 속도와 거리가 한 줄에 있으므로 ID나 별도 클래스 권장 */
.distance-value {
  font-size: 42px;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.distance-unit {
  color: var(--text);
  font-size: 14px;
  margin-left: 8px;
}

.speed-info {
  display: flex;
  justify-content: space-between;
  margin-top: 1px;
  padding-top: 1px;
}

.speed-info-item {
  text-align: center;
}

.speed-info-label {
  font-size: 11px;
  color: var(--text);
  margin-bottom: 1px;
}

.speed-info-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}


/* 모바일 반응형 */
@media (max-width: 600px) {
  .convenience-card {
    flex: 0 0 130px;
  }
  .convenience-card-icon {
    width: 1.7rem;
    height: 1.7rem;
  }
  .convenience-card-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
  .convenience-card-title {
    font-size: 0.85rem;
  }
  .speed-value {
    font-size: 36px;
  }
  .speed-value-container {
    flex-wrap: wrap; /* 글자가 넘치면 아래로 줄바꿈 */
    gap: 5px;
  }
  .speed-value, .distance-value {
    font-size: 28px; /* 모바일에서는 글자를 조금 더 작게 */
  }
}

/* ============================
  즐겨찾기 섹션
============================ */
.favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.favorites-actions {
  display: flex;
  gap: 0.5rem; 
}

.edit-favorites-btn {
  background: var(--brand);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.edit-favorites-btn:hover {
  background: #059669;
}

/* 삭제 버튼 */
.delete-fav-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
  display: none;
}
body.editing .delete-fav-btn {
  display: block;
}

.add-favorite-card {
  border: 2px dashed var(--brand);
  background: var(--bg);
  color: var(--brand);
  cursor: pointer;
  justify-content: center;
  transition: all 0.25s ease;
}

.add-favorite-card:hover {
  background: rgba(16, 185, 129, 0.08);
  transform: scale(1.05);
}

.add-card-icon {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
}

/* 카드 공통 스타일 */
.favorite-card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 3px 0;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease,
    box-shadow 0.25s ease;
  will-change: transform, box-shadow;
  max-width: 150px;
}
.favorite-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

/* 드래그 중 카드 효과 (3D 느낌) */
.favorite-card.dragging {
  opacity: 0.9;
  transform: scale(1.05) rotate(1deg) translateY(-3px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.25);
  z-index: 10;
  cursor: grabbing;
}

/* 편집 모드 시 커서 변경 */
body.editing .favorite-card {
  cursor: grab;
}

/* 드래그 가이드라인 */
.drag-guide-line {
  width: 100%;
  height: 4px;
  background: #10b981;
  border-radius: 2px;
  margin: 4px 0;
  animation: blink 0.6s ease-in-out infinite alternate;
}

@keyframes blink {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}


/* 바텀바 높이 (기본: 없음) */
:root {
  --bottom-bar-h: 0px;
}

/* 992px 이하에서는 바텀바가 생기므로 높이를 반영 */
@media (max-width: 992px) {
  :root {
    --bottom-bar-h: 64px; /* .bottom-bar height랑 반드시 동일 */
  }
}

/* 섹션 및 타이틀 */
.favorites {
  padding: 1.5rem;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(2.4rem + var(--bottom-bar-h));
}
.favorites-section-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

/* 슬라이더 */
.favorites-slider {
  display: flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  scroll-snap-stop: always;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  gap: 1rem;
}
.favorites-slider::-webkit-scrollbar {
  display: none;
}

/* 페이지 단위 */
.favorites-page {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 100px);
  gap: 1rem;
  flex: 0 0 100%;
  scroll-snap-align: start;
}

/* 아이콘 */
.favorite-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  transition: transform 0.25s ease;
  cursor: pointer;
  border-radius: 35%;
}
.favorite-icon:hover {
  transform: scale(1.12);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* 이름 */
.favorite-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

/* 인디케이터 */
.favorites-pagination {
  position: absolute;
  bottom: calc(0.9rem + var(--bottom-bar-h));
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
  opacity: 0;
  animation: fadeInDots 0.8s ease forwards;
}
.favorites-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #d1d5db;
  border-radius: 50%;
  margin: 0 4px;
  transform: scale(1);
  transition:
    background 0.3s ease,
    transform 0.3s ease,
    opacity 0.3s ease;
}
.favorites-dot.active {
  background: #10b981;
  transform: scale(1.3);
  opacity: 1;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

/* 모바일 */
@media (max-width: 600px) {
  .favorites-page {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 100px);
  }
  .favorite-icon {
    width: 50px;
    height: 50px;
  }
  .favorite-name {
    font-size: 0.85rem;
  }
}

/* 페이드 전환 */
body.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* 인디케이터 등장 */
@keyframes fadeInDots {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* 인디케이터 사라짐 */
.favorites.fade-out .favorites-pagination {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* 카드 페이드 + 슬라이드인 효과 */
@keyframes fadeSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  60% {
    opacity: 1;
    transform: translateY(-2px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================
  즐겨찾기 추가 모달
============================ */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  z-index: 100;
}

.modal-content {
  background: var(--card);
  padding: 1.5rem;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.available-items {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;

  /* ✅ 높이 제한 */
  max-height: 300px;          /* 데스크탑 기준 */
  overflow-y: auto;           /* 내부 스크롤 활성화 */
  padding-right: 6px;         /* 스크롤바 공간 확보 */
}

/* ✅ 모바일에서도 자연스럽게 동작하게 (반응형) */
@media (max-height: 700px) {
  .available-items {
    max-height: 40vh;         /* 화면 높이의 40%까지만 */
  }
}

/* ✅ 스크롤바 스타일 (선택사항) */
.available-items::-webkit-scrollbar {
  width: 6px;
}
.available-items::-webkit-scrollbar-thumb {
  background: rgba(100, 100, 100, 0.3);
  border-radius: 4px;
}
.available-items::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 100, 100, 0.45);
}

.available-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  font-weight: 600;
}

.available-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 35%;
}

.add-item-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.add-item-btn:hover {
  background: #059669;
}

.modal-actions {
  margin-top: 1rem;
}
.modal-actions .btn {
  background: #d1d5db;
  transition: background-color 0.2s ease;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 650;
}
.modal-actions .btn:hover {
  background: #9ca3af;
}


/* ============================
  삭제 애니메이션
============================ */
.favorite-card.deleting {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* 삭제 버튼 hover 효과 */
.delete-fav-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
  transition: background 0.2s ease, transform 0.2s ease;
}


/* 편집모드 흔들림 애니메이션 */
@keyframes wiggle {
  0% { transform: rotate(-1.5deg); }
  100% { transform: rotate(1.5deg); }
}

body.editing .favorite-card {
  cursor: grab;
  animation: wiggle 0.25s ease-in-out infinite alternate;
  transform-origin: center center;
}

/* 흔들릴 때 살짝 확대 */
body.editing .favorite-card:hover {
  transform: scale(1.03) rotate(0deg);
}


/* ============================
  지도 모달 (Glassmorphism + Bounce + 앱스타일)
============================ */
.map-modal {
  display: flex;
  position: fixed;
  inset: 0;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition:
    background 0.5s ease,
    backdrop-filter 0.5s ease,
    opacity 0.35s ease;
}

/* 활성화 시 */
.map-modal.active {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  opacity: 1;
  pointer-events: auto;
}

/* 닫힐 때 */
.map-modal.closing {
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  opacity: 0;
}

/* ====== 모달 본체 ====== */
.map-modal-content {
  background: color-mix(in srgb, var(--card) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--line, #e5e7eb) 30%, transparent);
  border-radius: 24px;
  width: min(420px, 90vw);
  padding: 26px 22px 30px;
  position: relative;
  text-align: center;
  color: var(--text);
  transform: scale(0.9);
  opacity: 0;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    0 0 30px rgba(255, 255, 255, 0.08) inset;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.4s ease,
    box-shadow 0.6s ease;
}

/* 등장 시 bounce */
@keyframes modalBounce {
  0%   { transform: scale(0.9); opacity: 0; }
  70%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.map-modal.active .map-modal-content {
  animation: modalBounce 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 닫힐 때 */
.map-modal.closing .map-modal-content {
  transform: scale(0.9);
  opacity: 0;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

/* 다크모드용 약간 더 투명하게 */
html[data-theme="dark"] .map-modal-content {
  background: color-mix(in srgb, var(--card) 75%, transparent);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(255, 255, 255, 0.05) inset;
}

/* ===== 모바일 전용 bottom-sheet ===== */
@media (max-width: 992px) {
  .map-modal {
    align-items: flex-end;
  }

  .map-modal-content {
    width: 100%;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    opacity: 1;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0);
    transition:
      transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 0.5s ease;
  }

  @keyframes bottomBounce {
    0%   { transform: translateY(100%); }
    70%  { transform: translateY(-3%); }
    100% { transform: translateY(0); }
  }

  .map-modal.active .map-modal-content {
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
    animation: bottomBounce 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  }

  .map-modal.closing .map-modal-content {
    transform: translateY(100%);
  }
}

/* ====== 내부 요소 ====== */
.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text);
  opacity: 0.7;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.close-btn:hover {
  opacity: 1;
  transform: rotate(90deg) scale(1.1);
}

.map-modal-content h3 {
  margin-top: 4px;
  margin-bottom: 14px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* 지도 미리보기 */
#mapPreview {
  width: 100%;
  height: 280px;
  border-radius: 14px;
  margin-top: 10px;
  opacity: 0;
  background: #f3f4f6;
  transition: opacity 0.4s ease;
}
#mapPreview.visible {
  opacity: 1;
}

/* 텍스트 */
.map-info-overlay {
  margin-top: 14px;
  color: var(--text);
  line-height: 1.45;
}
.map-info-overlay h4 {
  margin-bottom: 4px;
  font-weight: 700;
  font-size: 1.05rem;
}

/* 버튼 */
.map-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  padding: 11px 20px;
  background: var(--brand);
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}
.map-link-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}
.map-link-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ====== 지도 모달 헤더 ====== */
.map-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.map-header .map-icon {
  color: var(--brand);
  flex-shrink: 0;
  transition: transform 0.3s ease, color 0.3s ease;
}

.map-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

.map-modal.active .map-header .map-icon {
  transform: scale(1.15);
}



