/* ---------------------------------
-----  dimension variables --------
---------------------------------- */
/* ------  standard elements padding & margin  ------- */
/* spacing */
/**
**  Official Font sizes
------------------------------- */
/**
** Line-heights
------------------------------- */
/*
  Mixin to progressively-enhance :focus-visible, keeping :focus where not supported
  Add an arbitrary list of selectors into the arguments, and the styling in the block.
  I you pass no selectors to the mixin the parent ("ampersand") operator is used instead.

  There are two mixins:
  - focus-visible: a generic focus-visible, giving you "slots" to decide what to render for :focus, :focus reset, and :focus-visible
  - focus-visible-outline: a focus-visible, which only resets the outline. If you don't need more custom resets, use this one!

  Use focus-visible:
  The key thing here is checking which slot is being rendered.
  For example, you can reset box-shadow here, or anything else.

  @include focus-visible using ($slot) {
      @if $slot == focus {
          outline: 2px solid transparent;
          box-shadow: 0 0 0 4px blue;
      }
      @if $slot == focusReset {
          box-shadow: none;
      }
      @if $slot == focusVisible {
          box-shadow: 0 0 0 4px blue;
      }
  }

  Use focus-visible-outline:
  @include focus-visible-outline("button", "a[href]") {
      outline: 2px solid blue;
  }

  Resulting CSS (compressed):

  button:focus,
  a[href]:focus {
      outline: 2px solid blue;
  }

  button:focus:not(:focus-visible),
  a[href]:focus:not(:focus-visible) {
      outline: none;
  }
  button:focus-visible,
  a[href]:focus-visible {
      outline: 2px solid blue;
  }
*/
/**
@prop --ux-button-min-width: min-width of the default button
@prop --ux-button-min-height: min-height of the default button
@prop --ux-button-padding-horizontal: left and right padding
@prop --ux-button-padding-vertical: top and bottom padding
@prop --ux-button-bg-color: default background color
@prop --ux-button-border-color: default border color
@prop --ux-button-text-color: default text color
@prop --ux-button-shadow: default box-shadow style
@prop --ux-button-icon-size: size of the icon
@prop --ux-button-icon-size-large: icon size for icon-only buttons
@prop --ux-button-outline-width: button outline-width
@prop --ux-button-outline-offset: offset of the outline
@prop --ux-button-hover-bg-color: background color in hover state
@prop --ux-button-hover-border-color: border color in hover state
@prop --ux-button-hover-text-color: text color in hover state
@prop --ux-button-active-bg-color: background color in active state
@prop --ux-button-active-border-color: border color in active state
@prop --ux-button-active-text-color: text color in active state
@prop --ux-button-focus-bg-color: background color if the button has focus
@prop --ux-button-focus-border-color: border color if the button has focus
@prop --ux-button-focus-text-color: text color if the button has focus
@prop --ux-button-focus-shadow: box-shadow if the button has focus
@prop --ux-icon-button-width: width of the icon-only button
@prop --ux-icon-button-height: height of the icon-only button
@prop --ux-icon-button-height: height of the icon-only button
*/
:host {
  box-sizing: border-box;
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
  --button-border-left-width: var(--ux-button-border-width);
  --button-border-right-width: var(--ux-button-border-width);
}

button,
a {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--ux-font);
  font-weight: var(--ux-button-font-weight);
  font-size: var(--ux-button-font-size);
  color: var(--ux-button-text-color);
  line-height: 1.5em;
  background-color: var(--ux-button-bg-color);
  border: solid var(--ux-button-border-color);
  border-top-width: var(--ux-button-border-width);
  border-bottom-width: var(--ux-button-border-width);
  border-left-width: var(--button-border-left-width);
  border-right-width: var(--button-border-right-width);
  border-radius: 0;
  box-shadow: var(--ux-button-shadow);
  outline: var(--ux-button-outline-width) solid transparent;
  outline-offset: var(--ux-button-outline-offset);
  text-align: center;
  text-decoration: none;
  text-transform: var(--ux-button-text-transform);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  width: 100%;
  cursor: pointer;
  transition: var(--ux-button-transition);
  min-height: var(--ux-button-min-height);
  min-width: var(--ux-button-min-width);
  padding: 0 var(--ux-button-padding-horizontal);
  position: relative;
}
button:focus-visible:not(:hover),
a:focus-visible:not(:hover) {
  color: var(--ux-button-focus-text-color);
  outline-color: var(--ux-button-focus-border-color);
  background-color: var(--ux-button-focus-bg-color);
  box-shadow: var(--ux-button-focus-shadow);
}
button:not(:active):not(:disabled):hover,
a:not(:active):not(:disabled):hover {
  background: var(--ux-button-hover-bg-color);
  color: var(--ux-button-hover-text-color);
  border-color: var(--ux-button-hover-border-color);
}
button:active, button:active:hover,
a:active,
a:active:hover {
  background: var(--ux-button-active-bg-color);
  color: var(--ux-button-active-text-color);
  border-color: var(--ux-button-active-border-color);
  box-shadow: none;
}
button::before,
a::before {
  inset: 0 0 0 0;
  position: absolute;
  background: transparent;
  content: "";
}

a {
  width: auto;
}

ux-icon {
  display: inline;
  font-size: var(--ux-button-icon-size);
  height: var(--ux-button-icon-size);
  color: var(--ux-button-icon-color, currentColor);
  fill: currentColor;
  transform: translateY(-1px);
}

:host([variant=primary]) button,
:host([variant=primary]) a {
  background-color: var(--ux-button-primary-bg-color);
  border-color: var(--ux-button-primary-border-color);
  color: var(--ux-button-primary-text-color);
}
:host([variant=primary]) button:focus-visible:not(:hover),
:host([variant=primary]) a:focus-visible:not(:hover) {
  color: var(--ux-button-primary-focus-text-color);
  outline-color: var(--ux-button-primary-focus-border-color);
  background-color: var(--ux-button-primary-focus-bg-color);
  box-shadow: var(--ux-button-focus-shadow);
}
:host([variant=primary]) button:not(:active):not(:disabled):hover,
:host([variant=primary]) a:not(:active):not(:disabled):hover {
  color: var(--ux-button-primary-hover-text-color);
  border-color: var(--ux-button-primary-hover-border-color);
  background-color: var(--ux-button-primary-hover-bg-color);
  fill: var(--ux-button-primary-hover-text-color);
}
:host([variant=primary]) button:active, :host([variant=primary]) button:active:hover,
:host([variant=primary]) a:active,
:host([variant=primary]) a:active:hover {
  color: var(--ux-buttonprimary-active-text-color);
  border-color: var(--ux-button-primary-active-border-color);
  background-color: var(--ux-button-primary-active-bg-color);
}
:host([variant=primary]) button:not(:disabled):active::before,
:host([variant=primary]) a:not(:disabled):active::before {
  background-color: var(--ux-button-primary-active-bg-alt-color);
}
:host([variant=primary]) button:disabled,
:host([variant=primary]) a:disabled {
  background-color: var(--ux-button-primary-disabled-bg-color);
  border-color: var(--ux-button-primary-disabled-border-color);
  color: var(--ux-button-primary-disabled-text-color);
}

:host([variant=no-border]) {
  --ux-button-shadow: none;
}
:host([variant=no-border]) button,
:host([variant=no-border]) a {
  border: 0;
  padding-left: 0;
  padding-right: 0;
}
:host([variant=no-border]) button:active,
:host([variant=no-border]) a:active {
  color: var(--ux-button-text-color);
  background-color: var(--ux-button-bg-color);
}
:host([variant=no-border]) button:not(:active, .ux-button--disabled):hover,
:host([variant=no-border]) a:not(:active, .ux-button--disabled):hover {
  background-color: var(--ux-button-bg-color);
  color: var(--ux-button-text-color);
}
:host([variant=no-border]) button:not(:active, .ux-button--disabled):hover ux-icon,
:host([variant=no-border]) a:not(:active, .ux-button--disabled):hover ux-icon {
  fill: var(--ux-button-icon-color, #bbd03a);
}

:host([disabled]:not([disabled=false])) {
  pointer-events: none;
}
:host([disabled]:not([disabled=false])) button,
:host([disabled]:not([disabled=false])) a {
  font-weight: var(--ux-button-disabled-font-weight);
  opacity: var(--ux-button-disabled-opacity);
  box-shadow: none;
}

:host([selected]:not([selected=false])) button,
:host([selected]:not([selected=false])) button:disabled {
  background: var(--ux-button-selected-bg-color);
  border-color: var(--ux-button-selected-border-color);
  box-shadow: var(--ux-button-selected-shadow);
  color: var(--ux-button-selected-text-color);
  opacity: 1;
}
:host([selected]:not([selected=false])):host([variant=primary]) button,
:host([selected]:not([selected=false])):host([variant=primary]) button:disabled {
  background: var(--ux-button-primary-selected-bg-color);
  border-color: var(--ux-button-primary-selected-border-color);
  color: var(--ux-button-primary-selected-text-color);
  opacity: 1;
}

:host([size=icon]):host([iconplacement=start]) .ux-button__icon, :host([size=icon]):host([iconplacement=end]) .ux-button__icon {
  margin-left: 0;
  margin-right: 0;
}
:host([size=icon]) button,
:host([size=icon]) a {
  min-width: var(--ux-icon-button-width);
  min-height: var(--ux-icon-button-height);
  width: var(--ux-icon-button-width);
  height: var(--ux-icon-button-height);
  margin: 0;
  padding: 0;
}
:host([size=icon]) button ux-icon,
:host([size=icon]) a ux-icon {
  height: var(--ux-button-icon-size-large);
  font-size: var(--ux-button-icon-size-large);
  margin-left: 0;
  margin-right: 0;
  top: 0;
  transform: none;
}

:host([iconPlacement=start]) button .ux-button__icon,
:host([iconPlacement=start]) a .ux-button__icon {
  margin-left: calc(var(--ux-button-icon-spacing) * -1);
  margin-right: var(--ux-button-icon-spacing);
}
:host([iconPlacement=start]):host([variant=no-border]) button .ux-button__icon,
:host([iconPlacement=start]):host([variant=no-border]) a .ux-button__icon {
  margin-left: 0;
}

:host([iconPlacement=end]) button,
:host([iconPlacement=end]) a {
  flex-direction: row-reverse;
}
:host([iconPlacement=end]) button .ux-button__icon,
:host([iconPlacement=end]) a .ux-button__icon {
  margin-left: var(--ux-button-icon-spacing);
  margin-right: calc(var(--ux-button-icon-spacing) * -1);
}
:host([iconPlacement=end]):host([variant=no-border]) button .ux-button__icon,
:host([iconPlacement=end]):host([variant=no-border]) a .ux-button__icon {
  margin-right: 0;
}

.ux-button__label {
  padding: var(--ux-button-padding-vertical) 0;
}
.ux-button__label--hidden {
  display: none;
}
.ux-button__label--truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ux-button__icon--custom {
  height: var(--ux-icon-height);
  width: var(--ux-icon-width);
}
.ux-button__icon--custom svg {
  height: 100%;
  width: 100%;
}
.ux-button__icon--none {
  display: none;
}

.ux-button__label-visibility--s {
  width: var(--ux-icon-button-width);
  height: var(--ux-icon-button-height);
  padding: 0;
  content: "Test";
}
.ux-button__label-visibility--s .ux-button__label {
  display: none;
}
@media only screen and (min-width: 576px) {
  .ux-button__label-visibility--s {
    width: 100%;
    min-width: var(--ux-button-min-width);
    min-height: var(--ux-button-min-height);
    padding: 0 var(--ux-button-padding-horizontal);
  }
}
@media only screen and (max-width: 575px) {
  .ux-button__label-visibility--s .ux-button__icon {
    margin: 0 !important;
  }
}
@media only screen and (min-width: 576px) {
  .ux-button__label-visibility--s .ux-button__label {
    display: block;
  }
}
.ux-button__label-visibility--m {
  width: var(--ux-icon-button-width);
  height: var(--ux-icon-button-height);
  padding: 0;
  content: "Test";
}
.ux-button__label-visibility--m .ux-button__label {
  display: none;
}
@media only screen and (min-width: 768px) {
  .ux-button__label-visibility--m {
    width: 100%;
    min-width: var(--ux-button-min-width);
    min-height: var(--ux-button-min-height);
    padding: 0 var(--ux-button-padding-horizontal);
  }
}
@media only screen and (max-width: 767px) {
  .ux-button__label-visibility--m .ux-button__icon {
    margin: 0 !important;
  }
}
@media only screen and (min-width: 768px) {
  .ux-button__label-visibility--m .ux-button__label {
    display: block;
  }
}
.ux-button__label-visibility--l {
  width: var(--ux-icon-button-width);
  height: var(--ux-icon-button-height);
  padding: 0;
  content: "Test";
}
.ux-button__label-visibility--l .ux-button__label {
  display: none;
}
@media only screen and (min-width: 1024px) {
  .ux-button__label-visibility--l {
    width: 100%;
    min-width: var(--ux-button-min-width);
    min-height: var(--ux-button-min-height);
    padding: 0 var(--ux-button-padding-horizontal);
  }
}
@media only screen and (max-width: 1023px) {
  .ux-button__label-visibility--l .ux-button__icon {
    margin: 0 !important;
  }
}
@media only screen and (min-width: 1024px) {
  .ux-button__label-visibility--l .ux-button__label {
    display: block;
  }
}
.ux-button__label-visibility--xl {
  width: var(--ux-icon-button-width);
  height: var(--ux-icon-button-height);
  padding: 0;
  content: "Test";
}
.ux-button__label-visibility--xl .ux-button__label {
  display: none;
}
@media only screen and (min-width: 1440px) {
  .ux-button__label-visibility--xl {
    width: 100%;
    min-width: var(--ux-button-min-width);
    min-height: var(--ux-button-min-height);
    padding: 0 var(--ux-button-padding-horizontal);
  }
}
@media only screen and (max-width: 1439px) {
  .ux-button__label-visibility--xl .ux-button__icon {
    margin: 0 !important;
  }
}
@media only screen and (min-width: 1440px) {
  .ux-button__label-visibility--xl .ux-button__label {
    display: block;
  }
}