/* Product pages/categories that are explicitly cash-only. */
html.bz-installment-product-restricted,
body.bz-installment-restricted-product {
    --baz-torobpay-topbar-height: 0px !important;
    --baz-torobpay-header-offset: 0px !important;
}
html.bz-installment-product-restricted #torobpay-topbar,
body.bz-installment-restricted-product #torobpay-topbar,
html.bz-installment-product-restricted .baz-torobpay-pdp-slot,
html.bz-installment-product-restricted .baz-snapppay-pdp-slot,
html.bz-installment-product-restricted .torobpay-widget,
html.bz-installment-product-restricted .snapppay-widget,
body.bz-installment-restricted-product .baz-torobpay-pdp-slot,
body.bz-installment-restricted-product .baz-snapppay-pdp-slot,
body.bz-installment-restricted-product .torobpay-widget,
body.bz-installment-restricted-product .snapppay-widget {
    display: none !important;
}

.payment-list .bz-installment-gateway-disabled {
    display: none !important;
}

.bz-installment-checkout-notice {
    margin: 14px 0 20px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--color-primary, #7c3aed) 22%, transparent);
    border-radius: 16px;
    background: color-mix(in srgb, var(--color-primary, #7c3aed) 5%, var(--color-body-bg, #fff));
    color: var(--color-text, #222);
}
.bz-installment-notice__top {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}
.bz-installment-notice__icon {
    display: inline-flex;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--color-primary, #7c3aed);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    line-height: 1;
}
.bz-installment-notice__top strong {
    display: block;
    font-size: 14px;
    line-height: 1.8;
    font-weight: 800;
}
.bz-installment-notice__top p {
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.9;
    color: var(--color-text-70, #666);
}
.bz-installment-notice__groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 13px;
}
.bz-installment-group {
    min-width: 0;
    border: 1px solid color-mix(in srgb, currentColor 10%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-body-bg, #fff) 94%, transparent);
    overflow: hidden;
}
.bz-installment-group:only-child { grid-column: 1 / -1; }
.bz-installment-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-bottom: 1px solid color-mix(in srgb, currentColor 8%, transparent);
}
.bz-installment-group__head strong { font-size: 12px; font-weight: 800; }
.bz-installment-group__head span {
    font-size: 10px;
    color: var(--color-text-60, #777);
    white-space: nowrap;
}
.bz-installment-group.is-cash .bz-installment-group__head strong { color: #b42318; }
.bz-installment-group.is-installment .bz-installment-group__head strong { color: #16794b; }
.bz-installment-group__items {
    display: grid;
    gap: 0;
    max-height: 208px;
    overflow: auto;
    overscroll-behavior: contain;
}
.bz-installment-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 9px 10px;
    color: inherit;
    text-decoration: none !important;
}
.bz-installment-item + .bz-installment-item { border-top: 1px solid color-mix(in srgb, currentColor 7%, transparent); }
.bz-installment-item img,
.bz-installment-item__placeholder {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 9px;
    background: color-mix(in srgb, currentColor 5%, transparent);
}
.bz-installment-item__body { min-width: 0; display: grid; gap: 3px; flex: 1; }
.bz-installment-item__body strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
}
.bz-installment-item__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.bz-installment-item__reason,
.bz-installment-item__qty {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 6%, transparent);
    color: var(--color-text-60, #777);
    font-size: 9px;
    line-height: 1.5;
}
.bz-installment-notice__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px dashed color-mix(in srgb, currentColor 14%, transparent);
    font-size: 10px;
    color: var(--color-text-60, #777);
}
.bz-installment-notice__footer b { color: var(--color-text, #222); font-weight: 700; }

.bz-installment-classic-notice {
    display: grid;
    gap: 4px;
    margin: 12px 0 18px;
    padding: 13px 15px;
    border: 1px solid color-mix(in srgb, #b42318 24%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, #b42318 5%, var(--color-body-bg, #fff));
}
.bz-installment-classic-notice strong { font-size: 13px; }
.bz-installment-classic-notice span { font-size: 11px; line-height: 1.8; opacity: .75; }

@media (max-width: 767px) {
    .bz-installment-checkout-notice { padding: 13px; border-radius: 14px; }
    .bz-installment-notice__groups { grid-template-columns: 1fr; }
    .bz-installment-notice__footer { align-items: flex-start; flex-direction: column; gap: 3px; }
    .bz-installment-group__items { max-height: 180px; }
}

/* Avoid a misleading installment-banner flash while an SPA product route is being resolved. */
html.bz-installment-product-status-pending #torobpay-topbar,
html.bz-installment-product-status-pending .baz-torobpay-pdp-slot,
html.bz-installment-product-status-pending .baz-snapppay-pdp-slot,
html.bz-installment-product-status-pending .torobpay-widget,
html.bz-installment-product-status-pending .snapppay-widget {
    display: none !important;
}
