* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #eef0f3;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Map area ── */
.map-container {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  align-items: stretch;
  justify-content: center;
  position: relative;
}

.map-wrapper {
  position: relative;
  display: flex;
  user-select: none;
  overflow: hidden;
  height: 100%;
  flex-shrink: 0;
}

/* Base map image */
#mapImg {
  display: block;
  height: 100%;
  width: auto;
  transition: opacity 0.5s ease;
}

/* Aerial photo — on top, crossfades in/out */
#aerialImg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform-origin: center center;
  transform: translate(0px, 0px) scale(1);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
body.aerial-mode #aerialImg { opacity: 1; }
body.aerial-mode #mapImg    { opacity: 0; }

.map-wrapper svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* ── Markers ── */
.marker { cursor: pointer; }

/* The pulsing ring */
.marker-ring {
  fill: rgba(192, 57, 43, 0.28);
  stroke: none;
  transform-box: fill-box;
  transform-origin: center;
  animation: markerPulse 2.2s ease-out infinite;
}
.marker-ring.delay { animation-delay: 1.1s; }

@keyframes markerPulse {
  0%   { transform: scale(0.6); opacity: 0.85; }
  100% { transform: scale(2);   opacity: 0; }
}

/* The solid dot */
.marker-dot {
  fill: #c0392b;
  stroke: #fff;
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
  transition: fill 0.15s, transform 0.15s;
  transform-box: fill-box;
  transform-origin: center;
}
.marker:hover .marker-dot              { fill: #96281b; transform: scale(1.25); }
.marker.active .marker-dot             { fill: #1a73e8; transform: scale(1.5); stroke: #fff; stroke-width: 3; }
.marker.active .marker-ring            { animation: none; opacity: 0; }

/* ── Planned (future) building ── */
.marker--planned .marker-dot  { fill: #95a5a6; }
.marker--planned .marker-ring { fill: rgba(149,165,166,0.25); }
.marker--planned:hover .marker-dot { fill: #7f8c8d; }

/* ── View toggle button ── */
.btn-view-toggle {
  position: absolute;
  bottom: 16px; left: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0,0,0,0.22);
  border: none;
  font-family: inherit;
}
.btn-view-toggle .opt {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #fff;
  color: #777;
  transition: background 0.18s, color 0.18s;
  display: flex; align-items: center; gap: 6px;
}
.btn-view-toggle .opt:first-child { border-right: 1px solid #eee; }
.btn-view-toggle .opt.active { background: #c0392b; color: #fff; }
.btn-view-toggle .opt:hover:not(.active) { background: #f5f5f5; color: #333; }

/* ── Building list sidebar ── */
.building-list {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.building-list-header {
  padding: 18px 18px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #aaa;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.building-list-items {
  overflow-y: auto;
  flex: 1;
}

.building-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.12s;
}
.building-list-item:hover { background: #fdf5f5; }
.building-list-item.active { background: #fff3f2; }

.building-list-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c0392b;
  flex-shrink: 0;
  transition: transform 0.12s;
}
.building-list-item.active .building-list-dot {
  transform: scale(1.35);
}

.building-list-name {
  font-size: 13px;
  color: #333;
  line-height: 1.35;
}
.building-list-item.active .building-list-name {
  color: #c0392b;
  font-weight: 600;
}

/* ── Side panel ── */
.panel {
  width: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.panel.open { width: 370px; }

.panel-inner {
  width: 370px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-img-wrap {
  position: relative;
  flex-shrink: 0;
  height: 210px;
  background: #ddd;
  overflow: hidden;
}
.panel-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.panel-img-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #e4e4e4, #ccc);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #bbb;
  font-size: 13px;
}

/* ── Carousel controls ── */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.88);
  border: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  color: #333;
  z-index: 5;
  transition: background 0.15s;
  padding: 0;
}
.carousel-btn:hover { background: #fff; }
.carousel-btn svg { display: block; }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 5;
}
.carousel-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  transition: background 0.15s;
}
.carousel-dot.active { background: #fff; }

.panel-close {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255,255,255,0.92);
  border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  color: #555;
  transition: background 0.15s;
  z-index: 5;
}
.panel-close:hover { background: #fff; color: #c0392b; }

.panel-content {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}
.panel-address {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #c0392b;
  margin-bottom: 6px;
}
.panel-name {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.35;
  margin-bottom: 16px;
}
.panel-divider {
  height: 1px;
  background: #f0f0f0;
  margin-bottom: 16px;
}
.panel-description {
  font-size: 15px;
  color: #555;
  line-height: 1.7;
}
.panel-services { margin-top: 20px; }
.panel-services h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #aaa;
  margin-bottom: 10px;
}
.service-tag {
  display: inline-block;
  background: #fff3f2;
  color: #c0392b;
  font-size: 13px;
  padding: 5px 11px;
  border-radius: 20px;
  margin: 3px 4px 3px 0;
  border: 1px solid #f5c6c2;
}

/* ── Burger button (hidden on desktop) ── */
.burger-btn {
  display: none;
  position: absolute;
  top: 14px; left: 14px;
  z-index: 30;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px; height: 42px;
  background: #fff;
  border: none;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.22);
  cursor: pointer;
  padding: 0;
}
.burger-btn span {
  display: block;
  width: 20px; height: 2px;
  background: #333;
  border-radius: 2px;
  transition: background 0.15s;
}
.burger-btn:hover span { background: #c0392b; }

/* ── Sidebar backdrop (mobile) ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
}
.sidebar-backdrop.visible { display: block; }

/* ── Mobile layout ── */
@media (max-width: 768px) {
  .map-container {
    justify-content: flex-start;
  }

  .burger-btn {
    display: flex;
    position: fixed;
    top: 14px;
    left: 14px;
    right: auto;
    z-index: 101;
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.sidebar-open .burger-btn {
    left: calc(280px + 14px);
  }
  body.panel-open .burger-btn {
    display: none;
  }

  /* Keep toggle visible regardless of map scroll */
  .btn-view-toggle {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
  }

  /* Sidebar becomes a slide-in overlay */
  .building-list {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.2);
    width: 280px;
  }
  .building-list.open { transform: translateX(0); }

  /* Panel becomes a full-screen overlay */
  .panel {
    position: fixed;
    inset: 0;
    z-index: 95;
    width: 0 !important;
    transition: none;
  }
  .panel.open {
    width: 100% !important;
    transition: none;
  }
  .panel-inner {
    width: 100% !important;
  }
  .panel-img-wrap {
    height: 260px;
  }
}
