.nearme-page {
  --nm-bg: 340 30% 97%;
  --nm-fg: 340 30% 15%;
  --nm-primary: 340 82% 52%;
  --nm-primary-dim: 340 82% 46%;
  --nm-muted: 340 15% 92%;
  --nm-muted-fg: 340 15% 45%;
  --nm-border: 340 20% 88%;
  --nm-online: 142 76% 45%;
  --nm-radius: 0.75rem;
  --nearme-header-offset: 76px;
  --nearme-map-bg: #f8f4f0;

  --nearme-map-ui-z: 998;
}

.nearme-page.nearme-page--map-fullbleed {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-bottom: 0;
}


.nearme-page.nearme-page--map-fullbleed .nearme-map-stack {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding-top: 0;
  margin-top: calc(-1 * var(--nearme-header-offset));
  height: calc(100vh + var(--nearme-header-offset));
  height: calc(100dvh + var(--nearme-header-offset));
  min-height: calc(100vh + var(--nearme-header-offset));
  min-height: calc(100dvh + var(--nearme-header-offset));
  background: var(--nearme-map-bg);
}

.nearme-page.nearme-page--map-fullbleed .nearme-map-canvas-wrap {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Карта забирает всю высоту; панель — только absolute, не в потоке */
.nearme-page.nearme-page--map-fullbleed .nearme-map-canvas-wrap .nearme-map-ref {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  min-height: 0 !important;
}

@media (max-width: 991px) {
  .nearme-page {
    --nearme-header-offset: 74px;
  }
}

@media (max-width: 767px) {
  .nearme-page {
    --nearme-header-offset: 72px;
  }
}

.nearme-map-stack {
  padding-top: var(--nearme-header-offset);
  background: hsl(var(--nm-bg));
}

/* Плавающие контролы поверх карты (иконки + раскрываемый поиск + зум) */
.nearme-map-ui {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--nearme-map-ui-z, 998);
  padding: 0.65rem 0.75rem;
  pointer-events: none;
  box-sizing: border-box;
}

.nearme-page.nearme-page--map-fullbleed .nearme-map-ui {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  top: calc(
    var(--nearme-header-offset) + env(safe-area-inset-top, 0px) + 10px
  );
  bottom: auto;
  padding-top: 0;
  z-index: var(--nearme-map-ui-z, 998);
  width: auto;
  max-width: calc(100vw - 1.5rem);
  box-sizing: border-box;
}

.nearme-map-ui > * {
  pointer-events: auto;
}

.nearme-map-ui-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.nearme-map-ui-bar-main {
  flex: 1 1 auto;
  min-width: 0;
}

.nearme-map-ui-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.nearme-map-ui-cluster[hidden] {
  display: none !important;
}

.nearme-map-fab {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: hsl(var(--nm-fg));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.nearme-map-fab:hover,
.nearme-map-fab:focus {
  filter: brightness(0.98);
  outline: none;
}

.nearme-map-fab:focus-visible {
  outline: 2px solid hsl(var(--nm-primary));
  outline-offset: 2px;
}

.nearme-map-fab:active {
  transform: scale(0.96);
}

.nearme-map-ui-cluster--expanded .nearme-map-search-slide {
  flex: 1 1 auto;
  min-width: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .nearme-map-ui-cluster--expanded .nearme-map-search-slide {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition:
      max-width 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
      opacity 0.4s ease;
  }

  .nearme-map-ui-cluster--expanded.nearme-map-search-reveal .nearme-map-search-slide {
    max-width: 22rem;
    opacity: 1;
    overflow: visible;
  }

  .nearme-map-ui-cluster--expanded .nearme-map-search-pill {
    flex: none;
    width: 100%;
    max-width: 22rem;
    box-sizing: border-box;
  }
}

.nearme-map-fab--zoom {
  width: 40px;
  height: 40px;
  font-size: 0.85rem;
}

.nearme-map-ui-zoom {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-shrink: 0;
}

.nearme-map-search-pill {
  flex: 1 1 140px;
  min-width: 0;
  background: #fff;
  border-radius: 999px;
  border: 1.5px solid hsl(var(--nm-primary));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 0 1rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nearme-map-search-pill-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  color: hsl(var(--nm-fg));
  padding: 0.35rem 0;
  min-height: 36px;
}

.nearme-map-search-pill-input::placeholder {
  color: hsl(var(--nm-muted-fg));
}

.nearme-map-search-pill-input:focus {
  outline: none;
}

.nearme-map-search-pill--combo {
  position: relative;
  z-index: 1001;
  align-items: stretch;
  padding: 0 0.75rem;
}

.nearme-map-search-pill--combo .nearme-map-search-pill-input {
  flex: 1;
  min-width: 0;
}

.nearme-map-city-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  max-height: min(40vh, 280px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid hsl(var(--nm-primary) / 0.35);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1002;
}

.nearme-map-city-suggest[hidden] {
  display: none !important;
}

.nearme-map-city-suggest__item {
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.35;
  color: hsl(var(--nm-fg));
  cursor: pointer;
  word-break: break-word;
  hyphens: auto;
}

.nearme-map-city-suggest__item:hover,
.nearme-map-city-suggest__item[aria-selected="true"],
.nearme-map-city-suggest__item--active {
  background: hsl(var(--nm-primary) / 0.08);
}

.nearme-map-ui-cluster--expanded {
  width: 100%;
  max-width: 100%;
}

.nearme-map-search-error--float {
  margin-top: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--nm-radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.nearme-page .leaflet-control-zoom {
  display: none !important;
}

.nearme-map-search-field {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  align-items: stretch;
  background: hsl(0 0% 100%);
  border-radius: var(--nm-radius);
  border: 1px solid hsl(var(--nm-border));
  box-shadow: 0 1px 2px hsl(var(--nm-fg) / 0.04);
  overflow: hidden;
}

.nearme-map-search-input {
  border: none;
  box-shadow: none;
  min-height: 42px;
  font-size: 0.875rem;
  color: hsl(var(--nm-fg));
}

.nearme-map-search-input:focus {
  box-shadow: none;
  outline: 2px solid hsl(var(--nm-primary) / 0.35);
  outline-offset: -2px;
}

.nearme-map-search-submit {
  flex-shrink: 0;
  width: 44px;
  min-height: 42px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: linear-gradient(
    180deg,
    hsl(var(--nm-primary)) 0%,
    hsl(var(--nm-primary-dim)) 100%
  );
  color: hsl(0 0% 100%);
}

.nearme-map-search-submit:hover,
.nearme-map-search-submit:focus {
  color: hsl(0 0% 100%);
  filter: brightness(1.04);
}

.nearme-map-filter-btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  color: hsl(0 0% 100%);
  background: linear-gradient(
    180deg,
    hsl(var(--nm-primary)) 0%,
    hsl(var(--nm-primary-dim)) 100%
  );
  border: none;
  border-radius: var(--nm-radius);
  box-shadow: 0 1px 3px hsl(var(--nm-primary) / 0.35);
}

.nearme-map-filter-btn:hover,
.nearme-map-filter-btn:focus {
  color: hsl(0 0% 100%);
  filter: brightness(1.05);
}

.nearme-map-search-error {
  font-size: 0.8125rem;
  flex-basis: 100%;
  margin-top: 0.15rem;
}

.nearme-map-canvas-wrap {
  position: relative;
  height: 60vh;
  min-height: 400px;
  max-height: 640px;
  border-bottom: 1px solid hsl(var(--nm-border));
}

@media (max-width: 767px) {
  .nearme-map-canvas-wrap {
    height: 50vh;
    min-height: 280px;
    max-height: none;
  }
}

.nearme-map-canvas-wrap .nearme-map-ref {
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: var(--nearme-map-bg);
  border-radius: 0;
}

.nearme-page-body {
  background: hsl(var(--nm-bg));
}

.nearme-page-body-inner {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* Photo-pin marker (ported from home-map) */
.hmc-photo-pin {
  position: relative;
  width: 40px;
  height: 49px;
  cursor: pointer;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.hmc-photo-pin-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #e91e63;
  background: #fff;
  overflow: hidden;
  box-sizing: border-box;
}

.hmc-photo-pin-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.hmc-photo-pin::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 11px solid #e91e63;
}

/* Approximate-location variant: dashed ring + faded */
.hmc-photo-pin--approx .hmc-photo-pin-circle {
  opacity: 0.55;
  border-style: dashed;
}

.hmc-photo-pin--approx::after {
  opacity: 0.55;
}

.leaflet-div-icon.nearme-profile-marker {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 0;
  margin-top: 0;
}

.nearme-page .leaflet-marker-icon.nearme-profile-marker {
  pointer-events: auto;
}

/* Popup wrapper reset */
.nearme-page .leaflet-popup-content-wrapper {
  padding: 0 !important;
  border-radius: 12px;
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(0, 26, 66, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e51e63;
  overflow: hidden;
}

.nearme-page .leaflet-popup-content {
  margin: 0 !important;
}

.nearme-page .leaflet-popup-tip-container {
  display: none;
}

/* Popup card (ported from home-map) */
.hmc-popup-card {
  background: #fff;
  width: 165px;
  border-radius: 12px;
  overflow: hidden;
}

.hmc-popup-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 5px;
}

.hmc-popup-photo-wrap {
  flex-shrink: 0;
  padding: 1px;
  border-radius: 9px;
  background: linear-gradient(135deg, #005ac4, #e91e63);
}

.hmc-popup-photo {
  display: block;
  width: 48px;
  height: auto;
  min-height: 70px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center top;
}

.hmc-popup-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: start;
  gap: 4px;
}

.hmc-popup-nameline {
  display: flex;
  align-items: baseline;
  gap: 5px;
  overflow: hidden;
}

.hmc-popup-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hmc-popup-meta {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Distance row (nearme-only, no home-map equivalent) */
.hmc-popup-distance {
    margin-bottom:5px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hmc-popup-distance svg {
  width: 11px;
  height: 11px;
  color: #e91e63;
  flex-shrink: 0;
}

.hmc-popup-distance span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.hmc-popup-stars {
  font-size: 10px;
  color: #f59e0b;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 2px;margin-bottom:0px!important;
}

.hmc-popup-stars i {
  font-size: 9px;
}

.hmc-popup-review-count {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  margin-left: 2px;
}

.hmc-popup-price {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
      background: linear-gradient(90deg, #a0620a 0%, #e8c44a 40%, #e91e63 60%, #a0620a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom:0px!important;
}

.hmc-popup-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #005ac4 !important;
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1;
  margin-bottom:10px;
}

.hmc-popup-link:hover {
  color: #e91e63 !important;
  text-decoration: none;
}

.hmc-popup-link i {
  font-size: 9px;
}

/* Notice bar — amber warning style, pinned to bottom of map */
.nearme-notice-bar {
  position: fixed;
  top: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  pointer-events: auto;
  width: max-content;
  max-width: 92vw;
  white-space: nowrap;
  padding: 10px 44px 10px 18px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(180, 83, 9, 0.25), 0 2px 6px rgba(0, 0, 0, 0.1);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: #78350f;
  text-align: center;
}

.nearme-notice-bar .nearme-notice-text i {
  margin-right: 6px;
  color: #b45309;
}

.nearme-notice-bar.is-hidden {
  display: none;
}

.nearme-notice-close {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #78350f;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  pointer-events: auto;
}

.nearme-notice-close:hover {
  color: #451a03;
}

@media (max-width: 767px) {
  .nearme-notice-bar {
    width: 90%;
    max-width: 90%;
    white-space: normal;
    font-size: 12px;
    padding: 9px 40px 9px 14px;
  }
}

/* List section filter (modal trigger) */
.nearme-all-models-section .nearme-filter-btn.btn-primary {
  background: linear-gradient(
    180deg,
    hsl(var(--nm-primary)) 0%,
    hsl(var(--nm-primary-dim)) 100%
  );
  border: none;
  border-radius: var(--nm-radius);
  box-shadow: 0 1px 3px hsl(var(--nm-primary) / 0.35);
}

.nearme-all-models-section .nearme-filter-btn.btn-primary:hover,
.nearme-all-models-section .nearme-filter-btn.btn-primary:focus {
  filter: brightness(1.05);
}

.nearme-page .nearme-models-count {
  font-size: 0.9375rem;
  color: hsl(var(--nm-muted-fg));
}

.nearme-section-title {
  color: hsl(var(--nm-fg));
  letter-spacing: -0.02em;
}

.nearme-section-title .nearme-found-num {
  color: hsl(var(--nm-muted-fg));
}

.nearme-cards-grid .row {
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

.nearme-card-col {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.nearme-card-link {
  display: block;
  color: inherit;
}

.nearme-card {
  background: hsl(0 0% 100%);
  border: 1px solid hsl(var(--nm-border));
  border-radius: var(--nm-radius);
  overflow: hidden;
  box-shadow: 0 1px 3px hsl(var(--nm-fg) / 0.06);
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.nearme-card:hover {
  box-shadow: 0 10px 24px hsl(var(--nm-fg) / 0.1);
  transform: translateY(-1px);
}

.nearme-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 400 / 500;
  overflow: hidden;
  background: hsl(var(--nm-muted));
  border-radius: var(--nm-radius) var(--nm-radius) 0 0;
}

.nearme-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nearme-card-online-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: hsl(0 0% 100%);
  background: hsl(var(--nm-online));
  border-radius: calc(var(--nm-radius) - 4px);
  box-shadow: 0 1px 2px hsl(var(--nm-fg) / 0.12);
}

.nearme-card-info {
  padding: 12px 14px;
}

.nearme-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: hsl(var(--nm-fg));
  margin: 0 0 4px 0;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nearme-card-location {
  font-size: 0.875rem;
  color: hsl(var(--nm-muted-fg));
  line-height: 1.3;
}
