/* Map studio — Fieldboard style, green pin markers */

.map-page { margin-bottom: 28px; }

.map-studio {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 14px;
  min-height: 68vh;
  align-items: stretch;
}

/* —— Side panel —— */
.map-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background:
    linear-gradient(165deg, rgba(250, 248, 241, 0.97), rgba(244, 240, 230, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  max-height: 72vh;
  overflow: hidden;
}

.map-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--pine-soft);
  box-shadow: 0 4px 14px rgba(23, 63, 53, 0.06);
}
.map-search input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}
.map-search input::placeholder { color: #8a9691; font-weight: 500; }
.map-search-icon { display: grid; place-items: center; color: var(--pine); }

.map-filter-block { display: grid; gap: 8px; }
.map-filter-label {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pine-soft);
}

.map-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.map-chips--wrap {
  flex-wrap: wrap;
  overflow: visible;
}
.map-chips::-webkit-scrollbar { display: none; }

.map-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--pine);
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.18s ease;
}
.map-chip:hover {
  border-color: var(--pine);
  transform: translateY(-1px);
}
.map-chip.is-active {
  background: var(--pine);
  border-color: var(--pine);
  color: var(--sand);
}
.map-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 2px rgba(229, 154, 47, 0.25);
}
.map-chip.is-active .map-chip-dot {
  background: var(--amber);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.map-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--pine-soft);
}
.map-clear {
  border: 0;
  background: transparent;
  color: var(--amber);
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.map-clear:hover { color: var(--pine); }

.map-list {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  padding-right: 4px;
}
.map-list-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: 0.18s ease;
  cursor: pointer;
}
.map-list-item:hover,
.map-list-item.is-on {
  border-color: rgba(229, 154, 47, 0.65);
  box-shadow: 0 8px 22px rgba(23, 63, 53, 0.1);
  transform: translateY(-1px);
}
.map-list-item img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #e8efe9;
}
.map-list-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--pine);
  line-height: 1.05;
  margin-bottom: 3px;
}
.map-list-item span.meta {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}
.map-list-go {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eef5f1;
  color: var(--pine);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
}
.map-list-empty {
  padding: 22px 12px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

/* —— Map canvas —— */
.map-canvas-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 68vh;
  background: #c5d6cf;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}
.map-canvas {
  width: 100%;
  height: 100%;
  min-height: 68vh;
}
.map-canvas-wrap .leaflet-container {
  width: 100%;
  height: 100%;
  min-height: 68vh;
  font-family: var(--font-body);
  background: #c5d6cf;
}

/* Custom green pin (logo family) */
.bp-map-pin {
  background: transparent !important;
  border: 0 !important;
}
.bp-pin {
  width: 34px;
  height: 42px;
  position: relative;
  filter: drop-shadow(0 4px 8px rgba(8, 20, 16, 0.35));
  transition: transform 0.15s ease;
}
.bp-pin:hover,
.bp-pin.is-active {
  transform: scale(1.12) translateY(-2px);
}
.bp-pin svg {
  width: 34px;
  height: 42px;
  display: block;
}

/* Popup */
.leaflet-popup-content-wrapper {
  border-radius: 16px !important;
  padding: 0 !important;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2) !important;
  border: 1px solid rgba(23, 63, 53, 0.08);
}
.leaflet-popup-content {
  margin: 0 !important;
  min-width: 220px;
}
.leaflet-popup-tip {
  background: #fff !important;
}
.bp-popup {
  font-family: var(--font-body);
}
.bp-popup img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}
.bp-popup-body {
  padding: 12px 14px 14px;
}
.bp-popup-cat {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 4px;
}
.bp-popup strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--pine);
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin-bottom: 6px;
}
.bp-popup p {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.4;
}
.bp-popup a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--pine);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef5f1;
}
.bp-popup a:hover {
  background: var(--pine);
  color: #fff;
}

.map-legend-bar {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(250, 248, 241, 0.94);
  border: 1px solid rgba(23, 63, 53, 0.1);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--pine);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.ml-pin {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #173f35;
  border: 2px solid #fff;
  vertical-align: middle;
  margin-right: 4px;
  box-shadow: 0 0 0 1px rgba(23, 63, 53, 0.2);
}
.ml-pin--orig {
  background: #24584a;
  box-shadow: 0 0 0 1px rgba(229, 154, 47, 0.5), inset 0 0 0 2px #e59a2f;
}

.map-canvas-wrap .map-float-tools {
  top: 14px;
  right: 14px;
}

@media (max-width: 960px) {
  .map-studio {
    grid-template-columns: 1fr;
  }
  .map-panel {
    max-height: none;
  }
  .map-list {
    max-height: 280px;
  }
  .map-canvas-wrap,
  .map-canvas,
  .map-canvas-wrap .leaflet-container {
    min-height: 52vh;
  }
}
