:root {
  --select-border-radius: var(--control-height-m);
  --select-padding-left: 1em;
  --select-padding-right: 2em;
}

.root {
  position: relative;
  display: block;
  color: var(--color-text);
}

.root::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--select-padding-right);
  pointer-events: none;
  opacity: 0.5;
  background-image: url('./resources/arrow.svg');
  background-repeat: no-repeat;
  background-position: 0.5em center;
  background-size: 0.625em 0.4375em;
  border-top-right-radius: var(--select-border-radius);
  border-bottom-right-radius: var(--select-border-radius);
}

.select {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: var(--control-height-m);
  margin: 0;
  padding-left: var(--select-padding-left);
  padding-right: var(--select-padding-right);
  font: inherit;
  font-size: var(--typo-size-m);
  line-height: var(--typo-line-height-m);
  color: var(--color-text);
  background-color: #fff;
  border: 0;
  border-radius: var(--select-border-radius);
  cursor: pointer;
  outline: 0;
  border: 2px solid var(--color-borders);
  appearance: none;
  transition-duration: 0.2s;
  transition-property: border-color;
}

.select_invalid {
  border-color: var(--color-danger);
}

.select_disabled {
  opacity: 0.65;
  color: var(--color-text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

/* Focus */
.select:not(.select_invalid):not(.select_disabled):focus,
.select:not(.select_invalid):not(.select_disabled):hover {
  border-color: var(--color-primary);
  transition: none;
}

/* Hide the arrow in IE10 and up */
.select::-ms-expand {
  display: none;
}

/* <option> elements inherit styles from <select>, so reset them. */
.select option {
  color: var(--color-text);
  background: var(--control-background);
}

/* Media query to target Firefox only */
@-moz-document url-prefix() {
  /* Firefox hack to hide the arrow */
  .select {
    text-indent: 0.01px;
    text-overflow: '';
    padding-right: var(--select-padding-right);
  }
}
