/**
 * Coupon redemption.
 */
.checkout-pane-coupon-redemption {
  position: relative;
  border: 1px solid #ccc;
  border-radius: $border-radius;
  padding: 15px 20px;
  margin: 30px 0;

  .form-item {
    display: inline-block;
    width: 190px;
    margin-top: 0;
    margin-right: 15px;

    @media (max-width: $screen-sm) {
      margin-right: 5px;
    }

    .form-optional {
      display: none;
    }
  }

  input[type="submit"] {
    margin: 0;

    @media (max-width: $screen-sm) {
      padding: 6px;
    }
  }

  .coupon-redemption-form__coupons {
    h3 {
      margin-top: 10px;
      font-size: 22px;
    }

    table {
      margin-bottom: 0;

      tr {
        border: none;
      }

      td:last-of-type {
        text-align: right;
        padding: 5px 0;
      }

      input {
        background-color: #fff;
        border-color: #efefef;
        color: #000;
        padding: 6px 10px;

        &:hover, &:focus {
          background-color: #fff;
          border-color: #ccc;
          color: #cc0000;
        }

        @media (max-width: $screen-sm) {
          padding: 6px;
        }
      }
    }
  }

  .ajax-progress {
    position: absolute;
    top: 14px;
    right: 4px;
    width: 138px;
  }
}

/**
 * Cart.
 */
.cart-form {
  clear: both;
  display: inline-block;
  width: 100%;
  margin-bottom: 40px;

  &:last-of-type {
    margin-bottom: 0;
  }
}

.view-commerce-cart-form {
  .cart-mobile-message {
    padding-bottom: 10px;

    @media (min-width: 630px) {
      display: none;
    }
  }

  table {
    min-width: 600px;
    margin-bottom: 20px;

    // Table head.
    thead {
      th.views-field-edit-quantity {
        text-align: center;
      }

      th.views-field-unit-price__number,
      th.views-field-total-price__number {
        text-align: right;
      }
    }

    // Table body.
    tbody {
      tr {
        td {
          padding: 15px 5px;
        }

        // Image.
        td:nth-of-type(1) {
          width: 120px;

          @media (max-width: $screen-sm-max) {
            width: 100px;
          }

          .product__thumbnail__cart {
            position: relative;
            width: 80px;
            height: 80px;
            background: url(../gfx/logo-icon-watermark.svg) center center no-repeat;
            background-size: 75px 75px;

            img {
              width: 80px;
              height: 80px;
              border: 1px solid $gray;
              transition: border .2s ease-in-out;
            }

            a {
              position: absolute;
              width: 100%;
              height: 100%;
              z-index: 1;
              font-size: 0;

              &:hover + img,
              &:focus + img {
                border: 1px solid $c-primary;
              }
            }
          }
        }

        td.views-field-edit-quantity {
          width: 140px;
          text-align: center;

          @media (max-width: $screen-sm-max) {
            width: auto;
          }

          input {
            position: relative;
            max-width: 75px;
            height: 40px;
            margin-left: 5px;
            border-radius: 0;
            border: 1px solid #ccc;
            appearance: none;
            text-align: center;
          }

          .form-optional {
            display: none;
          }
        }

        td.views-field-remove-button {
          position: relative;
          width: 60px;

          @media (max-width: $screen-sm-max) {
            width: 50px;
          }

          input {
            display: inline-block;
            height: 40px;
            width: 40px;
            padding: 0;
            font-size: 0;
            background-color: $gray-lighter;
            border-color: $gray-light;
            color: #000;

            &:hover, &:focus {
              background-color: $gray-lighter;
              border-color: $gray;
              color: $c-primary;
            }
          }

          div {
            position: relative;

            &:after {
              position: absolute;
              top: 0;
              left: 12px;
              font-size: 23px;
              line-height: 40px;
              font-family: FontAwesome;
              content: '\f014';
              pointer-events: none;
              transition: color .1s ease-in-out;
            }
          }
        }

        td.views-field-unit-price__number,
        td.views-field-total-price__number {
          width: 140px;
          text-align: right;

          @media (max-width: $screen-sm-max) {
            width: auto;
          }
        }
      }
    }
  }

  .order-total {
    width: 100%;
  }

  .order-total-line {
    padding: 0 5px;
    text-align: right;

    .order-total-line-label {
      width: calc(100% - 105px);
    }

    .order-total-line-value {
      width: 100px;
    }
  }

  .form-actions {
    float: right;
    clear: right;
    text-align: right;

    .btn {
      margin-right: 0;
    }

    input[id^="edit-submit"] {
      background-color: $gray-lighter;
      border-color: $gray-light;
      color: #000;

      &:hover, &:focus {
        background-color: $gray-lighter;
        border-color: $gray;
        color: $c-primary;
      }
    }
  }
}

/**
 * Checkout progress.
 */
.checkout-progress {
  display: inline-block;
  width: 100%;
  margin: 10px 0 30px;
  padding: 10px 15px;
  background-color: $gray-light;
  border-radius: $border-radius;

  .checkout-progress--step {
    position: relative;
    padding-right: 50px;

    @media (max-width: $screen-sm) {
      padding-right: 25px;
      font-size: 14px;
    }

    @media (max-width: 560px) {
      display: block;
      margin-bottom: 10px;
      font-size: 16px;
    }

    &:last-of-type {
      padding-right: 0;
      margin-bottom: 0;
    }

    &:before {
      display: inline-block;
      height: 25px;
      width: 25px;
      margin-right: 8px;
      border: 1px solid $gray;
      border-radius: 50%;
      background-color: #fff;
      font-size: 15px;
      font-weight: 300;
      text-align: center;
      content: counter(checkout-progress) "";
    }
  }
}

/**
 * Login.
 */
.form-wrapper__returning-customer,
.form-wrapper__guest-checkout {
  .form-optional {
    display: none;
  }
}

.form-wrapper__guest-checkout .form-item:first-of-type {
  margin-top: 0;
}

.form-wrapper__login-option input.button,
#edit-actions-next {
  margin-right: 10px;
}

/**
 * Order info.
 */

// Summary.
.view-commerce-checkout-order-summary {
  padding: 15px;
  border: 1px solid $gray;
  border-radius: $border-radius;

  table {
    margin-bottom: 20px;

    // Table body.
    tbody {
      tr {
        td.views-field-total-price__number {
          text-align: right;
        }
      }
    }
  }

  .order-total-line {
    padding: 0 5px;
    text-align: right;

    .order-total-line-label {
      width: calc(100% - 100px);
    }

    .order-total-line-value {
      width: 90px;
    }
  }

  .field--name-weight {
    display: none;
  }
}

// Contact information.
.path-checkout #edit-contact-information,
.path-checkout #edit-review-contact-information {
  > legend {
    padding: 6px 0 10px;
    font-size: 26px;
    font-weight: 300;
    color: #cc0000;

    a {
      color: #000;
      font-size: 18px;

      &:hover, &:focus {
        color: $c-primary-hover;
      }
    }
  }
}

// Shipping information.
.path-checkout #edit-shipping-information,
.path-checkout #edit-review-shipping-information {
  > legend,
  #edit-shipping-information-shipments legend {
    padding: 6px 0 10px;
    margin-bottom: 10px;
    font-size: 26px;
    font-weight: 300;
    color: #cc0000;

    a {
      color: #000;
      font-size: 18px;

      &:hover, &:focus {
        color: $c-primary-hover;
      }
    }
  }

  #edit-shipping-information-shipments {
    legend {
      margin-bottom: 20px;
    }

    .form-optional {
      display: none;
    }
  }

  .form-submit {
    display: none;
  }

  // Field widths.
  select.country,
  input.family-name,
  input.given-name,
  input.organization,
  input.locality {
    max-width: 240px;
  }

  input.postal-code {
    max-width: 100px;
  }
}

// Payment information.
.path-checkout {
  fieldset[id^='edit-payment-information'],
  #edit-review-payment-information {
    > legend {
      padding: 6px 0 10px;
      margin-bottom: 10px;
      font-size: 26px;
      font-weight: 300;
      color: #cc0000;

      a {
        color: #000;
        font-size: 18px;

        &:hover, &:focus {
          color: $c-primary-hover;
        }
      }
    }

    // Field widths.
    input[id^='edit-payment-information-add-payment-method-payment-details-security-code'] {
      max-width: 65px;
    }

    input[id^='edit-payment-information-add-payment-method-payment-details-number'],
    select.country,
    input.family-name,
    input.given-name,
    input.organization,
    input.locality {
      max-width: 240px;
    }

    input.postal-code {
      max-width: 100px;
    }
  }

  fieldset[id^='edit-payment-information-payment-method'] {
    legend {
      display: none;
    }

    .form-optional {
      display: none;
    }
  }
}

// Checkout complete.
.checkout-complete__file {
  display: block;
  border-bottom: 1px solid #ccc;
  padding: 10px 5px;

  &:before {
    display: inline-block;
    position: relative;
    top: 0;
    padding-right: 5px;
    font-family: FontAwesome;
    content: '\f15b';
    color: $c-body;
  }
}

.commerce-checkout-completion-register {
  border: 1px solid #ccc;
  border-radius: $border-radius;
  padding: 0 20px 15px;
  margin: 30px 0;
}
