/* 統一台灣地圖樣式 */
.linelist__unified {
  background-color: #f8f9fa;
}

.linelist__unified__box {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  gap: 30px;
  padding: 30px 20px;
  height: calc(100vh - 40px);
  min-height: 600px;
}

.linelist__unified__map {
  flex: 0 0 380px;
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: fit-content;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow: hidden;
}

.linelist__unified__pic {
  width: 100%;
  text-align: center;
  position: relative;
}

.linelist__unified__pic svg {
  width: 100%;
  height: auto;
  max-width: 320px;
}

.linelist__unified__pic path[data-name] {
  fill: #e6e6e6;
  stroke: #ffffff;
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.3s ease;
}

.linelist__unified__pic path[data-name]:hover {
  fill: #d0d0d0 !important;
}

.linelist__unified__pic path[data-name].is-active {
  fill: #007bff !important;
}

.linelist__unified__remark {
  margin-top: 15px;
  padding: 10px;
  background-color: #f0f8ff;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
  color: #666;
  border: 1px solid #e0e0e0;
}

.linelist__unified__store {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.linelist__unified__storebox {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  align-content: start;
}

/* 地圖載入狀態 */
.map-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.map-loading p {
  color: #666;
  font-size: 14px;
  margin: 0;
}

/* 地圖錯誤狀態 */
.map-error {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.map-error p {
  margin-bottom: 16px;
  color: #d32f2f;
}

.map-error button {
  background: #007bff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.map-error button:hover {
  background: #0056b3;
}

/* 診所列表載入狀態 */
.linelist__unified .linelist__area__loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #666;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.linelist__unified .linelist__area__loading::before {
  content: '';
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

/* 空狀態樣式 */
.linelist__unified__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.linelist__unified__empty h3 {
  margin-bottom: 12px;
  color: #333;
  font-size: 18px;
}

.linelist__unified__empty p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

/* 位置偵測狀態提示 */
.location-detecting {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 20px;
  border-radius: 8px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
}

.location-detecting .loading-spinner {
  width: 20px;
  height: 20px;
  border-width: 2px;
  margin: 0;
}

/* 手機版響應式 */
@media (max-width: 768px) {
  .linelist__unified {
    padding: 20px 0;
    min-height: auto;
  }

  .linelist__unified__box {
    flex-direction: column;
    gap: 20px;
    padding: 0 15px;
    height: auto;
    min-height: auto;
  }

  .linelist__unified__map {
    flex: none;
    position: static;
    max-height: none;
  }

  .linelist__unified__pic svg {
    max-width: 280px;
  }

  .linelist__unified__storebox {
    grid-template-columns: 1fr;
    height: auto;
    max-height: 600px;
  }

  .linelist__unified .linelist__area__item {
    min-height: 160px;
    width: 100% !important;
  }
}

// 複寫 all.css 的樣式
.friendlyclinic .linelist__area__item {
  width: 100% !important;
}

/* 平板版響應式 */
@media (max-width: 1024px) and (min-width: 769px) {
  .linelist__unified__box {
    max-width: 100%;
    gap: 20px;
  }

  .linelist__unified__map {
    flex: 0 0 320px;
  }

  .linelist__unified__storebox {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* 大螢幕優化 */
@media (min-width: 1400px) {
  .linelist__unified__storebox {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
}
