/**
 * $JA#COPYRIGHT$
 */


// VARIABLES & MIXINS
// ------------------
@import "vars.less"; // Include Variables and Mixins


// EXTEND STYLE IN BASE
// --------------------
@import "../../../plugins/system/t3/base-bs3/less/megamenu.less";


//
// BASIC STYLE FOR MEGAMENU
// -------------------------
.t3-megamenu {
  &.animate {
    .opacity(1);
  }
  // THE MEGAMENU
  //--------------------------------------------

  // Global Menu Inner padding
  // -------------------------
  .mega-inner {
    padding: 10px 0;
  }

  // Inner Padding for 1 column
  .col-lg-12 .mega-inner,
  .col-md-12 .mega-inner,
  .col-sm-12 .mega-inner,
  .col-xs-12 .mega-inner {
  }


  // Menu Grids
  // ----------
  .row {
    margin-left: auto;
    margin-right: auto;
  }

  .row + .row  {
    padding-top: @t3-global-padding / 2;
    border-top: 1px solid @navbar-default-border;
  }


  // The Dropdown
  // ------------
  .mega-dropdown-menu {
    padding: (@t3-global-padding/2) 0;
    border: 1px solid @navbar-default-border;
    box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.04);
    margin-left: -1px;
    background: rgba(255,255,255,.96);

    @media screen and (min-width: @screen-md) and (max-height: 700px) {
      &.menu-layout-preview {
        max-height: calc(~"100vh - 52px");
        overflow-y: scroll;
      }
    }

    // Addition 

    &.menu-layout-preview {
      li {
        a {
          font-weight: bold;
          white-space: nowrap;
        }

        img {
          max-width: 100%;
          margin-bottom: @t3-global-margin/2;
          display: block !important;
        }

        &:hover,
        &:focus {
          background: none;
          color: @link-color;
        }
      }
    }
  }


  // Dropdown Sub Menus
  // ------------------
  .dropdown-submenu {
    .col-lg-12.mega-col-nav .mega-inner,
    .col-md-12.mega-col-nav .mega-inner,
    .col-sm-12.mega-col-nav .mega-inner,
    .col-xs-12.mega-col-nav .mega-inner {
      padding-top: 0;
      padding-bottom: 0;
    }
  }


  // The Group
  // ---------
  .mega-group {
  }

  // Group Title
  // We use BS3 "dropdown-header"
  //.mega-nav .mega-group > .mega-group-title,
  //.dropdown-menu .mega-nav .mega-group > .mega-group-title,
  //.dropdown-menu .active .mega-nav .mega-group > .mega-group-title
  .dropdown-header,
  .mega-nav .mega-group > .dropdown-header,
  .dropdown-menu .mega-nav .mega-group > .dropdown-header,
  .dropdown-menu .active .mega-nav .mega-group > .dropdown-header {
    margin: 0;
    padding: 10px 10px 20px;
    background: @t3-module-title-bg;
    color: @gray;
    font-size: @t3-font-size-smaller;
    font-weight: @font-weight-bold;
    line-height: normal;
    text-transform: uppercase;
    border-bottom: 1px solid @navbar-default-border;

    // Link states
    &:hover, &:active, &:focus {
      background: inherit;
      color: @brand-primary;
    }
  }

  // Group Content
  .mega-group-ct {
    .row {
      margin-left: -(@grid-gutter-width / 2);
      margin-right: -(@grid-gutter-width / 2);
    }
  }


  // Nav in Megamenu
  // ---------------
  .mega-col-nav {
  }

  // Inner padding
  .mega-col-nav .mega-inner {
  }

  // Inner padding for nav in 1 column
  .col-lg-12.mega-col-nav .mega-inner,
  .col-md-12.mega-col-nav .mega-inner,
  .col-sm-12.mega-col-nav .mega-inner,
  .col-xs-12.mega-col-nav .mega-inner {
  }

  .mega-group .col-lg-12.mega-col-nav .mega-inner,
  .mega-group .col-md-12.mega-col-nav .mega-inner,
  .mega-group .col-sm-12.mega-col-nav .mega-inner,
  .mega-group .col-xs-12.mega-col-nav .mega-inner {
  }

  // The Nav
  .mega-nav,
  .dropdown-menu .mega-nav {
  }

  .mega-nav > li,
  .dropdown-menu .mega-nav > li {

    &.active > a {
      color: @brand-primary;
    }
  }

  .mega-nav > li a,
  .dropdown-menu .mega-nav > li a {
    padding: 8px 10px;
    color: @dropdown-link-color;
    font-size: @t3-font-size-small;
    border-radius: 3px;

    // Link states
    &:hover, &:active, &:focus {
      background: @brand-primary;
      color: #fff;

      &:after {
        border-left-border: @white;
      }
    }
  }

  .dropdown-menu .mega-nav > li .separator {
  }

  // Nav in Group
  .mega-group > .mega-nav,
  .dropdown-menu .mega-group > .mega-nav {
  }

  .mega-group > .mega-nav > li,
  .dropdown-menu .mega-group > .mega-nav > li {
  }

  .mega-group .mega-nav > li a,
  .dropdown-menu .mega-group .mega-nav > li a {
  }

  .dropdown-menu .mega-group .mega-nav > li.active > a {
    color: @brand-primary;

    &:hover, &:active, &:focus {
      background: none;
    }
  }

  // The caret
  .mega-nav .dropdown-submenu {
    > a:after {
      border-left-color: @gray-light;
      margin-right: 0;
    }

    &.open > a {

      &:after {
        border-left-color: @white;
      }
    }

    &.open > .dropdown-menu {
      margin-left: -2px;
      box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.04);
    }

    > .mega-dropdown-menu > .mega-dropdown-inner {
      padding: 0 20px;
    }
  }


  // Modules in Megamenu
  // -------------------
  .mega-col-module {
  }

  // Inner padding
  .mega-col-module .mega-inner {
  }

  // The module
  .t3-module {
    &.layout-menu {
      padding-left: 0;
      padding-right: 0;
    }
  }

  // Module Title
  .t3-module .module-title {
    .dropdown-header(); // Make the Module Title look like Dropdown Header
    margin-bottom: 10px;
  }

  // Module Content
  .t3-module .module-ct {
  }

  // List in Module
  // Reset List Style in Module
  .t3-module ul,
  .t3-module .nav {
  }

  .t3-module ul li,
  .t3-module .nav li {
    list-style: disc;
    display: list-item;
    float: none;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .t3-module ul li a,
  .t3-module .nav li a {
    display: inline;
    padding: 0;
    margin: 0;
    border: 0;
    font-size: 100%;
    background: none;
    font: inherit;
    white-space: normal;
    // Link states
    &:hover, &:focus, &:active {
      background: none;
      color: inherit;
      font: inherit;
    }
  }
  
  // Nav in Module
  .dropdown-menu .t3-module .nav {
  }

  .dropdown-menu .t3-module .nav li {
  }

  .dropdown-menu .t3-module .t3-module li a {
    // Link states
    &:hover, &:focus, &:active {
    }
  }
  

  // The caption
  // -----------
  .mega-caption {
    color: @gray-light;
    font-size: @t3-font-size-smaller - 2px;
    margin-top: 3px;
    font-weight: @font-weight-normal;
    position: absolute;
    bottom: -2px;
    text-transform: none;
  }


  // The caret
  // ---------
  .nav .caret,
  .dropdown-submenu .caret,
  .mega-menu .caret {
  }

  // Show the caret on level 0 only
  .nav > .dropdown > .dropdown-toggle .caret {
    border: 0;
    margin-top: -30px;
    margin-left: 5px;
    // Using FontAwesome Icon instead
    &:before {
      content: "\f107";
      font-family: FontAwesome;
			font-style: normal;
   }
  }


  // The icon
  // --------
  .nav [class^="icon-"],
  .nav [class*=" icon-"],
  .nav .fa {
  }

  // Reset the margin on Input Group Addon
  .nav .input-group-addon [class^="icon-"],
  .nav .input-group-addon [class*=" icon-"],
  .nav .input-group-addon .fa {
    margin-right: 0;
  }

  // End
}