
:root {
    --global-nav__button-width:336px;
    --global-nav__button-width-half:calc(336px/2);
    --global-nav__button-height:64px;
}

.global-nav__button {
    width: var(--global-nav__button-width);
    position: relative;
    border: solid 2px rgba(255,255,255,0.3);
    height: var(--global-nav__button-height);
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
}
.global-nav__button:hover .hoverBtn:before, .global-nav__button:hover .hoverBtn:after {
    opacity: 1;
    -webkit-animation: open 0.4s;
    /* Chrome, Safari, Opera */
    animation: open 0.4s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.39, 0.575, 0.565, 1);
    animation-direction: normal;
}
.global-nav__button:hover .hoverBtn-bottom:before, .global-nav__button:hover .hoverBtn-bottom:after {
    opacity: 1;
    -webkit-animation: openB 0.4s;
    /* Chrome, Safari, Opera */
    animation: openB 0.4s;
    animation-delay: 0.4s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.39, 0.575, 0.565, 1);
    animation-direction: normal;
}
.global-nav__button p {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    text-align: center;
    color: #fff;
    font-size: 22px;
    line-height: var(--global-nav__button-height);
    letter-spacing: 1px;
}

.hoverBtn {
    width: 100%;
    height: var(--global-nav__button-height);
    position: absolute;
    top: -1px;
}
.hoverBtn:before {
    position: absolute;
    top: -1px;
    content: "";
    height: 0;
    width: 0;
    display: block;
    opacity: 0;
    border-top: solid 2px #fff;
    border-left: solid 2px #fff;
    -webkit-border-top-left-radius: 5px;
    -moz-border-top-left-radius: 5px;
    border-top-left-radius: 5px;
    -webkit-border-bottom-left-radius: 5px;
    -moz-border-bottom-left-radius: 5px;
    border-bottom-left-radius: 5px;
    right: calc(var(--global-nav__button-width-half) - 2px);
}
.hoverBtn:after {
    position: absolute;
    content: "";
    top: -1px;
    height: 0;
    width: 0;
    display: block;
    opacity: 0;
    border-top: solid 2px #fff;
    border-right: solid 2px #fff;
    -webkit-border-top-right-radius: 5px;
    -moz-border-top-right-radius: 5px;
    border-top-right-radius: 5px;
    -webkit-border-bottom-right-radius: 5px;
    -moz-border-bottom-right-radius: 5px;
    border-bottom-right-radius: 5px;
    left: calc(var(--global-nav__button-width-half) - 2px);
}

.hoverBtn-bottom {
    width: 100%;
    height: var(--global-nav__button-height);
    position: absolute;
}
.hoverBtn-bottom:before {
    position: absolute;
    bottom: 2px;
    content: "";
    height: 0;
    width: 0;
    display: block;
    opacity: 0;
    height: var(--global-nav__button-height);
    border-bottom: solid 2px #fff;
    -webkit-border-top-right-radius: 5px;
    -moz-border-top-right-radius: 5px;
    border-top-right-radius: 5px;
    -webkit-border-bottom-right-radius: 5px;
    -moz-border-bottom-right-radius: 5px;
    border-bottom-right-radius: 5px;
    right: -1px;
}
.hoverBtn-bottom:after {
    position: absolute;
    content: "";
    bottom: 2px;
    height: 0;
    width: 0;
    display: block;
    opacity: 0;
    height: var(--global-nav__button-height);
    border-bottom: solid 2px #fff;
    -webkit-border-top-left-radius: 5px;
    -moz-border-top-left-radius: 5px;
    border-top-left-radius: 5px;
    -webkit-border-bottom-left-radius: 5px;
    -moz-border-bottom-left-radius: 5px;
    border-bottom-left-radius: 5px;
    left: -1px;
}

@keyframes open {
    0% {
        width: 0;
        height: 0;
    }
    50% {
        width: calc(var(--global-nav__button-width)/2);
        height: 0;
    }
    100% {
        width: calc(var(--global-nav__button-width)/2);
        height: var(--global-nav__button-height);
    }
}
@keyframes openB {
    0% {
        width: 0px;
    }
    100% {
        width: calc(var(--global-nav__button-width)/2);
    }
}
