.invoice-wrapper,
#invoice-content,
.invoice-wrapper * { /* این خط را اضافه کنید */
    font-family: 'iransansdn' !important;
}

.invoice-wrapper {
    font-family: iransansdn;
    font-size: 10pt;
    color: #000;
    line-height: 1.5;
    direction: rtl; /* برای راست به چپ کردن کل فاکتور */
    text-align: right; /* برای راست چین کردن متن */
    padding: 10mm; /* حاشیه داخلی برای فاکتور */
}

.invoice-wrapper img {
    max-width: 120px; /* تنظیم اندازه لوگو */
    height: auto;
    display: block; /* برای اینکه margin-bottom درست عمل کند */
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
}

.uk-text-center {
    text-align: center;
}
.uk-margin-bottom {
    margin-bottom: 20px;
}
.uk-margin-small-bottom {
    margin-bottom: 10px;
}
.uk-margin-remove-top {
    margin-top: 0;
}
.uk-margin-remove-bottom {
    margin-bottom: 0;
}
hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

.uk-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    margin-bottom: 15px;
}

.uk-table th, .uk-table td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: right; /* تنظیم جهت متن برای فارسی */
}
.uk-table th {
    background-color: #f2f2f2;
}

.uk-table tfoot th, .uk-table tfoot td {
    border-top: 1px solid #ccc !important;
    font-weight: bold;
}
.uk-table tfoot th {
    text-align: left; /* جمع کل محصولات و ... چپ چین باشد */
}


/* Styles for grid layout within invoice (if using UIkit grid system) */
.uk-grid-small {
    margin-left: -10px; /* Adjust as per UIkit grid spacing */
}
.uk-grid-small > * {
    padding-left: 10px; /* Adjust as per UIkit grid spacing */
}
.uk-child-width-1-2\@s > * {
    width: 50%; /* Adjust for 2 columns on small screens and up */
    float: right; /* For RTL layout */
    box-sizing: border-box;
}

/* Clearfix for grid */
.uk-grid-small::before, .uk-grid-small::after {
    content: " ";
    display: table;
}
.uk-grid-small::after {
    clear: both;
}


/* Control page breaks for printing */
/* این قوانین page-break مستقیماً در iframe اعمال خواهند شد و در زمان چاپ تاثیر می‌گذارند */
h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
}
table {
    page-break-inside: auto;
}
tr {
    page-break-inside: avoid;
    page-break-after: auto;
}
thead {
    display: table-header-group;
}
tfoot {
    display: table-footer-group;
}

/* Ensuring text direction for RTL */
.uk-text-left {
    text-align: right; /* Default for RTL */
}
.uk-text-right {
    text-align: left; /* Default for RTL */
}
.uk-text-center {
    text-align: center;
}

.woocommerce td:last-child, .woocommerce th:last-child {
    text-align:center;
}

.uk-table td>:last-child {
    width: 80%;
}

.woocommerce td:first-child, .woocommerce th:first-child {
    padding-right: 10px !important;
}

.uk-table th {
    color:red !important;
    font-size:14px !important;
    font-weight:bold !important;
}