/* Base style for both directions */

.amwal-installment-promo {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
    color: #535353;
    line-height: 1.6;
    text-align: start;
    direction: inherit;
    transition: background-color 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    font-size: 14px !important;
    gap: 8px;
    flex-wrap: wrap; /* allows the icon + text to wrap as a unit if needed */
    /* Ensure text wraps properly */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;

    /* Prevent overflow */
    overflow: hidden;
}

.amwal-promo-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    flex-wrap: nowrap; /* wraps entire content block if needed */
}

.amwal-promo-text {
    white-space: normal; /* keeps text + link together */
    display: inline;
    /* Key properties to fix overflow */
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
}

.amwal-promo-content span {
    display: inline-flex;
    align-items: center;
    font-family: initial;
}
.amwal-promo-content svg
{
    margin-inline-start: 5px;
}
.amwal-installment-promo:hover {
    background-color: #e9f5f0;
    cursor: pointer;

}

.amwal-installment-link {
    text-decoration: none !important;
    color: #535353;
    white-space: wrap;
    cursor: pointer;
    font-size: inherit;
    font-family: initial;
    display: contents;
}
/* Ensure the promo content aligns to the start (left in LTR, right in RTL) */
#amwal-installment-promo .amwal-promo-content {
    justify-content: flex-start !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    font-family: inherit;
}

/* If the container has overall padding, reduce or remove it */
#amwal-installment-promo {
    padding: 8px 8px !important;
    margin-bottom: 8px;
    font-size: 14px !important;
}

/* For English pages */
body:not(.rtl) .amwal-installment-promo {
    /* Overwrite any positioning/margin anomalies */
/*     margin-left: auto;
    margin-right: auto; */
}

/* Ensure promo content flows left-to-right in English */
body:not(.rtl) .amwal-promo-content {
    flex-direction: row;
}

/* Ensure modal respects direction */
body:not(.rtl) #amwal-installment-modal .modal-content {
    direction: ltr;
}

/* Base hidden state */
.amwal-installment-hidden {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
}

#amwal-installment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4); /* Optional: dim background */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* must be higher than any other z-index on the page */
}
.modal-content {
    background: #e9f5f0 !important;
    border-radius: 12px !important;
    border: 1px solid #ccc !important;
    padding: 20px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    width: 50%;
    margin-top: 10px; /* optional: to move content slightly down */
}
/* Header with logo and close */
.amwal_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
}
/* Close button */
[id^="amwal_close_modal"] {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

[id^="amwal_close_modal"]:hover {
    color: #444;
}

/* Iframe styling */
#change_installment_src {
    border-radius: 8px;
    border: none;
    flex-grow: 1;
    height: 400px;
}

/* Support RTL (Arabic) */
.ar .modal-content {
    direction: rtl;
}
.en .modal-content {
    direction: ltr;
}
#mwb_wpr_order_notice{
    z-index:0;
}

@media (max-width: 768px) {
    #amwal-installment-modal .modal-content {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        padding: 0 !important;
        z-index: 99999 !important;
        overflow: auto !important;
    }

    #amwal-installment-modal .modal-content iframe {
        width: 100% !important;
        height: 100% !important;
        border: none !important;
    }

    body.modal-content {
        overflow: hidden;
    }
}

@media (max-width: 380px) {
    .amwal-installment-promo {
        font-size: 13px;
        line-height: 1.4;
        padding: 8px;
    }
    .amwal-promo-text {
        font-size: 13px;
        line-height: 1.4;
    }
}