/* Mapa lokalizacji: legenda z boku + wysoka mapa */
.ds-location-map,
.ds-location-map * {
  box-sizing: border-box;
}

.ds-location-map {
  --ds-loc-ink: #14244b;
  --ds-loc-accent: #c5b29d;
  --ds-loc-muted: #5a6478;
  --ds-loc-bg: #f4f1ea;
  --ds-loc-panel: #ffffff;
  --ds-loc-line: rgba(20, 36, 75, 0.12);
  --ds-loc-chip: #efebe3;
  margin: 1.25rem 0 1.75rem;
  color: var(--ds-loc-ink);
  width: 100%;
  max-width: 100%;
}

.ds-location-map.ds-theme-dark {
  --ds-loc-ink: #f2efe8;
  --ds-loc-accent: #c5b29d;
  --ds-loc-muted: #b8b2a6;
  --ds-loc-bg: #121820;
  --ds-loc-panel: #1a222c;
  --ds-loc-line: rgba(242, 239, 232, 0.12);
  --ds-loc-chip: #243040;
}

.ds-location-map__layout {
  display: grid;
  grid-template-columns: minmax(240px, 290px) 1fr;
  gap: 0;
  border: 1px solid var(--ds-loc-line);
  background: var(--ds-loc-panel);
  overflow: hidden;
  width: 100%;
  min-height: 760px;
}

.ds-location-map__legend {
  order: 0;
  background: var(--ds-loc-bg);
  border-right: 1px solid var(--ds-loc-line);
  padding: 14px 12px 16px;
  max-height: none;
  overflow: auto;
  align-self: stretch;
}

.ds-location-map__mode {
  position: absolute;
  top: 12px;
  left: 52px;
  z-index: 1000;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0;
  padding: 4px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(20, 36, 75, 0.14);
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(20, 36, 75, 0.14);
}

.ds-location-map__mode-btn {
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--ds-loc-ink) !important;
  font: inherit !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  line-height: 1.2 !important;
  padding: 8px 12px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  box-shadow: none !important;
  min-height: 0 !important;
  white-space: nowrap !important;
}

.ds-location-map__mode-btn.is-active {
  background: rgba(195, 158, 118, 0.35) !important;
  border-color: #c5b29d !important;
  color: #6e5230 !important;
}

.ds-location-map.ds-theme-dark .ds-location-map__mode {
  background: rgba(26, 34, 44, 0.96);
  border-color: rgba(242, 239, 232, 0.14);
}

.ds-location-map.ds-theme-dark .ds-location-map__mode-btn.is-active {
  color: #f2efe8 !important;
}

.ds-location-map__legend-toggle {
  display: none !important;
}

.ds-location-map__legend-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
  counter-reset: none !important;
}

.ds-location-map__legend-list > li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  counter-increment: none !important;
}

.ds-location-map__legend-list > li::before,
.ds-location-map__legend-list > li::after {
  content: none !important;
  display: none !important;
}

.ds-location-map__legend-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  width: 100% !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--ds-loc-ink) !important;
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  text-align: left !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  padding: 7px 6px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  box-shadow: none !important;
  min-height: 0 !important;
}

.ds-location-map__legend-text {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.ds-location-map__legend-label {
  display: block !important;
  color: inherit !important;
}

.ds-location-map__legend-dist {
  display: block !important;
  color: var(--ds-loc-muted) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: .01em;
}

.ds-location-map__legend-item:hover,
.ds-location-map__legend-item.is-active {
  background: rgba(195, 158, 118, 0.16) !important;
}

.ds-location-map.ds-theme-dark .ds-location-map__legend-item:hover,
.ds-location-map.ds-theme-dark .ds-location-map__legend-item.is-active {
  background: rgba(195, 158, 118, 0.22) !important;
}

.ds-location-map__badge {
  flex: 0 0 28px !important;
  width: 28px !important;
  height: 28px !important;
  margin-top: 1px !important;
  border-radius: 50% !important;
  background: #c5b29d !important;
  color: #fff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  margin: 0 !important;
  border: 2px solid #fff !important;
  box-shadow: 0 1px 4px rgba(20, 36, 75, 0.28) !important;
}

.ds-location-map.ds-theme-dark .ds-location-map__badge {
  background: var(--ds-loc-accent) !important;
  color: #fff !important;
}

.ds-location-map__canvas-wrap {
  order: 1;
  position: relative;
  width: 100% !important;
  min-width: 0;
  min-height: 760px;
  background: #dfe4ea;
  z-index: 1;
  align-self: stretch;
  overflow: hidden;
}

.ds-location-map__canvas,
.ds-location-map__canvas.leaflet-container {
  width: 100% !important;
  height: 100% !important;
  min-height: 760px !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 1 !important;
  background: #dfe4ea !important;
  font: inherit;
}

/* WordPress/Elementor: img{max-width:100%} rozjeżdża kafle Leaflet */
.ds-location-map .leaflet-container img.leaflet-tile,
.ds-location-map .leaflet-container img.leaflet-marker-icon,
.ds-location-map .leaflet-container img.leaflet-marker-shadow,
.ds-location-map .leaflet-tile-container img,
.elementor-widget-shortcode .ds-location-map .leaflet-container img {
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.ds-location-map .leaflet-tile-pane {
  opacity: 1 !important;
  visibility: visible !important;
}

.ds-loc-pin-wrap,
.ds-loc-site-wrap,
.ds-loc-area-wrap {
  background: transparent !important;
  border: 0 !important;
}

.ds-loc-pin {
  background: #c5b29d;
  color: #fff;
  border: 3px solid #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  box-shadow:
    0 0 0 2px rgba(41, 47, 41, 0.45),
    0 4px 14px rgba(20, 36, 75, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ds-loc-pin span {
  display: block;
  transform: translateY(0.5px);
}

.ds-loc-pin:hover,
.ds-loc-pin.is-active {
  transform: scale(1.18);
  background: #6e5230;
  box-shadow:
    0 0 0 3px #c0392b,
    0 0 0 6px rgba(192, 57, 43, 0.25),
    0 6px 18px rgba(20, 36, 75, 0.45);
  z-index: 10;
}

.ds-location-map .ds-loc-route {
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(20, 36, 75, 0.35));
}

.ds-location-map .ds-loc-route--walk,
.ds-location-map .ds-loc-route--bike {
  stroke-dasharray: 6 8;
}

.ds-location-map .ds-loc-route--drive,
.ds-location-map .ds-loc-route--drive-plan {
  stroke-dasharray: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ds-loc-walker-wrap,
.ds-loc-bike-wrap,
.ds-loc-car-wrap {
  background: transparent !important;
  border: 0 !important;
}

.ds-loc-bike {
  position: relative;
  width: 36px;
  height: 28px;
  transform-origin: 50% 80%;
  filter: drop-shadow(0 2px 3px rgba(20, 36, 75, 0.35));
}

.ds-loc-bike.is-flip {
  transform: scaleX(-1);
}

.ds-loc-bike__body {
  position: absolute;
  inset: 0;
  animation: ds-loc-bike-bob 0.34s ease-in-out infinite;
}

.ds-loc-bike.is-arrived .ds-loc-bike__body {
  animation: none;
}

.ds-loc-bike__wheel {
  position: absolute;
  bottom: 2px;
  width: 11px;
  height: 11px;
  border: 2px solid #1f3a2e;
  border-radius: 50%;
  background: radial-gradient(circle at center, #cfe8da 0 28%, transparent 30%),
    conic-gradient(from 0deg, #1f3a2e 0 12%, transparent 12% 50%, #1f3a2e 50% 62%, transparent 62%);
  animation: ds-loc-bike-spin 0.45s linear infinite;
}

.ds-loc-bike.is-arrived .ds-loc-bike__wheel {
  animation: none;
}

.ds-loc-bike__wheel--r {
  left: 2px;
}

.ds-loc-bike__wheel--f {
  right: 2px;
}

.ds-loc-bike__frame {
  position: absolute;
  left: 8px;
  top: 10px;
  width: 20px;
  height: 8px;
  border: 2px solid #2f9e6a;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  transform: skewX(-18deg);
}

.ds-loc-bike__seat {
  position: absolute;
  left: 10px;
  top: 7px;
  width: 8px;
  height: 3px;
  border-radius: 2px;
  background: #1f3a2e;
}

.ds-loc-bike__handle {
  position: absolute;
  right: 7px;
  top: 5px;
  width: 2px;
  height: 8px;
  background: #1f3a2e;
  border-radius: 1px;
}

.ds-loc-bike__handle::after {
  content: '';
  position: absolute;
  top: 0;
  left: -3px;
  width: 8px;
  height: 2px;
  background: #1f3a2e;
  border-radius: 1px;
}

.ds-loc-bike__rider {
  position: absolute;
  left: 14px;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c5b29d;
  box-shadow: 0 7px 0 -1px #8a735a;
}

@keyframes ds-loc-bike-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

@keyframes ds-loc-bike-spin {
  to {
    transform: rotate(360deg);
  }
}

.ds-loc-walker {
  position: relative;
  width: 28px;
  height: 40px;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 2px 3px rgba(20, 36, 75, 0.35));
}

.ds-loc-walker.is-flip {
  transform: scaleX(-1);
}

.ds-loc-walker__body {
  position: absolute;
  inset: 0;
  animation: ds-loc-walk-bob 0.38s ease-in-out infinite;
}

.ds-loc-walker.is-arrived .ds-loc-walker__body {
  animation: none;
}

.ds-loc-walker__head {
  position: absolute;
  top: 2px;
  left: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #5c4030;
  border: 2px solid #fff;
  box-sizing: border-box;
}

.ds-loc-walker__torso {
  position: absolute;
  top: 13px;
  left: 9px;
  width: 10px;
  height: 12px;
  border-radius: 3px;
  background: #c5b29d;
  border: 1px solid #fff;
  box-sizing: border-box;
}

.ds-loc-walker__arm,
.ds-loc-walker__leg {
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: #5c4030;
  transform-origin: top center;
}

.ds-loc-walker__arm {
  top: 14px;
  height: 10px;
}

.ds-loc-walker__arm--l {
  left: 7px;
  animation: ds-loc-swing-a 0.38s ease-in-out infinite;
}

.ds-loc-walker__arm--r {
  left: 18px;
  animation: ds-loc-swing-b 0.38s ease-in-out infinite;
}

.ds-loc-walker__leg {
  top: 24px;
  height: 13px;
}

.ds-loc-walker__leg--l {
  left: 10px;
  animation: ds-loc-swing-b 0.38s ease-in-out infinite;
}

.ds-loc-walker__leg--r {
  left: 15px;
  animation: ds-loc-swing-a 0.38s ease-in-out infinite;
}

.ds-loc-walker.is-arrived .ds-loc-walker__arm,
.ds-loc-walker.is-arrived .ds-loc-walker__leg {
  animation: none;
}

.ds-loc-car {
  position: relative;
  width: 28px;
  height: 44px;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 2px 4px rgba(20, 36, 75, 0.45));
  will-change: transform;
}

.ds-loc-car.is-flip {
  transform: none;
}

.ds-loc-car__body {
  position: absolute;
  inset: 0;
}

.ds-loc-car.is-arrived .ds-loc-car__body {
  filter: none;
}

/* Widok z góry — przód u góry */
.ds-loc-car__chassis {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 3px;
  bottom: 3px;
  border-radius: 9px 9px 7px 7px;
  background: linear-gradient(180deg, #3a5f8f 0%, #2f4f78 55%, #243e5f 100%);
  border: 1.5px solid #fff;
  box-sizing: border-box;
}

.ds-loc-car__hood {
  position: absolute;
  left: 7px;
  right: 7px;
  top: 5px;
  height: 9px;
  border-radius: 6px 6px 2px 2px;
  background: rgba(255, 255, 255, 0.18);
}

.ds-loc-car__windshield {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 13px;
  height: 7px;
  border-radius: 2px;
  background: #9ec4ef;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-sizing: border-box;
}

.ds-loc-car__cabin {
  position: absolute;
  left: 7px;
  right: 7px;
  top: 20px;
  height: 10px;
  border-radius: 2px;
  background: rgba(20, 36, 75, 0.22);
}

.ds-loc-car__trunk {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  height: 6px;
  border-radius: 2px 2px 4px 4px;
  background: rgba(255, 255, 255, 0.12);
}

.ds-loc-car__wheel {
  position: absolute;
  width: 5px;
  height: 9px;
  border-radius: 2px;
  background: #1a1a1a;
  border: 1px solid #fff;
  box-sizing: border-box;
}

.ds-loc-car__wheel--fl {
  left: 1px;
  top: 9px;
}

.ds-loc-car__wheel--fr {
  right: 1px;
  top: 9px;
}

.ds-loc-car__wheel--rl {
  left: 1px;
  bottom: 8px;
}

.ds-loc-car__wheel--rr {
  right: 1px;
  bottom: 8px;
}

.ds-loc-car.is-arrived .ds-loc-car__wheel {
  opacity: 0.95;
}

@keyframes ds-loc-walk-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes ds-loc-swing-a {
  0%,
  100% {
    transform: rotate(28deg);
  }
  50% {
    transform: rotate(-28deg);
  }
}

@keyframes ds-loc-swing-b {
  0%,
  100% {
    transform: rotate(-28deg);
  }
  50% {
    transform: rotate(28deg);
  }
}

.ds-loc-route-meta {
  color: #6e5230;
  font-weight: 600;
}

.ds-loc-site {
  background: #fff;
  color: #14244b;
  border: 2px solid #c5b29d;
  border-radius: 4px;
  padding: 6px 10px 5px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
  box-shadow: 0 3px 12px rgba(10, 16, 51, 0.22);
  white-space: nowrap;
}

.ds-loc-site small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  color: #5a6478;
}

.ds-loc-area {
  background: rgba(90, 130, 90, 0.18);
  color: #2f5a36;
  border: 1px solid rgba(47, 90, 54, 0.35);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.ds-location-map__footer {
  margin: 20px 0 10px;
  text-align: center;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--ds-loc-muted);
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 767px) {
  .ds-location-map__footer {
    font-size: 16px;
    padding: 0 12px;
  }
}

.ds-location-map__distances {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 8px 16px !important;
}

.ds-location-map__distances li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 14px;
  color: var(--ds-loc-ink);
}

.ds-location-map__distances li::before {
  content: none !important;
}

.ds-location-map__distances strong {
  color: var(--ds-loc-accent);
  margin-right: 4px;
}

.ds-location-map .leaflet-popup-content-wrapper {
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(10, 16, 51, 0.18);
}

.ds-location-map .leaflet-popup-content {
  margin: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
}

/* Ukryj całą mapę lokalizacji na telefonie (opcja w ustawieniach DS / hide_mobile="yes") */
@media (max-width: 782px) {
  .ds-location-map.ds-location-map--hide-mobile {
    display: none !important;
  }
}

@media (max-width: 820px) {
  .ds-location-map__layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .ds-location-map__legend {
    order: 2;
    border-right: 0;
    border-top: 1px solid var(--ds-loc-line);
    max-height: none;
  }

  .ds-location-map__legend-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .ds-location-map__legend-item {
    width: auto !important;
    border: 1px solid var(--ds-loc-line) !important;
    background: var(--ds-loc-chip) !important;
    border-radius: 999px !important;
    padding: 5px 10px 5px 5px !important;
    font-size: 12px !important;
  }

  .ds-location-map__canvas-wrap,
  .ds-location-map__canvas,
  .ds-location-map__canvas.leaflet-container {
    order: 1;
    min-height: 420px !important;
  }
}
