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

//
//  Common
//  _____________________________________________

& when (@media-common = true) {
    .multicheckout {
        .table:not(.cart):not(.totals)>thead>tr>th{
            border:none;
        }
        .box-content{
            margin: 10px 0;
        }

        &.results,
        &.success {
            h3 {
                font-size: 1.6rem;
                margin-bottom: @indent__base;
                margin-top: @indent__l;
                a {
                    color: @text__color;
                    &:hover {
                        text-decoration: none;
                    }
                }
            }

            ul.orders-list {
                list-style: none;
                padding-left: 0;
            }

            .orders-list {
                margin-top: @indent__m;
                padding-left: @indent__base - 4px;

                .shipping-list {
                    .shipping-item {
                        margin-left: 84px;
                    }

                    .shipping-label {
                        font-weight: @font-weight__bold;
                        margin-right: @indent__s;
                    }

                    .shipping-address {
                        font-weight: @font-weight__regular;
                    }

                    .error-block {
                        color: @error__color;

                        .error-label {
                            font-weight: @font-weight__bold;
                            margin-right: @indent__s;
                        }

                        .error-description {
                            font-weight: @font-weight__regular;
                        }
                    }
                }
            }

            .orders-succeed {
                .orders-list {
                    margin-top: 0;

                    .shipping-list {
                        .order-id {
                            float: left;
                        }

                        .shipping-item {
                            margin-left: 100px;
                        }
                    }
                }
            }
        }

        .title {
            margin-bottom: @indent__l;

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

        .table-wrapper {
            margin-bottom: 0;

            .action.delete {
                display: inline-block;
            }

            .col {
                .qty {
                    display: inline-block;

                    .input-text {
                        &:extend(.abs-input-qty all);
                    }
                }

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

                &.item {
                    .action.edit {
                        margin-left: 8px;
                        border-bottom: 2px solid;
                        font-weight: @font-weight__bold;
                        text-transform: uppercase;
                    }
                }
            }
        }

        &:not(.address) {
            .table-wrapper {
                .product-item-name {
                    margin: 0;
                    text-transform: uppercase;
                    font-weight: @font-weight__semibold;
                    a{
                        font-weight: @font-weight__semibold;
                    }
                }
            }
        }

        > .actions-toolbar {
            margin-top: @indent__xl;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
        }

        .actions-toolbar {
            > .secondary {
                display: block;

                .action {
                    margin-bottom: @indent__m;

                    &.back {
                        display: block;
                        margin-left: 0;
                    }
                }
            }

            > .primary {
                margin-right: @indent__s;
            }
        }

        .action.primary {
            &:extend(.abs-button-l all);
        }

        .item-options {
            margin: @indent__s 0 0;

            &:extend(.abs-product-options-list all);
            &:extend(.abs-add-clearfix all);
            dd{
                margin: 0 0 5px 5px;
            }
        }

        &:extend(.abs-account-blocks all);

        .block {
            &:extend(.abs-add-clearfix all);

            .methods-shipping {
                .item-content {
                    .fieldset {
                        > .legend {
                            &:extend(.abs-visually-hidden all);
                        }

                        > .legend + br {
                            &:extend(.abs-no-display all);
                        }

                        > .field {
                            &:before {
                                display: none;
                            }

                            .control {
                                display: inline-block;
                            }
                        }
                    }
                }
            }
        }

        .block-title,
        .block-content .title {
            &:extend(.abs-account-title all);

            strong {
                span {
                    .lib-css(color, @primary__color__light);
                }
            }
        }

        .block-content {
            &:extend(.abs-add-clearfix all);
            .title {
                border-bottom: none;
                padding-bottom: 0;
            }
        }

        &.order-review {
            .block-title > strong {
                .lib-font-size(24);
            }

            .block-shipping {
                .block-content:not(:last-child) {
                    margin-bottom: @indent__xl;
                }
            }

            .error-description {
                color: @error__color;
                font-weight: @font-weight__regular;
                margin-bottom: @indent__s;
                margin-top: -@indent__s;
            }
        }

        .box-title {
            span {
                margin-right: @indent__s;
            }

        }

        .box-shipping-method {
            .price {
                font-weight: @font-weight__bold;
            }
        }

        .box-billing-method {
            .fieldset {
                margin: 0;

                .legend.box-title {
                    margin: 0 0 @indent__xs;
                }
            }
        }

        .hidden {
            &:extend(.abs-no-display all);
        }

        .checkout-review{
            background: #f8f8f8;
            margin-bottom: 25px;
            padding: 35px;
            .actions-toolbar{
                .action{
                    width:100%;
                }
            }
            .grand.totals {
                .lib-font-size(@font-size__xl);
                margin-bottom: @indent__xl;

                .mark {
                    display: block;
                    font-weight: @font-weight__black;
                    text-transform: uppercase;
                }
               .amount{
                    font-size: 34px;
                    font-weight: @font-weight__black;
                    letter-spacing: -2px;
                    line-height: 1;
                 }
            }
        }
    }

    [class^='multishipping-'] {
        .nav-sections,
        .nav-toggle {
            &:extend(.abs-no-display all);
        }

        .logo {
            margin-left: 0;
        }
    }

    .multishipping-checkout-success {
        .nav-sections {
            display: block;
        }
        .multicheckout{
            .action.primary{
                padding: 12px 16px;
                font-size:14px;
                line-height:1;
            }
            .shipping-label{
                display:block;
            }
            .order-id{
                font-weight: @font-weight__semibold;
            }
            .shipping-list{
                background:#f8f8f8;
                padding:20px;
            }
        }
        .checkout-success-wrapper{
            max-width: 600px;
        }
    }
}

//
//  Mobile
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
    .multicheckout {
        &.address.form{
            .table-wrapper{
                .data.table {
                    tbody>tr td[data-th]{
                        &.qty,
                        &.actions,
                        &.product{
                            &:before{
                                content:none;
                            }
                        }
                    }
                    .address {
                        &:before {
                            margin-bottom: @indent__xs;
                        }
                    }
                    .col{
                        padding: 10px 0;
                        &,
                        &.address,
                        &.qty{
                            text-align:center;
                        }
                        &.actions{
                            padding-bottom: 30px;
                            border-bottom: 1px solid #e5e5e5;
                            margin-bottom: 30px;
                        }
                    }

                }
            }
        }

        .product-item-name,
        .price-including-tax,
        .price-excluding-tax {
            display: inline-block;
        }

        .block-content .box {
            &:not(:last-child) {
                margin-bottom: @indent__xl;
            }

            &:last-child {
                margin-bottom: 0;
            }
        }

        &.order-review {
            .box-items {
                .data.table {
                    thead {
                        display: block;

                        tr {
                            display: block;
                        }

                        .col.item {
                            display: block;
                            padding: 0;
                        }
                    }
                }
            }

            .data.table {
                &:extend(.abs-checkout-order-review all);
            }
        }
        > .actions-toolbar {
            display: block;
            .action {
                width:100%;
            }
        }
        .actions-toolbar {
            .action {
                margin-bottom: @indent__m;
            }

            > .primary {                
                margin-right: 0;
            }
        }
    }
}

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__s) {
    .multicheckout {
        &.form{ 
                .table{
                    thead{
                        background: @sidebar__background-color;
                        text-transform: uppercase;
                    }
                    .col{
                        padding: 14px 20px;
                        vertical-align: middle;
                    }
                }
            
        }
        .actions-toolbar {
            .column:not(.sidebar-main) & {
                &:extend(.abs-reset-left-margin-desktop-s all);
            }

            .secondary {
                float: none;
                margin-top: 11px;
                text-align: right;

                .action {
                    margin-left: @indent__s;

                    &.back {
                        display: block;
                        float: left;
                    }
                }
            }
        }
        /*
        .item-options {
            margin: @indent__base 0 0;
        }*/

        .block-content .box {
            margin-bottom: 0;
        }

        .block-shipping {
            .box {
                &:extend(.abs-add-box-sizing-desktop-s all);
                float: left;
                width: 50%;
            }
            .box-items{
                width: 100%;
                margin-top:40px;
            }
            .box-shipping-method {
                padding-left: @indent__m;
                padding-right: @indent__m;
                width: 50%;

                .fieldset {
                    .legend {
                        &:extend(.abs-reset-left-margin-desktop-s all);
                    }

                    .field {
                        &:before {
                            display: none;
                        }
                    }
                }
            }
        }

        .block-billing {
            &:extend(.abs-add-clearfix-desktop-s all);
            .box-billing-address {
                &:extend(.abs-add-box-sizing-desktop-s all);
                float: left;
                width: 50%;
            }

            .box-billing-method {
                &:extend(.abs-add-box-sizing-desktop-s all);
                float: left;
                padding-left: @indent__m;
                width: 50%;
            }
        }

        &.form.address {
            .table-wrapper {
                .applicable {
                    margin: 7px 0 0;
                }
            }
        }

        &.order-review {
            .box-items {
                clear: left;
                float: none;
                padding-top: @indent__xl;
                width: auto;
            }

            .col.item {
                width: 75%;
            }
            .table-order-review{
                tfoot>tr:first-child{
                    td,
                    th{
                        border-top: 1px solid #e5e5e5;
                    }
                }
                tfoot{
                    td{
                        text-align:right;
                        padding-right:32px;
                    }
                    th{
                        padding-left:32px;
                        padding-right:20px;
                    }
                }
            }
            .table{
                .col{
                    padding: 26px 14px;
                    &:first-child{
                        padding-left: 32px;
                    }
                    &:last-child{
                        padding-right: 32px;
                    }
                }
            }
            .checkout-review{
                max-width: 600px;
                margin-left: auto;
                 .grand.totals{
                     .amount{
                        font-size: 48px;
                     }
                }
            }
            .actions-toolbar .secondary{
                .action.back{
                    float: none;
                    margin-bottom:0;
                }
            }
        }

        //  Payment methods
        .methods-payment {
            .item-content > .fieldset {
                width: auto;

                .field {
                    &.cvv {
                        display: inline-block;
                        width: auto;
                    }
                }
            }

            .fieldset > .field:not(.choice) {
                > .label {
                    float: none;
                    margin-bottom: 8px;
                    text-align: left;
                    width: auto;
                }

                &:not(.cvv) {
                    .control {
                        width: 100%;
                    }
                }
            }
        }
    }
}

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .multicheckout {
        .block-shipping {
            .box {
                &:extend(.abs-add-box-sizing-desktop-s all);
                float: left;
                width: 25%;
            }
            .box-items{
                width: 100%;
            }
        }
        .block-billing {
            .box-billing-address {
                width: 25%;
            }
        }
    }
}
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
    .multishipping-checkout-success {
        .nav-toggle {
            display: block;
        }

        .logo {
            margin-left: @indent__xl;
        }
    }
}
