:host {
  /**
   * @prop --background: Background of the segment button
   * @prop --background-checked: Background of the checked segment button
   *
   * @prop --background-hover: Background of the segment button on hover
   * @prop --background-focused: Background of the segment button when focused with the tab key
   *
   * @prop --background-hover-opacity: Opacity of the segment button background on hover
   * @prop --background-focused-opacity: Opacity of the segment button background when focused with the tab key
   *
   * @prop --color: Color of the segment button
   * @prop --color-checked: Color of the checked segment button
   * @prop --color-hover: Color of the segment button on hover
   * @prop --color-focused: Color of the segment button when focused with the tab key
   *
   * @prop --border-radius: Radius of the segment button border
   * @prop --border-color: Color of the segment button border
   * @prop --border-style: Style of the segment button border
   * @prop --border-width: Width of the segment button border
   *
   * @prop --margin-top: Top margin of the segment button
   * @prop --margin-end: Right margin if direction is left-to-right, and left margin if direction is right-to-left of the segment button
   * @prop --margin-bottom: Bottom margin of the segment button
   * @prop --margin-start: Left margin if direction is left-to-right, and right margin if direction is right-to-left of the segment button
   *
   * @prop --padding-top: Top padding of the segment button
   * @prop --padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the segment button
   * @prop --padding-bottom: Bottom padding of the segment button
   * @prop --padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the segment button
   *
   * @prop --transition: Transition of the segment button
   *
   * @prop --indicator-height: Height of the indicator for the checked segment button
   * @prop --indicator-box-shadow: Box shadow on the indicator for the checked segment button
   * @prop --indicator-color: Color of the indicator for the checked segment button
   * @prop --indicator-transition: Transition of the indicator for the checked segment button
   * @prop --indicator-transform: Transform of the indicator for the checked segment button
   */
  --color: initial;
  --color-hover: var(--color);
  --color-checked: var(--color);
  --color-disabled: var(--color);
  --padding-start: 0;
  --padding-end: 0;
  --padding-top: 0;
  --padding-bottom: 0;
  border-radius: var(--border-radius);
  display: flex;
  position: relative;
  flex: 1 1 auto;
  flex-direction: column;
  height: auto;
  background: var(--background);
  color: var(--color);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-kerning: none;
  cursor: pointer;
}

.button-native {
  border-radius: 0;
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-decoration: inherit;
  text-indent: inherit;
  text-overflow: inherit;
  text-transform: inherit;
  text-align: inherit;
  white-space: inherit;
  color: inherit;
  margin-left: var(--margin-start);
  margin-right: var(--margin-end);
  margin-top: var(--margin-top);
  margin-bottom: var(--margin-bottom);
  padding-left: var(--padding-start);
  padding-right: var(--padding-end);
  padding-top: var(--padding-top);
  padding-bottom: var(--padding-bottom);
  transform: translate3d(0,  0,  0);
  display: flex;
  position: relative;
  flex-direction: inherit;
  flex-grow: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: inherit;
  max-width: inherit;
  height: auto;
  min-height: inherit;
  max-height: inherit;
  transition: 300ms;
  border: none;
  outline: none;
  background: transparent;
  contain: content;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
  .button-native {
    margin-left: unset;
    margin-right: unset;
    -webkit-margin-start: var(--margin-start);
    margin-inline-start: var(--margin-start);
    -webkit-margin-end: var(--margin-end);
    margin-inline-end: var(--margin-end);
  }
}
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
  .button-native {
    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);
  }
}

.button-native::after {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  position: absolute;
  content: "";
  opacity: 0;
  transition: 300ms;
}

.button-inner {
  display: flex;
  position: relative;
  flex-flow: inherit;
  align-items: center;
  justify-content: center;
  text-transform: capitalize;
  width: 100%;
  height: 100%;
  z-index: 1;
  transition: 300ms;
}

:host(.segment-button-checked) {
  background: var(--background-checked);
  color: var(--color-checked);
}

:host(.segment-button-disabled) {
  cursor: default;
  pointer-events: none;
}

:host(.gasco-focused) .button-native {
  color: var(--color-focused);
  transition: 300ms;
}
:host(.gasco-focused) .button-native::after {
  background: var(--background-focused);
  opacity: var(--background-focused-opacity);
}

:host(:focus) {
  outline: none;
}

@media (any-hover: hover) {
  :host(:hover) .button-native {
    color: var(--color-hover);
  }
  :host(:hover) .button-native::after {
    background: var(--background-hover);
    opacity: var(--background-hover-opacity);
  }

  :host(.segment-button-checked:hover) .button-native {
    color: var(--color-checked);
  }
}
::slotted(ion-icon) {
  flex-shrink: 0;
  order: -1;
  pointer-events: none;
}

::slotted(gasco-label) {
  display: block;
  align-self: center;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
  pointer-events: none;
}

:host(.segment-button-layout-icon-top) .button-native {
  flex-direction: column;
}

:host(.segment-button-layout-icon-start) .button-native {
  flex-direction: row;
}

:host(.segment-button-layout-icon-end) .button-native {
  flex-direction: row-reverse;
}

:host(.segment-button-layout-icon-bottom) .button-native {
  flex-direction: column-reverse;
}

:host(.segment-button-layout-icon-hide) ::slotted(ion-icon) {
  display: none;
}

:host(.segment-button-layout-label-hide) ::slotted(gasco-label) {
  display: none;
}

.segment-button-indicator {
  transform-origin: left;
  position: absolute;
  opacity: 0;
  box-sizing: border-box;
  will-change: transform, opacity;
  pointer-events: none;
  transition: 300ms;
}

.segment-button-indicator-background {
  width: 100%;
  height: var(--indicator-height);
  transform: var(--indicator-transform);
  box-shadow: var(--indicator-box-shadow);
  pointer-events: none;
  transition: 300ms;
}

.segment-button-indicator-animated {
  transition: var(--indicator-transition);
}

:host(.segment-button-checked) .segment-button-indicator {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .segment-button-indicator-background {
    transform: none;
  }

  .segment-button-indicator-animated {
    transition: none;
  }
}
:host {
  --background: none;
  --background-checked: none;
  --background-hover: var(--color-checked);
  --background-focused: var(--color-checked);
  --background-activated-opacity: 0;
  --background-focused-opacity: .12;
  --background-hover-opacity: .04;
  --color: #4D4D4D;
  --color-checked: var(--gasco-color-primary, #00A3E0);
  --indicator-box-shadow: none;
  --indicator-color: var(--color-checked);
  --indicator-height: 3px;
  --indicator-transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --indicator-transform: none;
  --padding-top: 0;
  --padding-end: 16px;
  --padding-bottom: 0;
  --padding-start: 16px;
  --transition: color 0.15s linear 0s, opacity 0.15s linear 0s;
  min-width: 90px;
  max-width: 360px;
  min-height: 48px;
  border-width: var(--border-width);
  border-style: var(--border-style);
  border-color: var(--border-color);
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

:host(.segment-button-disabled) {
  opacity: 0.3;
}

:host(.in-segment-color) {
  background: none;
  color: #4D4D4D;
  transition: 300ms;
}

:host(.in-segment-color) .segment-button-indicator-background {
  background: var(--gasco-color-base);
}

:host(.in-segment-color.segment-button-checked) .button-native {
  color: var(--gasco-color-base);
}

:host(.in-segment-color.gasco-focused) .button-native::after {
  background: var(--gasco-color-base);
}

:host(.in-segment-color:focus) {
  outline: 2px solid #4D4D4D;
  border-radius: 2px;
}

@media (any-hover: hover) {
  :host(.in-segment-color:hover) .button-native {
    color: #4D4D4D;
  }

  :host(.in-segment-color.segment-button-checked:hover) .button-native {
    color: var(--gasco-color-base);
  }

  :host(.in-segment.in-segment-color:hover) ::slotted(gasco-label) {
    color: var(--gasco-color-base);
  }
  :host(.in-segment.in-segment-color:hover) .button-inner {
    color: var(--gasco-color-base);
  }
  :host(.in-segment.in-segment-color:hover) .segment-button-indicator {
    opacity: 1;
  }
  :host(.in-segment.in-segment-color:hover) .segment-button-indicator .segment-button-indicator-background {
    background: var(--gasco-color-base);
  }
}
:host(.in-toolbar:not(.in-segment-color)) {
  --background: var(--gasco-toolbar-segment-background, none);
  --background-checked: var(--gasco-toolbar-segment-background-checked, none);
  --color: var(--gasco-toolbar-segment-color, #4D4D4D);
  --color-checked: var(--gasco-toolbar-segment-color-checked, var(--gasco-color-primary, #00A3E0));
  --indicator-color: var(--gasco-toolbar-segment-color-checked, var(--color-checked));
}

:host(.in-toolbar-color:not(.in-segment-color)) .button-native {
  color: rgba(var(--gasco-color-contrast-rgb), 0.6);
}

:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native {
  color: var(--gasco-color-contrast);
}

@media (any-hover: hover) {
  :host(.in-toolbar-color:not(.in-segment-color)) .button-native::after {
    background: var(--gasco-color-contrast);
  }
}
::slotted(gasco-icon) {
  margin-top: 12px;
  margin-bottom: 12px;
  font-size: 24px;
}
::slotted(gasco-label) {
  margin-top: 12px;
  margin-bottom: 12px;
}
:host(.segment-button-layout-icon-top) ::slotted(gasco-label),
:host(.segment-button-layout-icon-bottom) ::slotted(gasco-icon) {
  margin-top: 0;
}
:host(.segment-button-layout-icon-top) ::slotted(gasco-icon),
:host(.segment-button-layout-icon-bottom) ::slotted(gasco-label) {
  margin-bottom: 0;
}
:host(.segment-button-layout-icon-start) ::slotted(gasco-label) {
  margin-left: 8px;
  margin-right: 0;
}
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
  :host(.segment-button-layout-icon-start) ::slotted(gasco-label) {
    margin-left: unset;
    margin-right: unset;
    -webkit-margin-start: 8px;
    margin-inline-start: 8px;
    -webkit-margin-end: 0;
    margin-inline-end: 0;
  }
}

:host(.segment-button-layout-icon-end) ::slotted(gasco-label) {
  margin-left: 0;
  margin-right: 8px;
}
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
  :host(.segment-button-layout-icon-end) ::slotted(gasco-label) {
    margin-left: unset;
    margin-right: unset;
    -webkit-margin-start: 0;
    margin-inline-start: 0;
    -webkit-margin-end: 8px;
    margin-inline-end: 8px;
  }
}

:host(.segment-button-has-icon-only) ::slotted(gasco-icon) {
  margin-top: 12px;
  margin-bottom: 12px;
}
:host(.segment-button-has-label-only) ::slotted(gasco-label) {
  margin-top: 12px;
  margin-bottom: 12px;
}
.segment-button-indicator {
  left: 0;
  right: 0;
  bottom: -1px;
}

.segment-button-indicator-background {
  transition: 300ms;
  background: var(--indicator-color);
}

:host(.in-toolbar:not(.in-segment-color)) .segment-button-indicator-background {
  background: var(--gasco-toolbar-segment-indicator-color, var(--indicator-color));
}

:host(.in-toolbar-color:not(.in-segment-color)) .segment-button-indicator-background {
  background: var(--gasco-color-contrast);
}

@media only screen and (max-width: 480px) {
  :host(.segment-button-has-label-only) ::slotted(gasco-label) {
    font-size: 10px;
    line-height: 24px;
  }
}