/* ==========================================================================
   r2go4-Skin — Immo-Listing/Card/Filter/Pagination/Map-CSS
   1:1 extrahiert aus packages/immo/assets/css/immo.css (immo v1.x.x)
   Refactor 2026-05-28: Optik-CSS gehört in Skin, Package liefert nur Funktion.
   ========================================================================== */


/* ── Fullscreen Map + Container ──────────────────────────────────────────── */
.immo-map-fullscreen {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding-top: var(--header-height, 170px);
}

.immo-map-fullscreen .immo-map-container {
  max-width: 100%;
  margin: 0;
}

/* ── Search Page (own width, not constrained by parent container) ──────── */

/* ── Map / Markers / Popups / Leaflet-Overrides ──────────────────────────── */
.immo-map-container {
  position: relative;
  max-width: var(--immo-map-width);
  margin: 0 auto 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 1;
}

.immo-map-wrapper {
  position: relative;
}

.immo-map {
  position: relative;
  min-height: 400px;
  background: #f8f9fa;
  width: 100%;
  z-index: 1;
}

/* Loading state */
.immo-map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #333;
}

.immo-map-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #ddd;
  border-top: 2px solid var(--immo-ci-color);
  border-radius: 50%;
  animation: immoMapSpin 1s linear infinite;
}

@keyframes immoMapSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error state */
.immo-map-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: #f8d7da;
  color: #721c24;
  padding: 1.25rem;
  border: 1px solid #f5c6cb;
  max-width: 300px;
  text-align: center;
}

.immo-map-error h4 {
  margin: 0 0 0.5rem 0;
  color: #721c24;
}

.immo-map-error-button {
  margin-top: 0.625rem;
  padding: 0.5rem 1rem;
  background: var(--immo-ci-color);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
}

/* Noscript */
.immo-map-noscript {
  padding: 2.5rem;
  text-align: center;
  background: #f8f9fa;
  border: 1px solid #ddd;
}

.immo-map__empty {
  text-align: center;
  padding: 1rem;
  color: var(--color-text-light, #999);
  font-size: 0.9rem;
}

/* ── Map Legend ────────────────────────────────────────────────────────── */

.immo-map-legend {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  padding: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1000;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: #333;
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-marker {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  background: var(--immo-ci-color);
}

/* ── Map Markers ──────────────────────────────────────────────────────── */

.immo-marker {
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.75rem;
  color: #fff;
  width: 24px;
  height: 24px;
}

.immo-marker:hover {
  transform: scale(1.1);
  z-index: 1000;
}

.immo-marker.exact,
.immo-marker.approximate {
  background-color: var(--immo-ci-color);
}

/* ── Map Popup (horizontal layout: image left, info right) ────────────── */

.immo-map .leaflet-popup-content-wrapper {
  border-radius: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 0;
  overflow: hidden;
  min-width: 420px;
  max-width: 500px;
}

.immo-map .leaflet-popup-content {
  margin: 0;
  padding: 0;
  width: 100%;
}

.leaflet-container a.leaflet-popup-close-button {
  top: 0.5rem;
  right: 0.375rem;
  width: 1.875rem;
  height: 1.875rem;
  font: 24px/24px Tahoma, Verdana, sans-serif;
  color: #757575;
}

.immo-popup-container {
  display: flex;
  min-width: 420px;
  max-width: 500px;
  background: #fff;
}

.immo-popup-left {
  width: 140px;
  flex-shrink: 0;
  overflow: hidden;
  align-self: stretch;
}

.immo-popup-left img {
  width: 140px;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.immo-popup-right {
  flex: 1;
  padding: 0.8125rem 1.0625rem;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.immo-popup-location {
  font-size: 0.8125rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.immo-popup-title {
  margin: 0 0 auto 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.immo-popup-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.625rem;
}

.immo-popup-price {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--immo-ci-color);
  line-height: 1;
}

.immo-popup-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--immo-ci-color);
  text-decoration: none;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.immo-popup-link:hover {
  background: var(--immo-ci-color-hover);
}

.immo-popup-link svg {
  width: 10px;
  height: 10px;
  transform: rotate(-90deg);
}

/* ── STRG+Scroll Overlay ──────────────────────────────────────────────── */

.immo-map-scroll-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.immo-map-scroll-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.immo-map-scroll-overlay span {
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Cluster Markers ──────────────────────────────────────────────────── */

.marker-cluster {
  background-color: var(--immo-ci-color);
  opacity: 0.8;
  border-radius: 50%;
  text-align: center;
  color: #fff;
  font-weight: bold;
  font-size: 0.75rem;
  line-height: 40px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid #fff;
}

.marker-cluster div {
  background-color: var(--immo-ci-color);
  opacity: 0.9;
  border-radius: 50%;
  text-align: center;
  color: #fff;
  font-weight: bold;
  line-height: 36px;
  width: 36px;
  height: 36px;
  margin: 2px;
}

.marker-cluster-small      { background-color: var(--immo-ci-color); opacity: 0.8; }
.marker-cluster-small div  { background-color: var(--immo-ci-color); opacity: 0.9; }
.marker-cluster-medium     { background-color: var(--immo-ci-color); opacity: 0.85; }
.marker-cluster-medium div { background-color: var(--immo-ci-color); opacity: 0.95; }
.marker-cluster-large      { background-color: var(--immo-ci-color); opacity: 0.7; }
.marker-cluster-large div  { background-color: var(--immo-ci-color); opacity: 0.75; }

/* Leaflet tile fixes */
.leaflet-control-attribution { display: none; }
.leaflet-container { background: #ddd; }
.leaflet-tile { max-width: none; }
.leaflet-tile-pane { z-index: 2; }
.leaflet-objects-pane { z-index: 3; }
.leaflet-popup { z-index: 1010; }

/* Detail page styles are now in immo-detail.css (loaded separately) */

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet / Small Desktop: 2 columns */
