/* کارت‌های پرداخت آفلاین */
.invoice-html-offline-payments {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 28px;
    text-align: right !important;
}

/* عنوان پرداخت آفلاین */
.invoice-html-offline-payments > p:first-child {
    grid-column: 1 / -1;
    margin-bottom: 0 !important;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 16px;
    font-weight: 700;
}

/* هر روش پرداخت */
.invoice-html-offline-payments > div {
    position: relative;
    min-width: 0;
    padding: 18px 20px;
    margin: 0 !important;

    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: 4px solid #2563eb;
    border-radius: 12px;

    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

/* عنوان روش پرداخت */
.invoice-html-offline-payments > div > p.bold {
    margin: 0 0 14px;
    padding-bottom: 10px;

    color: #1e3a8a;
    border-bottom: 1px solid #eef2f7;
    font-size: 15px;
}

/* حذف فاصله پایین توضیحات */
.invoice-html-offline-payments > div > .mbot15 {
    margin-bottom: 0 !important;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

/* شماره‌های قابل کپی */
.invoice-html-offline-payments code {
    display: inline-block;
    max-width: 100%;
    padding: 3px 7px;

    direction: ltr;
    unicode-bidi: isolate;
    overflow-wrap: anywhere;

    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 5px;

    cursor: pointer;
    user-select: all;

    transition: 0.18s ease;
}

/* هیچ متن یا آیکنی اضافه نشود */
.invoice-html-offline-payments code::before,
.invoice-html-offline-payments code::after {
    content: none !important;
    display: none !important;
}

/* حس قابل کلیک بودن */
.invoice-html-offline-payments code:hover,
.invoice-html-offline-payments code:focus {
    background: #dbeafe;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
    outline: none;
}

/* بازخورد موفقیت کپی */
.invoice-html-offline-payments code.is-copied {
    color: #166534;
    background: #dcfce7;
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

/* مخفی کردن ستون اول جدول پرداخت‌ها */
.invoice-payments-table th:first-child,
.invoice-payments-table td:first-child {
    display: none !important;
}

/* بهینه‌سازی موبایل */
@media (max-width: 575px) {
    .invoice-html-offline-payments {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    /* اطلاعات شرکت و مشتری */
    .transaction-html-info-col-left,
    .transaction-html-info-col-right {
        float: none !important;
        width: 100% !important;
        padding: 14px 16px !important;
        margin-bottom: 14px;

        text-align: right !important;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
    }

    .invoice-html-company-info,
    .invoice-html-customer-billing-info {
        margin: 6px 0 0 !important;
        line-height: 1.75;
    }

    .invoice-html-company-info br + br,
    .invoice-html-customer-billing-info br + br {
        display: none;
    }

    .invoice-html-date {
        margin-top: 12px !important;
        padding-top: 10px;
        border-top: 1px dashed #cbd5e1;
    }

    /* فشرده‌تر شدن جدول معاملات */
    .invoice-payments-table th,
    .invoice-payments-table td {
        padding: 8px 5px !important;
        font-size: 12px;
        vertical-align: middle !important;
    }

    .invoice-payments-table th:nth-child(3),
    .invoice-payments-table td:nth-child(3),
    .invoice-payments-table th:nth-child(4),
    .invoice-payments-table td:nth-child(4) {
        white-space: nowrap;
    }
}




/* prompt 2 */


/* =========================================================
   بهبود فاصله بخش‌های اصلی فاکتور
   ========================================================= */

.preview-top-wrapper {
    margin-bottom: 24px;
}

.invoice-html-payments {
    margin-top: 28px;
}

.invoice-html-payments > p:first-child {
    margin-bottom: 12px;
}

.invoice-html-offline-payments {
    margin-top: 28px;
}


/* =========================================================
   اندازه و موقعیت لوگوی اصلی فاکتور
   ========================================================= */

.invoice-html-logo img {
    display: block;

    width: 100%;
    max-width: 230px;
    height: auto;

    margin-right: auto;
    margin-left: auto;
}


/* =========================================================
   ردیف‌های اطلاعات حساب
   ========================================================= */

.payment-account-owner {
    margin-bottom: 9px;
    padding-bottom: 9px;

    color: #475569;
    border-bottom: 1px dashed #dbe3ec;

    font-weight: 500;
}

.payment-detail-row {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 12px;

    min-height: 36px;
    padding: 5px 0;
}

.payment-detail-row > span {
    color: #475569;
    white-space: nowrap;
}

.payment-detail-row > code {
    min-width: 0;
    max-width: 100%;

    justify-self: end;
    text-align: left;
}


/* =========================================================
   لوگوی کوچک داخل هدر چسبان
   در دسکتاپ نمایش داده نمی‌شود
   ========================================================= */

.invoice-sticky-logo {
    display: none;
}


/* =========================================================
   تنظیمات موبایل
   ========================================================= */

@media (max-width: 767px) {
    /* لوگوی اصلی بالای صفحه */
    .invoice-html-logo img {
        max-width: 200px;
    }

    .preview-top-wrapper {
        margin-top: 18px !important;
        margin-bottom: 20px;
    }

    /*
     * لوگوی کوچک داخل هدر چسبان
     * در فضای خالی سمت چپ
     */
    .preview-sticky-header .invoice-sticky-logo {
        position: absolute;
        top: 50%;
        left: 18px;

        display: flex;
        align-items: center;
        justify-content: center;

        width: 88px;
        height: 42px;

        transform: translateY(-50%);
    }

    .preview-sticky-header .invoice-sticky-logo img {
        display: block;

        width: 100%;
        max-width: 88px;
        max-height: 42px;
        height: auto;

        object-fit: contain;
    }

    /* فضای داخلی مناسب هدر چسبان */
    .preview-sticky-header {
        min-height: 76px;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    /*
     * جلوگیری از نزدیک شدن شماره فاکتور و وضعیت
     * به لوگوی سمت چپ
     */
    .preview-sticky-header .preview-sticky-container {
        padding-left: 120px;
    }

    .invoice-html-payments {
        margin-top: 22px;
    }

    .invoice-html-offline-payments {
        margin-top: 24px;
    }

    .payment-detail-row {
        gap: 10px;
        min-height: 38px;
    }
}










/* =========================================================
   فاصله کارت‌های اطلاعات شرکت و مشتری از والد
   ========================================================= */

@media (max-width: 767px) {
    .transaction-html-info-col-left,
    .transaction-html-info-col-right {
        width: calc(100% - 30px) !important;
        margin-right: 15px !important;
        margin-left: 15px !important;
        margin-bottom: 16px !important;
    }
}


/* =========================================================
   فاصله پایین بخش پرداخت‌های آفلاین
   ========================================================= */

.invoice-html-offline-payments {
    margin-bottom: 36px !important;
}


/* =========================================================
   ردیف‌های منظم اطلاعات بانکی
   ========================================================= */

.payment-account-owner {
    margin-bottom: 8px;
    padding-bottom: 10px;

    color: #475569;
    border-bottom: 1px dashed #dbe3ec;
    font-weight: 500;
}

.payment-detail-row {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 12px;

    min-height: 42px;
    padding: 5px 0;
}

.payment-detail-row + .payment-detail-row {
    border-top: 1px solid #f1f5f9;
}

.payment-detail-row > span {
    color: #475569;
    white-space: nowrap;
}

/* مقدار در انتهای خط و سمت چپ */
.payment-detail-row > code {
    display: block !important;

    min-width: 0;
    max-width: 100%;

    margin: 0 !important;
    padding: 4px 7px;

    justify-self: end;
    text-align: left;

    line-height: 1.45 !important;
    white-space: normal;
    overflow-wrap: anywhere;
}


/* =========================================================
   لوگوی هدر چسبان موبایل
   روش مطمئن بدون نیاز به clone کردن DOM
   ========================================================= */

@media (max-width: 767px) {
    .preview-sticky-header {
        position: fixed;
        min-height: 82px;
        padding-left: 120px !important;
    }

    .preview-sticky-header::before {
        content: "";

        position: absolute;
        top: 50%;
        left: 18px;

        width: 88px;
        height: 44px;

        transform: translateY(-50%);

        background-image:
            url("https://xip.2visa.ir/uploads/company/26698e586b2a4479ab9365989f23e4b8.svg");

        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;

        pointer-events: none;
    }

    /*
     * این padding مانع قرار گرفتن اطلاعات فاکتور
     * روی لوگوی سمت چپ می‌شود.
     */
    .preview-sticky-header .preview-sticky-container {
        padding-left: 0 !important;
    }
}













/* کارت‌ها هنگام باز شدن هم‌ارتفاع نشوند */
.invoice-html-offline-payments {
    align-items: start;
}

/* عنوان قابل کلیک کارت */
.invoice-html-offline-payments .offline-payment-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 0 !important;
    padding-bottom: 0 !important;

    border-bottom: 0 !important;
    cursor: pointer;
    user-select: none;
}

/* علامت باز و بسته شدن */
.offline-payment-toggle::after {
    content: "+";

    flex: 0 0 24px;

    color: #2563eb;

    text-align: center;
    font-size: 22px;
    font-weight: 400;
    line-height: 24px;

    transition: transform 0.2s ease;
}

.offline-payment-card.is-open .offline-payment-toggle {
    margin-bottom: 14px !important;
    padding-bottom: 10px !important;

    border-bottom: 1px solid #eef2f7 !important;
}

.offline-payment-card.is-open .offline-payment-toggle::after {
    content: "−";
}

/* بدنه آکاردئون */
.offline-payment-body[hidden] {
    display: none !important;
}

/* تمرکز با کیبورد */
.offline-payment-toggle:focus {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 5px;
    border-radius: 4px;
}

/* فاصله کمتر برای اختصاص عرض بیشتر به code */
.payment-detail-row {
    gap: 6px;
}

/* تک‌خطی ماندن شماره شبا */
.payment-detail-row code.is-iban {
    padding-right: 4px;
    padding-left: 4px;

    font-size: 10.5px !important;
    letter-spacing: -0.3px;

    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}