// ┌──────────────────┐
// │ Calcite Dropdown │
// └──────────────────┘
//
// Styling for nav dropdown

.calcite-dropdown {
  order: 0;
  flex-shrink: 0;
  flex-grow: 0;

  // Esri fonts
  [class^="esri-icon-"], [class*=" esri-icon-"] {
    position: relative;
    font-size: 15px;
    top: 2px;
  }

  &.right {
    order: 2;
  }

  .dropdown-toggle {
    display: block;
    margin: $navbar_dropdown_toggle_margin;
    padding: $navbar_dropdown_toggle_padding;
    border: none;
  }

  .dropdown-toggle .icon-bar {
    display: block;
    border-radius: 0;
    height: $navbar_dropdown_toggle_icon_bar_height;
    width: $navbar_dropdown_toggle_icon_bar_width;
    background-color: #4c4c4c; //default
  }

  .dropdown-toggle .icon-bar + .icon-bar {
    margin-top: 4px;
  }

  &.open .dropdown-menu {
    visibility: visible;
    opacity: 1;
  }
  .dropdown-menu {
    position: absolute;
    display: block;
    visibility: hidden;
    opacity: 0;
    right: auto;
    max-height: $dropdown_menu_max_height;
    padding: $dropdown_menu_padding;
    border: none;
    border-radius: 0;
    overflow-y: auto;
    font-size: $dropdown_menu_font_size;
    -moz-transition: visibility, opacity .2s ease-out;
    -webkit-transition: visibility, opacity .2s ease-out;
    transition: visibility, opacity .2s ease-out;
  }

  &.calcite-right {
    .dropdown-menu {
      left: auto;
      right: 0;
    }
  }

  // Drawer menu - full height

  &.open .dropdown-menu {
    &.calcite-menu-drawer {
      left: 0;
      -moz-transition: left .25s ease-out;
      -webkit-transition: left .25s ease-out;
      transition: left .25s ease-out;
    }
  }

  .dropdown-menu {
    &.calcite-menu-drawer {
      position: fixed;
      top: 50px; // Default title height
      bottom: 0;
      max-height: 100%;
      left: -250px;
      visibility: visible;
      opacity: 1;
      -moz-transition: left .5s ease-out;
      -webkit-transition: left .5s ease-out;
      transition: left .5s ease-out;
    }
  }

  .dropdown-menu > li > a {
    padding: $dropdown_menu_li_a_padding;
  }

  .dropdown-menu a > span {
    padding-right: 3px;
  }

  // Offset dropdown menu
  &.dropdown .dropdown-menu {
		margin: 0;
	}
}

// Mobile screens

@media (max-width: $dropdown_breakpoint_width_mobile) {
  .calcite-navbar {
    .dropdown-toggle {
      padding: $navbar_dropdown_toggle_padding_mobile;
    }
  }
}

// @media (max-height: $dropdown_breakpoint_height_mobile) {
//   .calcite-navbar {
//     .dropdown-toggle {
//       //padding: $navbar_dropdown_toggle_padding_mobile;
//     }

//     // .dropdown-menu {
//     //   max-height: $dropdown_menu_max_height_mobile;
//     // }  
//   }
// }

@media (min-height: $base_breakpoint_min_height_xxs) { 
  .calcite-navbar {
    .dropdown-menu {
      max-height: $base_breakpoint_min_height_xxs - $navbar_height - 10px; // accomodate up to medium, padding?
    }
  }
}

@media (min-height: $base_breakpoint_min_height_xs) { 
  .calcite-navbar {
    .dropdown-menu {
      max-height: $base_breakpoint_min_height_xs - $navbar_height - 10px; // accomodate up to medium, padding?
    }
  }
}

@media (min-height: $base_breakpoint_min_height_sm) { 
  .calcite-navbar {
    .dropdown-menu {
      max-height: $base_breakpoint_min_height_sm - $navbar_height - 10px; // accomodate up to medium, padding?
    }
  }
}

