@import "./variables.css";

/**
 * UNITS btn components
 *
 * ==================================
 * @base:   [.uc-btn]
 * ==================================
 * @parts:  [.uc-***]
 *          [.uc-***]
 * ==================================
 * @option: [._***]
 *          [._***]
 * ==================================
 */

.uc-btn {
  display: inline-block;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  background-color: var(--color-btn);
  border: 2px solid var(--color-btn);
  line-height: 1;
  outline: transparent;
  cursor: pointer;
  transition: all .35s var(--Hover_easeOut);

  @media (--small-viewport) {
    max-width: 240px;
    width: 100%;
  }

  &:hover {
    background-color: var(--color-btn-hover);
    border: 2px solid var(--color-btn-hover);
  }

  & + .uc-btn {
    margin: 0 0 0 16px;

    @media (--small-viewport) {
      margin: 16px 8px 0;
    }
  }

  > span,
  > a {
    display: block;
    padding: 18px 48px;
    text-decoration: none;
    text-transform: uppercase;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: .05em;
    transition: all .35s var(--Hover_easeOut);

    @media (--small-viewport) {
      width: 100%;
      padding: 16px 24px;
      text-align: center;
      font-size: .875rem;
    }

    ._ghost & {
      color: var(--color-text);
    }
  }

  &._full {
    display: block;
    width: 100%;

    & + .uc-btn {
      margin: 16px 0 0;
    }
  }

  &._round {
    border-radius: 80px;
  }

  &._ghost > a,
  &._ghost > span,
  &._primary > a,
  &._primary > span,
  &._secondary> a,
  &._secondary> span,
  &._success> a,
  &._success> span,
  &._danger> a,
  &._danger> span,
  &._warning > a,
  &._warning > span {
    color: white;
  }

  &._ghost {
    background-color: transparent;

    &:hover {
      background-color: white;

      > a,
      > span {
        color: var(--color-text);
      }
    }
  }

  &._primary {
    background-color: var(--color-primary);
    border: 2px solid var(--color-primary);

    &:hover {
      background-color: var(--color-primary-hover);
      border: 2px solid var(--color-primary-hover);
    }
  }

  &._secondary {
    background-color: var(--color-secondary);
    border: 2px solid var(--color-secondary);

    &:hover {
      background-color: var(--color-secondary-hover);
      border: 2px solid var(--color-secondary-hover);
    }
  }

  &._success {
    background-color: var(--color-success);
    border: 2px solid var(--color-success);

    &:hover {
      background-color: var(--color-success-hover);
      border: 2px solid var(--color-success-hover);
    }
  }

  &._danger {
    background-color: var(--color-danger);
    border: 2px solid var(--color-danger);

    &:hover {
      background-color: var(--color-danger-hover);
      border: 2px solid var(--color-danger-hover);
    }
  }

  &._warning {
    background-color: var(--color-warning);
    border: 2px solid var(--color-warning);

    &:hover {
      background-color: var(--color-warning-hover);
      border: 2px solid var(--color-warning-hover);
    }
  }

  &._disabled,
  &:disabled {
    background-color: var(--color-btn-hover);
    border: 2px solid var(--color-btn-hover);
    position: relative;
    cursor: default;
    opacity: .5;

    &:before {
      content: " ";
      display: block;
      width: 100%;
      height: 100%;
      background-color: transparent;
      position: absolute;
      top: 0;
      left: 0;
      z-index: 1;
    }
  }

  &._icon {
    line-height: 1;

    i {
      font-size: 1.125rem;
    }
  }
}

.uc-btn-unit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  @media (--small-viewport) {
    flex-direction: column;
  }

  ._center &,
  &._center {
    justify-content: center;
  }
}
