/**
 * Orphit Akustiker-Karte – Platzhalter, Filter, Karten-Container.
 * v2.2.0 — Fix cluster count visibility: layer split, position fix, z-index.
 */

/* ── Eingebettete Section (Landingpage New 2) ───────────────────────────── */
.orphit-map__section {
  width: 100%;
  padding: 96px 24px 120px;
  background: #ffffff;
}

.orphit-map__section-inner {
  width: min(100%, 1080px);
  margin-inline: auto;
}

.orphit-map__section-title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 1.2rem + 3vw, 3rem);
  line-height: 1.15;
  color: var(--orphit-map-text, #20272b);
  text-align: center;
  font-weight: 700;
}

.orphit-map__section-intro {
  max-width: 620px;
  margin: 0 auto 28px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--orphit-map-text-muted, #5d6b71);
  text-align: center;
}

.orphit-map {
  /* Akzent an das Theme-Token koppeln: auf der Orphit-LP greift --cta (#36787B),
     auf Legacy-/Bricks-Seiten bleibt der Fallback #3c8c8c (non-breaking). */
  --orphit-map-accent: var(--cta, #3c8c8c);
  --orphit-map-accent-dark: #2f6f6f;
  --orphit-map-border: #d9e2e2;
  --orphit-map-text: #20272b;
  --orphit-map-text-muted: #5d6b71;
  position: relative;
  width: 100%;
  font-family: inherit;
}

.orphit-map *,
.orphit-map *::before,
.orphit-map *::after {
  box-sizing: border-box;
}

/* Formular-Controls erben die Theme-Typografie (Golos Text). Browser-UA setzt
   auf button/input/select/textarea sonst Arial, da Controls nicht erben. */
.orphit-map button,
.orphit-map input,
.orphit-map select,
.orphit-map textarea {
  font-family: inherit;
}

/* `hidden` (z. B. Gate vor Aktivierung) muss display:none gewinnen, auch wenn
   eine Klasse wie .orphit-map__gate display:flex setzt. */
.orphit-map [hidden] {
  display: none !important;
}

/* ── Consent-Gate (Platzhalter) ──────────────────────────────────────────── */
.orphit-map__gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  /* svh statt vh: vh rechnet gegen den großen Viewport (ohne Browser-Chrome) und
   * lässt den Platzhalter größer erscheinen als das sichtbare Fenster. */
  height: 80svh;
  min-height: min(500px, 70svh);
  max-height: 900px;
  padding: 32px 24px;
  text-align: center;
  background:
    radial-gradient(120px 90px at 15% 20%, rgba(60, 140, 140, 0.08), transparent 60%),
    radial-gradient(120px 90px at 85% 80%, rgba(60, 140, 140, 0.08), transparent 60%),
    #f7faf9;
  border: 1px solid var(--orphit-map-border);
  border-radius: 12px;
}

.orphit-map__gate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  color: #ffffff;
  background: var(--orphit-map-accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(60, 140, 140, 0.25);
}

.orphit-map__gate-btn:hover,
.orphit-map__gate-btn:focus-visible {
  background: var(--orphit-map-accent-dark);
  box-shadow: 0 6px 18px rgba(60, 140, 140, 0.35);
  outline: none;
}

.orphit-map__gate-btn:active {
  transform: translateY(1px);
}

.orphit-map__gate-note {
  max-width: 420px;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--orphit-map-text-muted);
}

/* ── PLZ-Suche (premium Pill) ────────────────────────────────────────────── */
.orphit-map__plz {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 12px 22px;
  background: var(--bg);
  border: 1px solid var(--orphit-map-border);
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
}

.orphit-map__plz-label {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted, var(--orphit-map-text-muted));
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  line-height: 1;
}

.orphit-map__plz-input {
  width: 160px;
  padding: 10px 16px;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
}

.orphit-map__plz-input::placeholder {
  color: var(--text-muted, var(--orphit-map-text-muted));
  opacity: 0.8;
}

.orphit-map__plz-input:focus-visible {
  outline: none;
  border-color: var(--orphit-map-accent);
  box-shadow: 0 0 0 3px rgba(60, 140, 140, 0.18);
}

/* ── Consent-Pill (wenn Cookies nicht akzeptiert) ─────────────────────────── */
.orphit-map__consent-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  /* Höhe war 650px fix => 97,5 % des Mobile-Windows bei 375x667. */
  height: min(70svh, 560px);
  padding: 32px 24px;
  text-align: center;
  background:
    radial-gradient(120px 90px at 15% 20%, rgba(60, 140, 140, 0.08), transparent 60%),
    radial-gradient(120px 90px at 85% 80%, rgba(60, 140, 140, 0.08), transparent 60%),
    #f7faf9;
  border: 1px solid var(--orphit-map-border);
  border-radius: 12px;
}

.orphit-map__consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  color: #ffffff;
  background: var(--orphit-map-accent-dark);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(60, 140, 140, 0.25);
}

.orphit-map__consent-btn:hover,
.orphit-map__consent-btn:focus-visible {
  background: #245a5a;
  box-shadow: 0 6px 18px rgba(60, 140, 140, 0.35);
  outline: none;
}

.orphit-map__consent-btn:active {
  transform: translateY(1px);
}

.orphit-map__consent-note {
  max-width: 420px;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--orphit-map-text-muted);
}

/* ── Consent-Glow (animiert den "Akzeptieren"-Button) ────────────────────── */
@keyframes orphit-glow-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(60, 140, 140, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(60, 140, 140, 0);
  }
}

.orphit-consent-glow {
  animation: orphit-glow-pulse 1.2s ease-in-out 3 !important;
  position: relative;
  z-index: 1;
}

/* ── Karten-Container ────────────────────────────────────────────────────── */
.orphit-map__canvas {
  position: relative;
  width: 100% !important;
  height: 80svh !important;
  min-height: min(500px, 70svh);
  max-height: 900px;
  margin: 0 auto;
  overflow: hidden;
  background: #dfe8e8;
  border: 1px solid var(--orphit-map-border);
  border-radius: 12px;
  z-index: 0;
  /* Nur Fallback: greift, wenn Leaflet keine eigene Klasse setzt. Leaflets
   * .leaflet-touch-drag { touch-action: none } (bei aktivem Drag) gewinnt sonst
   * und blockiert das Seitenscrollen. */
  touch-action: pan-x pan-y;
}

.orphit-map__canvas:hover .orphit-cluster-icon {
  transform: scale(1.12);
}

.orphit-map__msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-size: 0.95rem;
  color: var(--orphit-map-text-muted);
  background: rgba(255, 255, 255, 0.92);
  z-index: 1000;
}

/* ── Arrow Marker (Individual) ──────────────────────────────────────────── */
.orphit-marker-icon {
  background: none !important;
  border: none !important;
}

.orphit-arrow-marker {
  display: block;
  transition: transform 0.15s ease;
}

.orphit-arrow-marker svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Hover: lift arrow up + stronger shadow */
.orphit-marker-icon:hover .orphit-arrow-marker {
  transform: translateY(-3px) scale(1.08);
  filter: drop-shadow(0 4px 8px rgba(47, 62, 70, 0.4));
}

/* ── Cluster Marker (Arrow + Count) ─────────────────────────────────────── */
.orphit-cluster-icon {
  background: none !important;
  border: none !important;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.orphit-cluster-icon:hover {
  transform: scale(1.12);
}

.orphit-cluster-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orphit-cluster-count {
  position: absolute;
  left: 50.3%;
  top: 36.2%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  color: var(--text, #20272b);
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}

/* ── Leaflet Cluster: Teal Circles (fallback) ───────────────────────────── */
.orphit-map .marker-cluster-small,
.orphit-map .marker-cluster-medium,
.orphit-map .marker-cluster-large {
  background: rgba(60, 140, 140, 0.25) !important;
}

.orphit-map .marker-cluster-small div,
.orphit-map .marker-cluster-medium div,
.orphit-map .marker-cluster-large div {
  background: var(--orphit-map-accent) !important;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.85rem;
  width: 40px !important;
  height: 40px !important;
  margin-left: 5px !important;
  margin-top: 5px !important;
  line-height: 40px !important;
}

/* Override .marker-cluster inner div for custom arrow icons */
.orphit-map .orphit-cluster-icon > div {
  background: none !important;
  color: inherit !important;
  margin: 0 !important;
  line-height: normal !important;
}

/* ── Popup (im --bg-Stil, Ausstattung + CTA) ─────────────────────────────── */
.orphit-map .leaflet-popup-content-wrapper {
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.orphit-map .leaflet-popup-tip {
  background: var(--bg);
}

.orphit-map .leaflet-popup-content {
  margin: 16px 18px;
  line-height: 1.5;
}

.orphit-map__popup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  max-width: 300px;
}

.orphit-map__popup strong {
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--text);
}

.orphit-map__popup-addr,
.orphit-map__popup-loc {
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--text-muted, var(--orphit-map-text-muted));
}

.orphit-map__popup-feats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.orphit-map__popup-badge {
  display: inline-block;
  padding: 5px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--orphit-map-accent);
  background: color-mix(in srgb, var(--orphit-map-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--orphit-map-accent) 40%, transparent);
  border-radius: 999px;
}

.orphit-map__popup-unfit {
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--text-muted, var(--orphit-map-text-muted));
  background: transparent;
  margin-top: 4px;
}

.orphit-map__popup-select {
  margin-top: 12px;
  padding: 12px 20px;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
  background: var(--orphit-map-accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
  align-self: flex-start;
}

.orphit-map__popup-select:hover,
.orphit-map__popup-select:focus-visible {
  background: var(--orphit-map-accent-dark);
  outline: none;
}

.orphit-map__popup-select.is-selected,
.orphit-map__popup-select:disabled {
  cursor: default;
  opacity: 0.75;
}

/* ── Popup Kontakt-Daten (hidden — no contact info in popup) ────────────── */
.orphit-map__popup-contact {
  display: none;
}

.orphit-map__popup-phone,
.orphit-map__popup-email,
.orphit-map__popup-website {
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--orphit-map-accent);
  text-decoration: none;
  word-break: break-all;
}

.orphit-map__popup-phone:hover,
.orphit-map__popup-email:hover,
.orphit-map__popup-website:hover {
  text-decoration: underline;
  color: var(--orphit-map-accent-dark);
}

.orphit-map__popup-website::before {
  content: '→ ';
}

/* ── Zoom-Controls (im --bg-Stil) ────────────────────────────────────────── */
.orphit-map .leaflet-bar a {
  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid var(--orphit-map-border);
}

.orphit-map .leaflet-bar a:hover {
  background: color-mix(in srgb, var(--bg) 92%, var(--orphit-map-text-muted));
  color: var(--text);
}

.orphit-map .leaflet-bar a.leaflet-disabled {
  background: var(--bg);
  color: var(--text-muted, var(--orphit-map-text-muted));
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .orphit-map__section {
    padding: 64px 16px 80px;
  }

  .orphit-map__section-intro {
    margin-bottom: 20px;
    font-size: 0.95rem;
  }

  .orphit-map__gate {
    height: 70svh;
    min-height: 350px;
    padding: 24px 18px;
  }

  .orphit-map__plz {
    top: 24px;
    padding: 8px 10px 8px 14px;
    gap: 8px;
  }

  .orphit-map__plz-label {
    font-size: 1rem;
  }

  .orphit-map__plz-input {
    width: 120px;
    font-size: 1.1rem;
    padding: 6px 12px;
  }

  .orphit-map__canvas {
    height: min(70svh, 560px) !important;
    min-height: 350px !important;
    width: 100vw !important;
    margin-left: calc(50% - 50vw);
    border: 0;
    border-radius: 0;
    touch-action: pan-x pan-y;
  }

  /* Prevent page from scrolling while pinch-zooming the map on touch devices */
  .orphit-map__canvas.grabbing {
    touch-action: none;
  }
}
