/* Navigation bar */
@media (min-width: 980px) {
    .block-tb-megamenu {
        display: flex;
        align-items: center;
    }
}

nav.tbm-main {
    position: unset;
}

/* First level mega menu styles */

/* main animation */
.tbm.animate:not(.tbm--mobile) .tbm-item > .tbm-submenu {
    transition: none !important;
}

.tbm.animate:not(.tbm--mobile) .tbm-item.level-1 > .tbm-submenu {
    transition:opacity 400ms !important;
}

.tbm.animate:not(.tbm--mobile).slide .tbm-item.level-1 > .tbm-submenu > div {
    transition: opacity 400ms !important;
}

.tbm:not(.tbm--mobile) .tbm-item.level-2 > .tbm-submenu {
    transition: none !important;
    overflow: hidden;
}

.tbm:not(.tbm--mobile) .tbm-item.level-2 > .tbm-submenu > div {
    margin-left: -500px !important;
    transition: margin 400ms !important;
}

.tbm:not(.tbm--mobile) .tbm-item.level-2.open > .tbm-submenu > div {
    margin-left: 0px !important;
}

/* Main navigation container */
.tbm-nav.level-0 {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* First level items */
.tbm-item.level-1 {
  margin: 0;
  padding: 0;
  border: none;
}

.tbm-link.level-1 {
  font-weight: 700;
  padding: 15px 20px;
  color: inherit;
  text-decoration: none;
  display: block;
  color: #0e008a;
  border-bottom: 5px solid transparent;
  transition: color 0.3s ease, text-decoration 0.3s ease;
  background-color: #FFF;
}
@media (min-width:980px) and (max-width: 1100px) {
    /* To save some space in the header before going to hamburger */
    .tbm-link.level-1 {
        padding: 15px 15px;
    }
}

.tbm-item.active .tbm-link.level-1 {
    border-bottom: 5px solid #F70;
    border-color: #F70;
}

.tbm-link.level-1:focus {
    background-color: #FFF;
}

/* Hover effects for first level items */
.tbm-link.level-1:hover {
    border-bottom: 5px solid #0e008a;
    border-color: #0e008a;
    color: #0e008a;
    background-color: #FFF;
}

/* Remove borders between first level items */
.tbm-item.level-1 {
  border: none;
  border-right: none;
  border-left: none;
  border-top: none;
  border-bottom: none;
}

.tbm-item.level-1 .tbm-link-container {
  border: none;
}

ul.tbm-nav > li {
    list-style: none;
}

/* Hide toggle buttons for desktop */
@media (min-width: 980px) {
    .tbm-item.level-1 .tbm-submenu-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        background: none !important;
    }
}

.tbm-item.level-1.tbm-item--has-dropdown .tbm-link.level-1 {
  cursor: pointer;
}

.tbm-item.level-1.tbm-item--has-dropdown .tbm-link.level-1:hover {
  cursor: pointer;
}

/* Open submenu styles */
.tbm-item.level-1.open .tbm-link.level-1 {
  border-bottom: 5px solid #0e008a;
  border-color: #0e008a;
}

.tbm-submenu {
  display: none;
}

.tbm-submenu.open {
  display: block;
}

/* First level */
.tbm-item.level-1 > .tbm-submenu {
  position: absolute;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
}

ul.tbm-subnav.level-1 {
    padding: 23px 28px 150px;
}

/* Second level */
.tbm-item.level-1 .tbm-submenu {
  background-color: #292929;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

@media (min-width:980px) and (max-width: 1100px) {
    /* admin menu imposes margin on mega menu */
    body.toolbar-horizontal.toolbar-fixed .tbm-item.level-1 .tbm-submenu {
        margin-left: -62px;
    }
}
@media (min-width: 1041px) {
    /* admin menu imposes margin on mega menu */
    body.toolbar-horizontal.toolbar-fixed .tbm-item.level-1 .tbm-submenu {
        margin-left: -46px;
    }
}
@media (min-width: 1400px) {

    /* admin menu imposes margin on mega menu */
    body.toolbar-horizontal.toolbar-fixed .tbm-item.level-1 .tbm-submenu {
        margin-left: -42px;
    }
}

.tbm-item.level-1 .tbm-submenu * {
    color: #fff;
}

/* Submenu links */
.tbm-item.level-1 .tbm-submenu .tbm-link,
.tbm-item.level-1 .tbm-submenu ul > li.abc a {
  margin-bottom: 0;
  font-style: normal;
  display: flex !important;
  justify-content: space-between;
  border-right: none;
  color: #fff;
  text-shadow: none;
  position: relative;
  font-size: 1.8rem;
  line-height: 1.2;
  padding: 0 30px 10px 0;
  padding-top: 0px;
  -webkit-transition: color .2s ease;
  transition: color .2s ease;
  text-decoration: none;
}

/* Links in the third level submenu have reduced font size, as there are quite a few of them */
/* But on narrow widths, let's keep them as is, as they will be difficult to tap otherwise */
@media (min-width: 980px) {
    .tbm-item.level-3 a {
        font-size: 1.6rem !important;
        padding: 12px 0 !important;
    }
}

/* Back links and level  */
.tbm li.abc,
.tbm li.level-122,
.tbm li.level-211 {
    list-style: none;
}

a#back1:hover,
a#back1:focus,
a#back1:active,
a#back3:hover,
a#back3:focus,
a#back3:active {
    text-decoration: none;
}

@media (min-width: 980px) {
    .tbm-subnav.level-1 {
        padding-top: 0 !important;
    }

    .tbm-block {
        padding-top: 20px;
    }

    .tbm-subnav.level-2 > li.abc {
        margin-left: 24px;
        margin-top: 30px;
    }

    a#back1,
    .tbm-subnav.level-1 > li.abc {
        display: none !important;
    }

    li.level-211 {
        padding: 4px;
        position: absolute;
    }
}

.tbm-item.level-1 .tbm-submenu li + li .tbm-link {
    padding: 20px 0;
}

@media (min-width: 980px) {
    /* We apply inactive hovering effect to desktop menu version only */
    .tbm-submenu ul:hover > li > .tbm-link-container > .tbm-link,
    .tbm-submenu ul:hover > li.abc a {
        color: #6c6c6c;
    }
}
.tbm-submenu ul > li .tbm-link:hover,
.tbm-submenu ul:hover > li > .tbm-link-container > .tbm-link:hover,
.tbm-submenu ul > li.open > .tbm-link-container > .tbm-link,
.tbm-submenu ul > li.abc a:hover {
    color: #fff;
}

.tbm-submenu ul>li .tbm-link:not(.active-trail):focus,
.tbm-submenu ul>li.abc a:not(.active-trail):focus {
    color: #fff !important;
}

ul.tbm-subnav.level-1 > li {
    z-index: 1000;
}

/* Blocks layout */
.tbm-row {
    max-width: 1240px;
    margin: auto;
}

.tbm-row .tbm-column {
    margin-top: 50px;
}

/* Flyout styles*/

.tbm:not(.tbm--mobile) .tbm-submenu ul > li.tbm-item--has-flyout:hover > .tbm-link-container > a {
    margin-left: 25px;
    margin-right: 0;
}

.tbm:not(.tbm--mobile) .tbm-submenu ul > li.tbm-item--has-flyout > .tbm-link-container > a {
    transition-property: margin !important;
    transition-duration: .5s !important;
    margin-left: 0;
    margin-right: 25px;
}

/* --- FLYOUT (right side 2d level submenu)--- */
.tbm-item.level-2.tbm-item--has-flyout > .tbm-submenu {
  position: fixed;
  left: 50%;
  top: 0;
  min-width: 400px;
  min-height: 700px;
  background: #292929;
  color: #fff;
  z-index: 1100;
  box-shadow: none;
  border: none;
  margin: 0;
  padding: 0;
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s cubic-bezier(.4,0,.2,1), transform 0.3s cubic-bezier(.4,0,.2,1), min-height 0.3s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.tbm-item.level-2.tbm-item--has-flyout.open > .tbm-submenu {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.tbm-item.level-2.tbm-item--has-flyout {
  position: relative;
}

/* Embedded blocks and backlink styles */

.tbm li.abc > a,
.tbm .tb-block-link a {
    font-size: 3rem !important;
    font-family: 'Open Sans Condensed', sans-serif;
}

.tbm .tb-block-link a {
    line-height: 18px;
    padding: 0 0 20px;
    display: block;
    white-space: nowrap;
}

.tbm .tbm-block p {
    font-size: 14px;
}

/* Level 3 special styles */
@media (min-width: 980px) {
    li.tbm-item.level-2 > .tbm-submenu {
        padding-left: 10% !important;
        width: 100% !important;
    }

    li.tbm-item.level-3 {
        width: 385px;
    }

    .tbm-subnav.level-2 > li.abc {
        width: 385px;
    }

}

@media (min-width: 1250px) {
    li.tbm-item.level-3 {
        width: 485px;
    }

    .tbm-subnav.level-2 > li.abc {
        width: 485px;
    }
}

/* Active trail */
.tbm-submenu ul>li .tbm-link.active-trail {
    color: #F70 !important;
}

.tbm-submenu ul>li .tbm-link.active-trail:hover {
    color: #FFF !important;
}

/* Mobile menu styles */
@media (max-width: 979.98px) {
    #header {
        padding-left: 0;
    }

    .tbm-row .tbm-column {
        margin-top: 0;
    }

    .tbm,
    .tbm .tbm-collapse,
    .tbm .tbm-collapse .tbm-nav {
        background: #292929;
    }
    .tbm .tbm-collapse .tbm-nav {
        width: 100vw;
        height: 100vh !important;
        min-height: 50vh;
        display: inline-block;
        padding: 23px 28px 46px;
    }

    .tbm.tbm--mobile .tbm-collapse {
        width: 100vw;
        position: absolute;
        left: 0;
        top: 100%;
        padding-top: 0;
        margin-top: 0;
        background: #292929;
        transform: translate3d(0, 0, 0);
        transition: transform .25s ease-in-out, opacity .13s ease-in-out;
        -webkit-transition: opacity .13s ease-in-out, -webkit-transform .25s ease-in-out;
        z-index: 500;
    }

    /* Level 0 animation */
    .tbm.tbm--mobile .tbm-collapse {
        display: none;
    }

    .tbm.tbm--mobile.tbm--mobile-show .tbm-collapse {
        display: block;
        animation: slideDown .2s ease-in-out forwards, fadeIn .13s ease-in-out forwards;
    }

    .tbm.tbm--mobile:not(.tbm--mobile-show) .tbm-collapse {
        animation: fadeOut .13s ease-in-out forwards;
    }

    @keyframes slideDown {
        from {
            clip-path: inset(0 0 100% 0);
        }
        to {
            clip-path: inset(0 0 0% 0);
        }
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    @keyframes fadeOut {
        from {
            opacity: 1;
        }
        to {
            opacity: 0;
        }
    }

    /* disable link margin animations */
    .tbm-submenu ul > li.tbm-item--has-flyout > .tbm-link-container > a {
        transition: none !important;
    }
    .tbm-item.level-2.tbm-item--has-flyout>.tbm-submenu {
        transition: none !important;
    }

    .tbm-item.level-1.open .tbm-link.level-1 {
        border-color: transparent;
    }

    .tbm-item.level-1 > .tbm-submenu {
        box-shadow: none;
        top: 0;
    }

    .tbm .level-1 > .tbm-link-container .tbm-submenu-toggle {
        z-index: 1;
    }

    /* Margin transition on hover for level 1 links in mobile */
    .tbm:not(.tbm--mobile) .tbm-item.level-1.tbm-item--has-dropdown > .tbm-link-container > a {
        transition-property: margin !important;
        transition-duration: .5s !important;
        margin-left: 0;
        margin-right: 25px;
    }
    .tbm:not(.tbm--mobile) .tbm-item.level-1.tbm-item--has-dropdown > .tbm-link-container:hover > a {
        margin-left: 25px;
        margin-right: 0;
    }

    .tbm-item.level-2.tbm-item--has-flyout {
        z-index: 900;
    }

    .tbm-item.level-2.tbm-item--has-flyout > .tbm-submenu {
        left: 0;
        top: 0;
        min-width: 100vw;
        height: 100vh;
	overflow-y: auto;
        z-index: 1200;
    }

    .tbm-item.level-2.tbm-item--has-flyout > .tbm-submenu * {
        background-color: #292929;
    }

    ul.tbm-subnav.level-2 {
        padding: 23px 28px 150px;
    }


    /* Hide all by default */
    .tbm.tbm--mobile .tbm-collapse .tbm-submenu {
        display: none !important;
    }

    /* Show only 1st level menu when it's open */
    .tbm .tbm-collapse .tbm-item.level-1.open > .tbm-submenu {
        display: block !important;
        animation: slideRight .3s ease-in-out forwards;
    }

    .tbm .tbm-collapse .tbm-item.level-1.open > .tbm-submenu.closing {
        animation: slideBackLeft .3s ease-in-out forwards;
    }

    @keyframes slideRight {
        from {
            transform: translateX(100%);
            opacity: 0;
            visibility: hidden;
            display: none;
        }

        to {
            transform: translateX(-50%);
            opacity: 1;
            visibility: visible;
            display: block;
        }
    }

    @keyframes slideBackLeft {
        from {
            transform: translateX(-50%);
            opacity: 1;
            visibility: visible;
            display: block;
        }

        to {
            transform: translateX(100%);
            opacity: 0;
            visibility: hidden;
            display: none;
        }
    }

    /* Hide level 2 */
    .tbm .tbm-collapse .tbm-item.level-2 > .tbm-submenu {
        display: none !important;
    }

    /* Show level 2 only when parent is open */
    .tbm .tbm-collapse .tbm-item.level-2.open > .tbm-submenu {
        display: block !important;
        animation: slideRightL2 .3s ease-in-out forwards;
    }

    .tbm .tbm-collapse .tbm-item.level-2.open >.tbm-submenu.closing {
        animation: slideBackLeft2 .3s ease-in-out forwards;
    }

    /* Hide level 3 submenus */
    .tbm .tbm-collapse .tbm-item.level-3 > .tbm-submenu {
        display: none !important;
    }

    /* Show level 3 only when parent is open */
    .tbm .tbm-collapse .tbm-item.level-3.open > .tbm-submenu {
        display: block !important;
        animation: slideRightL2 .3s ease-in-out forwards;
    }

    .tbm .tbm-collapse .tbm-item.level-3.open > .tbm-submenu.closing {
        animation: slideBackLeft2 .3s ease-in-out forwards;
    }

    @keyframes slideRightL2 {
        from {
            transform: translateX(100%);
            opacity: 0;
            visibility: hidden;
            display: none;
        }

        to {
            transform: translateX(0%);
            opacity: 1;
            visibility: visible;
            display: block;
        }
    }

    @keyframes slideBackLeft2 {
        from {
            transform: translateX(0%);
            opacity: 1;
            visibility: visible;
            display: block;
        }

        to {
            transform: translateX(100%);
            opacity: 0;
            visibility: hidden;
            display: none;
        }
    }

    /* Hide 2d and 3d level items by default */
    .tbm .tbm-collapse .tbm-item.level-2,
    .tbm .tbm-collapse .tbm-item.level-3 {
        display: none !important;
    }

    /* Show 2d level items only when parent is open */
    .tbm .tbm-collapse .tbm-item.level-1.open .tbm-item.level-2 {
        display: block !important;
        position: unset;
    }

    /* Show 3d level items only when parent is open  */
    .tbm .tbm-collapse .tbm-item.level-2.open .tbm-item.level-3 {
        display: block !important;
    }

    /* Hide embedded blocks in mobile */
    .tbm .tbm-collapse .tbm-block {
        display: none !important;
    }

    /* Mobile menu toggle button */
    .tbm .tbm-collapse .tbm-submenu-toggle,
    .tbm.tbm--mobile .tbm-submenu .tbm-submenu-toggle {
        position: absolute;
        right: 0;
        top: 0;
        width: 50px;
        height: 100%;
        background: transparent;
        border: none;
        color: #fff;
        font-size: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
    }

    .tbm .tbm-collapse .tbm-submenu-toggle::before {
        content: unset;
    }

    .tbm .tbm-collapse .tbm-link-container {
        position: relative;
        padding-right: 50px;
    }

    .tbm .tbm-collapse .tbm-nav>li>.tbm-link-container>a,
    .tbm .tbm-collapse .tbm-nav>li>.tbm-link-container>span {
        display: block;
        font-size: 20px;
        font-size: 2rem;
        line-height: 1.2;
        padding: 20px 30px 20px 0;
        position: relative;
    }

    .tbm .tbm-nav > .active >.tbm-link-container > a,
    .tbm .tbm-nav > .active >.tbm-link-container > a:hover,
    .tbm .tbm-nav > .active > .tbm-link-container > a:focus,
    .tbm .tbm-nav > .active > .tbm-link-container > span.tbm-no-link,
    .tbm .tbm-nav > .active > .tbm-link-container > span.tbm-no-link:hover,
    .tbm .tbm-nav > .active > .tbm-link-container > span.tbm-no-link:focus,
    .tbm .tbm-nav > .active > .tbm-link-container > a,
    .tbm .tbm-collapse .tbm-nav >li.active >.tbm-link-container > a:hover,
    .tbm .tbm-collapse .tbm-nav >li > .tbm-link-container > a:hover,
    .tbm .tbm-collapse .tbm-nav >li > .tbm-link-container > a:focus,
    .tbm .tbm-collapse .tbm-nav >li > .tbm-link-container > a,
    .tbm .tbm-collapse .tbm-nav >li > .tbm-link-container > span.tbm-no-link:hover,
    .tbm .tbm-collapse .tbm-nav >li > .tbm-link-container > span.tbm-no-link:focus {
        background-image: none;
        background: #292929 !important;
        background-color: #292929 !important;
        color: #fff !important;
        border-color: transparent;
    }

    .tbm .tbm-collapse .tbm-nav > li,
    .tbm .tbm-collapse .tbm-subnav > li {
        border-top: none;
        border-bottom: 1px solid #494949;
    }
    .tbm .tbm-nav li.level-1.active {
        border-width: 3px;
        border-bottom-color: #F70;
    }

    .tbm-item.level-1 .tbm-submenu ul>li.abc a,
    a#back1,
    a#back3 {
        padding: 20px 0;
        display: block;
    }

    .tbm .tbm-nav li.tbm-item--has-dropdown>.tbm-link-container>.tbm-submenu-toggle::before {
        content: unset;
    }

    .block-tbm {
        position: unset;
    }

    .tbm .tbm-collapse,
    .tbm .tbm-collapse.collapse {
        z-index: 500;
        left: 0px !important;
        width: 100vw !important;
        margin-top: 0;
    }

    .navigation-main {
        position: unset;
    }

    .tbm .btn {
        border: none !important;
        background: white !important;
    }

    .tbm {
        position: unset;
    }

    /* Hamburger button styles */
    .tbm-button {
        position: unset;
        margin: 10px;
        border: none;
        background: none;
    }

    .tbm-button .tbm-button-container {
        width: 30px;
        height: 20px;
    }

    .tbm-button .tbm-button-container span {
        background-color: #0e008a;
        display: block;
        position: absolute;
        height: 3px;
        width: 100%;
        border-radius: 9px;
        opacity: 1;
        left: 0;
        transform: rotate(0deg);
        transition: .25s ease-in-out;
    }

    .tbm-button-container span:nth-child(1) {
        top: 0;
    }

    .tbm-button-container span:nth-child(2) {
        top: 10px;
    }

    .tbm-button-container span:nth-child(3) {
        top: 20px;
    }

    .tbm-button[aria-expanded="true"] .tbm-button-container span:nth-child(1) {
        top: 11px;
        width: 100%;
        left: 0;
        -webkit-transform: rotate(135deg);
        -moz-transform: rotate(135deg);
        -o-transform: rotate(135deg);
        transform: rotate(135deg);
    }

    .tbm-button[aria-expanded="true"] .tbm-button-container span:nth-child(2) {
        opacity: 0;
        left: -60px;
    }

    .tbm-button[aria-expanded="true"] .tbm-button-container span:nth-child(3) {
        top: 11px;
        -webkit-transform: rotate(-135deg);
        -moz-transform: rotate(-135deg);
        -o-transform: rotate(-135deg);
        transform: rotate(-135deg);
    }

    .hide {
        display: none;
    }

    .show {
        display: block;
    }

}
