$select-height: 2.5rem;
$select-container-height: $select-height + 0.5rem;
$select-arrow-box-width: 2.5rem;

.pragma-select {
  position: relative;
  display: block;
  height: $select-container-height;
  width: 100%;
  line-height: 2rem;
  border-radius: $default-border-radius;
  // Margin minus to apply shadow effect on focus. Can't target parent to apply shadow on focus
  margin: -$default-margin;

  select {
    @include ignore-device-rendering();
    outline: 0;
    box-shadow: none;
    background-color: var(--color-ui-4);
    border: $default-border-width-thin solid var(--color-ui-2-50);
    border-radius: $default-border-radius;
    width: 100%;
    height: $select-height;
    box-sizing: border-box;
    padding-left: 0.5rem;
    margin: $default-margin;
    color: var(--color-ui-1);
  }

  select:hover {
    box-shadow: 0 0 0 0.25rem var(--color-ui-2-30);
  }

  select:focus {
    box-shadow: 0 0 0 0.25rem var(--color-focus-80);
    border-color: var(--color-focus);
  }
}

.pragma-select:before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  margin-top: $default-margin;
  margin-bottom: $default-margin;
  margin-right: -0.25rem;
  pointer-events: none;
  width: $select-arrow-box-width;
  border: $default-border-width-thin solid var(--color-ui-2-50);
  border-top-right-radius: $default-border-radius;
  border-bottom-right-radius: $default-border-radius;
}

.pragma-select:hover:before {
  border-color: var(--color-ui-2);
}

.pragma-select:after {
  content: '\25BC';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  margin: 0.6rem;
  pointer-events: none;
  transform: scale(1, 0.5);
}
