@layer components {
/* Size the official Amazon host before its SDK measures and renders it. */
[data-toneart-buy-now] [data-amazon-hosted-button],
#PayWithAmazon-Product,
[id^="toneart-amazon-cart-"],
#minicart-amazon-pay-button [data-amazon-hosted-button],
body#html-body.hyva_checkout-index-index #PayWithAmazon-HyvaCheckout,
body#html-body.hyva_checkout-index-index #toneart-amazon-pay-method-button {

    width: 100% !important;
    max-width: 500px !important;
    height: 50px !important;
    min-height: 50px;
    max-height: 50px !important;
    margin-inline: auto;
}

/* Preserve the checkout overflow guard while allowing the larger SDK host. */
body#html-body.hyva_checkout-index-index #PayWithAmazon-HyvaCheckout > div,
body#html-body.hyva_checkout-index-index #PayWithAmazon-HyvaCheckout [class*="amazonpay-button-parent-container"],
body#html-body.hyva_checkout-index-index #toneart-amazon-pay-method-button [class*="amazonpay-button-parent-container"] {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 50px !important;
}

/* The product purchase panel orders its controls with flexbox. */
.catalog-product-view #toneart-amazon-product-buy-now {
    order: 6;
    flex: 0 0 100%;
    width: 100%;
}

/* Product-page shortcut styling must not dim or shrink the cart drawer. */
#cart-drawer #minicart-amazon-pay-button[data-amazon-pay-state="ready"] {
    opacity: 1 !important;
    transform: none !important;
}
#cart-drawer #PayWithAmazon-Cart {
    background: transparent !important;
    border-radius: 5px;
}
}
