*,
*::after,
*::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.ac-map__wrapper {
  height: 100%;
  width: 100%;
  max-height: 600px;
  max-width: 1200px;
  margin: 0 auto;
}

.mapboxgl-map {
  background-color: #9dc3de;
}

.ac-map__overlay {
  position: absolute;
  display: none;
  width: 100%;
  height: 100vh;
  z-index: -1;
  top: 0;
  left: 0;
  background: inherit;
  filter: blur(10px);
}

.ac-map--opened .ac-map__overlay {
  display: block;
}

.ac-map__popup {
  display: flex;
  position: fixed;
  flex-direction: column;
  right: -100%;
  top: 55px;
  height: calc(100% - 110px);
  width: calc(100% - 80px);
  padding: 0;
  background: rgba(3, 22, 36, 0.3);
  transition: 0.3s ease;
  z-index: 4;
}

.ac-map__trigger {
  width: 80px;
  height: 80px;
  padding: 7px 15px;
  cursor: pointer;
  user-select: none;
  position: fixed;
  top: 50%;
  right: 0%;
  transform: translateY(-50%);
  color: #ffffff;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  text-transform: uppercase;
}

.ac-map__trigger:before {
  content: '';
  display: block;
  background: url('./icon_map.svg') center no-repeat;
  width: 30px;
  height: 28px;
  margin: 0 auto;
  margin-bottom: 10px;
}

.ac-map__trigger:hover {
  background: rgba(0, 0, 0, 0.6);
}

.ac-map__trigger--opened {
  right: calc(100% - 80px);
  transition: 0.3s ease;
}

.ac-map__trigger.ac-map__trigger--loading {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.ac-map__close {
  padding: 10px;
  position: absolute;
  width: 21px;
  height: 21px;
  right: 6px;
  top: 6px;
  border: none;
  background: none;
  transition: 0.3s ease;
  cursor: pointer;
}

.ac-map__close:after {
  content: '';
  display: block;
  position: absolute;
  width: 12px;
  height: 3px;
  background-color: #ffffff;
  top: 50%;
  left: 50%;
  border-radius: 4px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.ac-map__close:before {
  content: '';
  display: block;
  position: absolute;
  width: 12px;
  height: 3px;
  background-color: #ffffff;
  top: 50%;
  left: 50%;
  border-radius: 4px;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.ac-map__close:hover {
  opacity: 0.8;
}

.ac-map__close--bottom:before,
.ac-map__close--bottom:after {
  background-color: #a2a19c;
}

.ac-map__popup.ac-map__popup--opened {
  right: 0;
}

.ac-map__map-box {
  width: 100%;
  height: 100%;
}

.ac-map__filters {
  margin: 17px auto 18px 20px;
  padding-right: 30px;
}

.ac-map__reset {
  float: right;
}

.ac-map__filter-button {
  padding: 13px 30px;
  color: #ffffff;
  text-align: center;
  text-transform: uppercase;
  font-size: 13.6px;
  margin-right: 28px;
  cursor: pointer;
  transition: 0.3s ease;
  border: 1px solid #ffffff;
  background-color: rgba(5, 14, 31, 0.4);
  background-repeat: no-repeat;
  background-position: 10px 50%;
  white-space: nowrap;
  padding: 0 20px 0 35px;
  height: 40px;
}

.ac-map__filter-button:hover {
  background-color: rgba(5, 14, 31, 0.6);
  border-color: #ffffff;
}

.ac-map__filter-button.ac-map__filter-button--disabled {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.4);
}

.ac-map__filter-button--disabled:hover {
  background-color: rgba(5, 14, 31, 0.35);
  border: 1px solid #ffffff;
}

.ac-map__filter-button:last-of-type {
  margin-right: 0;
  background-color: rgba(0, 0, 0, 0);
}

.ac-map__filter-button:last-of-type:hover {
  color: #dcdcdc;
}

.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip {
  border-top-color: #dfe0e4 !important;
}

.mapboxgl-popup-anchor-top .mapboxgl-popup-tip {
  border-bottom-color: #dfe0e4 !important;
}

.mapboxgl-popup-content {
  background-color: #dfe0e4;
  word-break: break-word;
  padding: 20px;
}

.ac-map__wrapper .mapboxgl-popup-content {
  background-color: #e6e6e5;
  border-radius: 0;
}

.mapboxgl-popup-close-button {
  font-size: 16px;
  line-height: 1;
  font-weight: bolder;
  right: 5px;
  top: 2px;
  color: #979797;
}

.marker-popup__title {
  text-transform: uppercase;
  line-height: 31px;
  color: #000000;
}

.ac-map__filter-button.ac-map__filter-button--reset {
  border: none;
  width: auto;
}

.marker-popup__field {
  display: inline-block;
}

.marker-popup__field--telephone,
.marker-popup__field--fax {
  display: flex;
}

.marker-popup__field--country {
  display: block;
  margin-bottom: 15px;
}

.marker-popup__field--telephone .marker-popup__field__title,
.marker-popup__field--fax .marker-popup__field__title,
.marker-popup__field__title {
  margin-right: 10px;
}

.marker-popup__fields-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #979797;
}

.marker-popup__fields-item:last-of-type {
  padding-bottom: 0;
  border-bottom: 0;
}

.marker-popup__fields-item__title {
  font-size: 10px;
  line-height: 14px;
  max-width: 109px;
  margin-right: 25px;
  color: #000000;
}

.marker-popup__fields-item__value,
.marker-popup__title {
  color: #000000;
  font-size: 17px;
  font-weight: bold;
}

.marker-popup__link {
  width: 100%;
  text-transform: uppercase;
  color: #169ed6;
  text-decoration: none;
  margin-top: 10px;
}

.marker-popup__link:hover {
  text-decoration: underline;
}

.mapboxgl-popup-tip {
  display: none;
}

@media (max-width: 1299px) {
  .ac-map__popup {
    width: calc(100% - 75px);
    height: 90vh;
  }

  .ac-map__trigger {
    width: 75px;
    height: 75px;
  }

  .ac-map__trigger--opened {
    right: calc(100% - 75px);
  }

  .ac-map__filters {
    overflow-x: scroll;
    width: 100%;
    margin: 17px 20px 0 20px;
    display: flex;
    padding-bottom: 13px;
  }

  .ac-map__close {
    border-top-left-radius: 50%;
    border-top-right-radius: 50%;
    background: rgba(3, 22, 36, 0.3);
    top: -24px;
    right: 20px;
    width: 30px;
    height: 24px;
    background: inherit;
  }

  .ac-map__close:before {
    top: 60%;
  }

  .ac-map__close:after {
    top: 60%;
  }
}

@media (max-width: 989px) {
  .ac-map__popup {
    width: calc(100% - 70px);
  }

  .ac-map__trigger {
    width: 70px;
    height: 70px;
  }

  .ac-map__trigger--opened {
    right: calc(100% - 70px);
  }

  .ac-map__trigger:before {
    margin-bottom: 5px;
  }

  .mapboxgl-popup-content--bottom {
    display: none;
  }
}

@media (max-width: 767px) {
  .ac-map__popup {
    width: 100%;
    height: 100vh;
    flex-flow: wrap;
    top: 0;
    transform: translate(0, 0);
  }

  .ac-map__trigger--opened {
    display: none;
  }

  .ac-map__filters {
    order: 2;
    margin: 17px 0 0 20px;
    padding-bottom: 5px;
  }

  .ac-map__map-box {
    height: calc(100% - 90px);
  }

  .mapboxgl-ctrl-top-right {
    top: 50px;
  }

  .ac-map__close {
    z-index: 1;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 0;
  }

  .ac-map__close:before {
    top: 50%;
  }

  .ac-map__close:after {
    top: 50%;
  }
}

.mapboxgl-popup-content--bottom {
  display: block;
  background-color: #dfe0e4;
  word-break: break-word;
  position: fixed;
  bottom: 90px;
  width: 100%;
  font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
  z-index: 2;
}
.mapboxgl-popup-content--bottom-wrap {
  padding: 20px 30px 44px 20px;
  position: relative;
}

.mapboxgl-popup-content--bottom .marker-popup {
  max-width: 400px;
  margin: auto;
}
