/**
 * menu.css
 * responsive menu
 */


/* global */

.menu {
    position: absolute;
    top: 100px;
    left: 0;
    bottom: 0;
    width: 100%;
    background: #3a4b65;
    padding-left: 20px;
    font-size: 14px;
    text-transform: uppercase;
}
.menu a {
    color: #ffffff;
    text-decoration: none;
}
.menu input[type=checkbox] {
    display: none;
}
#menu {
    display: none;
}



/* title */

.menu .title {
    display: none;
    position: absolute;
    top: 0;
    height: 65px;
    left: 14px;
    right: 65px;
    overflow: hidden;
    line-height: 65px;
}
.menu .title a {
    color: #5a8ee2;
}
.menu .title span {
    color: #ffffff;
}
.menu .title a:before,
.menu .title span:before {
    content: '\025B8';
    display: inline-block;
    margin: 0 6px 0 4px;
}
.menu .title a:first-child:before,
.menu .title span:first-child:before {
    display: none;
}



/* icon */

.menu .icon {
    display: none;
    margin: 0;
    height: 65px;
    width: 65px;
    float: right;
}
.menu .icon span {
    display: block;
    height: 2px;
    width: 24px;
    background: #ffffff;
    margin: 4px auto 0 auto;
    -webkit-transition: -webkit-transform 0.3s ease;
       -moz-transition:    -moz-transform 0.3s ease;
            transition:         transform 0.3s ease;
}
.menu .icon span:first-child {
    margin-top: 26px;
}




/* list */

.menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #3a4b65;
}
.menu ul li {
    position: relative;
}
.menu ul li a {
    display: block;
    padding: 0 14px;
    font-size: 14px;
    text-transform: uppercase;
    color: #fff;
    -webkit-transition: background 0.3s ease;
       -moz-transition: background 0.3s ease;
            transition: background 0.3s ease;
}
.menu ul li a:hover {
    text-decoration: none;
    background: rgba(255, 255, 255, .1);
}
.menu ul li ul {
    position: absolute;
    top: 100%;
    left: 0;
    width: 240px;
    visibility: hidden;
}
.menu ul li:hover > ul {
    visibility: visible;
}
.menu ul li ul li:hover {
    background: rgba(255, 255, 255, .1);
}
.menu ul li ul li a {
    line-height: 40px;
    height: 40px;
}
.menu ul li ul li ul {
    left: 100%;
    top: 0;
    background: #4D5D74;
}



/* first level */

.menu > ul {
    height: 100%;
    position: relative;
}
.menu > ul > li {
    float: left;
}
.menu > ul > li > a {
    line-height: 65px;
    height: 65px;
}
.menu > ul > li > a.active {
    color: #5a8ee2;
    border-bottom: solid 5px #0f1e3b;
}



/* buttons */

.menu ul li.buttons {
    position: static;
    float: right;
    height: 100%;
}
.menu ul li.buttons a,
.menu ul li.buttons label {
    float: right;
    height: 30px;
    line-height: 28px;
    margin: 17px 14px 0 0;
    cursor: pointer;
    padding: 0;
}
.menu ul li.buttons a:hover {
    background: none;
}
.menu ul li.buttons a i,
.menu ul li.buttons label i {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    width: 30px;
    height: 30px;
}
.menu ul li.buttons a i:before,
.menu ul li.buttons a i:after,
.menu ul li.buttons label i:before,
.menu ul li.buttons label i:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 30px;
    width: 30px;
    background-size: cover;
    -webkit-transition: opacity 0.2s ease;
       -moz-transition: opacity 0.2s ease;
            transition: opacity 0.2s ease;
}

.menu ul li.buttons .search i:before {background-image: url("../images/search-gray.png");}
.menu ul li.buttons .search i:after  {background-image: url("../images/search-white.png");}
.menu ul li.buttons .login i:before  {background-image: url("../images/login-gray.png");}
.menu ul li.buttons .login i:after   {background-image: url("../images/login-white.png");}

.menu ul li.buttons i:before              {opacity: 1;}
.menu ul li.buttons i:after               {opacity: 0;}
.menu ul li.buttons a:hover i:before      {opacity: 0;}
.menu ul li.buttons a:hover i:after       {opacity: 1;}
.menu ul li.buttons label:hover i:before  {opacity: 0;}
.menu ul li.buttons label:hover i:after   {opacity: 1;}

.menu ul li.buttons a span {
    display: inline-block;
    vertical-align: middle;
    height: 30px;
    border: 1px solid #929292;
    color: #929292;
    margin-left: 3px;
    font-size: 12px;
    text-transform: none;
    padding: 0 16px;
    -webkit-transition: color 0.2s ease, border-color 0.2s ease;
       -moz-transition: color 0.2s ease, border-color 0.2s ease;
            transition: color 0.2s ease, border-color 0.2s ease;
}
.menu ul li.buttons a:hover span {
    border-color: #ffffff;
    color: #ffffff;
}
.menu ul li.buttons form {
    position: absolute;
    top: 0;
    left: 0;
    right: 210px;
    height: 0;
}
.menu ul li.buttons form p {
    margin: 0;
    position: absolute;
    top: 17px;
    right: 0;
    overflow: hidden;
    width: 0;
    height: 30px;
    background: #ffffff;
    -webkit-transition: width 0.5s ease;
       -moz-transition: width 0.5s ease;
            transition: width 0.5s ease;
}
.menu ul li.buttons form input {
    position: absolute;
    height: 30px;
    background: none;
    border: none;
}
.menu ul li.buttons form input:focus {
    outline: none;
}
.menu ul li.buttons form input[type=submit] {
    right: 0;
    width: 120px;
    color: #000;
    font-style: italic;
    font-size: 16px;
}
.menu ul li.buttons form input[type=text] {
    left: 0;
    width: 100%;
    padding: 0 120px 0 16px;
    font-size: 15px;
    color: #333;
}
.menu ul li.buttons #search:checked + form {
    height: 65px;
}
.menu ul li.buttons #search:checked + form p {
    width: 100%;
}



/* mobile */

@media (max-width: 991px) {
    .menu .title {
        display: block;
    }
    .menu .icon {
        display: block;
    }
    .menu > ul {
        position: absolute;
        top: 65px;
        bottom: 0;
        left: 0;
        height: auto;
        width: 100%;
        overflow: auto;
    }
    .menu ul {
        background: rgba(255,255,255,0.05);
    }
    .menu > ul > li {
        float: none;
    }
    .menu ul li ul {
        position: relative;
        visibility: visible;
        width: 100%;
    }
    .menu > ul > li > a.active {
        border-bottom: none;
    }
    .menu > ul > li > a {
        height: 40px;
        line-height: 40px;
    }
    .menu ul li ul li ul {
        left: 0;
        background: none;
    }
    .menu ul li ul li a {
        padding-left: 30px;
    }
    .menu ul li ul li ul li a {
        padding-left: 40px;
    }
    .menu ul li ul li:hover {
        background: none;
    }
    .menu ul li.buttons {
        position: relative;
        height: auto;
        float: none;
        overflow: hidden;
        padding-bottom: 30px;
    }
    .menu ul li.buttons a,
    .menu ul li.buttons label {
        float: left;
        clear: both;
        padding: 0 14px;
        height: 30px;
        line-height: 26px;
        margin: 12px 0 0 0;
    }
    .menu ul li.buttons form {
        top: 54px;
        left: 50px;
        right: 20px;
    }
    .menu ul li.buttons form p {
        right: auto;
        left: 0;
        top: 0;
    }
    .menu ul li.buttons form input[type=submit] {
        display: none;
    }
    .menu ul li.buttons form input[type=text] {
        padding-right: 0;
    }
    .menu ul li.buttons #search:checked + form {
        height: 30px;
    }

    #menu:checked + header {
        height: 100%;
    }
    #menu:checked + header .menu .icon span:nth-child(1) {
        -webkit-transform: translateY(6px) rotate(-45deg);
           -moz-transform: translateY(6px) rotate(-45deg);
                transform: translateY(6px) rotate(-45deg);
    }
    #menu:checked + header .menu .icon span:nth-child(2) {
        opacity: 0;
    }
    #menu:checked + header .menu .icon span:nth-child(3) {
        -webkit-transform: translateY(-6px) rotate(45deg);
           -moz-transform: translateY(-6px) rotate(45deg);
                transform: translateY(-6px) rotate(45deg);
    }
}