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

//
//  Variables
//  _____________________________________________

@minicart__padding-horizontal: @indent__base;

@minicart-qty__height: 24px;

//
//  Common
//  _____________________________________________

& when (@media-common = true) {

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

    .block-minicart {
        .items-total {
            float: left;
            .count {
                font-weight: @font-weight__bold;
                color: #000;
            }
        }
        .subtotal {
            text-align: right;
            .label {
                &:extend(.abs-colon all);
            }
        }
        .subtitle {
            display: none;
            &.empty {
                display: block;
                padding: 18px 0;
                text-align: center;
                font-size: inherit;
                font-weight: 400;
            }
        }
        .text {
            &.empty {
                text-align: center;
            }
        }
        .block-content {
            > .actions {
                > .secondary {
                    text-align: center;
                    margin: 0 0 15px;
                    .action {
                        &.viewcart {
                            display: block;
                            width: 100%;
                            padding: 10px 15px;
                            text-transform: uppercase;
                            font-size: 15px;
                            border: 1px solid #ccc;
                            border-radius: 3px;
                        }
                    }
                }
                .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: @icon-mini-cart,
            @_dropdown-toggle-active-icon-content: @icon-mini-cart,
            @_dropdown-list-item-padding: false,
            @_dropdown-list-item-hover: false,
            @_dropdown-list-margin-top: 7px,
            @_dropdown-list-border: 0,
            @_dropdown-list-pointer-position-top: -21px,
            @_icon-font-position: before,
            @_icon-font-size: 26px,
            @_icon-font-line-height: 33px,
            @_icon-font-color: @minicart-icons-color,
            @_icon-font-color-hover: @minicart-icons-color-hover,
            @_icon-font-color-active: @minicart-icons-color
        );
        .block-minicart {
            .lib-css(padding, 15px @minicart__padding-horizontal);
            width: 300px;
            left: 0;
            color: #222529;
            top: 100%;
            margin-top: 13px;
            box-shadow: 0 5px 8px rgba(0,0,0,.15);
            .block-title {
                display: none;
            }
            &:before, &::after {display: none;}
        }
        .product {
            .actions {
                > .primary,
                > .secondary {
                    display: inline;
                }
            }
        }
        .action {
            &.close {
                width: 40px;
                height: 40px;
                top: 0;
                left: 0;
                position: absolute;
                .lib-button-reset();
                .lib-button-icon(
                    @icon-remove,
                    @_icon-font-color: #777,
                    @_icon-font-size: 16px,
                    @_icon-font-line-height: 16px,
                    @_icon-font-text-hide: true
                );
            }
            &.showcart {
                white-space: nowrap;
                display: flex;
                align-items: center;
                position: relative;
                &.active {
                  display: flex;
                  align-items: center;
                  .minicart-icon {
                    &::after {
                      content: "";
                      border-width: 1px 1px 0 0;
                      border-color: #f4f4f4;
                      border-style: solid;
                      background: #fff;
                      width: 14px;
                      height: 14px;
                      position: absolute;
                      top: calc(100%);
                      left: 50%;
                      margin-top: 8px;
                      margin-left: -7px;
                      transform: rotate(-45deg);
                      z-index: 1004;
                      animation: arrowFadeInDown .2s ease-out;
                    }
                  }
                }
                .minicart-icon {
                  font-size: 26px;
                  position: relative;
                  &::before {margin: 0;}
                }
                .text {
                    &:extend(.abs-visually-hidden all);
                }
                .counter.qty {
                    color: @minicart__qty_color;
                    position: absolute;
                    left: 18px;
                    top: -5px;
                    font-size: 10px;
                    font-weight: 600;
                    text-align: center;
                    width: 16px;
                    height: 16px;
                    line-height: 16px;
                    border-radius: 8px;
                    overflow: hidden;
                    color: #fff;
                    background-color: #ff5b5b;
                    padding: 0;
                    .loader {
                        > img {
                            .lib-css(max-width, @minicart-qty__height);
                        }
                    }
                }
                .counter-label {
                    &:extend(.abs-visually-hidden all);
                }
                &:before, &.active:before {
                    color: @minicart__icon_color;
                    line-height: 40px;
                    margin: 0;
                    display: none;
                }
                &:hover:before, &:active:before, &.active:before, &.active:hover:before {
                    color: @minicart__icon_color;
                }
                &::after {
                  content: "\e81c";
                  font-family: 'porto-icons';
                  font-size: 17px;
                  margin-right: 15px;
                  display: block;
                }
            }
        }
        .minicart-widgets {
            padding: 0 10px 0;
        }
    }
    .cart-design-2 {
      .action {
        &.showcart {
          .minicart-icon {
            width: 25px;
            height: 20px;
            border: 2px solid #222529;
            border-radius: 0 0 5px 5px;
            position: relative;
            opacity: 1;
            margin: 6px 3px 0;
            font-size: 32px;
            &::before {
              content: '';
              position: absolute;
              border: 2px solid;
              border-color: inherit;
              border-bottom: none;
              border-radius: 10px 10px 0 0;
              left: 50%;
              top: -8px;
              margin-left: -7.5px;
              width: 15px;
              height: 11px;
            }
          }
        }
      }
    }
    .minicart-items-wrapper {
        overflow-x: auto;
    }

    .minicart-items {
        .lib-list-reset-styles();
        .product-item {
            > .product {
                &:extend(.abs-add-clearfix all);
            }
        }
        .product-image-wrapper {
            &:extend(.abs-reset-image-wrapper all);
        }
        .product-item-pricing {
            .label {
                display: inline-block;
            }
        }
        .price-minicart {
            margin-bottom: @indent__xs;
        }
        .product-item-details {
            text-align: right;
            .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: right;
                min-width: 0;
            }
            .toggle {
                &:after {
                    position: static;
                    margin: 0 0 0 @indent__xs;
                    .lib-css(color, @color-gray56);
                }
                border: 0;
                padding: 0 0 @indent__xs @indent__xl;
            }
            .product.options {
                > .toggle {
                    &:after {
                        font-family: @icon-font-family;
                    }
                    .lib-icon-font-symbol(
                        @_icon-font-content: @icon-down,
                        @_icon-font-position: after
                    );
                }
                &.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 7px 0 0,
                        @_icon-font-position: after
                    );
                }
                .details {
                    display: none;
                }
            }
        }
        .details-qty,
        .price-minicart {
            .label {
                &:extend(.abs-colon all);
            }
        }
        .item-qty {
            width: 40px;
            text-align: center;
            margin-left: @indent__s;
            border-radius: 3px;
        }
        .update-cart-item {
            vertical-align: top;
            .lib-font-size(11);
        }
        .subtitle {
            display: none;
        }
    }

}

//
//  Mobile
//  _____________________________________________

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



//
//  Desktop
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .minicart-wrapper {
        .block-minicart {
            right: auto;
        }
    }
    .minilist .action.delete,
    .minicart-wrapper .action.edit {
        .lib-icon-font-size(
            @_icon-font-size: 16px
        );
    }
}
