/* ----------------------------------------------------------------------------
    Cart checkout
---------------------------------------------------------------------------- */


// Cart navigation

.cart-checkout-navigation {
    margin-bottom: 50px;
    height: 80px;
    background-color: darken(@white, 3%);
    border-bottom: 1px solid @gray-lighter;
    text-align: center;
}

.cart-checkout-navigation-list {
    display: inline-block;
    padding-left: 10px;
    line-height: 80px;
    counter-reset: steps;

    & > li {
        display: inline-block;
        padding-left: 35px;
        list-style-type: none;

        &:hover,
        &.active {
            .cart-checkout-navigation-list-item-link {
                &:extend(.base-clr-txt);

                &:before {
                    &:extend(.base-clr-bg);
                }
            }
        }

        &.active .cart-checkout-navigation-list-item-link {
            &:extend(.base-clr-bd);

            &:after {
                opacity: 1;
            }
        }
    }
}

.cart-checkout-navigation-list-item-link {
    .transition(~"color 0.2s ease, border 0.2s ease");

    position: relative;
    display: inline-block;
    padding: 28px 10px 25px 40px;
    line-height: 25px;
    color: @text-black;
    border-bottom: 3px solid transparent;
    cursor: pointer;

    &:before {
        .transition(~"background 0.2s ease");

        position: absolute;
        top: 27px;
        left: 0;
        display: inline-block;
        width: 25px;
        font-size: @font-size-small;
        line-height: 25px;
        counter-increment: steps;
        content: counter(steps);
        color: @text-white;
        background-color: @gray-light;
        border-radius: 50%;
    }

    &:after {
        &:extend(.base-clr-bd);
        .transition(~"opacity 0.2s ease");

        content: "";
        position: absolute;
        bottom: -12px;
        left: 50%;
        margin-left: -5px;
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 5px;
        border-left-color: transparent;
        border-right-color: transparent;
        border-bottom-color: transparent;
        opacity: 0;
    }
}


// Cart prev/next controls
.cart-checkout-navigation-controls {
    .clearfix();

    margin: 0 auto;
    max-width: 780px;
    width: 100%;
    padding: 0 15px 100px;

    .btn {
        margin: 0;

        &.prev {
            float: left;
        }

        &.next {
            float: right;
        }
    }
}


// Cart tab content

.cart-checkout-content {
    margin: 0 auto;
    max-width: 780px;
    width: 100%;

    .tab-pane > h3 {
        margin-bottom: 45px;
        text-align: center;
    }
}


// Cart list (and payment confirm table)

.payment-confirm {
    padding-bottom: 50px;
}

.cart-list,
.payment-confirm .table {
    margin: 0 0 60px;
    width: 100%;

    td,
    th {
        height: 70px;
        padding: 5px 15px;
        border: 1px solid @gray-lighter;
        vertical-align: middle;
    }

    thead th {
        position: relative;
        text-align: center;
        font-weight: @normal-weight;
        color: @text-alt;
        background-color: transparent;
        z-index: 1;

        &:before {
            &:extend(.base-clr-bg);

            position: absolute;
            top: 0;
            right: 0;
            left: 0;
            bottom: 0;
            width: 100%;
            content: "";
            z-index: -1;
            opacity: 0.06;
        }

        &.cart-list-item-actions {
            font-size: 0;
        }
    }

    & > thead:first-child > tr:first-child > th {
        border-top: 1px solid @gray-lighter;
    }

    td {
        color: @text-black;
    }
}

.cart-list-item {
    &:not(:hover) .cart-list-item-remove {
        vertical-align: middle;
        border-color: darken(@gray-lighter, 7.5%);

        .icon {
            color: lighten(@text-gray-light, 4.5%);
        }
    }

    &:hover .cart-list-item-meta:before {
        width: 3px;
        opacity: 1;
    }
}

.cart-list-item-meta {
    position: relative;

    &:before {
        &:extend(.base-clr-bg);

        .transition(~"opacity 0.2s ease, width 0.2s ease");

        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 0;
        content: "";
        // opacity: 0;
    }
}

.cart-list-item-image {
    margin: 5px 15px 5px 0;
    vertical-align: middle;
    display: inline-block;
    max-width: 80px;
    background-color: @white-alt;

    img {
        display: block;
        max-width: 100%;
        height: auto;
    }
}

.cart-list-item-name {
    display: inline-block;
}

td.cart-list-item-price {
    width: 140px;
    font-size: @font-size-h5 - 2px;
    text-align: center;
}

.cart-list-item-actions {
    width: 64px;
    text-align: center;
}

.cart-list-item-remove {
    &:extend(.base-clr-bg);

    .transition(~"background 0.2s ease");

    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 30px;
    border: 1px solid;
    border-radius: 50%;
    opacity: 1;

    &:not(:hover) {
        background-color: transparent;
    }

    &:hover .icon {
        color: @text-white;
    }

    .icon {
        .transition(~"color 0.2s ease");

        vertical-align: top;
        margin-top: 10px;
        display: inline-block;
        width: 100%;
        padding-left: 1px;
        font-size: 10px;
    }
}

.cart-list-item-total {
    font-size: @font-size-base;
    font-weight: normal;
    text-align: right;
    color: @text-alt;
}

.cart-list-item-amount {
    &:extend(.base-clr-txt);

    margin-left: 5px;
    font-size: @font-size-h4 - 2px;
}


// Payment methods

.payment-method-form {
    margin-bottom: 60px;
    text-align: center;
    width: 100%;

    input[type="radio"] {
        display: none;

        &:checked + .payment-method {
            border-color: transparent;

            &:before {
                opacity: 0.04;
            }

            .pseudo-radio:after {
                opacity: 1;
            }
        }
    }

    input[value="paypal"] + .payment-method {
        width: 270px;
        padding: 22px 40px;
    }
}

.payment-method {
    .transition(~"border 0.2s ease");

    position: relative;
    vertical-align: top;
    margin: 0 18px 40px;
    min-width: 270px;
    min-height: 108px;
    padding: 42px 40px;
    font-weight: normal;
    text-align: center;
    color: @text-alt;
    background-color: lighten(@white-alt, 3%);
    border: 1px solid @gray-lighter;
    cursor: pointer;
    z-index: 1;

    &:before {
        &:extend(.base-clr-bg);
        .transition(~"opacity 0.2s ease");

        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        content: "";
        opacity: 0;
        z-index: -1;
    }

    .payment-method-icon {
        display: inline-block;
        max-width: 135px;
    }

    .pseudo-radio {
        &:extend(.base-clr-bd);

        margin: -2px 25px 0 0;
        vertical-align: middle;
        display: inline-block;
        padding: 4px;
        width: 16px;
        height: 16px;
        border-width: 1px;
        border-style: solid;
        border-radius: 50%;
    }

    .pseudo-radio:after {
        &:extend(.base-clr-bg);
        .transition(~"opacity 0.2s ease");

        display: block;
        width: 100%;
        height: 100%;
        content: "";
        border-radius: 50%;
        opacity: 0;
    }
}


// Billing details

.billing-details-form {
    .form-group {
        margin-bottom: 20px;

        label {
            line-height: 25px;
        }
    }

    .result {
        margin-bottom: 30px;
        text-align: right;

        * {
            display: inline-block;
        }

        strong {
            font-weight: normal;
            text-transform: uppercase;
            color: #9c9fa1;
        }

        .cart-ammount {
            &:extend(.base-clr-txt);

            font-size: 26px;
        }
    }

    .btn.cart-submit {
        float: right;
        margin: 0 0 -46px;
    }
}



// Small devices

@media (max-width: @screen-sm-max) {
    .cart-checkout-navigation {
        height: auto;
        padding: 10px 35px 0;
        text-align: left;
    }

    .cart-checkout-navigation-list {
        margin: 0;
        width: 100%;
        padding: 5px 0;
        line-height: 1;

        & > li {
            width: 100%;
            padding-left: 0;

            &.active .cart-checkout-navigation-list-item-link {
                border-bottom-color: transparent;
            }
        }
    }

    .cart-checkout-navigation-list-item-link {
        margin-bottom: 10px;
        width: 100%;
        padding: 5px 0;
        font-size: @font-size-base;

        &:before {
            position: static;
            top: auto;
            left: auto;
            vertical-align: top;
            margin-right: 10px;
            text-align: center;
        }

        &:after {
            display: none;
        }
    }
}


// Extra small devices

@media (max-width: @screen-xs-max) {
    .cart-checkout-navigation-controls .btn,
    .billing-details-form .btn.cart-submit {
        min-width: 0;
        padding-left: 15px;
        padding-right: 15px;
    }

    .payment-method {
        max-width: 100%;
        margin: 0 auto 20px;
    }

    .billing-details-form .form-group {
        margin-bottom: 0;
    }
}
