@import '@vtmn/css-design-tokens/src/base-colors';
@import '@vtmn/css-design-tokens/src/themes/default';
@import '@vtmn/css-design-tokens/src/typography';
@import '@vtmn/css-design-tokens/src/opacities';
@import '@vtmn/css-design-tokens/src/transitions';
@import '@vtmn/css-design-tokens/src/radius';

.vtmn-select_container {
  font-family: var(--vtmn-typo_font-family);
  font-weight: var(--vtmn-typo_font-weight--normal);
  box-sizing: border-box;
  font-size: var(--vtmn-typo_text-2-font-size);
  line-height: var(--vtmn-typo_text-2-line-height);
  color: var(--vtmn-semantic-color_content-primary);
  inline-size: min-content;
  white-space: nowrap;
}

.vtmn-select_container > label {
  margin-block-end: rem(4px);
  display: inline-block;
  inline-size: fit-content;
}

.vtmn-select_container select {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  margin: 0;
  line-height: inherit;
  appearance: none;
  padding-block: rem(12px);
  padding-inline-start: rem(12px);
  padding-inline-end: rem(40px);
  display: block;
  box-shadow: inset 0 0 0 rem(1px) var(--vtmn-semantic-color_border-inactive);
  border-radius: var(--vtmn-radius_100);
  block-size: rem(48px);
  min-inline-size: 100%;
  inline-size: min-content;
  background-color: var(--vtmn-semantic-color_background-primary);
  cursor: pointer;
  border: 0;
  transition: var(--vtmn-transition_focus-visible);
}

.vtmn-select--no-border select {
  box-shadow: inset 0 0 0 rem(1px) transparent;
}

.vtmn-select_container::before {
  content: '';
  mask: url("data:image/svg+xml;charset=utf-8, <svg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='m8 8.781 3.3-3.3.943.943L8 10.667 3.757 6.424l.943-.943 3.3 3.3z'/></svg>");
  display: block;
  position: relative;
  float: right;
  inset-block-start: rem(40px);
  inset-inline-end: rem(12px);
  inline-size: rem(24px);
  block-size: rem(24px);
  pointer-events: none;
  background-color: var(--vtmn-semantic-color_content-primary);
}

.vtmn-select_container .vtmn-select_error-text {
  font-size: var(--vtmn-typo_text-3-font-size);
  line-height: var(--vtmn-typo_text-3-line-height);
  margin-block-start: rem(4px);
  display: inline-block;
  white-space: normal;
}

.vtmn-select_container .vtmn-select_error-text::before {
  position: relative;
  content: '';
  mask: url("data:image/svg+xml;charset=utf-8, <svg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M1.333 8a6.667 6.667 0 1 0 13.333 0A6.667 6.667 0 0 0 1.333 8zm12 0A5.333 5.333 0 1 1 2.667 8a5.333 5.333 0 0 1 10.666 0zm-4.666 2v1.333H7.333V10h1.334zm0-1.333v-4H7.333v4h1.334z'/></svg>");
  mask-size: cover;
  display: inline-block;
  background-color: var(--vtmn-semantic-color_content-negative);
  block-size: rem(16px);
  inline-size: rem(16px);
  margin-inline-end: rem(5px);
  transform: translateY(rem(2px));
}

.vtmn-select_container select:not(:disabled):hover {
  color: var(--vtmn-semantic-color_content-primary);
}

.vtmn-select_container select:not(:disabled):active,
.vtmn-select_container select:not(:disabled):focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 rem(2px) var(--vtmn-semantic-color_border-active);
}

.vtmn-select_container select:disabled,
.vtmn-select_container select:disabled + label {
  opacity: var(--vtmn-opacity_disabled-state);
  cursor: not-allowed;
}

.vtmn-select_container select.vtmn-select--error {
  box-shadow: inset 0 0 0 rem(2px) var(--vtmn-semantic-color_border-negative);
}
