.map-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 4.5rem);
  min-height: 32rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.75rem 1rem 5rem;
}

@media (min-width: 768px) {
  .map-page {
    padding-bottom: 1.5rem;
    height: calc(100vh - 5.5rem);
  }
}

.map-page__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.map-page__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--home-text, var(--color-text));
  line-height: 1.3;
}

.map-page__subtitle {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-top: 0.125rem;
}

.map-page__header-actions {
  display: flex;
  gap: 0.5rem;
}

.map-page__mode-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid var(--home-border, var(--color-border));
  text-decoration: none;
}

.map-page__mode-btn--active {
  background: var(--color-primary, var(--home-primary));
  border-color: var(--color-primary, var(--home-primary));
  color: #fff;
}

.map-page__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--home-border, var(--color-border));
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.map-page__map-section {
  flex: 0 0 42vh;
  min-height: 14rem;
  max-height: 50vh;
  position: relative;
}

.map-page__map-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.map-page__list-section {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f9fafb;
  border-top: 1px solid var(--home-border, var(--color-border));
}

.map-page__list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--home-border, var(--color-border));
  flex-shrink: 0;
}

.map-page__list-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--home-text, var(--color-text));
}

.map-page__list-count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

.map-page__list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.map-page__list-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
}

/* Компактная карточка в списке под картой */
.map-list-card {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  background: #fff;
  border-radius: 0.875rem;
  border: 1px solid var(--home-border, var(--color-border));
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-list-card.is-active {
  border-color: var(--color-primary, var(--home-primary));
  box-shadow: 0 0 0 2px rgba(45, 62, 80, 0.15);
}

.map-list-card__link {
  display: flex;
  flex: 1;
  gap: 0.75rem;
  padding: 0.5rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.map-list-card__thumb {
  width: 5.5rem;
  height: 4.125rem;
  border-radius: 0.625rem;
  background: #f3f4f6;
  flex-shrink: 0;
  overflow: hidden;
}

.map-list-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-list-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.map-list-card__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--home-text, var(--color-text));
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-list-card__price {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--home-text, var(--color-text));
  margin-top: 0.25rem;
}

.map-list-card__meta {
  font-size: 0.6875rem;
  color: #9ca3af;
  margin-top: 0.125rem;
}

.map-list-card__map-btn {
  flex-shrink: 0;
  align-self: center;
  margin-right: 0.5rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-primary, var(--home-primary, #2d3e50));
  background: rgba(45, 62, 80, 0.08);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}

.map-list-card__map-btn:hover {
  background: rgba(45, 62, 80, 0.14);
}

.search-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.map-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 500;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  border-radius: 0.875rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  color: #374151;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.map-marker-wrap {
  position: absolute;
  left: -3.5rem;
  top: -2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 7rem;
  box-sizing: border-box;
  cursor: pointer;
}

.map-marker {
  background: var(--color-primary, var(--home-primary));
  color: #fff;
  border: 2px solid #fff;
  border-radius: 0.625rem;
  padding: 0.3125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-marker-wrap.is-active,
.map-marker-wrap:focus-visible {
  outline: none;
}

.map-marker-wrap.is-active .map-marker {
  background: var(--home-text, var(--color-text));
}

.map-marker-wrap.is-active .map-marker__pointer {
  border-top-color: var(--home-text, var(--color-text));
}

.map-marker__pointer {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--color-primary, var(--home-primary));
  margin-top: -1px;
}

.search-map {
  font-family: var(--font-sans, 'Nunito', system-ui, sans-serif);
}

.map-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 14rem;
  padding: 2rem;
  text-align: center;
  background: #f9fafb;
}

.map-unavailable__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--home-text, var(--color-text));
  margin-bottom: 0.5rem;
}

.map-unavailable__text {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 1rem;
}

.map-unavailable__code {
  font-size: 0.8125rem;
  background: var(--home-border, var(--color-border));
  padding: 0.125rem 0.375rem;
  border-radius: 0.375rem;
}

.map-unavailable__btn {
  justify-content: center;
}
