/* Shared Popup and Carousel Styles */
.maplibregl-popup-content {
  padding: 0 !important;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: #fff;
}

.popup-container {
  width: 240px;
  height: 320px;
  padding: 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.popup-header {
  flex-shrink: 0;
}

.popup-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #000;
}

.popup-subtitle {
  color: #666;
  font-size: 13px;
  margin-bottom: 8px;
}

.popup-carousel-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-top: 1px solid #eee;
  padding-top: 8px;
}

.popup-carousel-wrapper {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  height: 100%;
}

.popup-carousel-wrapper::-webkit-scrollbar {
  display: none;
}

.popup-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  overflow-y: auto;
  box-sizing: border-box;
}

.popup-carousel-slide.image-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  padding: 10px;
}

.popup-carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
  display: flex;
  transition: background 0.2s;
}

.carousel-nav-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

.carousel-nav-btn.prev {
  left: 0;
}

.carousel-nav-btn.next {
  right: 0;
}

.carousel-nav-btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.description-text {
  color: #0066cc;
  font-size: 13px;
  white-space: pre-line;
}

.description-text .name-change {
  color: #666;
  display: block;
  margin-top: 5px;
  font-size: 12px;
}

.maplibregl-popup-close-button {
  display: none !important;
}

/* ===== IMAGE LIGHTBOX ===== */
.popup-img-tap-zone {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  cursor: zoom-in;
  z-index: 3;
}

#img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
}

#img-lightbox.open {
  display: flex;
}

#img-lightbox img {
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  object-fit: contain;
  border-radius: 6px;
  display: block;
  user-select: none;
}

#img-lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  transition: background 0.2s;
  z-index: 100000;
}

#img-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

#img-lightbox-prev,
#img-lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 100000;
}

#img-lightbox-prev { left: 16px; }
#img-lightbox-next { right: 16px; }

#img-lightbox-prev:hover,
#img-lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

#img-lightbox-prev svg,
#img-lightbox-next svg,
#img-lightbox-close svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}
