@import './sdesk.variables';

@mixin sdesk-label {
  position: relative;

  display: block;

  width: 100%;
  padding: 20px 0 4px;

  font-size: 12px;
  font-weight: 600;
  line-height: 1.33333;
  color: rgb(107 119 140);
}

@mixin sdesk-button {
  cursor: pointer;

  display: inline-flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: flex-start;

  max-width: 100%;
  height: 2.28571em;
  padding: 0 8px;

  font-size: inherit;
  font-weight: 500;
  font-style: normal;
  line-height: 2.28571em;
  white-space: nowrap;

  opacity: 1;
  border: none;
  border-radius: 3px;
  outline: none;

  transition: opacity 0.2s ease;

  &:disabled {
    cursor: default;
    opacity: 0.5;

    &:hover {
      opacity: 0.5;
    }
  }

  span {
    font-weight: 600;
    line-height: 1em;
  }

  .icon {
    padding-left: 12px;
  }

  &:hover {
    opacity: 0.7;
  }

  &.primary {
    color: rgb(255 255 255);
    background-color: var(--sdesk-content-background-color);
  }

  &.secondary {
    color: var(--color-gray-222);
    background-color: var(--color-gray-aaa);
  }

  &.basic {
    color: var(--default-color);
    background-color: var(--app-bg-color-l1);
    border: 1px solid var(--color-gray-888);
  }
}

@mixin sdesk-breadcrumbs {
  position: relative;

  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: flex-start;

  width: 100%;
  padding-bottom: 12px;

  .separator::after {
    content: '/';

    margin: 0;
    padding: 0 8px;

    font-size: 0.857143em;
    font-weight: 600;
    font-style: inherit;
    line-height: 1.33333;
    text-decoration: none;
  }

  .link:link,
  .link:visited {
    overflow: hidden;

    max-width: 160px;
    margin: 0;

    font-size: 0.857143em;
    font-weight: 600;
    font-style: inherit;
    line-height: 1.33333;
    color: var(--sdesk-link-text-color);
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@mixin sdesk-link-base($color: var(--sdesk-link-text-color)) {
  overflow: hidden;
  display: flex;

  margin: 0;
  padding: 24px;

  font-size: 1em;
  font-weight: 600;
  font-style: inherit;
  line-height: 1.14286;
  color: $color;
  letter-spacing: -0.003em;

  transition: background-color 0.2s ease;
}

@mixin sdesk-link($color: var(--sdesk-link-text-color), $hover-bg-color: var(--sdesk-link-hover-bg-color)) {
  @include sdesk-link-base($color);

  &:link,
  &:visited {
    @include sdesk-link-base($color);
  }

  &:hover {
    background-color: $hover-bg-color;
  }
}

@mixin sdesk-dropdown {
  @include viewport-laptop {
    max-width: calc(min(100vw, #{$contentMaxWidth}) - (2 * #{$pageContainerPaddingSide}));
  }

  @include viewport-mobile {
    max-width: calc(100vw - (2 * #{$pageContainerPaddingSideMobile}));
  }

  width: $contentMaxWidth;
  max-width: $contentMaxWidth - (2 * $pageContainerPaddingSide);
}
