/**
 * Cart
 *
 * We are using the 'vo-' prefix to avoid potential conflicts with WooCommerce
 * classes. Better safe than sorry!
 * ----------------------------------------------------------------------------
 */
.woocommerce-cart {
    .footer {
        display: none;
    }
}

// Variables.
$cart-width: 780px;
$cart-padding: $spacing--large 0;
$cart-item-padding: 15px;
$cart-item-padding-medium: $spacing $spacing--xlarge;
$cart-item-padding-large: $spacing $spacing--xxlarge;

.vo-cart {
    position: fixed;
    overflow-y: scroll;
    top: 0;
    left: 0;
    right: 0;
    color: $color-gray-45;
    bottom: 0;
    background: linear-gradient(to bottom, #f9f9f9 0%, #f9f9f9 50%, $color-gray-5 50%, $color-gray-5 100%);

    // Hide WooCommerce messages in cart.
    .woocommerce-message {
        display: none;
    }
}

.vo-cart__inner {
    position: relative;
    width: 100%;
    font-size: rem-calc(16);
    background-color: $color-white;
    max-width: $cart-width;
    margin: $spacing--xxxlarge auto;
    box-shadow: $shadow;
    padding: $cart-padding;
}

/**
 * Cart Item.
 */

.vo-cart__item {
    padding: $cart-item-padding;
    border-bottom: 1px solid $color-gray-35;
}

.vo-cart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: $spacing--small;
}

.vo-cart__title {
    font-size: rem-calc(16);
    font-weight: 500;
}

.vo-cart__remove {
    a {
        color: $color-gray-45;
    }
}

.vo-cart__content {
    display: flex;
    align-items: center;
}

.vo-cart__thumbnail {
    max-width: 150px;
    padding-right: 15px;
}

.vo-cart .quantity {
    margin: 0 $spacing 0 0;
}

.vo-cart .quantity__label {
    display: none;
}

.vo-cart__attributes {
    margin-right: $spacing;
}

.vo-cart__price {
    margin-left: auto;
    color: $color-gray-45;
}

.vo-cart__coupon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: $cart-item-padding;
    border-bottom: 1px solid $color-gray-35;
}

.vo-cart__coupon-input {
    margin: 0;
    border: 0;
    border-bottom: 1px solid transparent;
    padding: 0;

    &:focus {
        border: 0;
        border-bottom: 1px solid $color-black;
    }
}

.vo-cart__coupon-button {
    cursor: pointer;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 51 51"><g fill="none" fill-rule="evenodd" stroke="#000" stroke-width="2" transform="translate(1 1)"><circle cx="24.5" cy="24.5" r="24.5" opacity=".8"/><path stroke-linecap="square" d="M37.5 25.544H12.32M25 13.044v25.18"/></g></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
}

/**
 * Cart totals
 */
.vo-cart__totals {
    padding: $cart-item-padding;
    border-bottom: 1px solid $color-gray-35;

    table {
        margin: 0;
        tr:nth-child(even) {
            background: transparent;
        }
        th {
            font-weight: normal;
        }
        td {
            text-align: right;
            .shipping-calculator-form {
                text-align: left;
            }
        }
    }

    .woocommerce-Price-amount.amount {
        font-size: rem-calc(26);
        color: $color-black;
        font-weight: normal;
    }
}

/**
 * Subtotal
 */

.vo-cart__subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: $cart-item-padding;
    border-bottom: 1px solid $color-gray-35;
}


/**
 * Actions
 */

.vo-cart__actions {
    padding: $cart-item-padding;

    .button {
        margin-bottom: 0;
        width: 100%;
    }

    .checkout-button {
        margin-bottom: 16px;
    }
    .vo-cart__continue {
    }

    @include breakpoint(small only) {
        display: flex;
        flex-flow: row wrap;
        align-items: center;

        .button {
            flex: 0 0 100%;
            max-width: 100%;
        }

        .checkout-button {
            order: 1;
        }
        .vo-cart__continue {
            order: 2;
        }
    }

    @include breakpoint(medium) {
        display: flex;
        align-items: center;
        justify-content: space-between;
        .button {
            width: calc(50% - #{$spacing--xsmall});
        }
        .checkout-button {
            margin-bottom: 0;
        }
    }
}

/**
 * Hide the update button. It is toggled using JavaScript.
 */

.vo-cart__update {
    position: absolute;
    left: -9999px;
}

@include breakpoint(medium) {
    .vo-cart__subtotal,
    .vo-cart__coupon,
    .vo-cart__item,
    .vo-cart__totals,
    .vo-cart__actions {
        padding: $cart-item-padding-medium;
    }
}

@include breakpoint(large) {
    .vo-cart__subtotal,
    .vo-cart__coupon,
    .vo-cart__item,
    .vo-cart__totals,
    .vo-cart__actions {
        padding: $cart-item-padding-large;
    }
}
