.page-template-checkout {
  overflow-x: hidden;
}


/* Form */
.page-checkout__title {
  text-transform: uppercase;
  font-size: var(--font-size-35);
  padding-top: 41px;
}

.page-checkout #customer_details {
  padding-top: 60px;
  margin-top: 40px;
}

/* Coupon */
.woocommerce .woocommerce-form-coupon .form-row {
  float: none;
}

.woocommerce-form-coupon-toggle {
  display: none;
}

.checkout_coupon  {
  display: block !important;
  
}

/* Login */

.page-template-checkout .woocommerce a {
  text-decoration: underline;
}

.page-template-checkout .woocommerce .woocommerce-form-login {
  border: 1px solid;
  padding: 20px;
  border-radius: 0;
}



/* Checkout form layout */
#billing_first_name_field { grid-area: billing_first_name_field }
#billing_last_name_field { grid-area: billing_last_name_field }
#billing_company_field { grid-area: billing_company_field }
#billing_country_field { grid-area: billing_country_field }
#billing_address_1_field { grid-area: billing_address_1_field }
#billing_address_2_field { grid-area: billing_address_2_field }
#billing_postcode_field { grid-area: billing_postcode_field }
#billing_city_field { grid-area: billing_city_field }
#billing_state_field { grid-area: billing_state_field }
#billing_phone_field { grid-area: billing_phone_field }
#billing_email_field { grid-area: billing_email_field }
#billing_state_field { grid-area: billing_state_field}

#main .woocommerce-billing-fields .form-row {
  float: none; width: auto;
  margin-bottom: 12px;
}

.woocommerce-billing-fields__field-wrapper {
  display: grid; 
  grid-gap: 0 100px;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    'billing_first_name_field billing_city_field'
    'billing_last_name_field  billing_phone_field'
    'billing_company_field    billing_email_field'
    'billing_country_field    c'
    'billing_state_field      c'; 

  margin-bottom: 24px;
}

.three-columns .woocommerce-billing-fields__field-wrapper {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas:
    'billing_first_name_field billing_address_1_field billing_phone_field'
    'billing_last_name_field  billing_address_2_field billing_email_field'
    'billing_company_field    billing_postcode_field  -'
    'billing_country_field    billing_city_field      -'
    'billing_state_field      c                       -'; 

}


#main .woocommerce-billing-fields .mailchimp-newsletter {
  margin-bottom: 24px;
  display: block;
}

.woocommerce-account-fields {
  margin-bottom: 24px;
}

/* Review order */
#order_review_heading {
  padding-top: 77px;
  position: relative;
  margin-bottom: 16px;
}

#order_review_heading:before {
  top: 0px;
}

#order_review {
  display: grid;
  grid-template-columns: 1.1fr 1fr; 
  gap: 129px;
  max-width: 760px;
  margin-bottom: 79px;
}

.woocommerce table.shop_table {
  border: none; 
  font-size: var(--font-size-13);
  border-collapse: collapse;
  height: auto; margin-bottom: auto;
}

#order_review table.shop_table th {
  color: black;
  font-weight: 400;
}

.woocommerce table.shop_table thead {
  position: fixed; top: -100vh;
}

.woocommerce table.shop_table tbody th, 
.woocommerce table.shop_table tfoot td, 
.woocommerce table.shop_table tfoot th,
.woocommerce table.shop_table td {
  border-top: 1px solid;
  padding: 12px 0;
}

.product-quantity {
  display: block;
}

#order_review .cart_item *,
#order_review .recurring-total.cart-subtotal *,
#order_review .recurring-totals * {
  border-top: none;
}

#order_review .cart_item > * {
  vertical-align: top;
  padding-top: 5px;
}

#order_review .variation {
  display: flex; flex-direction: column;
  gap: 0; line-height: 1;
  margin-top: 10px;
}

#order_review .variation dt {
  padding: 0; font-weight: bold;
}

#order_review .variation dd {
  padding-top: 0; margin-bottom: 17px;
}

.woocommerce table.shop_table th:nth-child(2),
.woocommerce table.shop_table td:nth-child(2) {
  text-align: end;
}

#add_payment_method #payment, .woocommerce-cart #payment, .woocommerce-checkout #payment {
  background: none;
}

#order_review #payment ul.payment_methods li img {
  margin-left: 0; padding-left: 0;
  margin-top: 12px;
  margin-bottom: 18px;
}

.woocommerce-checkout #payment div.form-row,
.woocommerce-checkout #payment ul.payment_methods {
  padding: 0;
}

.woocommerce-checkout #payment ul.payment_methods {
  border-bottom: none;
}

.woocommerce-checkout #payment div.payment_box::before {
  display: none;
}

.woocommerce-checkout #payment div.payment_box {
  background: none;
  padding: 0; margin: 0 0 10px;
}

.woocommerce label {
  padding: 0;
}

.woocommerce-checkout #payment div.payment_box p {
  padding: 0;
}

.woocommerce-checkout #payment div.payment_box,
.woocommerce-checkout #payment div.form-row {
  border-top: none;
  font-size: var(--font-size-13);
  padding: 1px 0 3px;
  font-weight: 300;
  letter-spacing: 0.044em;
  line-height: 1.5;  
  
}

.woocommerce #payment #place_order, .woocommerce-page #payment #place_order {
  float: none; margin: 46px auto;
}

/* Remove item button */
#order_review  .product-name {
  display: flex; 
  flex-wrap: wrap;

  .product-name__with-remove {
    gap: 9px;
  }
  
  .remove {
    width: 20px; height: 20px;
    flex: 0 0 20px; 
    margin-inline-start: -30px;
    color: var(--color-text) !important;
    font-weight: normal;
    text-decoration: none;

    &:hover {
      background: var(--color-greige);
    }
  }
}




/* Checkout button area */
.woocommerce-checkout-payment a {
  text-decoration: underline;
}

.checkout__disclaimer {
  font-size: var(--font-size-10);
  margin: auto;
  letter-spacing: 0.05em;
  text-align: center;
}

/* Errors */
.woocommerce-error::before {
  display: none;
}

.woocommerce-checkout .woocommerce-error {
  padding: 0;
  gap: 15px;
  color: #a00;
}

#main .woocommerce-error a.button {
  display: none;
}

.woocommerce form .form-row label.inline  {
  display: inline-flex; align-items: center;
}

.create-account {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 0 100px;
  margin-bottom: 50px;
} 

/* Success */
.page-checkout--success .page-checkout__title {
  margin-bottom: 14px;
  padding-top: 74px;
}

.page-checkout__success,
.page-checkout--success .woocommerce ul.order_details li strong,
.page-checkout--success ul.order_details li,
.woocommerce-thankyou-order-received {
  font-size: var(--font-size-13);
  font-weight: 500;
  font-family: var(--font-family-sans-serif);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  float: none;
  color: black;
  border: none;
}

.page-checkout__success p {
  margin: 0.5em;
  line-height: 1.5
}

.page-checkout__success { 
  margin-bottom: 3em;
  position: relative; 
  padding-top: 60px;
  margin-top: 60px; 
}

.woocommerce-order {
  margin-bottom: 60px;
  font-weight: normal;
  font-size: var(--font-size-13);
  line-height: 1.6;
  letter-spacing: 0.04em;
}

.woocommerce-order  a {
  text-decoration: underline;
}

.page-checkout__success  a {
  text-decoration: underline;
}

.page-checkout__success:before {
  top: 3px;
}

.woocommerce-thankyou-order-received {
  margin-bottom: 44px;
}

.page-checkout--success .woocommerce ul.order_details li strong {
  font-weight: 300;
  display: block; margin-top: 3px;
  margin-bottom: 24px;
}

.page-checkout--success .woocommerce-order-details,
.page-checkout--success .woocommerce-customer-details {
  display: none;
}

/* Smaller screen */
@media (max-width: 1200px) {
  .create-account,
  .woocommerce-billing-fields__field-wrapper {
    grid-gap: 0 25px;
  }
}



/* Mobile */
@media (max-width: 1000px) {
  /* Notification */
  .woocommerce-notices-wrapper .woocommerce-message,
  .woocommerce-notices-wrapper li {
    font-size: var(--font-size-14);
    font-weight: 500;
  }

  #main .woocommerce-notices-wrapper a.button {
    display: none;
  }

  .page-checkout__title {
    font-size: var(--font-size-30)
  }

  .create-account {
    display: block;
  }

  /* Customer detail */
  .page-checkout #customer_details  {
    padding-top: 42px;
  }

  #customer_details .form-row {
    grid-area: inherit; 
  }
  
  .woocommerce-billing-fields__field-wrapper {
    grid-template-areas: none;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    grid-gap: 0px 20px;
    grid-auto-flow: row;
    margin-bottom: 41px;
  }

  #main .form-row-wide {
    grid-column: span 2;
  }

  #order_review_heading {
    padding-top: 50px;
  } 

  #order_review {
    display: block;
  }

  #order_review .woocommerce-checkout-review-order-table {
    margin-bottom: 47px;
  }

  .woocommerce #payment #place_order, .woocommerce-page #payment #place_order {
    width: auto;
  }

  #order_review {
    margin-bottom: 24px;
  }

  /* Successs */
  .page-checkout--success .page-checkout__title {
    padding-top: 39px;
    margin-bottom: 10px;
  }

  .woocommerce-thankyou-order-received {
    margin: 0;
  }

  .page-checkout--success .woocommerce ul.order_details li strong {
    margin-bottom: 25px;
  }

  .page-checkout__success {
    margin-top: 0; padding-top: 6px;
  }

  .page-checkout__success:before {
    top: -31px
  }
}