.psg-map-shell {
  position: relative;
  width: 100%;
  min-height: 280px;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.psg-map-shell .psg-map {
  width: 100%;
  height: 100%;
  min-height: inherit;
  border-radius: 0;
  box-shadow: none;
}

.psg-map {
  --psg-map-font: 'K2D', var(--bricks-font-family, sans-serif);
  --psg-map-brown: var(--psg-brown, #302516);
  --psg-map-muted: #5c5348;
  --psg-badge-from: var(--pacifique, #007ee0);
  --psg-badge-to: var(--sports, #51c090);
  --psg-btn-from: #e6422c;
  --psg-btn-to: #963396;

  width: 100%;
  min-height: 280px;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  background: #e8edf2;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  font-family: var(--psg-map-font);
}

.psg-map .leaflet-container {
  font-family: var(--psg-map-font);
}

.psg-map .leaflet-marker-icon {
  object-fit: contain;
}

.psg-map--styled {
  background-color: var(--psg-badge-from, #007ee0);
  background-image: var(--psg-water-bg, none);
  background-size: cover;
  background-position: center;
}

.psg-map .maplibregl-map {
  font-family: var(--psg-map-font);
}

.psg-map-marker--custom {
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
}

.psg-map-popup-wrap.maplibregl-popup .maplibregl-popup-content,
.psg-map-popup-wrap.leaflet-popup .leaflet-popup-content-wrapper,
.psg-map .leaflet-popup-content-wrapper {
  position: relative;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.psg-map-popup-wrap.maplibregl-popup {
  position: relative;
}

.psg-map-popup-wrap.maplibregl-popup .maplibregl-popup-content,
.psg-map-popup-wrap.leaflet-popup .leaflet-popup-content,
.psg-map .leaflet-popup-content {
  margin: 0;
  width: 260px !important;
  line-height: 1.4;
  font-family: var(--psg-map-font);
  overflow: hidden;
  border-radius: 14px;
}

.psg-map-popup-wrap .maplibregl-popup-close-button,
.psg-map-popup-wrap.leaflet-popup a.leaflet-popup-close-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  line-height: 0;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.psg-map-popup-wrap .maplibregl-popup-close-button:hover,
.psg-map-popup-wrap.leaflet-popup a.leaflet-popup-close-button:hover {
  background: transparent;
  box-shadow: none;
  color: transparent;
  text-decoration: none;
}

.psg-map-popup-wrap .maplibregl-popup-close-button:focus-visible,
.psg-map-popup-wrap.leaflet-popup a.leaflet-popup-close-button:focus-visible {
  outline: 2px solid var(--psg-badge-from);
  outline-offset: 2px;
}

.psg-map-popup-wrap .maplibregl-popup-close-button::before,
.psg-map-popup-wrap.leaflet-popup a.leaflet-popup-close-button::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background-color: var(--psg-map-brown);
  transition: background-color 0.15s ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
}

.psg-map-popup-wrap .maplibregl-popup-close-button:hover::before,
.psg-map-popup-wrap.leaflet-popup a.leaflet-popup-close-button:hover::before {
  background-color: var(--psg-btn-from, #e6422c);
}

.psg-map-popup-wrap.maplibregl-popup .maplibregl-popup-tip,
.psg-map-popup-wrap.leaflet-popup .leaflet-popup-tip,
.psg-map .leaflet-popup-tip {
  box-shadow: none;
}

.psg-map__empty {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--psg-map-muted);
  font-family: var(--psg-map-font);
}

.psg-map-popup {
  color: var(--psg-map-brown);
  font-family: var(--psg-map-font);
}

.psg-map-popup__image-link {
  display: block;
  overflow: hidden;
  background: #dfe7ef;
}

.psg-map-popup__image {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.psg-map-popup__body {
  padding: 0.9rem 1rem 1rem;
}

.psg-map-popup__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  font-family: var(--psg-map-font);
}

.psg-map-popup__title a {
  color: inherit;
  text-decoration: none;
}

.psg-map-popup__title a:hover {
  color: var(--psg-badge-from);
}

.psg-map-popup__location {
  margin: 0 0 0.75rem;
  color: var(--psg-badge-from);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-family: var(--psg-map-font);
}

.psg-map-popup__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.psg-map-popup__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem 0.15rem 0.2rem;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, var(--psg-badge-from) 0%, var(--psg-badge-to) 100%);
  color: #fff;
  font-family: var(--psg-map-font);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 8px rgba(0, 126, 224, 0.2);
}

.psg-map-popup__badge-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: #fff;
}

.psg-map-popup__badge-label {
  display: inline-block;
}

.psg-map-popup__status {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--psg-btn-from) 0%, var(--psg-btn-to) 100%);
  color: #fff;
  font-family: var(--psg-map-font);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.psg-map-popup__maps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, var(--psg-btn-from) 0%, var(--psg-btn-to) 100%);
  color: #fff !important;
  font-family: var(--psg-map-font);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 14px rgba(230, 66, 44, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.psg-map-popup__maps-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(150, 51, 150, 0.32);
}

.psg-map-popup-wrap.maplibregl-popup {
  --psg-map-font: 'K2D', var(--bricks-font-family, sans-serif);
  --psg-map-brown: var(--psg-brown, #302516);
  --psg-map-muted: #5c5348;
  --psg-badge-from: var(--pacifique, #007ee0);
  --psg-badge-to: var(--sports, #51c090);
  --psg-btn-from: #e6422c;
  --psg-btn-to: #963396;
  font-family: var(--psg-map-font);
}

.psg-map-popup-wrap.maplibregl-popup .maplibregl-popup-content {
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  background: #fff;
}

/* Leaflet popups render outside .psg-map — inherit brand tokens on the wrapper. */
.psg-map-popup-wrap.leaflet-popup {
  --psg-map-font: 'K2D', var(--bricks-font-family, sans-serif);
  --psg-map-brown: var(--psg-brown, #302516);
  --psg-map-muted: #5c5348;
  --psg-badge-from: var(--pacifique, #007ee0);
  --psg-badge-to: var(--sports, #51c090);
  --psg-btn-from: #e6422c;
  --psg-btn-to: #963396;
  font-family: var(--psg-map-font);
}

.psg-map-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 500;
}

.psg-map-overlays__right {
  position: absolute;
  top: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
  width: min(300px, calc(100% - 2rem));
  pointer-events: none;
}

.psg-map-overlay {
  position: absolute;
  pointer-events: auto;
  max-width: calc(100% - 2rem);
  display: flex;
  align-items: center;
}

.psg-map-overlay--list {
  top: 1rem;
  left: 1rem;
  width: min(320px, calc(100% - 2rem));
}

.psg-map-overlays__right .psg-map-overlay {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: 100%;
  max-width: none;
  flex-direction: row-reverse;
}

.psg-map-overlay--promo {
  margin-top: auto;
}

.psg-map-overlay__drawer {
  overflow: hidden;
  flex-shrink: 0;
  transition: max-width 0.32s ease, opacity 0.32s ease, transform 0.32s ease;
}

.psg-map-overlay--list .psg-map-overlay__drawer {
  max-width: min(320px, calc(100vw - 4rem));
}

.psg-map-overlays__right .psg-map-overlay__drawer {
  max-width: min(300px, calc(100vw - 4rem));
}

.psg-map-overlay--list.is-collapsed .psg-map-overlay__drawer {
  max-width: 0;
  opacity: 0;
  transform: translateX(-12px);
}

.psg-map-overlays__right .psg-map-overlay.is-collapsed .psg-map-overlay__drawer {
  max-width: 0;
  opacity: 0;
  transform: translateX(12px);
}

.psg-map-overlay__panel {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  padding: 1rem 1rem 0.85rem;
  font-family: var(--psg-map-font);
  width: min(320px, calc(100vw - 4rem));
}

.psg-map-overlays__right .psg-map-overlay__panel {
  width: min(300px, calc(100vw - 4rem));
}

.psg-map-overlay__panel--promo {
  position: relative;
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  padding: 0;
  overflow: hidden;
}

.psg-map-overlay__panel--promo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.72) 100%);
  pointer-events: none;
}

.psg-map-overlay__toggle {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--psg-map-brown);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.psg-map-overlay__toggle--left {
  margin-left: 6px;
}

.psg-map-overlay__toggle--right {
  margin-right: 6px;
}

.psg-map-overlay--list.is-collapsed .psg-map-overlay__toggle--left {
  margin-left: 0.75rem;
}

.psg-map-overlays__right .psg-map-overlay.is-collapsed .psg-map-overlay__toggle--right {
  margin-right: 0.75rem;
}

.psg-map-overlay__toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.22);
}

.psg-map-overlay__toggle:focus-visible {
  outline: 2px solid var(--psg-badge-from);
  outline-offset: 2px;
}

.psg-map-overlay__toggle-icon {
  display: block;
  transition: transform 0.32s ease;
}

/* Base SVG points left. Right-side toggles flip to point right when expanded. */
.psg-map-overlay__toggle--right .psg-map-overlay__toggle-icon {
  transform: rotate(180deg);
}

.psg-map-overlay--list.is-collapsed .psg-map-overlay__toggle--left .psg-map-overlay__toggle-icon {
  transform: rotate(180deg);
}

.psg-map-overlays__right .psg-map-overlay.is-collapsed .psg-map-overlay__toggle--right .psg-map-overlay__toggle-icon {
  transform: rotate(0deg);
}

.psg-map-overlay__title {
  margin: 0 0 0.45rem;
  color: var(--psg-badge-from);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.psg-map-overlay__description {
  margin: 0 0 0.75rem;
  color: var(--psg-map-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.psg-map-overlay__search {
  display: block;
  margin-bottom: 0.65rem;
}

.psg-map-overlay__search-input {
  width: 100%;
  min-height: 38px;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(0, 126, 224, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--psg-map-brown);
  font-family: var(--psg-map-font);
  font-size: 0.82rem;
  outline: none;
}

.psg-map-overlay__search-input:focus {
  border-color: var(--psg-badge-from);
  box-shadow: 0 0 0 3px rgba(0, 126, 224, 0.12);
}

.psg-map-overlay__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow: auto;
}

.psg-map-overlay__list-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.35rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.psg-map-overlay__list-item:first-child {
  border-top: 0;
}

.psg-map-overlay__list-item:hover,
.psg-map-overlay__list-item.is-active {
  background: rgba(0, 126, 224, 0.08);
}

.psg-map-overlay__list-item.is-filtered-out {
  display: none !important;
}

.psg-map-overlay__list-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.psg-map-overlay__list-thumb--placeholder {
  display: inline-block;
  background: linear-gradient(135deg, rgba(0, 126, 224, 0.12) 0%, rgba(81, 192, 144, 0.18) 100%);
  border: 1px solid rgba(0, 126, 224, 0.12);
}

.psg-map-overlay__list-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.psg-map-overlay__list-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--psg-map-brown);
  line-height: 1.25;
}

.psg-map-overlay__list-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--psg-badge-from);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.psg-map-overlay__stats {
  list-style: none;
  margin: 0;
  padding: 0;
}

.psg-map-overlay__stat {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.psg-map-overlay__stat:first-child {
  border-top: 0;
}

.psg-map-overlay__stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
}

.psg-map-overlay__stat-icon--glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
}

.psg-map-overlay__stat-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.psg-map-overlay__stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--psg-map-brown);
  line-height: 1.1;
}

.psg-map-overlay__stat-label {
  font-size: 0.72rem;
  color: var(--psg-map-muted);
  line-height: 1.2;
}

.psg-map-overlay__promo-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 1rem;
}

.psg-map-overlay__promo-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

.psg-map-overlay__promo-subtitle {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.35;
  opacity: 0.95;
}

.psg-map-overlay__promo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.psg-map-overlay__promo-btn--static {
  pointer-events: none;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 991px) {
  .psg-map-overlays {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: auto;
    padding: 0.75rem;
  }

  .psg-map-overlays__right {
    position: static;
    width: auto;
    gap: 0.75rem;
    pointer-events: auto;
  }

  .psg-map-overlay,
  .psg-map-overlay--list,
  .psg-map-overlays__right .psg-map-overlay {
    position: static;
    width: auto;
    max-width: none;
    flex-direction: column;
  }

  .psg-map-overlay__drawer,
  .psg-map-overlay--list .psg-map-overlay__drawer,
  .psg-map-overlays__right .psg-map-overlay__drawer,
  .psg-map-overlay--list.is-collapsed .psg-map-overlay__drawer,
  .psg-map-overlays__right .psg-map-overlay.is-collapsed .psg-map-overlay__drawer {
    max-width: none;
    opacity: 1;
    transform: none;
  }

  .psg-map-overlay.is-collapsed .psg-map-overlay__drawer {
    display: none;
  }

  .psg-map-overlay__panel,
  .psg-map-overlays__right .psg-map-overlay__panel {
    width: auto;
  }

  .psg-map-overlay__toggle {
    align-self: flex-end;
    margin: 0;
  }

  .psg-map-shell {
    display: flex;
    flex-direction: column;
  }

  .psg-map-shell .psg-map {
    min-height: 360px;
    flex: 1 1 auto;
  }
}
