.leaflet_container { max-width: 1000px; margin: 0 auto; }

button {
touch-action: manipulation;
}

/* Knapp ovanför listan för att öppna kartan */
#leaflet_open_map_bar { 
	display:none;
	margin-bottom: 23px;
	gap: 10px; 
}

.leaflet_btn_show_map {
  padding: 12px 24px;
  border: 1px solid #111;
  background: #111;
  color: white;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.leaflet_noactive {
border: 1px solid #ccc;
background: white;
color:black;

}


.leaflet_btn_show_map:hover {
  background: #333;
  color:white;
  transform: translateY(-1px);
}

/* Standard lista */
#leaflet_listView { display: block; }

/* HELSKÄRMS OVERLAY KARTA */
#leaflet_mapOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #e5e3df; /* Neutral kartliknande bakgrundsfärg */
  z-index: 99999;
}

#leaflet_map {
  width: 100%;
  height: 100%;
  transition: filter 0.3s ease;
}

/* Suddig effekt när kartan laddar */
#leaflet_map.leaflet_blurred {
  filter: blur(8px);
  pointer-events: none; /* Förhindra interaktioner under laddning */
}

/* LOADING SPINNER */
.leaflet_map_loader {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100001;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 20px 30px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.leaflet_map_loader.leaflet_active {
  display: flex;
}

.leaflet_spinner {
  width: 38px;
  height: 38px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #111;
  border-radius: 50%;
  animation: leaflet_spin 0.8s linear infinite;
}

@keyframes leaflet_spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.leaflet_loader_text {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

/* Stäng-knapp längst upp till höger */
.leaflet_btn_close_map {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100000;
  background: white;
  color: #111;
  border: 1px solid rgba(0,0,0,0.15);
  padding: 10px 18px;
  border-radius: 30px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.leaflet_btn_close_map:hover {
  background: #f0f0f0;
  transform: scale(1.03);
}

/* Custom Pris-Pins (Airbnb-stil) */
.leaflet_price_pin {
  background: white;
  color: #111;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  font-size: 13px;
  white-space: nowrap;
  text-align: center;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.08);
}

.leaflet_price_pin:hover, .leaflet_price_pin.leaflet_active {
  background: #111;
  color: white;
  transform: scale(1.1);
  z-index: 1000 !important;
}

/* Pop-up kort längst ner */
.leaflet_map_card_popup {
  cursor:pointer;
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));

  left: 50%;
  transform: translateX(-50%) translateY(150%);
  width: calc(100% - 32px);
  max-width: 380px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.leaflet_map_card_popup.leaflet_open {
  transform: translateX(-50%) translateY(0);
}

.leaflet_map_card_popup img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.leaflet_map_card_content {
  padding: 16px;
  position: relative;
}

.leaflet_map_card_close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7); /* Lite mörkare för bättre kontrast */
  color: white;
  border: none;
  width: 40px;  /* Ökat från 28px till 40px */
  height: 40px; /* Ökat från 28px till 40px */
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px; /* Lite större kryss */
  line-height: 40px;
  text-align: center;
  z-index: 10;   /* Säkerställ att den ligger överst */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.leaflet_map_card_close:active {
  transform: scale(0.92); /* Visuell feedback när man trycker */
}

.leaflet_map_card_title { font-size: 16px; font-weight: bold; margin-bottom: 4px; color: #111; }
.leaflet_map_card_area { color: #666; font-size: 13px; margin-bottom: 8px; }
.leaflet_map_card_price { font-size: 16px; font-weight: bold; color: #111; }
.leaflet_map_card_rating { font-size: 13px; color: #f39c12; margin-bottom: 4px; }