/* Coupon diagnostics: scoped, compact and safe inside the checkout sidebar. */
body.checkout-index-index .payment-option-content [data-role="checkout-messages"].messages,
body.checkout-cart-index .messages {
    box-sizing: border-box;
    max-width: 100%;
}

body.checkout-index-index .payment-option-content [data-role="checkout-messages"].messages {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body.checkout-index-index .payment-option-content .message-error.error,
body.checkout-cart-index .messages .message-error.error {
    background: #fff9f7 !important;
    border: 1px solid #f1d3ca !important;
    border-left: 4px solid #c4472d !important;
    border-radius: 10px !important;
    box-shadow: 0 3px 12px rgba(91, 42, 25, .06);
    box-sizing: border-box;
    color: #3b2924 !important;
    margin: 10px 0 !important;
    max-width: 100%;
    overflow: hidden;
    padding: 0 !important;
    width: 100%;
}

body.checkout-index-index .payment-option-content .message-error.error > div:first-child::before,
body.checkout-cart-index .messages .message-error.error > div:first-child::before {
    display: none !important;
}

body.checkout-index-index .payment-option-content .message-error.error > div,
body.checkout-cart-index .messages .message-error.error > div {
    color: #3b2924 !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
    padding: 12px 14px;
    text-align: left;
}

.saida-coupon-assistance {
    align-items: center;
    border-top: 1px solid #eadbd5;
    color: #6d5a52;
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 5px 8px;
    line-height: 1.4;
    margin: 10px 0 0;
    padding-top: 9px;
}

.saida-coupon-assistance a {
    align-items: center;
    color: #16763a;
    display: inline-flex;
    font-weight: 800;
    gap: 5px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.saida-coupon-assistance a:hover,
.saida-coupon-assistance a:focus-visible {
    color: #0f5d2c;
    outline: 2px solid rgba(22, 118, 58, .24);
    outline-offset: 2px;
}

.coupon-diagnostics,
.coupon-diagnostics * {
    box-sizing: border-box;
}

.coupon-diagnostics {
    color: #3b2924;
    font-size: 13px;
    line-height: 1.45;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 14px;
    text-align: left;
    word-break: normal;
}

.coupon-diagnostics__heading {
    align-items: flex-start;
    color: #a93722;
    display: flex;
    font-size: 15px;
    gap: 9px;
    line-height: 1.35;
    margin: 0;
}

.coupon-diagnostics__heading strong {
    color: inherit !important;
    flex: 1 1 auto;
    font-size: inherit !important;
    font-weight: 800;
    min-width: 0;
}

.coupon-diagnostics__heading-icon {
    background: #c4472d;
    border-radius: 50%;
    flex: 0 0 20px;
    height: 20px;
    position: relative;
    width: 20px;
}

.coupon-diagnostics__heading-icon::before,
.coupon-diagnostics__heading-icon::after {
    background: #fff;
    border-radius: 2px;
    content: "";
    left: 9px;
    position: absolute;
    width: 2px;
}

.coupon-diagnostics__heading-icon::before {
    height: 8px;
    top: 4px;
}

.coupon-diagnostics__heading-icon::after {
    height: 2px;
    top: 14px;
}

/* Shipping-method failures contain no diagnostic list: one customer-facing
 * sentence replaces all internal carrier/rule identifiers. */
.coupon-diagnostics--compact {
    padding: 10px 12px;
}

.coupon-diagnostics--compact .coupon-diagnostics__heading {
    align-items: center;
    font-size: 14px;
    line-height: 1.35;
}

.coupon-reasons {
    display: grid;
    gap: 6px;
    list-style: none;
    margin: 11px 0 0;
    padding: 0;
}

.coupon-diagnostics__cause {
    color: #5c4037;
    font-size: 13px;
    line-height: 1.45;
    margin: 10px 0 0;
}

.coupon-diagnostics__support {
    border-top: 1px solid #ecdcd6;
    margin-top: 11px;
    padding-top: 9px;
}

.coupon-diagnostics__support summary {
    color: #7a3511;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    list-style-position: inside;
    padding: 3px 0;
}

.coupon-diagnostics__support .sgx-riv-chip {
    margin-top: 8px;
    width: 100%;
}

.coupon-reason-item {
    color: #5c4037;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
    margin: 0 !important;
    min-width: 0;
    padding: 0 0 0 17px;
    position: relative;
}

.coupon-reason-item::before {
    background: #ef7622;
    border-radius: 50%;
    content: "";
    height: 6px;
    left: 2px;
    position: absolute;
    top: .55em;
    width: 6px;
}

.sgx-riv-helpbox {
    align-items: start;
    border-top: 1px solid #ecdcd6;
    display: grid;
    gap: 10px 11px;
    grid-template-columns: 34px minmax(0, 1fr);
    margin: 13px 0 0;
    max-width: 100%;
    min-width: 0;
    padding: 13px 0 0;
}

.sgx-riv-helpbox .helpbox-icon {
    align-items: center;
    background: #fff1e7;
    border: 1px solid #f2c7a2;
    border-radius: 50%;
    color: #bc4f19;
    display: flex;
    grid-column: 1;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.sgx-riv-helpbox .support-title,
.sgx-riv-helpbox .support-title i {
    font-size: 16px;
    line-height: 1;
}

.sgx-riv-helpbox .helpbox-copy {
    grid-column: 2;
    min-width: 0;
}

.sgx-riv-helpbox .helpbox-copy h3 {
    color: #2f2926;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 3px;
}

.sgx-riv-helpbox .helpbox-copy p {
    color: #6d5a52;
    font-size: 12px;
    line-height: 1.45;
    margin: 0;
}

.sgx-riv-actions {
    display: grid;
    gap: 7px;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
    min-width: 0;
}

.sgx-riv-chip {
    align-items: center;
    background: #fff;
    border: 1px solid #eadbd5;
    border-radius: 8px;
    color: #44342e;
    display: inline-flex;
    font-size: 11.5px;
    font-weight: 750;
    gap: 6px;
    justify-content: center;
    line-height: 1.25;
    min-height: 38px;
    min-width: 0;
    padding: 7px 8px;
    text-align: center;
    text-decoration: none !important;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
    white-space: normal;
}

.sgx-riv-chip i {
    flex: 0 0 auto;
}

.sgx-riv-chip:hover,
.sgx-riv-chip:focus-visible {
    background: #fff5ed;
    border-color: #ef7622;
    color: #a83e11;
}

.sgx-riv-chip--wa {
    background: #f0fff5;
    border-color: #bce6ca;
    color: #16763a;
    grid-column: 1 / -1;
}

.sgx-riv-chip--wa:hover,
.sgx-riv-chip--wa:focus-visible {
    background: #e4faec;
    border-color: #25a85a;
    color: #10612e;
}

@media (max-width: 380px) {
    .coupon-diagnostics {
        padding: 12px;
    }

    .sgx-riv-actions {
        grid-template-columns: 1fr;
    }

    .sgx-riv-chip--wa {
        grid-column: auto;
    }
}

@media (max-width: 480px) {
    .coupon-diagnostics--compact {
        padding: 9px 10px;
    }

    .coupon-diagnostics--compact .coupon-diagnostics__heading {
        display: block;
    }

    .coupon-diagnostics--compact .coupon-diagnostics__heading-icon {
        display: none;
    }

    .coupon-diagnostics--compact .coupon-diagnostics__heading strong {
        display: -webkit-box;
        font-size: 11.5px !important;
        line-height: 1.3;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sgx-riv-chip {
        transition: none;
    }
}
