:host {
  /**
   * @prop --padding-top: Top padding of the select
   * @prop --padding-end: Right padding if direction is left-to-right, and left padding
   *                      if direction is right-to-left of the select
   * @prop --padding-bottom: Bottom padding of the select
   * @prop --padding-start: Left padding if direction is left-to-right, and right padding
   *                        if direction is right-to-left of the select
   *
   * @prop --placeholder-color: Color of the select placeholder text
   * @prop --placeholder-opacity: Opacity of the select placeholder text
   *
   * @prop --border-radius: Border radius of the select button
   * @prop --background: Background of the select button
   * @prop --background-opacity: Background opacity of the select button
   * @prop --background-active: Background of the select button when pressed.
   * @prop --background-active-opacity: Opacity of the select button when pressed
   * @prop --background-focus: Background of the select button when focused with the tab key
   * @prop --background-focus-opacity: Opacity of the select button when focused with the tab key
   * @prop --background-hover: Background of the select button on hover
   * @prop --background-hover-opacity: Opacity of the select button of the background on hover
   * @prop --color: Text color of the select button
   * @prop --color-active: Text color of the select button when pressed
   * @prop --color-focus: Text color of the select button when focused with the tab key
   * @prop --color-hover: Text color of the select button when hover
   */
  --placeholder-color: initial;
  --padding-top: 10px;
  --padding-end: 0;
  --padding-bottom: 10px;
  --padding-start: var(--bkkr-spacer, 16px);
  --button-border-radius: 12px;
  --button-background: transparent;
  --button-background-active: var(--color, currentColor);
  --button-background-focus: var(--color, currentColor);
  --button-background-hover: var(--color, currentColor);
  --button-background-opacity: 1;
  --button-background-active-opacity: 0.12;
  --button-background-focus-opacity: 0.04;
  --button-background-hover-opacity: 0.04;
  --button-color-active: var(--color, currentColor);
  --button-color-focus: var(--color, currentColor);
  --button-color-hover: var(--color, currentColor);
  display: flex;
  position: relative;
  flex: 1;
  align-items: center;
  width: auto;
  font-family: var(--bkkr-font-family);
  touch-action: manipulation;
  z-index: 2;
}

.select-placeholder {
  transition: var(--placeholder-transition, none);
  transition-delay: var(--placeholder-transition-delay, none);
  color: var(--placeholder-color);
  opacity: var(--placeholder-opacity, 0.5);
}

label {
  left: 0;
  top: 0;
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  margin-bottom: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  cursor: pointer;
  appearance: none;
  display: flex;
  align-items: center;
  opacity: 0;
}
[dir=rtl] label, :host-context([dir=rtl]) label {
  left: unset;
  right: unset;
  right: 0;
}

label::-moz-focus-inner {
  border: 0;
}

.select-native {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  appearance: none;
}

.select-text {
  padding-left: var(--padding-start);
  padding-right: var(--padding-end);
  padding-top: var(--padding-top);
  padding-bottom: var(--padding-bottom);
  flex: 1;
  min-width: 16px;
  min-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
  .select-text {
    padding-left: unset;
    padding-right: unset;
    -webkit-padding-start: var(--padding-start);
    padding-inline-start: var(--padding-start);
    -webkit-padding-end: var(--padding-end);
    padding-inline-end: var(--padding-end);
  }
}

:host(.has-focus) .select-toggle-button bkkr-icon {
  transform: rotate(180deg);
  color: var(--highlight-background);
}

:host(.select-disabled) {
  opacity: 0.4;
  pointer-events: none;
}

.select-spinner {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

bkkr-spinner {
  width: 16px;
  height: 16px;
}

:host-context(.item-label-stacked) .select-spinner,
:host-context(.item-label-floating) .select-spinner {
  margin-top: -18px;
}
:host(.in-item) {
  position: static;
  width: 100%;
  max-height: 100%;
}

.select-toggle-button {
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-radius: var(--button-border-radius);
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-decoration: inherit;
  text-indent: inherit;
  text-overflow: inherit;
  text-transform: inherit;
  white-space: inherit;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  display: flex;
  position: relative;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  width: 41px;
  height: 41px;
  border: 0;
  outline: none;
  background: var(--button-background);
  color: var(--button-color, currentColor);
  contain: layout style;
  cursor: pointer;
  overflow: var(--overflow, initial);
  z-index: 0;
  box-sizing: border-box;
  appearance: none;
}

:host-context(.item-fill-none.item-label-stacked) .select-toggle-button,
:host-context(.item-fill-none.item-label-floating) .select-toggle-button,
:host-context(.item-fill-outline.item-label-stacked) .select-toggle-button,
:host-context(.item-fill-solid.item-label-stacked) .select-toggle-button {
  transform: translateY(-25%);
}

:host-context(.item:not(.item-label)) .select-toggle-button {
  margin-top: 10px;
  margin-bottom: 10px;
}
.select-toggle-button::after {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  position: absolute;
  content: "";
  opacity: 0;
  border-radius: var(--button-border-radius);
  transition: 0.2s opacity cubic-bezier(0.32, 0.72, 0, 1);
}

@media (any-hover: hover) {
  :host(:hover) .select-toggle-button {
    color: var(--button-color-hover);
  }
  :host(:hover) .select-toggle-button::after {
    background: var(--button-background-hover);
    opacity: var(--button-background-hover-opacity);
  }
}
:host(:focus) .select-toggle-button,
:host(.state-focused) .select-toggle-button {
  color: var(--button-color-focus);
}
:host(:focus) .select-toggle-button::after,
:host(.state-focused) .select-toggle-button::after {
  background: var(--button-background-focus);
  opacity: var(--button-background-focus-opacity);
}

:host(:active) .select-toggle-button,
:host(.state-activated) .select-toggle-button {
  color: var(--button-color-active);
}
:host(:active) .select-toggle-button::after,
:host(.state-activated) .select-toggle-button::after {
  background: var(--button-background-active);
  opacity: var(--button-background-active-opacity);
}

:host(:disabled),
:host(.state-disabled) {
  cursor: default;
  opacity: 0.5;
  pointer-events: none;
}