/*
 * Digipoost • consistent RTL customer notifications, 2026-11-21.
 * One reserved icon slot for WooCommerce notices across cart, checkout,
 * registration, account, product and other storefront screens.
 * Text, including long Persian lines/URLs, must never overlap notice icons.
 */
body.rtl .woocommerce-error,
body.rtl .woocommerce-info,
body.rtl .woocommerce-message {
    box-sizing: border-box;
    position: relative;
    display: block;
    direction: rtl;
    text-align: right;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    margin: 0 0 1rem !important;
    padding: 1rem 3.55rem 1rem 1.15rem !important;
    line-height: 1.95;
    font-family: inherit;
    border-radius: .85rem;
    overflow-wrap: anywhere;
    word-break: normal;
    list-style: none outside;
}

/* Replace font-dependent Woo symbols with consistent, space-reserved icons. */
body.rtl .woocommerce-error::before,
body.rtl .woocommerce-info::before,
body.rtl .woocommerce-message::before {
    box-sizing: border-box;
    position: absolute;
    display: grid !important;
    place-items: center;
    top: 1.06rem;
    right: 1.03rem;
    left: auto;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    margin: 0;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    content: '!' !important;
    font-family: Tahoma, Arial, sans-serif !important;
    font-size: .95rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    transform: none;
    float: none;
}
body.rtl .woocommerce-info::before {
    content: 'i' !important;
    font-family: Arial, sans-serif !important;
}
body.rtl .woocommerce-message::before {
    content: '✓' !important;
    font-family: Arial, sans-serif !important;
    font-size: .88rem;
}

body.rtl .woocommerce-error li,
body.rtl .woocommerce-info li,
body.rtl .woocommerce-message li {
    display: list-item;
    list-style: none outside !important;
    max-width: 100%;
    margin: 0 0 .35rem;
    padding: 0 !important;
    line-height: 1.9;
    overflow-wrap: anywhere;
}
body.rtl .woocommerce-error li:last-child,
body.rtl .woocommerce-info li:last-child,
body.rtl .woocommerce-message li:last-child {
    margin-bottom: 0;
}
body.rtl .woocommerce-error a,
body.rtl .woocommerce-info a,
body.rtl .woocommerce-message a {
    overflow-wrap: anywhere;
}

/* WooCommerce floats action links inside notices; keep them in normal flow. */
body.rtl .woocommerce-error > .button,
body.rtl .woocommerce-info > .button,
body.rtl .woocommerce-message > .button,
body.rtl .woocommerce-error > a.button,
body.rtl .woocommerce-info > a.button,
body.rtl .woocommerce-message > a.button {
    float: none !important;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    white-space: normal;
    margin: 0 0 .5rem .65rem;
}

/* Login notices have an intentionally centered icon: protect that layout. */
body.rtl.woocommerce-checkout .woocommerce-form-login-toggle .woocommerce-info {
    padding-right: 3.55rem !important;
    padding-left: 1.15rem !important;
}
body.rtl.woocommerce-checkout .woocommerce-form-login-toggle .woocommerce-info::before {
    top: 50% !important;
    transform: translateY(-50%) !important;
}

/* Keep coupon notice compact and icon-free as configured in checkout.css. */
body.rtl.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info {
    padding: 1rem 1.25rem !important;
}
body.rtl.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info::before {
    display: none !important;
    content: none !important;
}

/* Woo Blocks notices (when present) also need an independent icon column. */
body.rtl .wc-block-components-notice-banner {
    box-sizing: border-box;
    direction: rtl;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 1rem;
    line-height: 1.9;
    overflow-wrap: anywhere;
}
body.rtl .wc-block-components-notice-banner > svg {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 1.5rem;
    margin: .1rem 0 0;
}
body.rtl .wc-block-components-notice-banner > .wc-block-components-notice-banner__content {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 480px) {
    body.rtl .woocommerce-error,
    body.rtl .woocommerce-info,
    body.rtl .woocommerce-message {
        padding: .88rem 3.1rem .88rem .8rem !important;
        line-height: 1.9;
        font-size: .92rem;
        border-radius: .7rem;
    }
    body.rtl .woocommerce-error::before,
    body.rtl .woocommerce-info::before,
    body.rtl .woocommerce-message::before {
        right: .85rem;
        top: .94rem;
        width: 1.35rem;
        height: 1.35rem;
        font-size: .85rem;
    }
    body.rtl.woocommerce-checkout .woocommerce-form-login-toggle .woocommerce-info {
        padding-right: 3.1rem !important;
        padding-left: .8rem !important;
    }
    body.rtl.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info {
        padding: .88rem .95rem !important;
    }
    body.rtl .wc-block-components-notice-banner {
        padding: .85rem;
        gap: .6rem;
    }
}
