body.mt-catalog-checkout {
  --mt-catalog-ink: var(--mytrela-ink, #1d221a);
  --mt-catalog-border: #d7e5cd;
  --mt-catalog-lime: var(--mytrela-lime, #9bd23e);
  --mt-catalog-focus: #1d221a;
  --mt-catalog-orange: var(--mytrela-orange, #ff5a00);
}

.mt-catalog-checkout .mt-catalog-checkout-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 20px;
  box-sizing: border-box;
  max-width: 1080px;
  margin: 0 auto 16px;
  padding: clamp(16px, 3vw, 28px);
  border-bottom: 1px solid var(--mt-catalog-border);
  color: var(--mt-catalog-ink);
}

.mt-catalog-checkout .mt-catalog-checkout-header a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mt-catalog-checkout .mt-catalog-checkout-header h1 {
  flex-basis: 100%;
  margin: 0;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  letter-spacing: -.025em;
}

.mt-catalog-checkout #wcf-embed-checkout-form {
  width: min(100% - 24px, 1080px);
  margin-inline: auto;
}

.mt-catalog-checkout #wcf-embed-checkout-form input:where([type="email"], [type="tel"], [type="text"]) {
  min-height: 48px;
  border-color: var(--mt-catalog-border);
  border-radius: 12px;
}

/* Keep the WooCommerce labels visible in the same position before and after entry. */
body.mt-catalog-checkout #wcf-embed-checkout-form form.checkout :is(
  #billing_email_field, #billing_first_name_field, #billing_last_name_field, #billing_phone_field
) > label {
  position: static;
  display: block;
  margin: 0 0 6px;
  padding: 0;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  color: var(--mt-catalog-ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

body.mt-catalog-checkout #wcf-embed-checkout-form form.checkout :is(
  #billing_email_field, #billing_first_name_field, #billing_last_name_field
) > label .required {
  display: inline;
  color: #a32222;
}

body.mt-catalog-checkout #wcf-embed-checkout-form form.checkout #billing_phone_field > label .optional {
  display: inline;
  color: #62665d;
  font-weight: 400;
}

body.mt-catalog-checkout #wcf-embed-checkout-form form.checkout :is(
  #billing_email, #billing_first_name, #billing_last_name, #billing_phone
) {
  padding: 12px;
}

body.mt-catalog-checkout #wcf-embed-checkout-form form.checkout :is(
  #billing_email, #billing_first_name, #billing_last_name, #billing_phone
)::placeholder {
  color: transparent;
  opacity: 0;
}

body.mt-catalog-checkout #wcf-embed-checkout-form #billing_country_field:has(#billing_country[type="hidden"]) {
  display: none;
}

body.mt-catalog-checkout #wcf-embed-checkout-form .woocommerce-additional-fields:has(> .woocommerce-additional-fields__field-wrapper):not(:has(> .woocommerce-additional-fields__field-wrapper > *)) > h3 {
  display: none;
}

body.mt-catalog-checkout #wcf-embed-checkout-form #payment button#place_order,
body.mt-catalog-checkout #wcf-embed-checkout-form #payment button#place_order:is(:hover, :active, :focus, :focus-visible) {
  width: 100%;
  min-height: 52px;
  border-color: var(--mt-catalog-orange) !important;
  border-radius: 12px;
  background: var(--mt-catalog-orange) !important;
  color: #fff !important;
  font-size: 19px !important;
  font-weight: 700 !important;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.mt-catalog-checkout #wcf-embed-checkout-form #payment input[type="radio"][name="payment_method"] {
  accent-color: var(--mt-catalog-lime);
}

body.mt-catalog-checkout #wcf-embed-checkout-form #payment input[type="radio"][name="payment_method"]:checked {
  border-color: var(--mt-catalog-lime) !important;
  background-color: var(--mt-catalog-lime) !important;
}

body.mt-catalog-checkout #wcf-embed-checkout-form #payment input[type="radio"][name="payment_method"]:checked::before {
  background-color: var(--mt-catalog-focus) !important;
}

body.mt-catalog-checkout #wcf-embed-checkout-form .cf-ic-product-thumbnail-batch .instant-checkout-batch {
  background-color: var(--mt-catalog-lime) !important;
  color: var(--mt-catalog-ink) !important;
}

.mt-catalog-checkout form.checkout #payment .woocommerce-terms-and-conditions-wrapper #terms[type="checkbox"] {
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  accent-color: var(--mt-catalog-lime) !important;
}

.mt-catalog-checkout form.checkout #payment .woocommerce-terms-and-conditions-wrapper #terms[type="checkbox"]::before,
.mt-catalog-checkout form.checkout #payment .woocommerce-terms-and-conditions-wrapper #terms[type="checkbox"]::after {
  display: none !important;
  content: none !important;
}

body.mt-catalog-checkout .mt-catalog-checkout-header a:focus-visible,
body.mt-catalog-checkout #wcf-embed-checkout-form :is(
  #customer_details input, #payment #terms, #payment input[name="payment_method"], #payment #place_order,
  .mt-catalog-checkout-coupon input, .mt-catalog-checkout-coupon button
):focus-visible {
  outline: 2px solid var(--mt-catalog-focus) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 3px var(--mt-catalog-lime) !important;
}

.mt-catalog-checkout .mt-catalog-checkout-coupon {
  margin-block: 14px 18px;
}

.mt-catalog-checkout .mt-catalog-checkout-coupon label {
  display: block;
  margin-bottom: 6px;
  font-weight: 650;
}

.mt-catalog-checkout .mt-catalog-checkout-coupon-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mt-catalog-checkout .mt-catalog-checkout-coupon input {
  flex: 1 1 11rem;
  min-width: 0;
}

body.mt-catalog-checkout #wcf-embed-checkout-form #payment .mt-catalog-checkout-coupon button[type="submit"] {
  min-height: 48px;
  padding-inline: 16px;
  border: 1px solid var(--mt-catalog-border) !important;
  border-radius: 12px;
  background: #fff !important;
  color: var(--mt-catalog-ink) !important;
}

.mt-catalog-checkout #mt-catalog-coupon-status {
  margin: 6px 0 0;
}

.mt-catalog-checkout #mt-catalog-coupon-status:empty {
  margin: 0;
}
