.map-section {
  padding-block: var(--space-8);
  overflow: hidden;
  background: #d8d0c4;
}

.map-section .section-head {
  margin-bottom: var(--space-5);
}

.map-section .section-head h2 {
  max-width: 12ch;
}

.map-filters {
  display: flex;
  gap: 0.55rem;
  margin-bottom: var(--space-4);
  padding-bottom: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.map-filter {
  min-height: 2.8rem;
  flex: 0 0 auto;
  padding: 0 1rem;
  border: 1px solid #82776d;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.map-filter[aria-pressed="true"] {
  border-color: var(--wine);
  background: var(--wine);
  color: var(--white);
}

.brand-map {
  position: relative;
  min-height: 48rem;
  overflow: hidden;
  border: 1px solid #a89d91;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(35deg, transparent 48%, rgb(119 31 45 / 8%) 49% 51%, transparent 52%),
    #c8c0b5;
}

.brand-map__canvas {
  position: absolute;
  inset: 0;
}

.brand-map .leaflet-proxy {
  position: absolute;
  width: 0;
  height: 0;
  visibility: hidden;
}

.brand-map .leaflet-tile-pane {
  filter: grayscale(1) sepia(0.24) hue-rotate(322deg) saturate(0.58) contrast(0.88) brightness(1.07);
}

.brand-map .leaflet-tile {
  mix-blend-mode: multiply;
}

.brand-map .leaflet-control-zoom {
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgb(28 19 17 / 16%);
}

.brand-map .leaflet-control-zoom a {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border: 0;
  background: var(--paper-soft);
  color: var(--ink);
  line-height: 1;
}

.brand-map .leaflet-control-zoom a:hover {
  background: var(--wine);
  color: var(--white);
}

.brand-map .leaflet-control-attribution {
  padding: 0.25rem 0.45rem;
  background: rgb(242 238 230 / 86%);
  color: var(--ink-soft);
  font-size: 0.62rem;
}

.brand-map-marker-wrap {
  background: transparent;
  border: 0;
}

.brand-map-marker {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border: 2px solid var(--paper-soft);
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 5px 15px rgb(22 18 15 / 28%);
  color: var(--white);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: transform 160ms ease;
}

.leaflet-marker-icon:hover .brand-map-marker,
.leaflet-marker-icon:focus .brand-map-marker {
  transform: scale(1.18);
}

.brand-map-project {
  position: relative;
  display: grid;
  width: 4rem;
  height: 4rem;
  place-items: center;
  border: 3px solid var(--paper-soft);
  border-radius: 50%;
  background: var(--wine);
  box-shadow: 0 10px 30px rgb(79 17 28 / 35%);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.brand-map-project::before,
.brand-map-project::after {
  position: absolute;
  inset: -0.7rem;
  border: 1px solid rgb(119 31 45 / 45%);
  border-radius: 50%;
  content: "";
  animation: map-pulse 2.8s ease-out infinite;
}

.brand-map-project::after {
  animation-delay: 1.4s;
}

.brand-map-project i {
  position: absolute;
  bottom: -0.85rem;
  width: 0;
  height: 0;
  border: 0.6rem solid transparent;
  border-top-color: var(--wine);
}

@keyframes map-pulse {
  from { opacity: 0.8; transform: scale(0.75); }
  to { opacity: 0; transform: scale(1.3); }
}

.map-panel {
  position: absolute;
  z-index: 500;
  top: var(--space-4);
  left: var(--space-4);
  display: flex;
  width: min(23rem, calc(100% - 2rem));
  max-height: calc(100% - 3rem);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: var(--radius-md);
  background: rgb(54 15 23 / 94%);
  box-shadow: 0 20px 55px rgb(31 16 15 / 24%);
  color: var(--white);
  backdrop-filter: blur(12px);
}

.map-panel__selected {
  padding: var(--space-5);
  border-bottom: 1px solid rgb(255 255 255 / 16%);
}

.map-panel__category {
  display: block;
  margin-bottom: 0.55rem;
  color: #e5b4bc;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-panel h3 {
  margin-bottom: var(--space-4);
  font-size: var(--step-2);
}

.map-panel__facts {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  color: rgb(255 255 255 / 70%);
  font-size: 0.84rem;
}

.map-panel__route {
  color: var(--white);
  font-size: 0.84rem;
  font-weight: 600;
}

.map-nearby {
  min-height: 0;
  padding: var(--space-4) var(--space-5) var(--space-5);
  overflow-y: auto;
}

.map-nearby__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  color: rgb(255 255 255 / 50%);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-nearby__list {
  display: grid;
  gap: 0.25rem;
}

.map-nearby__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.65rem 0;
  border: 0;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
  background: transparent;
  color: var(--white);
  text-align: left;
}

.map-nearby__item span {
  font-size: 0.82rem;
}

.map-nearby__item small {
  color: rgb(255 255 255 / 48%);
  font-size: 0.68rem;
  white-space: nowrap;
}

.map-home {
  position: absolute;
  z-index: 500;
  right: 1rem;
  top: 1rem;
  min-height: 2.8rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--paper-soft);
  box-shadow: 0 8px 24px rgb(28 19 17 / 16%);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.map-source {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: 0.8rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.map-unavailable .brand-map__canvas {
  display: none;
}

.map-unavailable .map-panel {
  position: relative;
  margin: var(--space-4);
}

@media (max-width: 820px) {
  .brand-map {
    display: grid;
    min-height: 60rem;
    grid-template-rows: 31rem auto;
  }

  .brand-map__canvas {
    position: relative;
    grid-row: 1;
  }

  .map-panel {
    position: relative;
    z-index: 5;
    top: auto;
    left: auto;
    grid-row: 2;
    width: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    background: var(--wine-dark);
    box-shadow: none;
  }

  .map-nearby {
    overflow: visible;
  }

  .map-source {
    flex-direction: column;
    gap: 0.25rem;
  }
}

@media (max-width: 520px) {
  .map-filter {
    min-height: 2.6rem;
    padding-inline: 0.85rem;
  }

  .brand-map {
    margin-inline: calc(var(--edge) * -0.55);
    border-radius: var(--radius-md);
  }

  .map-panel__selected,
  .map-nearby {
    padding: 1.2rem;
  }

  .map-nearby__item {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-map-project::before,
  .brand-map-project::after {
    animation: none;
  }
}
