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

//
//  Variables
//  _____________________________________________

@minicart__border-color: @color-gray80;
@minicart__padding-horizontal: @indent__base;

@minicart-qty__height: 24px;

//
//  Common
//  _____________________________________________

& when (@media-common = true) {

    //
    //  Minicart
    //  ---------------------------------------------

    .block-minicart {
        .items-total {
            float: left;
            margin: 0 @indent__s;
            .count {
                font-weight: @font-weight__bold;
            }
        }
        .subtotal {
            margin: 0 @indent__s;
            text-align: right;
            .label {
                &:extend(.abs-colon all);
            }
        }
        .amount {
            .price-wrapper {
                &:first-child {
                    .price {
                        font-size: @font-size__l;
                        font-weight: @font-weight__bold;
                    }
                }
            }
        }
        .subtitle {
            display: none;
            &.empty {
                display: block;
                font-size: 14px;
                padding: @indent__l 0 @indent__base;
                text-align: center;
            }
        }
        .text {
            &.empty {
                text-align: center;
            }
        }
        .block-content {
            > .actions {
                margin-top: 15px;
                > .secondary {
                    text-align: center;
                }
                > .primary {
                    margin: 0 @indent__s 15px;
                    .action {
                        &.primary {
                            &:extend(.abs-button-l all);
                            display: block;
                            width: 100%;
                        }
                    }
                }
                .paypal-logo {
                    margin-top: 15px;
                    text-align: center;
                }
            }
        }
        .block-category-link,
        .block-product-link,
        .block-cms-link,
        .block-banners {
            margin: 15px 0 0;
            text-align: center;
        }
    }

    .minicart-wrapper {
        .lib-dropdown(
        @_toggle-selector: ~".action.showcart",
            @_options-selector: ~".block-minicart",
            @_dropdown-toggle-icon-content: '\f290',
            @_dropdown-toggle-active-icon-content: '\f290',
            @_dropdown-list-item-padding: false,
            @_dropdown-list-item-hover: false,
            @_icon-font-position: before,
            @_icon-font-size: 26px,
            @_icon-font: 'Fontawesome',
            @_icon-font-line-height: 40px,
            @_icon-font-color: @cpanel-txt-color-white,
            @_icon-font-color-hover: @cpanel-txt-color-theme,
            @_icon-font-color-active: @cpanel-txt-color-white
            );
        float: right;
        position:relative;
        .block-minicart {
            .lib-css(padding, 25px @minicart__padding-horizontal 10px);
            right: 0;
            width: 320px;
            .block-title {
                display: none;
            }
            &:after {
                left: auto;
                right: 25px;
            }
            &:before {
                left: auto;
                right: 26px;
            }
        }
        .product {
            .actions {
                float: right;
                margin: -24px 0 0;
                > .primary,
                > .secondary {
                    display: inline;
                    &:not(:last-child) {
                        margin-right: 15px;
                    }
                }
            }
        }
        .action {
            &.close {
                height: 40px;
                position: absolute;
                right: 0;
                top: 0;
                width: 40px;
                .lib-button-reset();
                .lib-button-icon(
                @icon-remove,
                @_icon-font-color: @minicart-icons-color,
                    @_icon-font-size: 16px,
                    @_icon-font-line-height: 16px,
                    @_icon-font-text-hide: true
                    );
            }
            &.showcart {
                white-space: nowrap;
                .text {
                    color: #ffffff;
                    display: inline-block;
                    font-weight: 600;
                    height: auto;
                    line-height: 40px;
                    margin: 0;
                    position: relative;
                    text-transform: uppercase;
                    width: auto;
                    padding-left: 5px;
                }
                .counter.qty {
                    .lib-css(background, transparent);
                    .lib-css(color, #ffffff);
                    .lib-css(height, 40px);
                    .lib-css(line-height, 40px);
                    display: inline-block;
                    overflow: hidden;
                    white-space: normal;
                    padding-left: 4px;
                    font-weight: 600;
                    vertical-align:top;
                    &.empty {
                        display: inline-block;
                        vertical-align:top;
                    }
                    .loader {
                        > img {
                            .lib-css(max-width, @minicart-qty__height);
                        }
                    }
                }
                .counter-label {
                    &:extend(.abs-visually-hidden all);
                }
            }
        }
        .minicart-widgets {
            margin-top: 15px;
        }
    }

    .minicart-items-wrapper {
        .lib-css(border, 1px solid @minicart__border-color);
        .lib-css(margin, 0 -@minicart__padding-horizontal);
        border-left: 0;
        border-right: 0;
        overflow-x: auto;
        padding: 15px;
    }

    .minicart-items {
        .lib-list-reset-styles();
        .product-item {
            padding: @indent__base 0;
            &:not(:first-child) {
                .lib-css(border-top, 1px solid @minicart__border-color);
            }
            &:first-child {
                padding-top: 0;
            }
            > .product {
                &:extend(.abs-add-clearfix all);
            }
        }
        .product-image-wrapper {
            &:extend(.abs-reset-image-wrapper all);
        }
        .product-item-pricing {
            .label {
                display: inline-block;
                width: 4.5rem;
            }
        }
        .price-minicart {
            margin-bottom: @indent__xs;
        }
        .product-item-name {
            font-weight: 400;
            font-size: 14px;
            margin: 0 0 @indent__s;
            a {
                .lib-css(color, @link__color);
            }
        }
        .product-item-details {
            padding-left: 88px;
            .price {
                font-weight: @font-weight__bold;
            }
            .price-including-tax,
            .price-excluding-tax {
                margin: @indent__xs 0;
            }
            .weee[data-label] {
                .lib-font-size(11);
                .label {
                    &:extend(.abs-no-display all);
                }
            }
            .details-qty {
                margin-top: @indent__s;
            }
        }
        .product {
            > .product-item-photo,
            > .product-image-container {
                float: left;
            }
            .toggle {
                &:extend(.abs-toggling-title all);
                &:after {
                    .lib-css(color, @color-gray56);
                    margin: 0 0 0 @indent__xs;
                    position: static;
                }
                border: 0;
                padding: 0 @indent__xl @indent__xs 0;
            }
            .active {
                > .toggle {
                    .lib-icon-font-symbol(
                    @_icon-font-content: @icon-up,
                        @_icon-font-position: after
                        );
                }
            }
            &.pricing {
                margin-top: 3px;
            }
            &.options {
                .tooltip.toggle {
                    .lib-icon-font(
                    @icon-down,
                    @_icon-font-size: 12px,
                        @_icon-font-line-height: 12px,
                        @_icon-font-text-hide: true,
                        @_icon-font-margin: -3px 0 0 7px,
                        @_icon-font-position: after
                        );
                }
                .details {
                    display: none;
                }
            }
        }
        .details-qty,
        .price-minicart {
            .label {
                &:extend(.abs-colon all);
            }
        }
        .item-qty {
            margin-right: @indent__s;
            text-align: center;
            width: 40px;
        }
        .update-cart-item {
            .lib-font-size(11);
            vertical-align: top;
        }
        .subtitle {
            display: none;
        }
        .action {
            &.edit,
            &.delete {
                .lib-icon-font(
                @icon-edit,
                @_icon-font-size: 18px,
                    @_icon-font-line-height: 20px,
                    @_icon-font-text-hide: true,
                    @_icon-font-color: @minicart-icons-color,
                    @_icon-font-color-hover: @primary__color,
                    @_icon-font-color-active: @minicart-icons-color
                    );
            }
            &.delete {
                .lib-icon-font-symbol(
                @_icon-font-content: @icon-trash
                    );
            }
        }
    }
}

//
//  Mobile
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__xs) {
    .minicart-wrapper .block-minicart {
        width: 290px;
    }
}

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
    .minicart-wrapper {
        margin-top: @indent__s;
    }
}

//
//  Desktop
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .minicart-wrapper {
        margin: 9px 0 0 13px;
        .block-minicart {
            right: 0px;
            width: 390px;
        }
    }
    .minilist .action.delete,
    .minicart-wrapper .action.edit {
        .lib-icon-font-size(
        @_icon-font-size: 16px
            );
    }
}
@media only screen and (max-width: 767px) {
    .minicart-wrapper {
        margin-top: 10px;
    }
}