.map-wrapper {
    position: relative;        /* точка отсчёта для теней */
    width:fit-content;
    max-width: 100%;
	border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;              /* чтобы скругления обрезали контейнер */
    background: #fff;              /* фон под картой, если она с прозрачностью */
	box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
}

.map-wrapper::before,
.map-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 24px;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity .2s ease;
}

.map-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,.15), transparent);
}

.map-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,.15), transparent);
}

.map-wrapper.has-left-shadow::before  { opacity: 1; }
.map-wrapper.has-right-shadow::after  { opacity: 1; }

.map-container {
    position: relative;
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    /*line-height: 0;*/
    scrollbar-width: thin;
    scrollbar-color: #bbb transparent;
}

.map-scene {
    position: relative;          /* точка отсчёта для меток */
    width: 1000px;               /* фиксированная ширина карты */
    /* высота задаётся автоматически по img */
    display: inline-block;       /* чтобы не сжималась по ширине контейнера */
}

.map-container::-webkit-scrollbar {
    height: 8px;
}
.map-container::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}
.map-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.map-image {
    display: block;
    width: 1000px;
    height: auto;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
}

#markers-layer {
    position: absolute;
    inset: 0;                    /* ровно по .map-scene */
    pointer-events: none;
    z-index: 2;
}

.marker {
  position: absolute; /* Позиционируется относительно .map-container */
  /*width: 15px;
  height: 19px;*/
  cursor: pointer;
  z-index: 10; /* Гарантирует, что маркер будет сверху */
  pointer-events: auto; /* Включает клики для самого маркера */
  /* Центрирование маркера: сдвигаем на половину его ширины/высоты */
  transform: translate(-50%, -50%); 
  width: clamp(10px, 1.2cqi, 20px);   /* 1.2% ширины контейнера, но не меньше 10 и не больше 20 */
  height: clamp(10px, 1.2cqi, 20px);
  transform: translate(-50%, -100%);
}


/* Подпись: тоже привязана к (x, y), но смещена своим transform */
.marker-label {
    position: absolute;
    color: #333;
    background: rgba(255,255,255,.85);
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    z-index: 1;
	font-size: clamp(9px, 0.8cqi, 11px);
    padding: clamp(1px, 0.15cqi, 3px) clamp(3px, 0.4cqi, 7px);
	
    --label-scale: 1;
    transform: translate(var(--tx, 0), var(--ty, 0)) scale(var(--label-scale));
    transform-origin: 0 0;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.marker-label:hover {
    --label-scale: 1.05;                       /* только увеличиваем */
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    z-index: 15;                                /* поверх соседних подписей */
}

.marker-label--right {
    --tx: 5px;
    --ty: -100%;
}
.marker-label--left {
    --tx: calc(-100% - 5px);
    --ty: -100%;
}
.marker-label--top {
    --tx: -50%;
    --ty: -170%;
}
.marker-label--bottom {
    --tx: -50%;
    --ty: -20%;
}
.marker-label--bottom-right {
    --tx: 0;
    --ty: -50%;
}
.marker-label--bottom-left {
    --tx: -100%;
    --ty: -50%;
}
.marker-label--top-right {
    --tx: 0;
    --ty: -140%;
}

.marker-label--top-middleright {
    --tx: -40%;
    --ty: -170%;
}

.marker-label--top-left {
    --tx: -100%;
    --ty: -150%;
}

.marker-label-border {
	border: 1px solid #7631be;
	z-index: 15; 
}


