// /**
//  * Copyright Â© Magento, Inc. All rights reserved.
//  * See COPYING.txt for license details.
//  */

//
//  Main elements -> Actions bar -> Store Switcher
//  _____________________________________________

//  ToDo UI:  Consist old styles, should be changed with new design

.store-switcher {
    color: @text__color;
    float: left;
    font-size: round(@font-size__base - .1rem, 1);
    margin-top: .59rem;

    .admin__action-dropdown {
        background-color: @page-main-actions__background-color;
        margin-left: .5em;
    }

    .dropdown {
        .lib-dropdown(
        @_options-selector: ~'.dropdown-menu',
        @_dropdown-list-border: 1px solid @color-gray65-lighten,
        @_dropdown-list-pointer: false,
        @_icon-font-line-height: 2,
        @_icon-font-color: @text__color,
        @_icon-font-color-hover: @text__color,
        @_icon-font-color-active: @text__color,
        @_dropdown-list-item-hover: transparent,
        @_dropdown-list-item-padding: 0,
        @_dropdown-list-min-width: 19.5rem,
        @_dropdown-list-shadow: @component__box-shadow__base
        );
    }

    .dropdown-menu {
        left: 0;
        margin-top: .5em;
        max-height: 250px;
        overflow-y: auto;
        padding-top: .25em;
        &::-webkit-scrollbar {
            -webkit-appearance: none;
            width: 7px;
        }
        &::-webkit-scrollbar-thumb {
            background-color: rgba(0, 0, 0, .5);
            border-radius: 4px;
        }

        li {
            border: 0;
            cursor: default;

            &:hover {
                cursor: default;
            }

            a,
            span {
                color: @text__color;
                display: block;
                padding: .5rem 1.3rem;
            }

            a {
                text-decoration: none;

                &:hover {
                    background: @color-lighter-gray;
                }
            }

            span {
                color: @color-gray68;
                cursor: default;
            }

            &.current {
                span {
                    background: @color-gray-darken0;
                    color: @text__color;
                }
            }
        }

        .store-switcher-store {
            a,
            span {
                padding-left: 2.6rem;
            }
        }

        .store-switcher-store-view {
            a,
            span {
                padding-left: 3.9rem;
            }
        }

        .dropdown-toolbar {
            border-top: 1px solid @color-gray92;
            margin-top: 1rem;

            a {
                &:before {
                    &:extend(.abs-icon all);
                    content: @icon-systems__content;
                    margin-right: .25em;
                    position: relative;
                    top: 1px;
                }
            }
        }
    }
}

.store-switcher-label {
    font-weight: @font-weight__bold;
}

.store-switcher-alt {
    display: inline-block;
    position: relative;

    &.active {
        .dropdown-menu {
            display: block;
        }
    }

    .dropdown-menu {
        margin-top: 2px;
        white-space: nowrap;

        ul {
            list-style: none;
            margin: 0;
            padding: 0;
        }
    }

    strong {
        color: @color-gray65-almost;
        display: block;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.333;
        padding: 5px 10px;
    }

    .store-selected {
        color: @color-brownie-light;
        cursor: pointer;
        font-size: 12px;
        font-weight: 400;
        line-height: 1.333;

        &:after {
            -webkit-font-smoothing: antialiased;
            color: @color-dark-grayish-orange;
            content: '\e02c'; // Arrow down icon
            font-style: normal;
            font-weight: normal;
            margin: 0 0 0 3px;
            speak: none;
            vertical-align: text-top;
        }
    }

    .store-switcher-website,
    .store-switcher-store {
        padding: 0;

        &:hover {
            background: none;
        }
    }

    .store-switcher-store-view {
        padding: 0;
    }

    .store-switcher-all,
    .manage-stores {
        padding: 0;

        > a {
            color: @color-brownie-light;
            display: block;
            font-size: 12px;
            padding: 8px 15px;
            text-decoration: none;
        }
    }
}

.store-switcher-website {
    margin: 5px 0 0;

    > strong {
        padding-left: 13px;
    }
}

.store-switcher-store {
    margin: 1px 0 0;

    > strong {
        padding-left: 20px;
    }

    > ul {
        margin-top: 1px;
    }
}

.store-switcher-store-view {
    &:first-child {
        border-top: 1px solid @color-gray90;
    }

    > a {
        color: @color-gray20;
        display: block;
        font-size: 13px;
        padding: 5px 15px 5px 24px;
        text-decoration: none;
    }
}

.store-view {
    &:not(.store-switcher) {
        float: left;
        margin-top: 13px;
    }

    .store-switcher-label {
        display: inline-block;
    }
}

//
//  Tooltip
//  ---------------------------------------------

.tooltip {
    display: inline-block;
    margin-left: .5em;

    .help {
        span,
        a {
            cursor: pointer;
            display: inline-block;
            height: 22px;
            position: relative;
            vertical-align: middle;
            width: 22px;
            z-index: 2;

            &:before {
                &:extend(.abs-icon all);
                color: @text__color;
                content: @icon-help__content;
                font-size: 1.7rem;
            }

            span {
                &:extend(.abs-visually-hidden all);
            }
        }

        a {
            &:hover {
                text-decoration: none;
            }
        }
    }

    .tooltip-content {
        background: rgba(49, 48, 43, .8);
        background: @color-black;
        border-radius: 3px;
        color: @color-white;
        display: none;
        margin-left: -19px;
        margin-top: 10px;
        max-width: 200px;
        padding: 4px 8px;
        position: absolute;
        text-shadow: none;
        z-index: 20;

        &:before {
            border-bottom: 5px solid @color-black;
            border-left: 5px solid transparent;
            border-right: 5px solid transparent;
            content: '';
            height: 0;
            left: 20px;
            opacity: .8;
            position: absolute;
            top: -5px;
            width: 0;
        }

        &.loading {
            position: absolute;

            &:before {
                border-bottom-color: rgba(0, 0, 0, .3);
            }
        }
    }

    &:hover > .tooltip-content {
        display: block;
    }
}
