//--------------------------------------------------------------
// Copyright (C) joomla-monster.com
// License: http://www.joomla-monster.com/license.html Joomla-Monster Proprietary Use License
// Website: http://www.joomla-monster.com
// Support: info@joomla-monster.com
//---------------------------------------------------------------

// VARIABLES import
//---------------------------------------------------------------

@import "bootstrap_variables.less";  
@import "template_variables.less";

// MIXINS import
//---------------------------------------------------------------
  
@import "template_mixins.less";

// DJMENU
//---------------------------------------------------------------

.dj-megamenu-override {
  margin: 0;
  padding: 0;
  position: relative;   
  display: inline-block;
  width: 100%;
  vertical-align: top;
  z-index: 500;
  border-top: 1px solid @JMmegamenuBorderColor;
  li{
    &.dj-up {
      position: relative;
      display: inline-block;
      vertical-align: top;
      &:after {
        content: '';
        position: absolute;
        height: 0;
        width: 100%;
        top: -1px;
        left: 0;
        right: auto;
        .transition(all 0.2s ease-out 0s);
        pointer-events: none;
        z-index: 301;
      }
      &.active:after {
          height: 1px;
          background: @JMstyleMegamenuBorderColor;
      }
      &:hover a.dj-up_a,
      &.hover a.dj-up_a {
        color: @JMmegamenuTextActiveColor;
        background: @JMsubmegamenuBackground;
      }
    }
    a.dj-up_a {
      font-family: @JMtopmenuFontFamily;
      font-size: @JMtopmenuFontSize;
      font-weight: 300;
      display: block;
      text-decoration: none;
      padding: 35px;
      line-height: 1;
      cursor: pointer;
      color: @JMmegamenuTextColor;
      .transition(all 0.2s ease-out 0s);
      text-align: center;
      &.withsubtitle {
        padding: 30px 35px 30px;
      }
      small.subtitle {
        display: block;
        font-size: 10px;
        text-transform: none;
        line-height: 1;
        font-weight: 300;
        opacity: 0.7;
      }
      span {
        display: block;
        &.dj-drop {
          padding: 0 14px 0 0 !important;
          position: relative;
          z-index: 201;
					i {
						vertical-align: middle;
					}
          &:after {
            background: url("../images/megamenu-dropdown.png");
            content: "";
            height: 4px;
            position: absolute;
            right: 0;
            left: auto;
            top: 50%;
            margin-top: -1px;
            width: 7px;
          }
        }
      }
    }
    &:hover a.dj-up_a span.dj-drop:after,
    &.hover a.dj-up_a span.dj-drop:after {
      background: url("../images/megamenu-dropdown-hover.png");
    }
    &.separator > a {
    cursor: default;
    }
    &:hover,
    &.hover {
      position: relative;
      z-index: 200;
    }
    // Hide submenus
    div.dj-subwrap,
    &:hover div.dj-subwrap li div.dj-subwrap,
    &.hover div.dj-subwrap li div.dj-subwrap {
      position: absolute;
      left: -9999px;
      right: auto;
      top: -9999px;
      height: 0;
      margin: 0;
      padding: 0;
      z-index: 0;
    }
    // Show first level submenu
    &:hover div.dj-subwrap,
    &.hover div.dj-subwrap {
        left: 0;
        right: auto;
        top: 100%;
        height: auto;
        z-index: 300;
        .box-sizing(border-box);
    }
  }
  &.hasSubtitles li a.dj-up_a {
    padding: 30px 35px 40px;
  }
}

// sticky 
.dj-megamenu-sticky {
    background: @JMbarBackground;
    border-top: none;
}

.dj-megamenu-sticky > .dj-megamenu-override  {
    left: 0!important;
    right: auto!important;
}

.dj-megamenu-override .dj-stickylogo {
	&.dj-align-center {
		text-align: center;
		margin: 10px;
	}
	&.dj-align-left {
		text-align: left;
		margin: 10px;
	}
	&.dj-align-right {
		text-align: right;
		margin: 10px;
	}
}

//full width submenu
.dj-megamenu-override li.dj-up.fullsub {
  position: static !important;
}

.dj-megamenu-override li.dj-up.fullsub a.dj-up_a {
  position: relative;
}

// mobile
#jm-djmenu {
	.dj-megamenu-offcanvas,
	.dj-megamenu-accordion,
	.dj-megamenu-select {
		.dj-mobile-open-btn {
			margin-bottom: 10px;
		}
	}
}

// width if one column
.dj-megamenu-override li {
  &:hover,
  &.hover {
    div.dj-subwrap.single_column, 
    div.dj-subwrap.single_column {
      width: auto!important;
    }
    div.dj-subwrap-in,
    div.dj-subwrap-in {
      display: inline-block;
      background: @JMsubmegamenuBackground;
      .border-bottom-radius(3px);
      padding: 30px 0;
    }
    .single_column div.dj-subwrap-in,
    .single_column div.dj-subwrap-in {
      padding: 10px 0;
    }
  }
}

// Show higher level submenus
.dj-megamenu-override li:hover div.dj-subwrap li:hover > div.dj-subwrap,
.dj-megamenu-override li.hover div.dj-subwrap li.hover > div.dj-subwrap {
  left: 100%;
  right: auto;
  top: -10px;
  margin: 0;
  height: auto;
  z-index: 400;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  div.dj-subwrap-in,
  div.dj-subwrap-in {
    .border-radius(3px)
  }
}

// Submenu elements styles - drop down
.dj-megamenu-override li div.dj-subcol {
  .box-sizing(border-box);
  display: table-cell;
  vertical-align: top;
  height: 100%;
  border-left: 1px solid lighten(@JMsubmegamenuBackground, 4% );
  &:first-child {
    border: none;
  }
}

.dj-megamenu-override li ul.dj-submenu { 
  padding: 0;
  margin: 0;
  text-align: left;
  > li {
    display: block;
    position: relative;
    padding: 0 30px;
    > a {
      display: block;
      font-size: @JMsubmegamenuFontSize;
      line-height: 1.1;
      text-decoration: none;
      padding: 20px 0;
      color: @JMsubmegamenuTextColor;
      border-top: 1px solid lighten(@JMsubmegamenuBackground, 4% );
      small.subtitle {
        display: block;
        font-size: 10px;
        line-height: 1em;
        font-weight: 300;
        text-transform: uppercase;
        opacity: 0.4;
      }
    }
    &:first-child > a {
      border-top: 1px solid transparent;
    }
    &.parent > a {
      position: relative;
      &:after {
        content: '';
        position: absolute;
        top: 50%;
        right: 0;
        left: auto;
        background: url('../images/megamenu-parent.png');
        width: 4px;
        height: 7px;
        margin-top: -3px;
      }
    }
    &:hover > a,
    &.hover > a,
    &.active > a{
      color: @JMstyleLink;
    }
  }
}

// image menu
.dj-megamenu-override li {
  a { 
    span.image-title {
      margin: 0 0 0 15px;
      display: inline-block;
      float: none;
      vertical-align: middle;
    }
    &.dj-up_a img {
      max-height: 30px;
      max-width: none;
      vertical-align: middle;
    }
  }
  ul.dj-submenu > li > a img {
    max-height: 15px;
  }
}

// Submenu elements styles - tree 
.dj-megamenu-override li {
  ul.dj-submenu > li > .dj-subtree {
    padding-bottom: 10px;
  }
  ul.dj-subtree {
    list-style: none outside;
    padding: 0 0 0 10px;
    margin: 0;
    text-align: left;
    > li {
      display: block;
      position: relative;
      > a {
        display: block;
        font-size: 16px;
        line-height: 1.1;
        text-decoration: none;
        padding: 8px 10px;
        color: @JMsubmegamenuTextColor;
        small.subtitle {
          display: block;
          font-size: 10px;
          line-height: 1em;
          font-weight: 300;
          text-transform: uppercase;
          opacity: 0.4;
        }
      }
      &:hover > a,
      &.hover > a,
      &.active > a {
        color: @JMstyleLink;
      }
    }
  }
}

// modules loaded into menu
.dj-megamenu-override .modules-wrap {
  padding: 10px 0;
  text-align: left;
  color: @JMsubmegamenuTextColor;
  font-size: @JMsubmegamenuFontSize;
  .moduletable {
    margin: 30px 0 0;
    &:first-child {
      margin: 0;
    }
    > h3 {
      font-size: @JMsubmegamenuFontSize;
			color: @JMmegamenuModuleTitle;
      line-height: 1.1;
      font-weight: 700;
      margin: 0 0 30px;
      text-transform: uppercase;
    }
  }
}

//megamenu section
#jm-djmenu {
  .category-module {
    .mod-articles-category-title {
      color: @JMsubmegamenuTextColor;
    }
  }
  .newsflash {
    h1,h2,h3,h4,h5 {
      color: @JMsubmegamenuTextColor;
      a {
        color: @JMsubmegamenuTextColor;
      }
    }
  }
  .readmore {
		color: @JMreadmoreMegamenuFontColor;
		border: 1px solid @JMmegamenuSubmenuBorderColor;
    &:hover {
			color: @JMreadmoreFontColorHover;
      border: 1px solid transparent;
    }
  }
  .btn,
  a.button,
  input.button,
  button.button {
		color: @JMbuttonMegamenuFontColor;
		border: 1px solid @JMmegamenuSubmenuBorderColor;
    &:hover {
			color: @JMbuttonFontColorHover;
      border: 1px solid transparent;
    }
  }
  .nav.menu {
    li {
      &:hover > a,
      &.active > a {
				color: @JMstyleLink;
      }
    }
    > li > a,
    > li > span.separator {
			border-top: 1px solid @JMmegamenuSubmenuBorderColor;
      color: @JMsubmegamenuTextColor;
    }
    > li:first-child {
      > a,
      > span.separator {
        border: none;
      }
    }
    > li.parent.deeper > a,
    > li.parent.deeper > span.separator {
			border-bottom: 1px solid @JMmegamenuSubmenuBorderColor;
    }
    .nav-child li {
      a, 
      span.separator {
        color: @JMsubmegamenuTextColor;
      }
      &:hover > a,
      &.active > a {
				color: @JMstyleLink;
      }
    }
  }
}