/* ==========================================================================
   Dropdowns
   ========================================================================== */
.dropdown {
  position: relative;
}

.dropdown .btn:not(.btn-squared):not(.btn-rounded) {
  justify-content: flex-start;
}

.dropdown .dropdown-menu {
  background: $white;
  border-radius: $border-radius-base;
  border: 0;
  box-shadow: 0 2px 8px rgba($primary, .1);
  display: none;
  left: 0;
  margin: 6px 0;
  max-width: 220px;
  min-width: 140px;
  overflow: auto;
  padding: 0;
  position: absolute;
  top: 100%;
  width: auto;
  z-index: 9999;

  &

  > li > a {
    font-weight: $fwp-bold;
    display: inline-flex;
  }

  .dropdown-divider {
    margin: 0;
    padding: 0;
    height: 0px;
  }
}

.dropdown.dropdown-with-sections .dropdown-menu {
  padding: 6px 0 !important;
}

.open .dropdown-menu {
  display: inline-block;
}

.dropdown-section-title {
  color: rgba($white, 0.4);
  display: block;
  font-family: $font-primary;
  font-size: 14px;
  font-weight: $fwp-normal;
  line-height: 18px;
  padding: 6px 12px;
  text-align: left;
}

.dropdown-menu li {
  margin: 0;
  padding: 0;

  &:first-child {
    .btn {
      border-top-right-radius: 4px;
      border-top-left-radius: 4px;
    }
  }

  &:last-child {
    .btn {
      border-bottom-right-radius: 4px;
      border-bottom-left-radius: 4px;
    }
  }

  .btn {
    width: 100%;
    border-radius: 0;
  }
}

/* Dropdown Menu Icon
   ========================================================================== */

.dropdown-icon .dropdown-menu {
  list-style: none;
  padding: 12px 0;
}

.dropdown-icon .dropdown-menu li {
  &:first-child {
    margin-top: 0;
  }

  &:last-child {
    margin-bottom: 0;
  }
}

.dropdown-icon .dropdown-menu li a,
.dropdown-icon .dropdown-menu li button {
  color: rgba($primary, .8);
  font-size: 12px;
  line-height: 36px;
  margin: 0;
  padding: 0 20px;

  @include anim(all);

  span {
    color: rgba($primary, .8);
    display: inline-block;
    margin-right: 20px;
    position: relative;
    text-align: center;
    top: 3px;
    width: 14px;

    @include anim(color);
  }

  &:hover,
  &:focus {
    background-color: rgba($accent, .1);
    color: $accent;

    span {
      color: $accent;
    }
  }
}

.dropdown.dropdown-logs {
  .icon {
    display: inline-block;
    line-height: 34px;
    margin-right: 20px;
    position: relative;
    top: 3px;
  }

  .icon-red {
    color: $color-red;
  }

  .icon-orange {
    color: $color-orange;
  }

  .icon-yellow {
    color: $color-yellow;
  }

  .icon-primary {
    color: rgba($primary, .8);
  }
}

/* Dropdown Filter
   ========================================================================== */

.dropdown.dropdown-filter {
  display: inline-block;
}

.dropdown.dropdown-filter .btn.btn-default {
  border-radius: 4px;
  font-family: $font-primary;
  font-size: 14px;
  font-weight: 700;
  height: 48px;
  line-height: 48px;
  margin: 0;
  padding: 0 33px 0 12px;
  position: relative;
  text-align: left;
}

.dropdown.dropdown-filter .btn.btn-default [class*="icon-12-"] {
  line-height: 46px;
  position: absolute;
  right: 12px;
}

.dropdown.dropdown-filter .dropdown-menu {
  left: 0;
  margin: 0;
  min-width: 100%;
  padding: 12px 0;
  top: 100%;
}

.dropdown.dropdown-filter .dropdown-menu li {
  margin: 0;
  padding: 0;
}

.dropdown.dropdown-filter .dropdown-menu li a {
  border-bottom-width: 0;
  color: rgba($primary, .8);
  font-family: $font-primary;
  font-size: 12px;
  font-weight: 600;
  line-height: 36px;
  padding: 0 20px;
}

.dropdown.dropdown-filter .dropdown-menu li a:hover {
  background-color: rgba($accent, .1);
  color: $accent;
}

/* Dropdown Settings
   ========================================================================== */

.dropdown.dropdown-settings {
  display: flex;
  justify-content: flex-end;
  padding: 0 20px 0 0;
}

.dropdown.dropdown-settings .btn-icon {
  border-radius: 4px;
  display: block;
  line-height: 48px;
  margin: 0;
  padding: 0 12px;
  width: 46px;
}

.dropdown.dropdown-settings .dropdown-menu {
  left: auto;
  list-style: none;
  margin: 0;
  padding: 12px 0;
  right: 20px;
}

.dropdown.dropdown-settings .dropdown-menu li {
  margin: 0;
}

.dropdown.dropdown-settings .dropdown-menu li a {
  border-bottom-width: 0;
  color: rgba(14, 20, 26, .8);
  font-family: $font-primary;
  font-size: 12px;
  font-weight: 600;
  line-height: 36px;
  margin: 0;
  padding: 0 20px;
  transition: all .3s ease-in-out;
}

.dropdown.dropdown-settings .dropdown-menu li a:hover {
  background-color: rgba($accent, .1);
  color: $accent;
}

.dropdown.dropdown-settings .dropdown-menu li a span {
  color: rgba(14, 20, 26, .8);
  display: inline-block;
  margin-right: 20px;
  position: relative;
  text-align: center;
  top: 3px;
  transition: color .3s ease-in-out;
  width: 14px;
}

.dropdown.dropdown-settings .dropdown-menu li a:hover span {
  color: $accent;
}

/* Dropdown Confirmation
   ========================================================================== */

.dropdown.dropdown-confirmation .btn [class^="icon-12-"],
.dropdown.dropdown-confirmation .btn [class*="icon-12-"] {
  line-height: 36px;
}

.dropdown.dropdown-confirmation .dropdown-menu {
  left: 50%;
  list-style: none;
  margin: 0;
  padding: 12px;
  text-align: center;
  top: 100%;
  transform: translateX(-50%);
  width: 218px;
}

.dropdown.dropdown-confirmation .dropdown-menu h3 {
  color: rgba($primary, .8);
  font-family: $font-primary;
  font-size: 14px;
  font-weight: 700;
}

.dropdown.dropdown-confirmation .dropdown-menu p {
  color: rgba($primary, .4);
  font-family: $font-secondary;
  font-size: 11px;
  font-weight: 600;
}

.dropdown.dropdown-confirmation .dropdown-menu .btn {
  font-family: $font-primary;
  font-size: 12px;
  font-weight: 600;
  height: 36px;
  line-height: 36px;
  margin-right: 12px;
  padding: 0;
  width: calc(50% - 6px);
}

.dropdown.dropdown-confirmation .dropdown-menu .btn:last-child {
  margin-right: 0;
}
