/*
 * Cart + Checkout fixes. Loaded only on is_cart() / is_checkout() (see functions.php).
 * Uses px on purpose: the theme scales html font-size, so rem is not 16px here.
 */

/* ---------- Bootstrap clash: WooCommerce .col-1/.col-2 are not grid columns ---------- */
.woocommerce .col2-set .col-1,
.woocommerce .col2-set .col-2,
.woocommerce-page .col2-set .col-1,
.woocommerce-page .col2-set .col-2 {
  flex: none;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  position: static;
}

/* ---------- Page spacing ---------- */
.woocommerce-cart #the-page-content,
.woocommerce-checkout #the-page-content {
  padding-bottom: 60px;
}

/* ---------- Typography ---------- */
.woocommerce-cart #the-page-content h2,
.woocommerce-checkout #the-page-content h3 {
  font-family: 'Chuck', serif;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  color: rgba(19, 27, 46, 1);
  margin: 0 0 18px;
}

.woocommerce-checkout #the-page-content h3#ship-to-different-address {
  font-size: 20px;
  margin-top: 10px;
}

.woocommerce-checkout #ship-to-different-address input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.woocommerce-checkout #ship-to-different-address label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

/* ---------- Form fields ---------- */
.woocommerce form .form-row {
  margin: 0 0 16px;
  padding: 0;
}

.woocommerce form .form-row label {
  display: block;
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 6px;
  color: rgba(64, 64, 64, 1);
}

.woocommerce form .form-row label.checkbox,
.woocommerce form .form-row label.woocommerce-form__label-for-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.woocommerce form .form-row .input-text,
.woocommerce form .form-row select,
.woocommerce-cart #coupon_code,
.woocommerce form .form-row textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font-size: 16px;
  line-height: 1.4;
  color: rgba(64, 64, 64, 1);
  background-color: #fff;
  border: 1px solid #c9ccd3;
  border-radius: 4px;
  box-sizing: border-box;
}

.woocommerce form .form-row textarea {
  min-height: 120px;
}

.woocommerce form .form-row select {
  height: 46px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 44px;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper label.woocommerce-form__label-for-checkbox {
  display: block;
  padding-left: 28px;
  position: relative;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper label.woocommerce-form__label-for-checkbox input[type="checkbox"] {
  position: absolute;
  left: 0;
  top: 2px;
}

.woocommerce form .form-row .input-text:focus,
.woocommerce form .form-row select:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce-cart #coupon_code:focus {
  outline: none;
  border-color: rgba(246, 142, 37, 1);
  box-shadow: 0 0 0 3px rgba(246, 142, 37, .2);
}

.woocommerce form .form-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
}

.woocommerce-checkout .select2-container .select2-selection--single {
  height: 46px;
  border: 1px solid #c9ccd3;
  border-radius: 4px;
}

.woocommerce-checkout .select2-container .select2-selection--single .select2-selection__rendered {
  line-height: 44px;
  padding-left: 14px;
  font-size: 16px;
}

.woocommerce-checkout .select2-container .select2-selection--single .select2-selection__arrow {
  height: 44px;
}

/* ---------- Checkout layout: details left, order summary right ---------- */
@media (min-width: 992px) {
  .woocommerce-checkout form.checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    column-gap: 50px;
    align-items: start;
  }

  .woocommerce-checkout form.checkout > * {
    grid-column: 1;
  }

  .woocommerce-checkout form.checkout #customer_details {
    grid-column: 1;
    grid-row: 1 / span 3;
  }

  .woocommerce-checkout form.checkout #order_review_heading {
    grid-column: 2;
    grid-row: 1;
  }

  .woocommerce-checkout form.checkout #order_review {
    grid-column: 2;
    grid-row: 2;
    position: sticky;
    top: 120px;
  }

  /* billing and shipping stacked inside the left column */
  .woocommerce .col2-set .col-1,
  .woocommerce .col2-set .col-2 {
    float: none;
    width: 100%;
  }

  .woocommerce .col2-set .col-2 {
    margin-top: 30px;
  }
}

.woocommerce-checkout #order_review_heading {
  margin-top: 30px;
}

@media (min-width: 992px) {
  .woocommerce-checkout #order_review_heading {
    margin-top: 0;
  }
}

/* ---------- Tables (cart + order review) ---------- */
.woocommerce table.shop_table {
  border: 1px solid #e3e5ea;
  border-radius: 6px;
  border-collapse: separate;
  margin: 0 0 24px;
  font-size: 15px;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
  padding: 14px 16px;
  vertical-align: middle;
}

.woocommerce table.shop_table th {
  font-weight: 700;
  color: rgba(19, 27, 46, 1);
}

.woocommerce-checkout table.shop_table tfoot th,
.woocommerce-checkout table.shop_table tfoot td,
.woocommerce-checkout table.shop_table .cart_item td {
  font-style: normal;
}

.woocommerce-cart table.cart img {
  width: 70px;
  height: auto;
}

.woocommerce-cart table.cart td.actions {
  padding: 14px 16px;
}

.woocommerce-cart table.cart td.actions .coupon {
  display: flex;
  gap: 10px;
  align-items: center;
}

.woocommerce-cart table.cart td.actions .coupon #coupon_code {
  width: 200px;
  margin: 0;
}

.woocommerce-cart table.cart .quantity .qty {
  width: 70px;
  min-height: 42px;
  padding: 6px;
  text-align: center;
  border: 1px solid #c9ccd3;
  border-radius: 4px;
  font-size: 16px;
}

/* ---------- Buttons ---------- */
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce-checkout #payment #place_order {
  font-family: 'Chuck', serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.2;
  padding: 13px 26px;
  border-radius: 4px;
  border: 0;
  background-color: rgba(246, 142, 37, 1);
  color: #fff;
  transition: background-color .2s ease;
}

.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce-checkout #payment #place_order:hover {
  background-color: rgba(19, 27, 46, 1);
  color: #fff;
}

.woocommerce button.button:disabled,
.woocommerce button.button:disabled[disabled],
.woocommerce button.button:disabled:hover {
  background-color: #e3e5ea;
  color: #8a8f99;
  padding: 13px 26px;
  opacity: 1;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  font-size: 20px;
  padding: 18px 26px;
  margin-bottom: 0;
}

.woocommerce-checkout #payment #place_order {
  width: 100%;
  float: none;
  font-size: 20px;
  padding: 18px 26px;
  margin-top: 10px;
}

/* ---------- Cart totals ---------- */
.woocommerce-cart .cart-collaterals .cart_totals {
  background: #f7f7f9;
  border-radius: 6px;
  padding: 24px;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table {
  background: #fff;
}

/* ---------- Payment box ---------- */
.woocommerce-checkout #payment {
  background: #f7f7f9;
  border-radius: 6px;
}

.woocommerce-checkout #payment div.payment_box {
  background-color: #eceef2;
  color: rgba(64, 64, 64, 1);
  font-size: 14px;
  line-height: 1.6;
}

.woocommerce-checkout #payment div.payment_box::before {
  border-bottom-color: #eceef2;
}

.woocommerce-checkout #payment div.payment_box input.input-text,
.woocommerce-checkout #payment div.payment_box .js-sv-wc-payment-gateway-credit-card-form-input {
  /* background-color only: the gateway sets the card-type icon via background-image/size/position */
  background-color: #fff;
  border: 1px solid #c9ccd3;
  border-radius: 4px;
  font-size: 16px;
  min-height: 46px;
  padding: 10px 14px;
}

.woocommerce-checkout #payment .form-row.place-order {
  padding: 16px;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper {
  font-size: 15px;
}

.woocommerce-checkout .wc-af-captcha-checkout-wrapper {
  margin: 0 0 20px;
}

/* ---------- Notices ---------- */
.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-info,
.woocommerce-checkout .woocommerce-message,
.woocommerce-checkout .woocommerce-info,
.woocommerce-checkout .woocommerce-error {
  border-top-color: rgba(246, 142, 37, 1);
  font-size: 15px;
}

.woocommerce-cart .woocommerce-info::before,
.woocommerce-checkout .woocommerce-info::before,
.woocommerce-cart .woocommerce-message::before,
.woocommerce-checkout .woocommerce-message::before {
  color: rgba(246, 142, 37, 1);
}

.woocommerce-message .button.wc-forward {
  font-size: 15px;
  padding: 9px 18px;
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  .woocommerce form .form-row-first,
  .woocommerce form .form-row-last {
    width: 100%;
    float: none;
  }

  .woocommerce-cart table.cart td.actions .coupon {
    flex-wrap: wrap;
  }

  .woocommerce-cart table.cart td.actions .coupon #coupon_code,
  .woocommerce-cart table.cart td.actions .coupon .button {
    width: 100%;
    float: none;
  }

  .woocommerce-cart table.cart td.actions > .button {
    width: 100%;
    margin-top: 10px;
  }

  .woocommerce-cart .cart-collaterals .cart_totals {
    padding: 16px;
  }
}

/* theme's `.woocommerce a:not(...)` link colour (style.scss) out-specifies normal selectors */
.woocommerce a.button,
.woocommerce a.button:hover,
.woocommerce a.button.alt,
.woocommerce a.button.alt:hover,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
  color: #fff !important;
  text-decoration: none !important;
}
