@use 'sass:math';

.-dark-mode {
    background-color: $gg-dark-2;
}

.-has-page-header {
    padding-top: ($unit * 7) !important;
}

.gds-slide-out {
    .gds-page-header__logo {
        transform: translateX(-25rem);

        @media #{$phone-width}, #{$phablet-width} {
            display: none;
        }
    }

    .gds-page-header {
        transform: translateX(25rem);

        @media #{$phablet-width} {
            transform: translateX(20rem);
        }

        @media #{$phone-width} {
            transform: translateX(15rem);
        }
    }

    .gds-page-header__nav-bar {
        color: $pageHeaderPrimaryBackgroundColor;
    }

    .gds-slide-nav__user-name {
        @media #{$phone-width}, #{$phablet-width} {
            display: none;
        }
    }

    .gds-page-header__menu-line {
        transition-delay: 250ms !important;
    }

    .gds-page-header__menu-line:nth-child(1) {
        top: 7px;
        width: 0%;
        left: 50%;
    }

    .gds-page-header__menu-line:nth-child(2) {
        transform: rotate(45deg);
    }

    .gds-page-header__menu-line:nth-child(3) {
        transform: rotate(-45deg);
    }

    .gds-page-header__menu-line:nth-child(4) {
        top: 7px;
        width: 0%;
        left: 50%;
    }

    .gds-page-header__page-name {
        transform: translateY(0) !important;
    }

    .gds-page-header__primary-nav:hover {
        .gds-page-header__menu-line:nth-child(1) {
            top: 7px;
            width: 0%;
            left: 50%;
        }

        .gds-page-header__menu-line:nth-child(2) {
            transform: rotate(45deg);
            left: 0;
            top: 9px;
            width: 100%;
        }

        .gds-page-header__menu-line:nth-child(3) {
            transform: rotate(-45deg);
            left: 0;
            top: 9px;
            width: 100%;
        }

        .gds-page-header__menu-line:nth-child(4) {
            top: 7px;
            width: 0%;
            left: 50%;
        }
    }
}

.gds-page-header {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(0);
    width: 100%;
    height: auto;
    color: $primaryDark2Color;
    padding: 0;
    z-index: $z-index-7;
    border-bottom: 1px solid $grayLight2Color;
    @include transition-ease-out(all, 250ms);
}

.gds-page-header--dark {
    border-bottom: 1px solid $gg-dark-2;
    &:hover {
        box-shadow: 0 ($unit * 0.5) $unit rgba(0, 0, 0, 0.5);

        .gds-page-header__product-bar {
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
        }
    }
}

.gds-page-header__product-bar {
    position: relative;
    background-color: #ffffff;
    width: 100%;
    padding: ($unit * 0.5);
    z-index: $z-index-2;
    overflow: hidden;
    border-bottom: 1px solid $grayLight2Color;
    @include transition-ease-out(all, 250ms);
    height: 41px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gds-page-header__product-bar--collapsed {
    height: math.div($unit, 3);
    padding: 0 ($unit * 0.5);

    .gds-page-header__product-name {
        opacity: 0;
    }

    .gds-page-header__logo,
    .gds-page-header__product-img {
        opacity: 0;
    }

    &:hover {
        height: 41px;
        padding: ($unit * 0.5);

        .gds-page-header__product-name {
            opacity: 1;
        }

        .gds-page-header__logo {
            opacity: 1;
        }
    }
}

.gds-page-header__product-name {
    font-size: $font-size-minus-2;
    font-family: $sec-font-bold;
    font-weight: $font-weight-bolder;
    line-height: $unit;
    color: $primaryDark5Color;
    text-transform: uppercase;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: $unit * 0.45;
    cursor: default;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    @include transition-ease-out(all, 250ms);
}

.gds-page-header__product-name--two-lines {
    font-size: 0.6rem;
    line-height: 0.9rem;
    letter-spacing: 0.4rem;
}

.gds-page-header__product-img {
    height: ($unit * 0.8);
    @include transition-ease-out(all, 100ms);
}

.gds-page-header__product-img--two-lines {
    height: ($unit * 1.5);
}

.gds-page-header__nav-bar {
    position: relative;
    color: $gg-light-4;
    background-color: rgba(white, 0.9);
    width: 100%;
    z-index: $z-index-1;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.gds-page-header__nav-bar--dark {
    color: $gg-light-2;
    background-color: rgba($gg-dark-3, 0.98);
}

.gds-page-header__logo {
    height: ($unit * 1.5);
    padding-right: $unit * 0.5;
    @include transition-ease-out(all, 250ms);
}

.gds-page-header__primary-nav {
    float: left;
    cursor: pointer;
    padding: ($unit * 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 100px;
    @include transition-ease-out(all, 250ms);
}

.gds-page-header__primary-nav:hover {
    .gds-page-header__page-name {
        color: $pageHeaderSecondaryBackgroundColor;
    }

    .gds-page-header__menu-line {
        background-color: $pageHeaderSecondaryBackgroundColor;
        transition-delay: 0s;
    }

    .gds-page-header__menu-line:nth-child(1) {
        top: 3px;
        transform: rotate(-45deg);
        width: 50%;
    }

    .gds-page-header__menu-line:nth-child(2),
    .gds-page-header__menu-line:nth-child(3) {
        top: 9px;
        width: 75%;
        left: 2px;
    }

    .gds-page-header__menu-line:nth-child(4) {
        top: 15px;
        transform: rotate(45deg);
        width: 50%;
    }
}

// Hide breadcrumbs when gds-slide-nav menu is open
.gds-slide-out .gds-page-header__breadcrumb-nav {
    display: none;
}

.gds-page-header__breadcrumb-nav {
    float: left;
    padding: math.div($unit, 1.75);
    margin-left: ($unit * 0.75);
    padding-left: ($unit * 1.25);
    white-space: nowrap;

    &:empty {
        &:before {
            background-color: transparent;
        }
    }

    @media #{$phone-width}, #{$phablet-width}, #{$tablet-width} {
        display: none;
    }

    &:before {
        content: '';
        height: calc(100% + 3px);
        width: 1px;
        background-color: rgba($gg-light-2, 0.75);
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;

        @media #{$phone-width}, #{$phablet-width} {
            display: none;
        }
    }
}

.gds-page-header__breadcrumb-nav--nonresponsive {
    @media #{$phone-width}, #{$phablet-width} {
        display: block;
    }
}

.gds-page-header__breadcrumbs {
    margin-top: 1px;
    padding: 0;
    white-space: nowrap;
    color: $gg-light-3;
}

.gds-page-header__breadcrumbs-list-item {
    float: left;
    font-size: $font-size-minus-1;
    @include transition-back(all, 250ms);
    margin-right: ($unit * 2);

    &:not(:last-child):after {
        content: '';
        display: block;
        position: absolute;
        top: -8px;
        right: -18px;
        width: 13px;
        height: 46px;
        background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIxLjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxMS44IDQ3LjQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDExLjggNDcuNDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsLXJ1bGU6ZXZlbm9kZDtjbGlwLXJ1bGU6ZXZlbm9kZDtmaWxsOiNEQkRCREI7fQo8L3N0eWxlPgo8cG9seWdvbiBjbGFzcz0ic3QwIiBwb2ludHM9IjExLjgsMjMuNyAwLjgsMCAwLDAgMTEsMjMuNyAwLDQ3LjQgMC44LDQ3LjQgMTEuOCwyMy43IDExLjgsMjMuNyAiLz4KPC9zdmc+Cg==');
        background-size: 100% 100%;
        pointer-events: none;
    }
    & .-ellipsis {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 125px;
        display: block;
    }
    > .gds-page-header__breadcrumbs-list-item {
        margin-right: 0;
        padding-right: ($unit * 0.5);
    }
}

.gds-page-header__breadcrumbs-list-item--has-menu {
    padding-left: 15px;
}

.gds-page-header__breadcrumbs-menu {
    position: absolute;
    top: 3px;
    left: -9px;
    width: 20px;
    height: 20px;
    cursor: pointer;

    &:hover .gds-page-header__breadcrumbs-menu-dots {
        background-color: $pageHeaderSecondaryBackgroundColor;
    }

    &:hover .gds-page-header__breadcrumbs-menu-dots:before {
        transform: translateY(-2px);
        background-color: $pageHeaderSecondaryBackgroundColor;
    }

    &:hover .gds-page-header__breadcrumbs-menu-dots:after {
        transform: translateY(2px);
        background-color: $pageHeaderSecondaryBackgroundColor;
    }
}

.gds-page-header__breadcrumbs-menu-dots {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: $gg-light-3;
    border-radius: 50%;
    top: 9px;
    left: 9px;
    @include transition-ease-out(all, 250ms);

    &:before,
    &:after {
        content: '';
        display: block;
        position: absolute;
        width: 2px;
        height: 2px;
        background-color: $gg-light-3;
        border-radius: 50%;
        @include transition-ease-out(all, 250ms);
    }

    &:before {
        top: -5px;
    }

    &:after {
        top: 5px;
    }

    & ~ .gds-bubble__menu {
        left: -5px;
    }
}

.gds-page-header__breadcrumbs-link {
    color: $pageHeaderSecondaryBackgroundColor;
    text-decoration: none;
    padding-right: ($unit * 0.5);

    &:hover {
        color: $pageHeaderPrimaryBackgroundColor;
    }
    & .-ellipsis {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 125px;
        display: block;
    }
}

// Animated hamburger menu & close x icon
.gds-page-header__menu {
    vertical-align: top;
    width: 32px;
    height: 25px;
    position: relative;
    margin-top: math.div($unit, 3);
    margin-right: ($unit * 0.5);
    transform: rotate(0deg);
    @include transition-ease-out(all, 250ms);
    transition-delay: 200ms;
    background-color: transparent;
    border: 0;
    outline: 0;
    cursor: pointer;

    &:focus {
        border: 0;
        outline: 0;
    }
}

// Back arrow
.gds-page-header__menu--back {
    .gds-page-header__menu-line:nth-child(1) {
        top: 3px;
        transform: rotate(-45deg);
        width: 50%;
    }

    .gds-page-header__menu-line:nth-child(2),
    .gds-page-header__menu-line:nth-child(3) {
        top: 9px;
        width: 75%;
        left: 2px;
    }

    .gds-page-header__menu-line:nth-child(4) {
        top: 15px;
        transform: rotate(45deg);
        width: 50%;
    }
}

.gds-page-header__menu-line {
    display: block;
    position: absolute;
    height: 1px;
    width: 100%;
    background: #acacac;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    @include transition-ease-out(all, 250ms);
}

.gds-page-header__menu-line:nth-child(1) {
    top: 2px;
}

.gds-page-header__menu-line:nth-child(2),
.gds-page-header__menu-line:nth-child(3) {
    top: 9px;
}

.gds-page-header__menu-line:nth-child(4) {
    top: 16px;
}

.gds-page-header__secondary-nav {
    position: absolute;
    top: 0;
    right: 0;
    background-color: white;
    height: ($unit * 2);
    transition: all 250ms cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: ($unit * 0.5) $unit ($unit * 0.5) ($unit * 0.5);
    height: calc(#{$unit * 3} - 2px);

    &:before {
        content: '';
        position: absolute;
        top: 0;
        left: -30px;
        width: 30px;
        height: 100%;
        background: -moz-linear-gradient(
            left,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 1) 100%
        );
        background: -webkit-linear-gradient(
            left,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 1) 100%
        );
        background: linear-gradient(
            to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 1) 100%
        );
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=1 );
    }
}

.-dark-mode .gds-page-header__secondary-nav:before {
    background: -moz-linear-gradient(left, rgba(68, 68, 68, 0) 0%, rgba(68, 68, 68, 1) 100%);
    background: -webkit-linear-gradient(left, rgba(68, 68, 68, 0) 0%, rgba(68, 68, 68, 1) 100%);
    background: linear-gradient(to right, rgba(68, 68, 68, 0) 0%, rgba(68, 68, 68, 1) 100%);
}

.gds-page-header__secondary-nav--dark {
    background-color: $gg-dark-3;
}

.gds-slide-out .gds-page-header__secondary-nav {
    transform: translateX(-25rem);

    @media #{$phone-width}, #{$phablet-width} {
        display: none;
    }
}

.gds-page-header__secondary-nav__icon-holder {
    display: inline-block;
    width: ($unit * 2);
    height: ($unit * 2);
    margin-left: ($unit * 0.5);
    text-align: center;
    line-height: ($unit * 1.83);
    font-size: ($unit * 1.3);
    bottom: 0.4 * $unit;
}

.gds-page-header__secondary-nav__icon {
    width: 100%;
    height: 100%;
}

.gds-page-header__secondary-nav__icon-link {
    color: $gg-light-4;
    @include transition-ease-out(all, 250ms);
    &:hover {
        color: $pageHeaderSecondaryBackgroundColor;
    }
}

.gds-page-header__secondary-nav__icon-link--dark {
    color: $gg-light-2;
}

.gds-page-header__secondary-nav__icon--active .gds-page-header__secondary-nav__icon-link {
    color: $pageHeaderSecondaryBackgroundColor;
}

/*alias - need to phase this out*/
.gds-page-header__secondary-nav__icon--link {
    color: $gg-light-4;
    @include transition-ease-out(all, 250ms);
    &:hover {
        color: $pageHeaderSecondaryBackgroundColor;
    }
}

.gds-page-header__page-name {
    margin-bottom: 0;
    display: inline-block;
    vertical-align: top;
    font-size: ($unit * 1.2);
    line-height: 1.6;
    margin-left: ($unit * 0.5);
    transform: translateZ(0);
    @include transition-ease-out(all, 250ms);
}
