/*
 * WooCommerce gives every input inside a payment method item the radio button margin
 * (.woocommerce-checkout #payment ul.payment_methods li input). "revert" restores the browser
 * default, which is what the box inputs had, since the box only sets the checkbox top margin.
 */
#payment #payphonebox-classic-container input {
  margin: revert;
}

#payment #payphonebox-classic-container .ppb-form-check-input {
  margin-top: 3px;
}

/* The input group overlaps an input with its icon by one border width (box Bootstrap). */
#payment #payphonebox-classic-container .ppb-input-group > input:not(:first-child) {
  margin-left: calc(var(--ppb-bs-border-width) * -1);
}

/*
 * WooCommerce also styles every img and li inside a payment method item
 * (#payment ul.payment_methods li img / li). The browser defaults come back first, then the box's
 * own rules for its images, which the reset above outranks.
 */
#payment #payphonebox-classic-container img {
  vertical-align: baseline;
  margin: 0;
  padding: 0;
  position: static;
  box-shadow: none;
}

#payment #payphonebox-classic-container .ppb-img {
  vertical-align: middle;
}

#payment #payphonebox-classic-container .ppb-div-btn-control .ppb-img-btn-control {
  margin: 0;
  position: absolute;
}

#payment #payphonebox-classic-container .ppb-loading img.ppb-center-img {
  position: absolute;
  margin-top: -140px;
  margin-left: -75px;
}

#payment #payphonebox-classic-container li {
  line-height: inherit;
  text-align: inherit;
  font-weight: inherit;
}

/* The box draws its own white card, so WooCommerce's payment box frame is removed for Payphone. */
.woocommerce-checkout #payment div.payment_box.payment_method_payphonebox {
  padding: 0;
  background-color: transparent;
}

.woocommerce-checkout #payment div.payment_box.payment_method_payphonebox::before {
  display: none;
}

/* Same size as the payment method label in the blocks checkout (block-payment/src/index.js). */
#payment ul.payment_methods li.payment_method_payphonebox > label img {
  max-height: 36px;
  max-width: 100%;
  width: auto;
  vertical-align: middle;
}
