/* =============================================
   SMARTBUILD — Map Section (Карта проектов)
   Яндекс.Карты + кастомные маркеры и баллуны
   ============================================= */

.map {
  background-color: var(--color-alabaster);
  padding-bottom: 0;
}

/* ---- Header ---- */

.map__header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 0 var(--content-padding);
  margin-bottom: 60px;
}

.map__title {
  flex: 1;
  font-size: 54px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -2.7px;
  color: var(--color-dark);
}

.map__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-top: 14px;
}

.map__description {
  font-size: var(--body-size);
  font-weight: var(--body-weight);
  line-height: var(--body-line-height);
  letter-spacing: var(--body-letter-spacing);
  color: var(--color-dark);
  max-width: 435px;
}

/* Stats row */
.map__stats {
  display: flex;
  gap: 20px;
}

.map__stat {
  flex: 1;
  display: flex;
  gap: 20px;
  align-items: center;
}

.map__stat-number {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 40px;
  background-color: var(--color-yellow);
  border-radius: var(--radius-md);
  font-size: var(--h4-size);
  font-weight: var(--h4-weight);
  line-height: var(--h4-line-height);
  letter-spacing: var(--h4-letter-spacing);
  color: var(--color-dark);
  flex-shrink: 0;
}

.map__stat-label {
  font-size: var(--h5-size);
  font-weight: var(--h5-weight);
  line-height: var(--h5-line-height);
  letter-spacing: var(--h5-letter-spacing);
  color: var(--color-dark);
}

/* ---- Yandex Map container ---- */

.map__container {
  position: relative;
  width: 100%;
  height: 600px;
}

/* ---- Оверлей затемнения при открытом баллуне ---- */

.map__overlay {
  position: absolute;
  inset: 0;
  z-index: 2500;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.map__overlay--active {
  opacity: 1;
}

/* Баллун-пейн выше events-pane (3000), чтобы баллун был кликабелен */
.map__container [class*="ymaps"][class*="balloon-pane"] {
  z-index: 3100 !important;
}

/* ---- Кастомные маркеры (белые плашки как в Figma) ---- */

.map-marker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  width: max-content;
  background-color: #fff;
  border-radius: 20px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.map-marker:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.map-marker__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 16px;
  flex-shrink: 0;
}

.map-marker__icon svg {
  display: block;
  width: 13px;
  height: 16px;
}

.map-marker__text {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.36px;
  color: var(--color-dark);
}

/* ---- Баллун (карточка проекта по клику — дизайн Figma) ---- */

/* Скрываем стандартную обёртку баллуна Яндекс.Карт */
.map__container .ymaps-2-1-79-balloon,
.map__container [class*="ymaps"][class*="balloon"] {
  box-shadow: none !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

.map__container [class*="ymaps"][class*="balloon__layout"] {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.map__container [class*="ymaps"][class*="balloon__close"] {
  display: none !important;
}

.map__container [class*="ymaps"][class*="balloon__tail"] {
  display: none !important;
}

/* Карточка: full-bleed фото 435×350 с градиентным оверлеем */
.map-balloon {
  position: relative;
  width: 435px;
  height: 350px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  font-family: 'Manrope', sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* Фоновое фото на весь блок */
.map-balloon__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 0;
}

/* Градиентный оверлей: верх и низ затемнены */
.map-balloon__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 25%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 45%);
}

/* Верхняя строка: статус + крестик */
.map-balloon__top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

/* Статус-бейдж (тёмный bg + точка + текст) */
.map-balloon__status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 6px;
  background: var(--color-graphite);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.16px;
  color: var(--color-alabaster);
  white-space: nowrap;
}

.map-balloon__status-dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.map-balloon__status--built .map-balloon__status-dot {
  background: #02AD0B;
}

.map-balloon__status--building .map-balloon__status-dot {
  background: var(--color-yellow);
}

/* Кнопка закрытия — тёмный круг с ✕ */
.map-balloon__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--color-graphite);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}

.map-balloon__close svg {
  display: block;
  width: 10px;
  height: 10px;
}

.map-balloon__close:hover {
  background: var(--color-dark);
}

/* Нижняя строка: название + локация */
.map-balloon__bottom {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-balloon__title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.56px;
  color: #fff;
  margin: 0;
}

.map-balloon__location {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.18px;
  color: #ccc;
}

.map-balloon__loc-icon {
  display: block;
  width: 13px;
  height: 16px;
  flex-shrink: 0;
}
