.map-page {
  padding: 0;
  color: #fff;
  height: 100svh;
  position: relative;
  --map-water-color: #6993DD;
  width: 100%;
  overflow: hidden;
}

@supports not (height: 1svh) {
  .map-page {
    height: 100vh;
  }
}

body.map-root {
  background: var(--map-water-color);
  background-image: none;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

html.map-root-html {
  overflow: hidden;
  overscroll-behavior: none;
  width: 100%;
  height: 100%;
}


.map-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--map-water-color);
  border: none;
  box-shadow: none;
  z-index: 0;
  touch-action: none;
  overscroll-behavior: none;
}

@supports not (height: 1svh) {
  .map-container {
    height: 100vh;
  }
}

#navbar {
  position: relative;
  z-index: 9999;
}

.map-root nav[data-shmoobium="navbar"] {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-color: #000000 !important;
}

#mapCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.map-info {
  position: fixed;
  left: 14px;
  bottom: 14px;
  transform: none;
  padding: 6px 10px;
  color: #fff;
  background: rgba(0,0,0,0.85);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  pointer-events: auto;
  text-align: left;
  width: auto;
  max-width: min(260px, calc(100vw - 28px));
  box-sizing: border-box;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 200;
}

.map-info.hidden {
  display: none;
}

#cursorLocation {
  display: none;
}

.map-info-line + .map-info-line {
  margin-top: 4px;
  opacity: 0.85;
}

.map-info-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

#coordDisplay {
  flex: 1;
  text-align: center;
}

.coord-toggle {
  width: 14px;
  height: 14px;
  accent-color: #ffffff;
  margin: 0;
}

.coord-input {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 90vw);
  min-height: 140px;
  max-height: 50vh;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  z-index: 9500;
  resize: vertical;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.4;
}

.coord-input.hidden {
  display: none;
}

.map-detail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(360px, 88vw);
  max-height: 100vh;
  overflow: hidden;
  background: rgba(0,0,0,0.85);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  z-index: 100;
  display: block;
  visibility: visible;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-100%);
  transition: transform 0.22s ease, opacity 0.22s ease;
  box-sizing: border-box;
}

.map-detail.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.map-detail-content {
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 16px;
  box-sizing: border-box;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.map-detail.hidden {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.detail-block.hidden {
  display: none;
}


.detail-banner {
  width: calc(100% + 32px);
  margin: 0 -16px 12px;
  height: 35vh;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.detail-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-title {
  margin-top: 0;
  font-size: 22px;
  font-weight: 900;
}

.detail-type {
  margin-top: 4px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.8;
}

.detail-section-title {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-divider {
  height: 1px;
  background: rgba(255,255,255,0.2);
  margin: 16px 0;
}

.detail-block > .detail-divider:first-child {
  margin-top: 0;
}

.detail-description {
  margin-top: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.4;
}
.detail-description + .detail-divider {
  margin-top: 16px;
}

.detail-images {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 12px;
}

.detail-images img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.detail-images img:hover {
  transform: scale(1.03);
}

.detail-image-viewall {
  position: relative;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.detail-image-viewall:hover {
  transform: scale(1.03);
}

.detail-image-viewall img {
  display: block;
}

.detail-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.detail-related {
  margin-top: 12px;
}

.detail-related.hidden {
  display: none;
}

.detail-related-title {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 8px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.related-grid a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.related-grid a:hover {
  transform: translateY(-2px);
}

.related-grid img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: 10px;
  border: none;
}

.related-item-name {
  margin-top: 6px;
  color: rgba(255,255,255,0.9);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.map-gallery {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  z-index: 9000;
  padding-top: 120px;
}

.map-gallery.hidden {
  display: none;
}

.gallery-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.gallery-main {
  width: min(80vw, 900px);
  height: min(60vh, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  border-radius: 16px;
  padding: 12px;
  margin: 24px auto 0;
}

.gallery-main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: min(80vw, 900px);
  max-height: 20vh;
  overflow: auto;
  padding: 6px;
  margin: 0 auto;
  justify-content: center;
  align-content: flex-start;
}

.gallery-thumbs img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.gallery-thumbs img:hover {
  transform: scale(1.1);
}

@media (max-width: 700px) {
  .map-info {
    display: none;
  }

  .coord-toggle,
  .coord-input {
    display: none;
  }


  .map-detail {
    width: 100vw;
    max-width: 100vw;
    height: 50svh;
    max-height: 50svh;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
    transition: transform 0.22s ease, opacity 0.22s ease;
  }
  @supports not (height: 1svh) {
    .map-detail {
      height: 50vh;
      max-height: 50vh;
    }
  }
  .map-detail.is-open {
    transform: translateY(0);
  }
  .map-detail-content {
    padding: 0 14px calc(28px + env(safe-area-inset-bottom));
  }
  .map-info {
    bottom: calc(14px + env(safe-area-inset-bottom));
    font-size: 12px;
    min-width: 200px;
  }
  .detail-images {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
  .detail-banner {
    height: 35vh;
    width: calc(100% + 28px);
    margin: 0 -14px 10px;
  }
  .gallery-main {
    width: 90vw;
    height: 50vh;
  }
  .gallery-thumbs {
    max-width: 90vw;
  }
  .detail-images img {
    height: 120px;
  }
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .related-grid img {
    height: 60px;
  }
  .related-item-name {
    font-size: 9px;
    margin-top: 4px;
  }
}
