@use "../../../../styles/tokens/color";
@use "../../../../styles/tokens/space";
@use "../../../../styles/tools/convert";
@use "./config";

@mixin menu($height: config.$menu-height) {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1;
  float: left;
  width: 100%;
  max-height: $height;
  padding: 0;
  margin: -2px 0 0;
  color: color.$black;
  background-color: color.$white;
  background-clip: padding-box;
  border: 2px solid color.$black;
  overflow-y: auto;
  border-radius: convert.to-rem(5px);

  &:empty {
    display: none;
  }
}

@mixin menu-visible {
  display: block;
}

@mixin menu-hidden {
  display: none;
}

@mixin hint {
  position: absolute;
}

@mixin option {
  display: block;
  position: relative;
  width: 100%;
  padding: space.get("small");
  clear: both;
  color: color.$black;
  text-align: inherit;
  background-color: transparent;
  border: 0;
  margin-bottom: 0;

  &::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
  }

  &:first-child {
    border-top-left-radius: 0;
    background-clip: padding-box;
    border-top-right-radius: 0;
  }
}

@mixin active-option {
  color: color.$white;
  background: color.$black;
}

@mixin wrapper {
  position: relative;
  isolation: isolate;
  z-index: 0;
  width: 100%;
  max-width: convert.to-rem(350px);
}
