.offices {
  min-width: 100% !important;
  display: flex;
  background-color: #eeeff3;
  font-family: 'PT Sans', Arial, sans-serif;
  color: #222;
  height: 100vh; /* ФИКС: вся высота экрана */
  min-height: 600px; /* ФИКС: минимум для стабильности */
  flex-direction: row; /* По умолчанию row */
  overflow: hidden; /* ФИКС: без переполнения */
}

#offices-map {
  flex: 1 0 50%;
  width: 50%;
  min-height: 400px; /* ФИКС: минимум для карты */
}

.offices-contacts {
  flex: 1 0 50%;
  padding: 12px 24px 0;
  box-shadow: -5px 1px 6px -3px rgba(34, 34, 34, 0.2);
  z-index: 5;
  overflow-y: auto; /* ФИКС: скролл внутри, если контента много */
}

/* МОБИЛЬНАЯ ВЕРСИЯ */
@media (max-width: 770px) {
  .offices {
    flex-direction: column;
  }

  #offices-map {
    flex: 0 0 auto; /* ФИКС: фиксированная высота, не растягивается */
    height: 50vh; /* ФИКС: половина экрана для карты */
    min-height: 300px;
    width: 100%;
  }

  .offices-contacts {
    flex: 1; /* ФИКС: занимает остаток высоты */
    box-shadow: 0 -5px 6px -3px rgba(34, 34, 34, 0.2);
    overflow-y: auto; /* Скролл для списка */
  }
}

/* Остальные стили без изменений */
.offices-header {
  font-size: 24px;
  margin-bottom: 24px;
}

.offices-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 992px) {
  .offices-filters {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.office-filter {
  position: relative;
  background-color: #fff;
  cursor: pointer;
}

.office-filter:hover {
  background-color: #f5f6fa;
}

.region-selected,
.office-type-selected {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.region-selected button,
.office-type-selected button {
  padding: 11px 18px;
  font-size: 18px;
  border: none;
  color: #aa0020;
  cursor: pointer;
  background-color: #fff !important;
}

.region-selected button:hover,
.office-type-selected button:hover,
.region-selected button:focus,
.office-type-selected button:focus {
  background-color: transparent;
  color: #aa0020;
}

.office-filter .dropdown-icon {
  margin-right: 12px;
}

.offices-types-list,
.regions-list {
  position: absolute;
  max-height: 245px;
  padding: 0;
  background-color: #fff;
  left: 0;
  right: 0;
  opacity: 0;
  list-style: none;
  user-select: none;
  pointer-events: none;
  cursor: none;
  overflow-y: auto;
}

.offices-types-list li,
.regions-list li {
  box-sizing: border-box;
  padding: 12px 18px;
  border-bottom: 1px solid rgb(238, 239, 243);
}

.offices-types-list li:hover,
.regions-list li:hover {
  background-color: #f5f6fa;
}

.region-filter.clicked .regions-list,
.office-type-filter.clicked .offices-types-list {
  opacity: 1;
  user-select: auto;
  pointer-events: auto;
  cursor: pointer;
}

.region-filter {
  z-index: 5;
}

.office-type-filter {
  z-index: 4;
}

.office-item.selected .office-details,
.office-item.selected .office-address {
  height: auto;
  opacity: 1;
  user-select: auto;
  pointer-events: auto;
}

.office-details,
.office-address {
  height: 0;
  opacity: 0;
  user-select: none;
  pointer-events: none;
  transition: all 150ms ease-in-out;
}

.office-item {
  padding: 18px 0;
  border-bottom: 1px solid #fff;
  cursor: pointer;
}

.office-item h4 {
  margin: 0;
}

.office-item-header {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  padding-right: 12px;
  align-items: center;
  transition: all 150ms ease-in-out;
}

.office-item.selected .office-item-header {
  margin-bottom: 12px;
}

.office-item.selected .dropdown-icon {
  transform: rotate(180deg);
  transition: all 150ms ease-in-out;
}

.office-item-title {
  font-size: 18px;
  transition: all 150ms ease-in-out;
}

.office-item.selected .office-item-title {
  font-size: 24px;
  color: #aa0020;
}

.office-address {
  display: flex;
  align-items: center;
  gap: 3px;
}

.office-item.selected .office-address {
  margin-bottom: 18px;
}

.office-address svg {
  flex: 0 0 14px;
}

.office-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 600px) {
  .office-details {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .office-phone {
    order: 1;
  }

  .office-fax {
    order: 2;
  }

  .office-mail {
    order: 3;
  }

  .office-site {
    order: 4;
  }
}

.detail-text,
.link-text {
  font-size: 17px;
  line-height: auto;
}

#offices-list .link-text {
  text-decoration: none;
  color: #aa0020;
}

/* Theme styles */
#offices-list {
  overflow-y: auto;
  height: 100%;
}

.office-item.active {
  background-color: #e0f7fa;
  border-color: #0095b6;
}
