/* ==========================================================================
   Checkout pop-up styles (payment-sq.pug, thank-you.pug)
   Loaded after default.css. Breakpoints: 840px (cart moves above the
   form, single column) and 650px.
   ========================================================================== */

/* ---------- Form fields ---------- */

input {
  width: 100%;
  height: 48px;
  padding-left: 16px;
  background-color: #fff;
  font-size: 16px;
  border: none;
  outline: none;
  box-sizing: border-box;
}
input:focus {
  border: none;
  outline: none;
}
input#discount-code:focus,
input#discount-code-a:focus {
  border: 2px solid #9C3424;
}
#discount-code-message,
#discount-code-message-a {
  display: none;
}

/* ---------- Layout ---------- */

.checkout-row {
  width: 90%;
  margin: 20px auto 0;
  padding: 20px;
  display: flex;
  flex-direction: row;
  background-color: #fafafa;
}
.col-40 {
  width: 45%;
  padding: 0;
}
.col-60 {
  width: 55%;
}

/* The order summary is rendered twice: above the form on small screens
   (.cart-before-form) and beside it on large ones (.cart-after-form). */
.cart-before-form,
.cart-after-form {
  padding: 10px;
  font-size: 14px;
}
.cart-before-form { display: none; }
.cart-after-form  { display: block; }

/* ---------- Order summary ---------- */

.checkout-header {
  padding: 27px 10px 10px 20px;
  margin: 0;
  background-color: #fafafa;
  border-bottom: 1px solid #e0e2e3;
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 500;
}
.order-details-section {
  padding: 20px 12px;
  border-top: 1px solid #c2c7cc;
  background-color: #ffffff;
}
.order-details-section__item {
  padding: 10px 0;
}
.order-details-section__item__desc {
  display: inline-block;
  width: 80%;
}
.order-details-section__item__price {
  float: right;
  text-align: right;
}
.font-weight-500 { font-weight: 500; }
.float-right     { float: right; }

.padding-small           { padding: 10px; }
.padding-vertical-small  { padding-top: 10px; padding-bottom: 10px; }
.padding-vertical-medium { padding-top: 20px; padding-bottom: 20px; }

/* ---------- Payment form ---------- */

.payment-form {
  width: 80%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 20px;
}
#fast-checkout {
  background: #ffffff;
  color: black;
}
#fast-checkout .wrapper {
  position: relative;
  width: 95%;
  max-width: 450px;
  background-color: #ffffff;
}
#fast-checkout input {
  position: relative;
  border-radius: 6px;
}
#fast-checkout button {
  width: 100%;
}
#card-container {
  border-radius: 8px;
}
#card-button {
  font-size: 14px;
  max-width: 220px;
}
#receipt-button {
  font-size: 12px;
}

/* "EXPRESS CHECKOUT" / "OR PAY WITH A CARD" dividers */
#fast-checkout .border {
  position: relative;
  height: 2px;
  width: 100%;
  margin: 30px 0;
  color: #9c3424;
  background: #9c3424;
  font-size: 16px;
  line-height: 20px;
  text-transform: uppercase;
}
#fast-checkout .border span {
  position: absolute;
  top: -10px;
  left: calc(50% - 1em - 85px);
  padding: 0 10px;
  background: #fafafa;
}

#apple-pay-button,
#google-pay-button {
  height: 48px;
  width: 94%;
  margin: 10px auto;
}
#apple-pay-button {
  cursor: pointer;
  -webkit-appearance: -apple-pay-button;
  -apple-pay-button-type: plain;
  -apple-pay-button-style: black;
}

/* ---------- Status message ---------- */

#payment-flow-message {
  display: block;
  width: 100%;
  height: 30px;
  margin: 11px 0;
  font-size: 16px;
}
#payment-flow-message.error   { color: #bf0020; }
#payment-flow-message.success { color: #3374ff; }

/* ---------- Spinner (shown while a payment is processing) ---------- */

#loading-cursor {
  pointer-events: none; /* never block clicks on what's underneath */
  position: absolute;
  left: calc(50% - 32px);
  top: calc(36% - 32px);
  width: 64px;
  height: 64px;
  padding: 0;
  margin: 0 auto;
}
#loading-cursor-img {
  display: none;
  width: 100%;
  height: 100%;
  opacity: 0.8;
  animation: rotating-cursor 1s infinite;
}
#loading-cursor img {
  border: none;
  box-shadow: none;
}
@keyframes rotating-cursor {
  0%   { transform: rotate(0deg)   scale(1.0); }
  10%  { transform: rotate(36deg)  scale(0.9); }
  20%  { transform: rotate(72deg)  scale(0.8); }
  30%  { transform: rotate(108deg) scale(0.7); }
  40%  { transform: rotate(144deg) scale(0.6); }
  50%  { transform: rotate(180deg) scale(0.5); }
  60%  { transform: rotate(216deg) scale(0.6); }
  70%  { transform: rotate(252deg) scale(0.7); }
  80%  { transform: rotate(288deg) scale(0.8); }
  90%  { transform: rotate(324deg) scale(0.9); }
  100% { transform: rotate(360deg) scale(1.0); }
}

/* ==========================================================================
   840px and down: single column, cart shown above the form
   ========================================================================== */
@media (max-width: 840px) {
  .checkout-row {
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .col-60 { width: 100%; }
  .col-40 { width: 0; }

  /* overrides .padding-vertical-medium on these headers */
  .checkout-header {
    padding: 27px 10px 10px 20px;
  }

  .cart-before-form {
    display: block;
    border-bottom: 1px solid #c2c7cc;
  }
  .cart-after-form {
    display: none;
  }

  .payment-form {
    width: 100%;
    max-width: none;
    height: auto;
    padding: 0;
    border-radius: 0;
    font-size: 14px;
  }
  #fast-checkout .wrapper {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 650px) {
  .order-details-section:first-of-type {
    border-top: none;
  }
}
