@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;
}

#cart-drawer #minicart-amazon-pay-button {
    margin-top: 15px !important;
}
}

/* Reserve a stable row for the two native product payment controls. */
body#html-body.catalog-product-view .toneart-purchase-extras {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 10px;
    align-items: start;
}
body#html-body.catalog-product-view .toneart-purchase-extras > * { grid-column: 1 / -1; min-width: 0; }
body#html-body.catalog-product-view .toneart-purchase-extras > .toneart-paypal-product-shortcut {
    grid-column: 1; order: 5 !important;
    position: relative; height: 50px; min-height: 50px; margin: 0 !important;
}
body#html-body.catalog-product-view .toneart-purchase-extras > #toneart-amazon-product-buy-now {
    grid-column: 2; order: 5 !important;
    position: relative; min-height: 50px; margin: 0 !important;
}
body#html-body.catalog-product-view .toneart-purchase-extras > .toneart-paypal-product-message { order: 6 !important; }
body#html-body.catalog-product-view #paypalInContextPDP {
    width: 100% !important; max-width: none !important;
    height: 50px !important; min-height: 50px !important; margin: 0 !important;
}
body#html-body.catalog-product-view .toneart-payment-placeholder {
    position: absolute; inset: 0 0 auto; height: 50px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #d5d9df; border-radius: 5px;
    background: #f3f4f6; color: #4b5563; font-size: 13px;
    padding: 4px; text-align: center; pointer-events: none;
}
body#html-body.catalog-product-view [data-payment-state="ready"] .toneart-payment-placeholder { display: none !important; }
body#html-body.catalog-product-view .toneart-paypal-product-shortcut:not([data-payment-state="ready"]) #paypalInContextPDP,
body#html-body.catalog-product-view #toneart-amazon-product-buy-now:not([data-payment-state="ready"]) [data-amazon-hosted-button] { visibility: hidden; }
body#html-body.catalog-product-view #toneart-amazon-product-buy-now [data-amazon-status]:empty { display: none; }
body#html-body.catalog-product-view .toneart-purchase-extras:not(:has(#toneart-amazon-product-buy-now)) > .toneart-paypal-product-shortcut,
body#html-body.catalog-product-view .toneart-purchase-extras:not(:has(.toneart-paypal-product-shortcut)) > #toneart-amazon-product-buy-now { grid-column: 1 / -1; }

body#html-body.catalog-product-view #toneart-amazon-product-buy-now [data-amazon-status] {
    width: calc(200% + 10px); margin-left: calc(-100% - 10px); font-size: 12px; line-height: 18px;
}

/* Skeleton wireframe keeps the native controls' footprint while providers load. */
body#html-body.catalog-product-view [data-payment-state="loading"] .toneart-payment-placeholder {
    overflow: hidden;
    color: transparent;
    background: #e9edf1;
    border-color: #cbd2da;
}
body#html-body.catalog-product-view [data-payment-state="loading"] .toneart-payment-placeholder::before {
    content: "";
    position: absolute;
    width: 42%; max-width: 112px; height: 14px;
    border: 1px solid #c3cbd5; border-radius: 4px;
    background: #d3dae3;
}
body#html-body.catalog-product-view [data-payment-state="loading"] .toneart-payment-placeholder::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.65) 50%, transparent 80%);
    transform: translateX(-100%);
    animation: toneart-payment-skeleton 1.6s ease-in-out infinite;
}
@keyframes toneart-payment-skeleton {
    to { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
    body#html-body.catalog-product-view [data-payment-state="loading"] .toneart-payment-placeholder::after { animation: none; display: none; }
}

/* Match each compact note to the payment control above it. */
body#html-body.catalog-product-view .toneart-purchase-extras > #toneart-amazon-product-buy-now { display: contents; }
body#html-body.catalog-product-view #toneart-amazon-product-buy-now > .toneart-amazon-product-control {
    position: relative; grid-column: 2; order: 5; min-width: 0; height: 50px;
}
body#html-body.catalog-product-view .toneart-purchase-extras > .toneart-paypal-product-message {
    grid-column: 1; order: 6 !important; margin: 8px 0 0 !important;
    padding: 0 !important; border: 0 !important; border-radius: 0 !important;
    background: transparent !important; box-shadow: none !important;
    min-height: 0 !important; width: 100% !important;
}
body#html-body.catalog-product-view #toneart-amazon-product-buy-now [data-amazon-status] {
    grid-column: 2; order: 6; width: auto; margin: 8px 0 0;
    font-size: 12px; line-height: 17px; font-weight: 400;
}
body#html-body.catalog-product-view #toneart-amazon-product-buy-now > button { grid-column: 2; order: 7; }
body#html-body.catalog-product-view .toneart-purchase-extras:not(:has(.toneart-paypal-product-shortcut)) .toneart-amazon-product-control,
body#html-body.catalog-product-view .toneart-purchase-extras:not(:has(.toneart-paypal-product-shortcut)) #toneart-amazon-product-buy-now [data-amazon-status] { grid-column: 1 / -1; }

/* Compact spacing and a quiet separator between the two payment notes. */
body#html-body.catalog-product-view .toneart-purchase-extras { row-gap: 8px; }
body#html-body.catalog-product-view .toneart-purchase-extras > .lease-form-link { margin-bottom: 4px; }
body#html-body.catalog-product-view .toneart-purchase-extras > .toneart-paypal-product-message,
body#html-body.catalog-product-view #toneart-amazon-product-buy-now [data-amazon-status] { margin-top: 0 !important; }
body#html-body.catalog-product-view #toneart-amazon-product-buy-now [data-amazon-status] {
    position: relative; align-self: stretch;
}
body#html-body.catalog-product-view .toneart-purchase-extras:has(.toneart-paypal-product-message) #toneart-amazon-product-buy-now [data-amazon-status]:not(:empty)::before {
    content: ""; position: absolute; left: -5px; top: 0; bottom: 0;
    width: 1px; background: #82919b; opacity: .45;
}

/* Keep the native cart payment controls side by side. */
body#html-body #cart-drawer [x-html="getSectionDataExtraActions"],
body#html-body.checkout-cart-index .checkout-methods-items > li:has(> #paypalInContextRenderTarget0) {
    display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px; align-items: start;
}
body#html-body #cart-drawer #paypalInContextRenderTarget1,
body#html-body.checkout-cart-index #paypalInContextRenderTarget0 {
    grid-column: 1; width: 100% !important; min-width: 0 !important;
    height: 50px !important; min-height: 50px !important; margin: 0 !important;
}
body#html-body #cart-drawer #paypalInContextRenderTarget1 > .paypal-buttons,
body#html-body.checkout-cart-index #paypalInContextRenderTarget0 > .paypal-buttons { min-width: 0 !important; width: 100% !important; }
body#html-body #cart-drawer #minicart-amazon-pay-button,
body#html-body.checkout-cart-index .checkout-methods-items [data-toneart-buy-now] {
    grid-column: 2; width: 100% !important; min-width: 0 !important; margin: 0 !important;
}
body#html-body.checkout-cart-index .checkout-methods-items > li:has(> [data-toneart-buy-now]) > #minicart-amazon-pay-button { display: none !important; }
body#html-body #cart-drawer #minicart-amazon-pay-button .amazon-button-column { width: 100%; min-width: 0; margin: 0; }
body#html-body #cart-drawer #minicart-amazon-pay-button [data-amazon-status],
body#html-body.checkout-cart-index .checkout-methods-items [data-amazon-status] { font-size: 12px; line-height: 17px; margin-top: 8px; }

@layer components {
body#html-body #cart-drawer #minicart-amazon-pay-button { margin-top: 0 !important; }
}

body#html-body.catalog-product-view #toneart-amazon-product-buy-now [data-amazon-status] { padding: 10px; }

/* Give payment logos and disclosures their full width on small phones. */
@media (max-width: 479px) {
    body#html-body.catalog-product-view .toneart-purchase-extras { grid-template-columns: minmax(0, 1fr); }
    body#html-body.catalog-product-view .toneart-purchase-extras > .toneart-paypal-product-shortcut { grid-column: 1; order: 5 !important; }
    body#html-body.catalog-product-view .toneart-purchase-extras > .toneart-paypal-product-message { grid-column: 1; order: 6 !important; }
    body#html-body.catalog-product-view #toneart-amazon-product-buy-now > .toneart-amazon-product-control {
        grid-column: 1; order: 7; margin-top: 6px;
    }
    body#html-body.catalog-product-view #toneart-amazon-product-buy-now [data-amazon-status] {
        grid-column: 1; order: 8; padding: 0;
    }
    body#html-body.catalog-product-view #toneart-amazon-product-buy-now > button { grid-column: 1; order: 9; }
    body#html-body.catalog-product-view .toneart-purchase-extras:has(.toneart-paypal-product-message) #toneart-amazon-product-buy-now [data-amazon-status]::before { display: none; }
}
