* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Roboto Flex', Roboto, Arial, sans-serif;
}

.map-container {
  position: relative;
  width: 100%;
  max-width: 650px;
  margin: 0 auto;
}

#map {
  position: relative;
  width: 100%;
  height: 650px;
  min-height: 650px;
}

/* --- custom balloon (popup card), styled from Figma node 9801:3606 --- */

.popup-card {
  width: 250px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.popup-inner {
  background: #FFFDF6;
  border-radius: 8px;
  padding: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.16);
  margin-bottom: -12px;
  position: relative;
  z-index: 2;
}

.popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.popup-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.popup-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  color: #000;
  margin: 0;
}

.popup-region {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  color: rgba(0, 0, 0, 0.7);
  margin: 0;
}

.popup-close {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0.5;
  margin-top: 3px;
}
.popup-close:hover { opacity: 1; }
.popup-close svg { display: block; width: 100%; height: 100%; }

.popup-image {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
  border-radius: 2px;
}

.popup-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 0;
  background: #E43519;
  border: 1.5px solid #E43519;
  border-radius: 2px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.popup-button:hover {
  background: transparent;
  border-radius: 3px;
  color: #BC1A00;
}

.popup-tail {
  width: 24px;
  height: 24px;
  transform: rotate(45deg);
  background: #FFFDF6;
  margin-left: 36px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.08);
  z-index: 1;
}

/* --- cluster icon (grouped markers at low zoom), styled from Figma node 9801:3596 --- */
.cluster-number {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: #000;
}

/* strip default Yandex balloon chrome so only our card shows */
.ymaps-2-1-79-balloon,
.ymaps-2-1-79-balloon__content,
.ymaps-2-1-79-balloon__content > ymaps {
  padding: 0 !important;
  background: transparent !important;
}
.ymaps-2-1-79-balloon__tail,
.ymaps-2-1-79-balloon__close,
.ymaps-2-1-79-balloon__close-button {
  display: none !important;
}
