@use 'sass:math';
@import '../abstract/_all';

$list-disc: 4px;

ul.list-disc {
  list-style: none;
  margin: $padding-global * 2 0;
  padding: 0;

  li {
    position: relative;
    padding: 0 $padding-global * 2;

    &::after {
      background-color: $list-disc-color;
      content: '';
      border-radius: 50%;
      width: $list-disc;
      height: $list-disc;
      position: absolute;
      left: 0;
      margin-top: -#{math.div($list-disc, 4)};
      top: 50%;
      transform: translateY(-50%);
    }

    a {
      text-decoration: none;
      padding: 14px 0;
    }

    a::after {
      bottom: 7px;
    }
  }
}

ul.list-inline {
  li {
    display: inline-flex;
    padding: 0 math.div($padding-global, 2);

    &::after {
      display: none;
    }
  }
}

ul.list-inline-flex {
  margin: 0;
  padding: 0;

  li {
    display: inline-flex;
    padding: 0 math.div($padding-global, 2);
    margin: 0;

    &::after {
      display: none;
    }
  }
}

ul.list-inline-clear {
  margin: 0;
  padding: 0;

  li {
    display: inline-block;
    margin: 0;

    &::after {
      display: none;
    }
  }
}

ul.list-clear {
  li {
    list-style: none;

    &::after {
      display: none;
    }
  }
}

ul.h-size-selector {
  a {
    position: relative;
    width: 20px;
    height: 20px;
    text-align: center;

    &:hover {
      cursor: pointer;

      &::after {
        border: var(--line-width) solid rgb(51 48 48);
      }
    }

    &::after {
      content: '';
      position: absolute;
      border: var(--line-width) solid transparent;
      width: 10px;
      height: 10px;
      left: 3px;
      top: 3px;
      padding: 8px;
      border-radius: 50%;
      transition: 0.5s ease all;
    }
  }
}

ul.list-mini {
  margin: 8px 0;

  > li {
    position: relative;
    padding: 4px 8px;
    line-height: 1;
    float: left;
    clear: both;
    list-style: none;

    &.is-missing {
      &::after {
        content: '';
        width: 100%;
        height: var(--line-width);
        background-color: $c-primary;
        border-radius: $form-radius;
        margin-top: -1px;
        transform: none;
      }
    }

    &::after {
      content: '';
      width: 2px;
      height: 2px;
      background-color: $c-primary;
      position: absolute;
      left: 0;
      bottom: 10px;
    }
  }
}

.list-table {
  display: table;
  width: 100%;
}

.list-box {
  display: table-cell;
  box-sizing: border-box;
  border: 1px solid $c-dark-grey;
  transition: all 0.2s ease;
  opacity: 0.5;
  left: -1px;

  &:first-child {
    left: 0;
  }

  &.is-active,
  &:hover {
    border: 1px solid $c-primary;
    opacity: 1;
    cursor: pointer;
  }
}

.multiple-table {
  display: table;
  width: calc(100% + 2px);

  .list-box:last-child {
    left: -2px;
  }
}

.list-button {
  position: relative;
  padding: 16px 0;
  border-bottom: var(--line-width) solid transparent;
  cursor: pointer;
  opacity: 1;

  span {
    font-size: $text-sm;
  }

  &:hover {
    opacity: 0.6;
  }

  &.list-secondary,
  &.list-secundary {
    background-color: transparent;
    padding-left: 16px;
  }
  &.list-tertiary {
    padding-left: 32px;

    svg-icon,
    svg-icon2,
    md-icon {
      left: 20px;
      opacity: 1;
    }
  }

  &.list-icons {
    display: flex;
    align-items: center;
    gap: 8px;

    span {
      flex-grow: 1;
    }
  }
}

.list-selection {
  a {
    padding: 8px;
    background: $c-white;
  }

  a:hover,
  .is-active {
    padding: 8px;
    background: $c-light-grey;
  }
}

ul.list-disc,
ul.list-mini {
  &.has-light {
    > li {
      &.is-missing {
        &::after {
          background-color: $c-white;
        }
      }

      &::after {
        background-color: $c-white;
      }
    }
  }
}

ul.list-breadcrumb li {
  display: inline-flex;
  margin: 0;
  padding: 0;
  &.list-breadcrumb-divider {
    color: #949494;
    position: relative;
    top: 4px;
    padding: 0;
  }
}

.list-state {
  .list-state-item {
    position: relative;
    padding-left: 20px;
    margin-left: 6px;
    color: $c-dark-grey;
    &::after {
      content: '';
      position: absolute;
      width: 11px;
      height: 11px;
      border: 1px solid black;
      background-color: #fff;
      top: 2px;
      left: -5px;
    }
    &::before {
      content: '';
      position: absolute;
      width: 1px;
      height: 100%;
      border-left: 1px dashed black;
      top: 12px;
      left: 0;
    }
    &.state-1 {
      color: $c-primary;
      &::before {
        content: '';
        border-left: 1px solid black;
      }
      &::after {
        border: 1px solid black;
        background-color: black;
      }
    }
    &.state-2 {
      color: $c-primary;
      &::before {
        content: '';
        border-left: 1px dashed black;
      }
      &::after {
        border: 1px solid black;
        background-color: black;
      }
    }
    &:last-child {
      &::before {
        content: '';
        border: none;
      }
    }
  }
}
