.locations {
  --blue: #063e7d;
  --text: #203047;
  --muted: #6c7788;

  width: 100%;
  overflow: hidden;
  background: #f7f9fc;
  font-family: Arial, sans-serif;
}

.locations__map-wrapper {
  position: relative;
}

#locations-map {
  width: 100%;
  height: clamp(420px, 52vw, 650px);
  background: #edf4fb;
}

.locations__intro {
  position: absolute;
  z-index: 3;
  top: 32px;
  left: clamp(20px, 4vw, 60px);
  max-width: 320px;
  pointer-events: none;
}

.locations__intro h2 {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: clamp(28px, 3vw, 48px);
  line-height: 1.1;
}

.locations__intro p {
  margin: 0;
  color: #506077;
  font-size: 16px;
  line-height: 1.6;
}

/* Marker */

.map-marker {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.map-marker__pin {
  position: relative;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 50% 50% 50% 0;
  background: var(--marker-color);
  transform: rotate(-45deg);
  box-shadow: 0 3px 8px rgb(0 0 0 / 20%);
}

.map-marker__pin::after {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: white;
}

.map-marker__label {
  padding: 10px 14px;
  white-space: nowrap;
  color: var(--blue);
  border-radius: 6px;
  background: white;
  box-shadow: 0 4px 16px rgb(20 45 80 / 18%);
  font-size: 13px;
  font-weight: 700;
}

/* Popup */

.maplibregl-popup-content {
  width: min(360px, calc(100vw - 40px));
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 12px 35px rgb(0 40 90 / 20%);
}

.location-popup {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 15px;
}

.location-popup img {
  width: 120px;
  height: 120px;
  border-radius: 7px;
  object-fit: cover;
}

.location-popup h3 {
  margin: 2px 0 8px;
  color: var(--blue);
  font-size: 16px;
}

.location-popup strong,
.location-popup address {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.location-popup address {
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
}

/* Cards */

.location-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 0 24px 24px;
  margin-top: -25px;
  position: relative;
  z-index: 4;
}

.location-card {
  min-width: 0;
  overflow: hidden;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: white;
  box-shadow: 0 6px 24px rgb(30 60 100 / 10%);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.location-card:hover,
.location-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgb(30 60 100 / 18%);
}

.location-card img {
  width: 100%;
  height: 120px;
  border-radius: 7px;
  object-fit: cover;
}

.location-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 4px 8px;
  color: var(--blue);
  font-size: 15px;
}

.location-card__dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: var(--marker-color);
}

.location-card strong,
.location-card address {
  display: block;
  margin: 0 4px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.location-card address {
  margin-top: 5px;
  color: var(--muted);
  font-style: normal;
}

/* Tablet */

@media (max-width: 1024px) {
  .location-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-marker__label {
    display: none;
  }
}

/* Mobile */

@media (max-width: 600px) {
  .locations__intro {
    position: relative;
    top: auto;
    left: auto;
    max-width: none;
    padding: 24px 20px;
    background: white;
  }

  #locations-map {
    height: 420px;
  }

  .location-cards {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    margin-top: 0;
    padding: 16px 20px 24px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .location-cards::-webkit-scrollbar {
    display: none;
  }

  .location-card {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }

  .location-popup {
    grid-template-columns: 90px 1fr;
  }

  .location-popup img {
    width: 90px;
    height: 100px;
  }
}