.partial-payment-wrapper {
  margin: 18px 0;
}

.partial-payment-wrapper .pp-options {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
}

.partial-payment-wrapper.block .pp-options {
  display: block;
}

.pp-button {
  width: 100%;
  background: var(--pp-button-bg);
  color: var(--pp-button-text);
  font-size: var(--pp-font-size);
  font-family: var(--pp-font-family);
  padding: 15px 10px;
  margin-block: 5px;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  position: relative;
  overflow: visible;
}

.pp-button .discount-badge {
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--pp-discount-badge-bg);
  color: var(--pp-discount-badge-text);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  font-weight: normal;
}

.pp-popover {
  color: black;
  display: none;
  position: absolute;
  width: max-content;
  max-width: 200px;
  background: white;
  border: 1px solid #ddd;
  padding: 10px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  text-align: start;
  font-size: 14px;
  line-height: 18px;
}

.pp-popover img {
  max-width: 150px;
  max-height: 150px;
  display: block;
}

.pp-info-icon {
  position: relative;
  display: inline-block;
}

.pp-info-icon:hover .pp-popover {
  display: block;
}

.pp-popover--top {
  bottom: calc(100% + 5px);
  right: 0;
}

.pp-popover--bottom {
  top: calc(100% + 5px);
  right: 0;
}

.poweredby-text {
  font-size: 9px;
  margin: 0;
  padding: 0;
  position: absolute;
  right: 5px;
  bottom: 4px;
}

.cart-updating-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.cart-updating-box {
  background: rgba(0, 0, 0, 0.7);
  padding: 5px 20px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.cart-updating-box .spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.cart-updating-box p {
  color: #fff;
  font-size: 0.95em;
  margin: 0 !important;
}

.pp-button.loading {
  position: relative;
  opacity: 0.7;
  pointer-events: none;
}

.pp-button.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--pp-button-text);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

body:has(.pp-button) shopify-accelerated-checkout,
body:has(.pp-button) shopify-accelerated-checkout-cart,
body:has(.pp-button) .button.add-to-cart,
body:has(.pp-button) .cart__ctas,
body:has(.pp-button) #checkout {
  display: none !important;
}

.partial-payment-cart .cart__ctas,
.partial-payment-cart #checkout,
.partial-payment-cart shopify-accelerated-checkout-cart,
.partial-payment-cart shopify-accelerated-checkout {
  display: none !important;
}

.partial-payment-cart button[name="checkout"] {
  display: none !important;
}

body:not(.partial-payment-cart):not(.partial-payment-product):not(:has(.pp-button)) .cart__ctas,
body:not(.partial-payment-cart):not(.partial-payment-product):not(:has(.pp-button)) #checkout,
body:not(.partial-payment-cart):not(.partial-payment-product):not(:has(.pp-button)) .button.add-to-cart,
body:not(.partial-payment-cart):not(.partial-payment-product):not(:has(.pp-button)) shopify-accelerated-checkout-cart,
body:not(.partial-payment-cart):not(.partial-payment-product):not(:has(.pp-button)) shopify-accelerated-checkout {
  display: block !important;
}

body.partial-payment-cart:not(:has(.pp-button)) button[name="checkout"] {
  display: block !important;
}

.partial-payment-policy {
  color: black;
}
