/* =========================
   📦 WRAPPER & BAS
========================= */
.karta-wrapper {
  position: relative;
}

.map-img {
  width: 100%;
  display: block;
}

.map-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}


/* =========================
   🟦 OMRÅDEN (polygoner)
========================= */
.map-overlay polygon {
  fill: rgba(34,113,177,0.15);
  stroke: #2271b1;
  stroke-width: 2;
  cursor: pointer;
  transition: 0.2s;
}

.map-overlay polygon:hover {
  fill: rgba(34,113,177,0.35);
}

.map-overlay polygon.active {
  fill: rgba(34,113,177,0.45);
  stroke: #2271b1;
}
.map-label:hover {
  transform: translate(-50%, -50%) scale(1.02);
}

/* =========================
   🏠 TOMTER (om du använder dem)
========================= */
.tomt {
  fill: rgba(34,113,177,0.08);
  stroke: rgba(34,113,177,0.4);
  stroke-width: 1.5;
  cursor: pointer;
  transition: 0.15s;
}

.tomt:hover {
  fill: rgba(34,113,177,0.25);
  stroke: #2271b1;
}


/* =========================
   📍 MAP LABEL (rutor)
========================= */
.map-label {
  position: absolute;
  transform: translate(-50%, -50%);
  max-width: 140px;

  font-size: 13px;
  line-height: 1.3;

  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.8);
  overflow: hidden;
	padding: 0px;
  background: #fff; /* viktig */
  pointer-events: auto;
  z-index: 10;
}
 
.map-label.active {
  outline: 2px solid #2271b1;
  transform: translate(-50%, -50%) scale(1.0);
	box-shadow: 0 14px 20px black;
}

/* 🔵 HEADER */
.map-label .omrade-titel {
  background: #2f6fa3;
  color: #fff;
  font-weight: 600;
  padding: 6px 8px;
  font-size: 13px;
	padding-bottom: 4px
}
.map-label .lista {
  background: #fff;
  padding: 6px 8px;
  margin: 0; /* 👈 viktigt */
}

.map-label .lista .rad:first-child {
  margin-top: 0;
}

.map-label .omrade-titel {
  margin: 0; /* 👈 tar bort ev glapp */
}


/* 📄 BODY */
.map-label .lista {
  background: #fff;
  padding: 6px 8px;
}


/* =========================
   📋 RADER (adress + namn)
========================= */
.rad {
  display: flex;
  align-items: flex-start;

  gap: 8px;
  margin-bottom: 4px;

  cursor: pointer;
}

.rad:hover {
  background: rgba(0,0,0,0.05);
  border-radius: 4px;
}


/* nummer */
.map-label .nr {
  width: auto;
  font-weight: 700;
  min-width: 22px;
  line-height: 1.2;
  padding-top: 0px;
}

/* namnlista */
.namnlista {
  display: flex;
  flex-direction: column;
}

.namn {
  color: #333;
  line-height: 1.2;
}

.map-label {
  opacity: 0;
  pointer-events: none;

  transition: opacity 0.15s ease;
}

.map-label.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {

  .map-label {
    display: none !important;
  }

}

@media (max-width: 768px) {

  #mobile-omrade-panel {
    margin-top: 18px;
  }

  .mobile-omrade-box {

    background: #fff;

    border-radius: 8px;

    padding: 14px;

    box-shadow:
      0 2px 8px rgba(0,0,0,0.08);
  }

  .mobile-omrade-box h3 {

    margin: 0 0 12px 0;

    font-size: 18px;
  }

  .mobile-rad {

    display: flex;

    gap: 10px;

    padding: 10px 0;

    border-bottom: 1px solid #eee;
  }

  .mobile-rad:last-child {
    border-bottom: none;
  }

  .mobile-nr {

    width: 28px;

    font-weight: 700;

    flex-shrink: 0;
  }

  .mobile-namn {
    line-height: 1.3;
  }
.map-overlay polygon {
  pointer-events: all;
}
.omrade {
  cursor: pointer;
}
}

/* =========================
   🟦 DESKTOP HOVER-LABELS
========================= */

@media (min-width: 769px) {

  .map-label {
    opacity: 0;
    pointer-events: none;

    transition:
      opacity 0.15s ease,
      transform 0.15s ease;
  }

  .map-label.active {
    opacity: 1;
    pointer-events: auto;
  }

}