#map-module {
  width: 100%;
  height: 100%;
}

#tabContent {
  width: 100%;
  height: 500px;
}

.form-select, .form-control {
  border-radius: 2px;
}

.form-select:focus, .form-control:focus {
  box-shadow: none;
  border-color: #3faeff;
}

.resetbutton {
  background-color: #3faeff;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 4px;
}

.resetbutton:disabled {
  opacity: 0.4;
}

.resetbutton:hover {
  background-color: #0b99ff;
}

.resetbutton:active {
  background-color: #0070c0;
}

input:not(:placeholder-shown) {
  background-color: rgb(231, 249, 255);
}

select:not(:has(option:first-child:checked)) {
  background-color: rgb(231, 249, 255);
}

.nav-link {
  color: #0094ff;
}

#list, #legend {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 340px;
  right: 20px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  z-index: 100;
  border-radius: 8px;
}

#map-module {
  position: relative;
  /*width: 100%;
  height: 100%;*/
  overflow: hidden;
}
#map-module .map-container {
  width: 100%;
  height: 100%;
}
#map-module .map-sidebar {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 20px;
  width: 300px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  z-index: 1000;
  border-radius: 8px;
}
.map-sidebar > *{
  font-family: VelaSans, sans-serif;
  font-size: 14px;
  margin-bottom: 1em;
}

.map-sidebar label{
  font-weight: bold;
  margin-bottom: 5px;
}

.ts-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
}

#searchResults {
    max-height: 200px;
    overflow-y: auto;
}

#map-module .sidebar-toggle {
  position: absolute;
  top: 25px;
  left: 35px;
  z-index: 1100;
  border: none;
  background-color: transparent;
  color: #3faeff;
  font-size: 40px;
  font-weight: bolder;
}

@media (max-width: 768px) {
  #map-module .map-sidebar {
    transform: translateX(-120%);
    width: 80%;
    max-width: none;
    padding-top: 4em;
  }
  #map-module .map-sidebar.open {
    transform: translateX(0);
  }

  #list, #legend {
    left: 20px;
    right: 20px;
    border-top:4em solid white;
  }
}

.icon-grid {
  display: grid;
  gap: 2px;
  justify-items: center;
  align-items: center;
  height: 20px;
  width: 22px;
  transform: translate(-50%, -50%) scale(1);
  z-index: 9999;
  pointer-events: auto;
}

.icon-grid img {
  height: 10px;
  width: 10px;
}

/* 1 child → 1×1, centered */
.icon-grid:has(> :only-child) {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

/* 2 children → 2×1, spaced evenly */
.icon-grid:has(> :nth-child(2):nth-last-child(1)) {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 1fr;
}

/* 3 children → 3×1, spaced evenly */
.icon-grid:has(> :nth-child(3):nth-last-child(1)) {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr;
}

/* 4 children → 2×2 */
.icon-grid:has(> :nth-child(4):nth-last-child(1)) {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

/* 5 children → 3×2 (last cell empty) */
.icon-grid:has(> :nth-child(5):nth-last-child(1)) {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

/* 6 children → 3×2 (full) */
.icon-grid:has(> :nth-child(6):nth-last-child(1)) {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.ymaps3x0--marker {
  pointer-events: none;
}

div.popover{
  z-index: 1110;
}

div.popover-body p {
  margin-bottom: 0.5rem;
}

div.popover-body a {
  text-decoration: none;
}

.with-icon {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4em;
  line-height: 1.4;
}

p.with-icon {
  margin-bottom: 1rem;
}

.with-icon::before {
  content: "";
  display: inline-block;
  background-repeat: no-repeat;
  background-size: contain;
  width: 1.5em;
  height: 1.5em;
  flex-shrink: 0;
}
.with-icon.mail-icon::before {
  background-image: url("mail_icon.png");
}
.with-icon.phone-icon::before {
  background-image: url("phone_icon.png");
}
.with-icon.web-icon::before {
  background-image: url("web_icon.png");
}
.with-icon.head-icon::before {
  background-image: url("head.png");
}
.with-icon.prod-icon::before {
  background-image: url("prod.png");
}
.with-icon.sales-icon::before {
  background-image: url("sales.png");
}
.with-icon.study-icon::before {
  background-image: url("study.png");
}
.with-icon.repres-icon::before {
  background-image: url("repres.png");
}
.with-icon.distrib-icon::before {
  background-image: url("distrib.png");
}
