/* ============================================================
   map-custom.css — 2GIS map page custom styles
   Speech-bubble badge markers + popup card
   ============================================================ */

.map-badge-wrap {
    overflow: visible !important;
    background: transparent !important;
    border: none !important;
}

.map-badge {
    display: inline-block;
    background: #fff;
    border: 2px solid #507154;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
	font-family: 'Inter', Arial, sans-serif;
    color: #111;
    white-space: nowrap;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    cursor: pointer;
    transition: transform .15s, background .15s, color .15s;
    line-height: 1.3;
}

/* Tail — outer border triangle */
.map-badge::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid #507154;
    pointer-events: none;
}

/* Tail — inner white fill triangle */
.map-badge::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #fff;
    pointer-events: none;
}

/* Yellow border — special offer / property owner */
.map-badge.is-special {
    border-color: #87a88b;
}
.map-badge.is-special::before {
    border-top-color: #87a88b;
}
.map-badge.is-special::after {
    border-top-color: #fff;
}

/* Agent listing — dark branded surface with a gold accent and white text */
.map-badge.is-agent {
    border-color: #3e3b34;
    background: #2f5238;
    color: #fff;
    box-shadow: 0 3px 10px rgba(47, 82, 56, .34);
}
.map-badge.is-agent::before {
    border-top-color: #3e3b34;
}
.map-badge.is-agent::after {
    border-top-color: #2f5238;
}

.map-badge.is-active.is-agent::before {
    border-top-color: #d8bd7d;
}
.map-badge.is-active.is-agent::after {
    border-top-color: #24432d;
}

.leaflet-container a {
    color: #4e6b51 !important;
	font-weight: 800;
}
.leaflet-container a:hover {
    color: #507154 !important;
	font-weight: 800;
}

.map-popup-agent-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e7f0e8;
    border: 1px solid #d5e4d7;
    color: #304b36;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 600;
    margin: 4px 0px 8px;
}

.map-badge:hover {
    transform: scale(1.05);
    z-index: 9999 !important;
}

.map-badge.is-active::before {
    border-top-color: #507154;
}
.map-badge.is-active::after {
    border-top-color: #507154;
}

.map-badge.is-active.is-special::before {
    border-top-color: #87a88b;
}
.map-badge.is-active.is-special::after {
    border-top-color: #87a88b;
}

/* ── Cluster icon ─────────────────────────────────────────────────────────── */
.map-cluster {
    background: #507154;
    color: #fff;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
	font-family: 'Inter', Arial, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
    border: 2px solid #fff;
}

/* Override default cluster marker backgrounds */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(80, 113, 84, .25) !important;
}
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: #507154 !important;
    color: #fff !important;
    font-weight: 700;
}

/* ── Popup wrapper ────────────────────────────────────────────────────────── */
.map-popup-wrap .leaflet-popup-content-wrapper,
.map-popup-wrap.dg-popup__container {
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
    max-height: 250px;
    max-height: 191px; 
	width: 435px !important;
}
.map-popup-wrap .leaflet-popup-content {
    margin: 0;
}

/* On the CRM objects map, the popup must stay above the price badge. */
.objects-result-map-modal .leaflet-popup-pane {
    z-index: 800 !important;
}

.objects-result-map-modal .map-popup-wrap .leaflet-popup-content-wrapper,
.objects-result-map-modal .map-popup-wrap .leaflet-popup-content {
    position: relative;
    z-index: 801;
}

.map-popup-wrap .leaflet-popup-tip-container {
    display: none; /* we use the badge tail instead */
}

/* ── Popup card ───────────────────────────────────────────────────────────── */
.map-popup-card {
    width: 405px;
    font-size: 13px;
	font-family: 'Inter', Arial, sans-serif;
    color: #222;
    background: #fff;
}

/* На ноутбуках popup не должен вытеснять карту и боковую панель. */
@media (min-width: 769px) and (max-width: 1440px) {
    .map-popup-wrap .leaflet-popup-content-wrapper,
    .map-popup-wrap.dg-popup__container {
        width: 360px !important;
        max-width: calc(100vw - 40px);
    }
    .map-popup-card { width: 330px; max-width: 100%; }
}

/* Two-column inner section */
.map-popup-inner {
    display: flex;
    gap: 10px;
    padding: 12px 12px 8px;
}

/* Left column */
.map-popup-left {
    flex-shrink: 0;
}

/* Image area */
.map-popup-img-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 8px;
    overflow: hidden;
    background: #e9ecef;
}
.map-popup-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Photo count — bottom-right of image */
.map-popup-photo-cnt {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 11px;
	font-family: 'Inter', Arial, sans-serif;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}
.map-popup-img-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 8px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 1.8rem;
	font-family: 'Inter', Arial, sans-serif;
}

/* Right column */
.map-popup-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

/* Price row: price + action buttons */
.map-popup-price-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}
.map-popup-price {
    font-size: 1rem;
    font-weight: 800;
	font-family: 'Inter', Arial, sans-serif;
    color: #111;
    line-height: 1.3;
}

/* Main params — blue */
.map-popup-params {
    font-size: 12px;
    font-weight: 500;
	font-family: 'Inter', Arial, sans-serif;
    color: #507154;
    line-height: 1.4;
    text-decoration: none;
	border-top: 1px solid #e9e9e9;
    padding: 4px 0px 0px 0px;
}

/* Address — gray */
.map-popup-address {
    font-size: 11px;
	font-family: 'Inter', Arial, sans-serif;
    color: #888;
    line-height: 1.4;
}

.leaflet-container a.leaflet-popup-close-button {
    display:none;
}
.leaflet-popup-content-wrapper {
    overflow: hidden;
    padding: 0;
    min-width: 60px;
    min-height: 50px;
    border: 0;
    border-radius: 3px;
    background: 0 0;
    -webkit-box-shadow: none;
    box-shadow: none;
    color: #e6e6e6;
    font-size: 14px;
    -webkit-transition: opacity ease-out .2s, max-height ease-out .2s, height ease-out .2s;
    transition: opacity ease-out .2s, max-height ease-out .2s, height ease-out .2s;
    -webkit-transform-origin: 50% 100%;
    -ms-transform-origin: 50% 100%;
    transform-origin: 50% 100%;
    background-color: rgb(83 112 86 / 80%) !important;
}

/* Action buttons */
.map-popup-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}
.map-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
    color: #555;
    font-size: 14px;
	font-family: 'Inter', Arial, sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.map-popup-btn:hover {
    background: #e7f0e8;
    color: #304b36;
}
.map-popup-btn-fav {
    /* inherits .map-popup-btn */
}
.map-popup-btn-fav.is-fav i,
.map-popup-btn-fav i.fa-solid.fa-heart {
    color: #e74c3c;
	font-size: 12px;
}

.map-popup-owner-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #edf4ee;
    border: 1px solid #d5e4d7;
    color: #456052;
    border-radius: 3px;
    font-size: 11px;
	font-family: 'Inter', Arial, sans-serif;
    font-weight: 600;
    padding: 5px 5px 5px 5px;
}

.map-popup-agent-tag {
	display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #507154;
    border-color: #4c7050;
    color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	width: 65%;
	font-family: 'Inter', Arial, sans-serif;
    padding: 5px 5px 5px 5px;
    border-radius: 3px;
}

.map-popup-hr {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 0 0 7px;
}
.map-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px 8px;
    font-size: 11px;
	font-family: 'Inter', Arial, sans-serif;
    color: #aaa;
}

/* Detail link button */
.map-popup-detail-btn {
    display: block;
    margin: 0 12px 12px;
    padding: 7px 0;
    background: #507154;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
	font-family: 'Inter', Arial, sans-serif;
    font-weight: 600;
    transition: background .15s;
}
.map-popup-detail-btn:hover {
    background: #3d5f41;
    color: #fff;
}

/* ── Mobile adjustments ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .map-popup-card,
    .map-popup-wrap .leaflet-popup-content {
        width: calc(100vw - 40px) !important;
        max-width: 290px;
    }
    .map-popup-img-wrap,
    .map-popup-img-placeholder {
        width: 90px;
        height: 90px;
    }
}
