// Appears inside the credit card field when the card number is deemed valid.
input.edd-input.card-number.valid {
    background-image: url(assets/images/tick.png);
    background-repeat: no-repeat;
    background-position: 98% 50%;
}

.edd_form fieldset p {
    margin-bottom: 1rem;
}

// only with the checkout template

.edd_cart_item_image {
    display: inline-block;
    vertical-align: middle;

    img {
        display: block;
        margin-right: 1rem;
    }

}

// discount shown at checkout and also with the [download_discounts] shortcode
.edd_cart_discount_row .edd_discount {
    text-align: right;
    display: block;
}

// The error notice shown when the discount did not work.
#edd-discount-error-wrap {
    display: block;
    margin: 1rem 0 0 0;
}

.edd_discount_rate,
.edd_discount_remove {
    vertical-align: middle;
}

// remove discount
.edd_discount_remove {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: url( 'assets/images/xit.gif' ) 0 0 no-repeat;
    position: relative;

    &:hover {
        background-position: -10px 0;
    }

}

// checkout rows
.edd_cart_footer_row th {
    text-align: right;
    background: #fff;
}

// total footer row
.edd_cart_footer_row .edd_cart_total {
    background: $light-grey;
}

// Secure payment icon and message

#edd_secure_site_wrapper {
    margin-bottom: 1rem;
    padding-right: 3rem;
    font-weight: bold;
}

span.padlock {
    display: block;
    position: absolute;
    top: 2rem;
    right: 2rem;
}

.edd-cart-ajax {
    color: #fff;
    line-height: 1;
    margin-top: -9px;
    position: absolute;
    right: 1rem;
    top: 50%;
}

// discounts
#edd-discount {
    margin-bottom: 1rem;
}

@media #{$screen-sm}{

    // New wrapper as of EDD 2.8.7
    .edd-discount-code-field-wrap {
        display: flex;

        #edd-discount { 
            margin-bottom: 0;
        }

        .edd-apply-discount {
            width: auto;
            margin-left: 0.5rem;
        }

    }

}

#edd-discount-code-wrap,
#edd_show_discount {
    margin-bottom: 0;
}

.edd-discount-loader.edd-loading {
    display: inline-block;
    position: relative;
    left: auto;
    vertical-align: middle;
    width: 1.5rem;
    height: 1.5rem;
}
// end discounts

// Center the "Your cart is empty" text when there are no items in the cart.
// The "Restore Previous Cart." text will also appear on the same line if cart saving is enabled.
.no-sidebar.edd-empty-cart #edd_checkout_wrap {
    text-align: center;
}

#edd_checkout_form_wrap span.edd-required-indicator {
    color: $required;
    font-size: 1.5rem;
}

#edd_discount_code {
    margin-bottom: 2rem;
}

// Fieldset styling.
// To do: consolidate all these styles using a common selector.
#edd_profile_personal_fieldset,
#edd_profile_address_fieldset,
#edd_profile_password_fieldset,
#edd_discount_code,
#edd_checkout_user_info,
#edd_register_account_fields,
#edd_login_fields,
#eddc_profile_paypal_fieldset, // EDD commissions
#edd_purchase_form #edd_cc_address, // only affect the address fields at checkout and not the one provided by EDD Stripe
#edd_cc_fields,
#edd_terms_agreement,
#edd_simple_shipping_fields,
#edd_simple_shipping_diff_address,
#edd-stripe-manage-cards > fieldset,
#edd_payment_mode_select {
    padding: 1rem;
    // border: 1px solid $border-light-grey-alt;
    background: $white;
    position: relative;
    box-shadow: $drop-shadow;

    p:last-child {
        margin-bottom: 0.5rem;
    }
}

// Terms of use.
#edd_terms_agreement {
    margin-bottom: 2rem;
}

// Terms of use - checkbox.
#edd_agree_to_terms {
    margin-top: 0.375rem; // 6px
    margin-right: 0.5rem;
    align-self: flex-start;
}

// Terms of use - text.
#edd_show_terms + .edd-terms-agreement {
    margin-top: 0.5rem;
}

.edd-terms-agreement {
    display: flex;
}

// Simple shipping
#edd_simple_shipping_diff_address label {
    margin-bottom: 0;
}

// Force select menus to be 100% width or they cause scrollbars
#edd_purchase_form_wrap select {
    width: 100%;
}

#edd_purchase_form_wrap .edd-select-small {
    width: auto;
}

@media #{$screen-md}{
    #edd_purchase_form_wrap select {
        width: 60%;
    }
}

@media #{$screen-sm}{

    #edd_profile_personal_fieldset,
    #edd_profile_address_fieldset,
    #edd_profile_password_fieldset,
    #edd_checkout_user_info,
    #edd_register_account_fields,
    #edd_login_fields,
    #eddc_profile_paypal_fieldset, // EDD commissions
    #edd_purchase_form #edd_cc_address, // only affect the address fields at checkout and not the one provided by EDD Stripe
    #edd_cc_fields,
    #edd_terms_agreement,
    #edd-stripe-manage-cards > fieldset,
    #edd_simple_shipping_fields,
    #edd_simple_shipping_diff_address,
    #edd_payment_mode_select {
        padding: 2rem;
    }

    #edd_discount_code {
        padding: 1rem 2rem;
    }

    #edd_register_fields #edd_register_account_fields {
        margin-bottom: 0;
    }
}

// submit button wrap
#edd_profile_submit_wrap {
    margin-bottom: 0;
}

.edd-payment-mode-label {
    font-size: 1.5rem;
}

.edd_checkout_cart_item_title {
    vertical-align: middle;
    display: block; // Site underneath
}

.edd_cart_item_image + .edd_checkout_cart_item_title {
    margin-top: 0.5rem;
}

.edd-description {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: lighten( $body-text-color, 10% );
}

.edd_cart_actions {
    text-align: right;
    
    .edd-item-quantity {
        margin-right: 0.5rem;
    }
}

#edd_final_total_wrap {
    text-align: center;
    margin-bottom: 2rem;
}

#edd-purchase-button-wrap {
    position: relative;
}

#edd_final_total_wrap,
#edd-purchase-button {
    font-size: 1.5rem;
}

#edd-purchase-button {
    padding: 1.25rem 2.5rem;
}

.edd_cart_header_row,
.edd_cart_item {
    border-bottom: 1px solid $light-grey;
}

// shows the total price at checkout
.edd_cart_total {
    text-align: right;
}

.edd_cart_amount {
    font-weight: bold;
}

#edd_checkout_cart {
    width: 100%;
    text-align: left;
    margin-bottom: 2rem;

    th {
        font-weight: bold;
    }
}

// payment icons
.edd-payment-icons {
    margin-bottom: 2rem;
}

.edd-payment-icons img {
    display: inline-block;
    margin-right: 0.5rem;
}

.edd-payment-mode-label {
    margin-bottom: 1rem;
    display: inline-block;
}

.edd-gateway,
.edd-gateway-option {
    cursor: pointer;
}

.edd-gateway {
    margin-right: 0.5rem;
}

.edd-gateway-option {
    margin-right: 2rem;
    display: inline-block;
    vertical-align: middle;
}

label[for=edds-confirm-update-default] {
    width: 90%;
    vertical-align: top;
}

// Card type.
// Shown at EDD checkout when CC is selected and also by EDD recurring when updating the payment method
span.card-type {
    position: absolute;
    top: 0;
    right: 0;
    width: 43px;
    height: 32px;
    background-size: 43px 32px !important;
}

label[for=card_number] {
    position: relative;
}

span.card-type.off {
    display: none;
}

span.card-type.visa {
    background: url(assets/images/icons/visa.gif) no-repeat;
}

span.card-type.mastercard {
    background: url(assets/images/icons/mastercard.gif) no-repeat;
}

span.card-type.discover {
    background: url(assets/images/icons/discover.gif) no-repeat;
}

span.card-type.amex {
    background: url(assets/images/icons/americanexpress.gif) no-repeat;
}

#edd_purchase_submit {
    margin-bottom: 0;
}

// Amazon Payments

.edd-amazon-profile-wrapper {
    font-size: 1rem;
}

.edd-amazon-profile-name {
    font-weight: bold;
}

// Make the Amazon logout link look clickable.
.edd-amazon-logout a {
    cursor: pointer;
}

// Hide the div with border since all fields inside are hidden anyway
.edd-amazon-fields #edd_cc_address {
    display: none;
}

// Hard-set the height so the Amazon iframe appears
#edd-amazon-wallet-box,
#edd-amazon-address-box {
    height: 228px;
}

#edd-amazon-address-box {
    margin-bottom: 2rem;
}

// Distraction Free checkout styling.

.edd-checkout-distraction-free {

    .site-branding {
        margin-left: auto;
        margin-right: auto;
        text-align: center; // make sure both site title and description are centered
    }

    .site-footer .site-info {
        text-align: center;
    }
}

@media #{$screen-xs-max}{
    .edd_discount_link {
        display: block;
    }
}

@media #{$screen-sm}{

    #edd_checkout_cart {
        td, th {
            padding: 1rem 2rem;
        }
    }

}
