.offices-map {
  position: relative;

  &__holder {
    height: 670px;

    @include sm {
      height: 100vh;
      max-height: 515px;
    }
  }

  &__header {
    position: absolute;
    top: 40px;
    display: flex;
    justify-content: center;
    width: 100%;
    pointer-events: none;

    @include sm {
      top: 24px;
      display: block;
    }

    h2 {
      margin: 0;
      text-align: center;

      @include sm {
        width: 100%;
        font-size: 2.4rem;
        line-height: 3.2rem;
      }
    }
  }

  &__region-selector {
    font-family: var(--font-heading);;
    position: relative;
    font-size: 3.8rem;
    line-height: 4.5rem;
    margin-left: 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 1;

    &::before {
      content: '';
      display: block;
      position: absolute;
      top: -20px;
      left: -24px;
      bottom: -16px;
      right: -24px;
      background: $white;
      border-radius: 20px;
      box-shadow: 0 12px 24px 0 rgba(30,53,92,0.11), 0 2px 4px 0 rgba(30,53,92,0.31);
      opacity: 0;
      height: 82px;
      transition: all 0.3s ease-out;
      width: 320px;
      z-index: -1;

      @include sm {
        width: auto;
      }
    }

    &.js-open {
      pointer-events: all;

      a {
        opacity: 1;
        transition-delay: 150ms;
        color: $primary-color;

        &:first-child {
          color: $medium-color;
          font-size: 3.8rem;
          line-height: 4.5rem;

          &::after {
            transform: rotate(135deg);
            transform-origin: 5px 8px;
            border-color: $medium-color;
          }
        }

        &:hover {
          color: $medium-color;
        }
      }

      &::before {
        opacity: 1;
        height: calc(100% + 36px);
      }
    }

    a {
      position: relative;
      color: $medium-color;
      opacity: 0;
      transition: opacity 0.3s ease-out;
      width: 0;
      white-space: nowrap;
      font-size: 2.1rem;
      line-height: 2.9rem;
      margin-top: 0.8rem;

      @include sm {
        width: auto;
      }

      &:first-child {
        pointer-events: all;
        padding-right: 30px;
        opacity: 1;
        width: auto;
        color: $medium-color;
        font-size: 3.8rem;
        line-height: 4.5rem;
        margin: 0 0 5px;

        @include sm {
          padding-right: 22px;
          width: auto;
        }

        &::before {
          content: '';
          display: block;
          position: absolute;
          background-color: $white;
          opacity: 0.6;
          border-radius: 16px;
          width: calc(100% + 24px);
          height: 50px;
          top: -2px;
          left: -10px;
          z-index: -1;
        }

        &::after {
          content: '';
          position: absolute;
          display: block;
          right: 0;
          top: 14px;
          width: 13px;
          height: 13px;
          border-bottom: 2px solid  $medium-color;
          border-left: 2px solid  $medium-color;
          transform: rotate(-45deg);
          transition: transform 0.3s ease-out;

          @include sm {
            top: 12px;
            width: 10px;
            height: 10px;
          }
        }
      }
    }

    @include sm {
      font-size: 2.4rem;
      line-height: 3rem;
      margin: 8px auto;
      align-items: center;
      max-width: 215px;
    }
  }

  .office-map-marker {
    position: relative;
    width: 18px;
    height: 18px;
    background-color: $white;
    border: 7px solid $primary-color;
    border-radius: 50%;
    transition: transform 0.2s ease-out;

    &::after {
      content: '';
      display: block;
      position: absolute;
      width: 118px;
      height: 118px;
      top: -57px;
      left: -57px;
      background-color: $primary-color;
      border-radius: 50%;
      pointer-events: none;
      z-index: -1;
      opacity: 0;
      transform: scale(1);
      transition: all 0.3s ease-out;
    }

    &:hover {
      transform: scale(1.4);

      &::after {
        opacity: 0.5;
        transform: scale(0);
      }
    }
  }

  &__box-icon-link {
    color: $medium-color;
    font-size: 1.4rem;
    line-height: 2.1rem;
    font-weight: 700;

    &::before {
      content: '';
      display: inline-flex;
      width: 11px;
      height: 11px;
      margin-right: 5px;
    }

    &--phone::before {
      background: url("../assets/img/svg/phone.svg") no-repeat;
      background-size: 100%;
    }

    &--fax::before {
      background: url("../assets/img/svg/fax.svg") no-repeat;
      background-size: 100%;
    }

    &--external::before {
      background: url("../assets/img/svg/external-sec.svg") no-repeat;
      background-size: 100%;
    }
  }

  &__box-contacts {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .popup-tip-anchor {
    height: 0;
    position: absolute;
  }

  .popup-bubble-anchor {
    position: absolute;
    width: 100%;
    left: 0;
  }

  &__box {
    width: 324px;
    padding: 32px 32px 16px;
    background-color: $white;
    border-radius: 20px;
    border: 1px solid $gray-bluish;
    box-shadow: 0 12px 24px 0 rgba(30,53,92,0.11), 0 2px 4px 0 rgba(30,53,92,0.31);
    color: $primary-color;
    transform: translate(-50%,-50%) scale(0.4);
    transition: all 200ms ease-out;
    opacity: 0;
    font-family: var(--font-default);;

    @include sm {
      width: 275px;
      padding: 32px 24px 16px;
    }

    h3 {
      margin: 0;
      font-size: 2.6rem;
      font-weight: 700;
      line-height: 3rem;
      color: $primary-color;

      @include sm {
        font-size: 2.1rem;
        line-height: 2.9rem;
      }
    }

    p {
      margin: 0.8rem 0;
      font-size: 1.6rem;
      line-height: 1.5;
      color: $primary-color;

      @include sm {
        margin: 0.4rem 0;
        font-size: 1.4rem;
      }
    }

    .js-show & {
      transform: translate(-50%,-50%) scale(1);
      opacity: 1;
    }
  }

  &__box-contact {
    position: relative;
    display: flex;
    padding-top: 16px;
    margin-top: 16px;

    &::before {
      content: '';
      display: block;
      position: absolute;
      top: 0;
      left: -32px;
      right: -32px;
      border-bottom: 1px solid $gray-bluish;
    }

    &-info {
      padding-left: 16px;
    }

    &-info-label {
      font-size: 1.2rem;
      line-height: 1.5rem;
      letter-spacing: 2px;
      font-family: var(--font-heading);;
      text-transform: uppercase;
    }

    &-info-name {
      font-weight: 700;
      font-size: 1.6rem;
      line-height: 1.9rem;
      color: $primary-color;
      margin: 4px 0;
    }
  }

  &__box-contact-img {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;

    img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
    }
  }

  &__box-close {
    position: absolute;
    right: 8px;
    top: 8px;

    @include sm {
      right: 4px;
      top: 4px;
    }
  }
}
