@import 'bootstrap/custom-bootstrap-variables';
@import 'bootstrap/scss/mixins/breakpoints';
@import 'mixins/a11y';
@import 'mixins/forms';

.control {
  height: 40px;
  width: 40px;
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: 1fr;
  border: none;
  
  @include media-breakpoint-up(sm) {       
    height: 60px;
    width: 60px;
  }

  .toggle {
    @include no-appearance;
    cursor: pointer;
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    outline: none;
    border-radius: 0;
    border: none;
    background-color: transparent;
    padding: 0;
    
    &:focus {
      @include focusOutline;
    }
  }
  
  .toggle--navigation > * {    
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
  }

  .toggle .icon--inline::before {
    //transform: scale(0.75);
    background-size: 50px 50px;
    transform: scale(1);
    width: 25px;
    height: 25px;
    background-size: cover;
    
    @include media-breakpoint-up(md) { 
      //transform: scale(0.5);
      width: 35px;
      height: 35px;
    }
  }

  .toggle--search > .icon--inline + .icon--inline {
    display: none;
  }
}


.control--responsive-menu {
  display: grid;
  
  
  .toggle > .icon--inline + .icon--inline {
    display: none;
  }
}

@include media-breakpoint-up(lg) {       
  .control--responsive-menu {
    display: none;
  }
}


body.search-is-active {
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

body.search-is-active .control--fly-out-search {
  position: fixed;
  z-index: 498;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  max-height: inherit;
  background-color: rgba(255,255,255,.98);
  display: block;
  -webkit-overflow-scrolling: touch;
      
  .toggle {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    position: absolute;
    cursor: default;
    
    > .icon--inline {
      display: none;
      width: 60px;
      height: 60px;
      position: absolute;
      top: calc(#{$spacer} * 2);
      right: calc(#{$spacer} * 2);
      cursor: pointer;
      
      &::before {
        transform: none;
      }
      
      + .icon--inline {
        display: inline-flex;
      }
    }
  }
}

body.search-is-active #toolbar-administration ~ * .control--fly-out-search .toggle > .icon--inline {
  top: calc(#{$spacer} * 6);
}


body.nav-is-active .control--responsive-menu {
  
  .toggle > .icon--inline {
    display: none;
      
    + .icon--inline {
      display: inline-flex;
    }
  }
}