/* Картата на комплексите (assets/js/complexes_map.js): панел в съдържанието на
   страницата, светлосива подложка, точките и бутоните в акцентния цвят на скина. */
.cxmap {
  --cxm-accent: var(--accent, var(--brand-accent, #0f6e66));
  position: relative;
  height: clamp(420px, 68vh, 640px);
  margin: 0 0 24px;
  border-radius: 18px; overflow: hidden;
  background: #f2f2f0;
  box-shadow: 0 18px 50px rgba(20, 30, 40, .12), 0 0 0 1px rgba(20, 30, 40, .06);
  display: flex; flex-direction: column;
  animation: cxmapIn .3s cubic-bezier(.22, 1, .36, 1);
}
.cxmap[hidden], .cxmap-wrap[hidden] { display: none; }
@keyframes cxmapIn { from { opacity: 0; transform: translateY(10px); } }
/* от футъра: панелът стои в края на съдържанието, в ширината на сайта */
.cxmap-wrap { box-sizing: border-box; width: 100%; max-width: 1320px; margin: 32px auto 8px; padding: 0 16px; align-self: center; }
.cxmap-wrap .cxmap { margin: 0; }

.cxmap__head {
  position: absolute; z-index: 1000; top: 16px; left: 16px; right: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  pointer-events: none;
}
.cxmap__title {
  margin: 0; padding: 10px 18px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(20, 30, 40, .12);
  font-size: 15px; font-weight: 700; letter-spacing: .01em; color: #1d2329;
  pointer-events: auto;
}
.cxmap__close {
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: #fff; color: #1d2329;
  box-shadow: 0 6px 24px rgba(20, 30, 40, .16);
  pointer-events: auto; transition: transform .15s;
}
.cxmap__close:hover { transform: rotate(90deg); }
.cxmap__close:focus-visible { outline: 2px solid var(--cxm-accent); outline-offset: 2px; }
.cxmap__map { flex: 1; position: relative; z-index: 0; background: #f2f2f0; }
.cxmap-tiles { filter: saturate(1.45) hue-rotate(-12deg) brightness(1.04) contrast(.96); }
.cxmap__empty {
  position: absolute; z-index: 1000; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; padding: 14px 22px; border-radius: 12px; background: #fff; color: #444;
  box-shadow: 0 6px 24px rgba(20, 30, 40, .12);
}
.cxmap__empty[hidden] { display: none; }

/* ---- точка: плътно ядро с мек ореол в акцентния цвят ---- */
.cxmap-pin { background: none; border: 0; }
.cxmap-pin span {
  position: absolute; inset: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--accent, var(--brand-accent, #0f6e66)) 22%, transparent);
  transition: transform .2s;
}
.cxmap-pin span::after {
  content: ""; position: absolute; inset: 10px; border-radius: 50%;
  background: var(--accent, var(--brand-accent, #0f6e66));
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.cxmap-pin:hover span { transform: scale(1.25); }

/* ---- попъп: карта със снимка, име, етикети и бутон ---- */
.cxmap-popup .leaflet-popup-content-wrapper { padding: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 14px 40px rgba(20, 30, 40, .22); }
.cxmap-popup .leaflet-popup-content { margin: 0; }
.cxmap-popup .leaflet-popup-content > .cxmap-card { width: 100%; }
.cxmap-popup .leaflet-popup-tip { box-shadow: none; }
.leaflet-container .cxmap-popup a.leaflet-popup-close-button {
  top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17, 24, 32, .72); color: #fff; font: 600 22px/1 sans-serif;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3); z-index: 2; transition: background .15s;
}
.leaflet-container .cxmap-popup a.leaflet-popup-close-button:hover, .leaflet-container .cxmap-popup a.leaflet-popup-close-button:focus-visible { background: rgba(17, 24, 32, .9); color: #fff; }
.leaflet-container .cxmap-popup a.leaflet-popup-close-button span { color: inherit; }
.cxmap-card__name { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; color: #1d2329; }
.cxmap-card__price { margin-top: 5px; font-size: 17px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; color: var(--accent, var(--brand-accent, #0f6e66)) !important; }
.cxmap-card__price small { font-size: 11.5px; font-weight: 700; opacity: .8; letter-spacing: .02em; }
.cxmap-card__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cxmap-chip {
  padding: 4px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  background: #f0f1f2; color: #4a525a;
}
.cxmap-chip--accent { background: color-mix(in srgb, var(--accent, var(--brand-accent, #0f6e66)) 12%, #fff); color: var(--accent, var(--brand-accent, #0f6e66)); }

.cxmap .leaflet-control-zoom, .cxmap-host .leaflet-control-zoom { border: 0; box-shadow: 0 6px 24px rgba(20, 30, 40, .14); border-radius: 12px; overflow: hidden; margin: 0 16px 24px 0; }
.cxmap .leaflet-control-zoom a, .cxmap-host .leaflet-control-zoom a { width: 40px; height: 40px; line-height: 40px; color: #1d2329; }

@media (prefers-reduced-motion: reduce) {
  .cxmap, .cxmap-pin span, .cxmap__close { animation: none; transition: none; }
}
@media (max-width: 575px) {
  .cxmap { height: 72vh; border-radius: 12px; }
  .cxmap__head { top: 10px; left: 10px; right: 10px; }
  .cxmap__title { font-size: 13px; padding: 8px 14px; }
}

/* бутоните горе вдясно: цял екран + затваряне */
.cxmap__tools { display: flex; gap: 10px; }
.cxmap__full:hover { transform: scale(1.06); }
/* цял екран: панелът покрива прозореца (Esc или бутонът го връщат) */
.cxmap.cxmap--full { position: fixed; inset: 0; z-index: 100000; height: auto; margin: 0; border-radius: 0; animation: none; }
html.cxmap-noscroll, html.cxmap-noscroll body { overflow: hidden; }


/* балончето: снимка със сърце, име и оферти, отдолу два бутона на един ред */
.cxmap-card { display: flex; flex-direction: column; }
.cxmap-card__top { position: relative; }
.cxmap-card__img { display: block; width: 100%; height: 150px; object-fit: cover; background: #e8e8e6; }
.cxmap-card__body { padding: 14px 16px 12px; }
.cxmap-card__body.has-fav { padding-left: 58px; min-height: 34px; }
.cxmap-card__fav {
  position: absolute; top: 10px; left: 10px; z-index: 2; width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .94); color: #1d2329; box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.cxmap-card__fav .material-icons-outlined { font-size: 20px; }
.cxmap-card__fav:hover { transform: scale(1.1); }
.cxmap-card__fav:focus-visible { outline: 2px solid var(--accent, var(--brand-accent, #0f6e66)); outline-offset: 2px; }
.cxmap-card__fav.is-active { color: #e0245e; }
.cxmap-card__btns { display: flex; gap: 8px; padding: 0 12px 12px; }
.cxmap-card__btn {
  flex: 1 1 0; min-width: 0; min-height: 40px; padding: 8px 6px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap;
  font-size: 13px; font-weight: 700; text-decoration: none !important; transition: filter .15s, background .15s;
}
.cxmap-card__btn .material-icons-outlined { font-size: 17px; transition: transform .15s; }
.cxmap-card__btn:focus-visible { outline: 2px solid var(--accent, var(--brand-accent, #0f6e66)); outline-offset: 2px; }
.cxmap-card__btn--ghost { flex: .8 1 0; background: #f0f1f2; color: #1d2329 !important; }
.cxmap-card__btn--ghost:hover { background: #e4e6e8; }
.cxmap-card__btn--ghost .material-icons-outlined { color: var(--accent, var(--brand-accent, #0f6e66)); }
.cxmap-card__go { background: var(--accent, var(--brand-accent, #0f6e66)); color: var(--accent-ink, #fff) !important; }
.cxmap-card__go:hover { filter: brightness(1.08); }
.cxmap-card__go:hover .material-icons-outlined { transform: translateX(3px); }
