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

$list-disc: 4px;

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

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

    &::after {
      background-color: setup.$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 {
  margin: 0;
  padding: 0;

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

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

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

  li {
    display: inline-flex;
    padding: 0 math.div(setup.$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: 1px solid rgb(51 48 48);
      }
    }

    &::after {
      content: '';
      position: absolute;
      border: 1px 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: 1px;
        background-color: setup.$c-primary;
        border-radius: setup.$form-radius;
        margin-top: -1px;
        transform: none;
      }
    }

    &::after {
      content: '';
      width: 2px;
      height: 2px;
      background-color: setup.$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 setup.$c-dark-grey;
  transition: all 0.2s ease;
  opacity: 0.5;
  left: -1px;

  &:first-child {
    left: 0;
  }

  &.is-active,
  &:hover {
    border: 1px solid setup.$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;
  background: setup.$c-white;
  border-bottom: 1px solid setup.$c-middle-grey;
  cursor: pointer;
  opacity: 1;

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

  &:hover {
    opacity: 0.6;
  }

  &.list-secondary,
  &.list-secundary {
    background-color: setup.$c-middle-grey;
    padding-left: 42px;
  }
  &.list-tertiary {
    background-color: setup.$c-light-grey;
    padding-left: 64px;

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

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

    span {
      flex-grow: 1;
    }
  }
}

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

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

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

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

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