:root {
  --mr-accent: #68b022;
  --mr-accent-dark: #5a9a1c;
  --mr-accent-bg: #f4f9ef;
  --mr-text: #333;
  --mr-muted: #666;
  --mr-border: #e8e8e8;
  --mr-bg: #f7f7f7;
  --mr-white: #fff;
  --mr-panel-w: 380px;
}

.mr-standortsuche {
  position: relative;
  margin: 0 0 2rem;
  color: var(--mr-text);
  font-family: inherit;
}

.mr-standortsuche .is-hidden {
  display: none !important;
}

/* —— Controls —— */

.mr-standortsuche__controls {
  padding: 14px 0 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--mr-border);
  background: var(--mr-white);
}

.mr-standortsuche__toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.mr-standortsuche__search,
.mr-standortsuche__select {
  font: inherit;
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--mr-border);
  border-radius: 4px;
  background: var(--mr-white);
  color: var(--mr-text);
  box-sizing: border-box;
  width: auto;
  max-width: none;
}

.mr-standortsuche__search {
  flex: 0 1 240px;
  width: 240px;
  max-width: 240px;
  min-width: 160px;
}

.mr-standortsuche__select {
  flex: 0 1 220px;
  min-width: 160px;
  max-width: 260px;
  width: auto !important; /* Salient setzt select oft auf 100% */
  cursor: pointer;
}

.mr-standortsuche__view-toggle {
  display: flex;
  flex: 0 0 auto;
  border: 1px solid var(--mr-border);
  border-radius: 4px;
  overflow: hidden;
}

.mr-standortsuche__view-toggle button {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border: none;
  background: var(--mr-white);
  color: var(--mr-muted);
  cursor: pointer;
}

.mr-standortsuche__view-toggle button.is-active {
  background: var(--mr-accent);
  color: var(--mr-white);
}

/* Chips exakt wie Mockup (.filter-chips button) */
.mr-standortsuche__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding-top: 8px;
}

/* Spezifität (0,2,1)+ schlägt Salient `body[data-button-style] button` (0,1,2) */
.mr-standortsuche__controls .mr-standortsuche__chips button {
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  padding: 5px 12px !important;
  border-radius: 20px !important;
  cursor: pointer;
  border: 1px solid var(--mr-border) !important;
  background: var(--mr-white) !important;
  color: var(--mr-muted) !important;
  white-space: nowrap;
  box-shadow: none !important;
  text-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  min-height: 0 !important;
  min-width: 0 !important;
  height: auto !important;
  width: auto !important;
  margin: 0 !important;
}

.mr-standortsuche__controls .mr-standortsuche__chips button.is-active {
  background: var(--mr-accent) !important;
  border-color: var(--mr-accent) !important;
  color: var(--mr-white) !important;
}

/* „mehr / weniger anzeigen“ – dezenter Textlink, kein Pill */
.mr-standortsuche__controls .mr-standortsuche__chips button.mr-standortsuche__chips-more {
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 5px 6px !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--mr-accent-dark) !important;
  cursor: pointer;
  text-decoration: underline;
  box-shadow: none !important;
  white-space: nowrap;
  min-height: 0 !important;
  height: auto !important;
  width: auto !important;
}

.mr-standortsuche__controls .mr-standortsuche__chips button.mr-standortsuche__chips-more:hover {
  color: var(--mr-accent) !important;
  background: transparent !important;
  border: none !important;
}

/* —— Workspace / Karte —— */

.mr-standortsuche__workspace {
  position: relative;
  min-height: 420px;
}

.mr-standortsuche__map {
  position: relative;
  background: #fff;
  overflow: hidden;
}

.mr-standortsuche__map-img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.mr-standortsuche__markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mr-standortsuche__markers .mr-standortsuche__marker {
  position: absolute;
  width: 32px !important;
  height: 32px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 3px solid #fff !important;
  border-radius: 50% !important;
  background: #68b022 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900 !important;
  font-size: 11px !important;
  line-height: 1;
  color: #fff !important;
  min-width: 0 !important;
  min-height: 0 !important;
  text-shadow: none !important;
}

.mr-standortsuche__markers .mr-standortsuche__marker:hover,
.mr-standortsuche__markers .mr-standortsuche__marker.is-active {
  background: #5a9a1c !important;
  transform: translate(-50%, -50%) scale(1.15);
  z-index: 5;
}

.mr-standortsuche__markers .mr-standortsuche__marker.is-dimmed {
  opacity: 0.25;
  pointer-events: none;
}

.mr-standortsuche__markers .mr-standortsuche__marker:focus-visible {
  outline: 2px solid #5a9a1c;
  outline-offset: 2px;
}

.mr-standortsuche__hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 8;
  margin: 0;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e8e8e8;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  color: #666;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  pointer-events: none;
  transition: opacity 0.25s ease;
  white-space: nowrap;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.mr-standortsuche.is-panel-open .mr-standortsuche__hint {
  opacity: 0;
}

.mr-standortsuche__empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.88);
  z-index: 10;
}

.mr-standortsuche__empty strong {
  font-size: 18px;
}

.mr-standortsuche__empty p {
  margin: 0 0 8px;
  color: #666;
  max-width: 320px;
}

/* —— Liste —— */

.mr-standortsuche__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0 16px;
  background: #fff;
}

.mr-standortsuche__list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid #e8e8e8;
  border-radius: 0;
  background: transparent;
  padding: 16px 0;
  cursor: pointer;
  font: inherit;
  color: #333;
}

.mr-standortsuche__list-item:hover,
.mr-standortsuche__list-item.is-active {
  background: #f4f9ef;
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
  width: calc(100% + 24px);
}

.mr-standortsuche__list-item-main {
  min-width: 0;
}

.mr-standortsuche__list-item strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.mr-standortsuche__list-item span {
  color: #666;
  font-size: 13px;
}

.mr-standortsuche__list-item-arrow {
  flex-shrink: 0;
  color: #68b022;
  font-weight: 700;
  font-size: 16px;
}

/* —— Overlay am body (außerhalb .mr-standortsuche) ——
   Wichtig: feste Farben, keine abhängigen Variablen vom Shortcode-Root. */

.mr-standortsuche__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45) !important;
  z-index: 1000000;
  border: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.mr-standortsuche__backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

.mr-standortsuche__backdrop.is-hidden,
.mr-standortsuche__panel.is-hidden {
  display: none !important;
}

.mr-standortsuche__panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #ffffff !important;
  background-color: #ffffff !important;
  opacity: 1 !important;
  border-left: 1px solid #e8e8e8;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
  z-index: 1000001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  color: #333;
  font-family: inherit;
  visibility: hidden;
}

.mr-standortsuche__panel.is-open {
  transform: translateX(0);
  visibility: visible;
}

.mr-standortsuche__panel-handle {
  display: none;
}

.mr-standortsuche__panel-header {
  position: relative;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
  background: #fff;
}

.mr-standortsuche__region {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #68b022;
}

.mr-standortsuche__region:empty {
  display: none;
}

.mr-standortsuche__title {
  margin: 0;
  padding-right: 36px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
  color: #333;
}

.mr-standortsuche__panel .mr-standortsuche__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px !important;
  height: 32px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: none !important;
  border-radius: 50% !important;
  background: #f7f7f7 !important;
  color: #666 !important;
  font-size: 18px !important;
  line-height: 1;
  cursor: pointer;
  padding: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.mr-standortsuche__panel .mr-standortsuche__close:hover {
  background: #e8e8e8 !important;
}

.mr-standortsuche__panel-body {
  padding: 18px 22px 24px;
  overflow-y: auto;
  flex: 1;
  background: #fff;
}

.mr-standortsuche__block {
  margin-bottom: 18px;
}

.mr-standortsuche__block h3 {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
  font-weight: 700;
}

.mr-standortsuche__contact-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: #333;
}

.mr-standortsuche__ico {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.7;
  line-height: 1.45;
}

.mr-standortsuche__contact-item a {
  color: #5a9a1c !important;
  font-weight: 700;
  text-decoration: none !important;
  word-break: break-word;
}

.mr-standortsuche__contact-item a:hover {
  text-decoration: underline !important;
}

.mr-standortsuche__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mr-standortsuche__tag {
  background: #f4f9ef;
  color: #5a9a1c;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 4px;
}

.mr-standortsuche__empty-inline {
  margin: 0;
  color: #666;
  font-size: 14px;
}

.mr-standortsuche__panel-actions {
  padding: 16px 22px 22px;
  border-top: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  background: #fff;
}

.mr-standortsuche__btn {
  display: block;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 4px;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
}

.mr-standortsuche__btn--primary {
  background: #68b022 !important;
  color: #fff !important;
  border: none !important;
}

.mr-standortsuche__btn--primary:hover {
  background: #5a9a1c !important;
  color: #fff !important;
}

.mr-standortsuche__btn--secondary {
  background: #fff !important;
  color: #68b022 !important;
  border: 2px solid #68b022 !important;
}

.mr-standortsuche__btn--secondary:hover {
  background: #f4f9ef !important;
}

body.mr-standortsuche-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .mr-standortsuche__toolbar {
    flex-wrap: wrap;
  }

  .mr-standortsuche__search {
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
  }

  .mr-standortsuche__select {
    flex: 1 1 auto;
    max-width: none;
  }
}

@media (max-width: 960px) {
  /* iOS: kein Auto-Zoom beim Fokus */
  .mr-standortsuche__search,
  .mr-standortsuche__select {
    font-size: 16px !important;
  }

  .mr-standortsuche__panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 88vh;
    max-height: 88dvh;
    border-left: none;
    border-top: 1px solid #e8e8e8;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .mr-standortsuche__panel.is-open {
    transform: translateY(0);
  }

  .mr-standortsuche__panel-handle {
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: #ccc;
    margin: 12px auto 4px;
  }

  .mr-standortsuche__panel .mr-standortsuche__close {
    width: 44px !important;
    height: 44px !important;
    top: 12px;
    right: max(12px, env(safe-area-inset-right, 12px));
  }

  .mr-standortsuche__panel-actions {
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 600px) {
  .mr-standortsuche__view-toggle {
    flex: 1 1 100%;
  }

  .mr-standortsuche__view-toggle button {
    flex: 1 1 auto;
  }
}
