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

//
//  Variables
//  _____________________________________________

@checkout-summary__background-color: @color-white-smoke;
@checkout-summary__padding: 22px @indent__l;

@checkout-summary-title__margin: @indent__s;
@checkout-summary-mark-value__color: @color-gray40;

@checkout-summary-items__max-height: 370px;
@checkout-summary-items__padding: 15px;

//
//  Common
//  _____________________________________________

& when (@media-common = true) {

    //
    //  Order Summary
    //  ---------------------------------------------

    .opc-block-summary {
        .lib-css(background, @checkout-summary__background-color);
        .lib-css(margin, 0 0 @checkout-sidebar__margin);
        .lib-css(padding, @checkout-summary__padding);
        &:extend(.abs-add-box-sizing all);

        > .title {
            &:extend(.abs-checkout-title all);
            display: block;
        }

        //  Totals table
        .table-totals {
            &:extend(.abs-sidebar-totals all);
        }

        .mark {
            .value {
                .lib-css(color, @checkout-summary-mark-value__color);
                display: block;
            }
        }

        .discount.coupon {
            display: none;
        }

        .grand.incl {
            & + .grand.excl {
                .mark,
                .amount {
                    border-top: 0;
                    .lib-font-size(14);
                    padding-top: 0;

                    strong {
                        font-weight: @font-weight__regular;
                    }
                }
            }
        }

        .not-calculated {
            font-style: italic;
        }

        //
        //  Items list
        //  ---------------------------------------------

        //  Block title
        .items-in-cart {
            > .title {
                border-bottom: @border-width__base solid @border-color__base;
                .lib-css(padding, @indent__s 0 @indent__s @indent__xl);
                cursor: pointer;
                .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,
                @_icon-font-position: after,
                @_icon-font-display: block
                );
                margin-bottom: 0;
                position: relative;
                font-family: @font-family-name__vazirmatn-fd;

                &:after {
                    position: absolute;
                    left: 0;
                    top: @indent__s;
                }

                strong {
                    .lib-font-size(18);
                    font-weight: @font-weight__light;
                    margin: 0;
                }
            }

            &.active {
                > .title {
                    .lib-icon-font-symbol(
                    @_icon-font-content: @icon-up,
                    @_icon-font-position: after
                    );
                }
            }

            .product {
                position: relative;
                .item-options {
                    &:extend(.abs-product-options-list all);
                    &:extend(.abs-add-clearfix all);
                }
            }
        }

        //  Cart items
        .minicart-items-wrapper {
            .lib-css(margin, 0 0 0 -(@checkout-summary-items__padding));
            .lib-css(max-height, @checkout-summary-items__max-height);
            .lib-css(padding, @checkout-summary-items__padding 0 0 @checkout-summary-items__padding);
            border: 0;
        }

        .column.main & {
            .product-item {
                margin: 0;
                padding-right: 0;
            }
        }

        .product-item {
            .product-item-details {
                &:extend(.abs-add-clearfix all);
            }

            .product-item-inner {
                display: table;
                margin: 0 0 @indent__s;
                width: 100%;
            }

            .product-item-name-block {
                display: block;
                padding-left: @indent__xs;
                text-align: right;
            }

            .subtotal {
                display: block;
                text-align: right;
            }

            .price {
                .lib-font-size(16);
                font-weight: @font-weight__regular;
                font-family: @font-family-name__vazirmatn-fd;
            }

            .price-including-tax {
                & + .price-excluding-tax {
                    .price {
                        .lib-font-size(10);
                    }
                }
            }

            .message {
                margin-top: 10px;
            }
        }

        .actions-toolbar {
            position: relative;
            z-index: 1;

            .secondary {
                border-top: @border-width__base solid @border-color__base;
                display: block;
                margin: -1px 0 0;
                padding: 15px 0 0;
                text-align: left;

                .action {
                    margin: 0;
                }
            }
        }
    }
}

//
//  Mobile
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
    .opc-block-summary {
        > .title {
            border-bottom: 0;
            .lib-css(font-size, @checkout-step-title-mobile__font-size);
            margin-bottom: @indent__base;
            padding-bottom: 0;
        }

        .totals {
            &:extend(.abs-sidebar-totals-mobile all);
        }
    }
}

//
//  Desktop
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .opc-summary-wrapper {
        .modal-header {
            .action-close {
                display: none;
            }
        }
    }
}

//
//  Tablet
//  _____________________________________________

@media only screen and (max-width: @screen__m) {
    .opc-block-summary {
        .product-item {
            .product-item-inner {
                display: block;
            }

            .product-item-name-block {
                display: block;
                text-align: left;
            }

            .subtotal {
                display: block;
                text-align: left;
            }
        }
    }
}
