.map-popup[hidden] { display: none; }

.map-popup {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding: 48px 24px 36px;
  background: #fff0ee;
  color: #370b27;
}

body.map-popup-open { overflow: hidden; }

.map-popup-close {
  position: absolute;
  top: 24px;
  right: 32px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #5f2761;
  border-radius: 50%;
  background: transparent;
  color: #370b27;
  font: 400 30px/1 Roobert, sans-serif;
  cursor: pointer;
}

.map-popup-heading {
  flex: 0 0 auto;
  width: min(650px, calc(100% - 80px));
  text-align: center;
}

.map-popup-heading h2 {
  width: max-content;
  max-width: none;
  margin: 0;
  margin-inline: auto;
  font-size: 36px;
  line-height: 1.1;
  text-transform: none;
}

.map-popup-region { color: #ff5f62; }
.map-popup-title-line { display: block; white-space: nowrap; }

.map-popup-heading p {
  margin: 24px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

.map-popup-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 40px 0;
  flex: 0 0 auto;
}

.map-filter {
  height: 31px;
  padding: 8px 14px;
  border: 0;
  border-radius: 100px;
  background: #9f67a1;
  color: #fff;
  font: 600 12px/1.2 Roobert, sans-serif;
  cursor: pointer;
}

.map-filter[aria-pressed="true"] { background: #5f2761; }

.map-popup-cards {
  display: grid;
  grid-template-columns: repeat(3, 300px);
  gap: 10px 16px;
  width: min(932px, 100%);
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  grid-auto-rows: max-content;
  scrollbar-width: thin;
  scrollbar-color: #9f67a1 transparent;
}

.map-popup-cards.has-scroll-bottom:not(.has-scroll-top) {
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 18px), transparent 100%);
}

.map-popup-cards.has-scroll-top:not(.has-scroll-bottom) {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 100%);
}

.map-popup-cards.has-scroll-top.has-scroll-bottom {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

.popup-card {
  display: flex;
  min-height: 139px;
  height: max-content;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
  padding: 10px;
  overflow: hidden;
  border-radius: 30px;
  background: #fff;
  text-align: left;
}

.popup-card-head { display: flex; align-items: center; gap: 10px; }

.category-image {
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  margin-right: 2px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ffbfc0;
}

.category-image img { width: 100%; height: 100%; object-fit: cover; }
.category-image[data-category="Art & Prints"] { background: #e7efff; }
.category-image[data-category="Beauty & Wellness"] { background: #ffefb5; }
.category-image[data-category="Home & Décor"] { background: #97b3ff; }
.category-image[data-category="Fashion & Accessories"] { background: #ffa4c7; }
.category-image[data-category="Food & Treats"] { background: #ff5f62; }

.popup-card h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font: 500 16px/1.2 Roobert, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popup-card-description {
  margin: 0;
  padding: 0 10px;
  color: rgb(55 11 39 / 80%);
  font-size: 10px;
  line-height: 1.2;
}

.popup-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.popup-tags { display: flex; min-width: 0; flex-wrap: wrap; gap: 4px; }
.popup-tag { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 4px; border-radius: 100px; background: #f2f2f2; font: 600 8px/1.2 Roobert, sans-serif; white-space: nowrap; }
.popup-tag::before { content: ""; flex: 0 0 3px; width: 3px; height: 3px; border-radius: 50%; background: #ff5f62; }
.popup-tag[data-category="Flowers & Plants"] { background: #ffeeee; }
.popup-tag[data-category="Fashion & Accessories"] { background: #fee6ee; }
.popup-tag[data-category="Beauty & Wellness"] { background: #fff5d3; }
.popup-tag[data-category="Food & Treats"] { background: #ffd4d5; }
.popup-tag[data-category="Home & Décor"] { background: #e7efff; }
.popup-tag[data-category="Art & Prints"] { background: #e6f3ff; }
.popup-links { display: flex; flex: 0 0 auto; gap: 4px; }
.popup-link { position: relative; display: grid; width: 25px; height: 25px; place-items: center; overflow: visible; border-radius: 50%; background: #5f2761; text-decoration: none; }
.popup-link.instagram { background: transparent; }
.popup-link::after { content: "↗"; position: absolute; right: -1px; bottom: -1px; display: grid; width: 10px; height: 10px; place-items: center; border-radius: 50%; background: #fff; color: #5f2761; font: 500 10px/1 Roobert, sans-serif; pointer-events: none; }
.popup-link > img { width: 25px; height: 25px; }
.popup-link.udora { background: #ff5f62; }
.popup-link.udora > img { width: 66.39%; height: 57.43%; transform: translate(-0.165%, -0.625%); }
.website-letter { color: #fff; font: 800 14px/1 Roobert, sans-serif; }
@media (min-width: 1537px) { .popup-card h3 { font-size: calc(16px + var(--wide-step)*.00520833); } }
.map-popup-empty { display: grid; width: 100%; flex: 1 1 auto; margin: 0; place-items: center; font-size: 18px; text-align: center; }
.map-popup-empty[hidden], .map-popup-cards[hidden] { display: none; }

@media (max-width: 1024px) {
  .map-popup-cards { grid-template-columns: repeat(2, 300px); width: 616px; }
}

@media (max-width: 680px) {
  .map-popup { align-items: stretch; padding: 60px 20px 24px; }
  .map-popup-close { top: 14px; right: 20px; width: 38px; height: 38px; font-size: 26px; }
  .map-popup-heading { width: 100%; text-align: left; }
  .map-popup-heading h2 { width: 100%; max-width: 100%; margin-inline: 0; font-size: 25px; }
  .map-popup-title-line { white-space: normal; }
  .map-popup-heading p { margin-top: 16px; font-size: 16px; }
  .map-popup-filters { justify-content: flex-start; flex-wrap: nowrap; margin: 24px -20px; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
  .map-popup-filters::-webkit-scrollbar { display: none; }
  .map-filter { flex: 0 0 auto; padding-top: 0; padding-bottom: 0; }
  .map-popup-cards { grid-template-columns: 1fr; width: 100%; }
  .popup-card { width: 100%; border-radius: 20px; }
}
