@page{
    size: a4;
    min-height: 29.7cm;
}

@page{
    size: a4;
    min-height: 29.7cm;
}

.print-wrapper {
    /* width: 7cm; */
    display: none;
    margin: 0;
    margin-right: 1cm;
}

.print-wrapper table {
    /*font-size: 12px;*/
    font-size: 14px;
    overflow-x: hidden;
}

.print-wrapper table td,
.print-wrapper table th {
    padding: .25rem;
}

.print-wrapper * {
    color: black !important;
}

.print-wrapper .show-on-full-a4-size {
    display: none;
}

@media print {
    .print-wrapper {
        display: block !important;
    }

    .container-fluid {
        padding: 0 !important;
        margin: 0 !important;
    }

    #MainDiv,
    .navbar,
    #toast-container,
    .modal,
    .content > nav ~ div > .row,
    .footer,
    #CancelButton,
    .offcanvas,
    .footer,
    /*.modal-content,*/
    .fade {
        display: none;
    }

    html * {
        background-color: white !important;
    }

    hr {
        background-color: black !important;
        border-color: black !important;
    }
}

    .print-wrapper, .print-wrapper.print-template.d-none {
        width: 100%;
        padding: .25cm .25cm 0 .25cm;
        margin: 0;
        height: calc((29.7cm / 2) - 1.5px - 1cm);
        display: flex;
        flex-direction: column;
        font-family: "MyFont";
    }

    .print-wrapper.print-template.d-none {
        background-image: url(../img/print_template.png);
        background-repeat: no-repeat;
        background-size: cover;
        height: 100% !important;
        min-height: 29.6cm;
        /* min-height: 41cm; */
        width: 100%;
        padding: 0 !important;
        direction: rtl !important;
    }

    .print-template *{
        background-color: transparent !important;
    }

@media print and (min-width: 8cm) {

    /* fallback */
    @font-face {
        font-family: 'MyFont';
        font-style: normal;
        font-weight: 400;
        src: url(../font/PFDinTextUniversal-Regular.otf) format('opentype');
    }

        .navbar-vertical-collapsed .navbar-vertical.navbar-expand-xl.navbar-inverted + .content{
        padding: 0 !important;
        margin: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-inline-end: 0 !important;
        margin-inline-start: 0 !important;
    }

    .print-wrapper.print-template.d-none {
        background-image: url(../img/print_template.png);
        background-repeat: no-repeat;
        background-size: cover;
        height: 100% !important;
        min-height: 29.6cm;
        /* min-height: 41cm; */
        width: 100%;
        padding: 0 !important;
        direction: rtl !important;
    }

    .print-template *{
        background-color: transparent !important;
    }

    .print-wrapper.d-flex {
        height: 100%;
        /* width: calc((29.7cm / 2) - 1.5px - 1cm); */
    }

    .print-wrapper.full-a4-size {
        min-height: calc(29.7cm - 2cm - 2px);
    }

    .print-wrapper.full-a4-size>hr {
        display: none;
    }

    .print-wrapper.full-a4-size .hide-on-full-a4-size {
        display: none;
    }

    .print-wrapper.full-a4-size table thead.show-on-full-a4-size {
        display: none;
    }

    .print-wrapper.full-a4-size table td.show-on-full-a4-size {
        display: table-cell;
    }

    .print-wrapper.full-a4-size table th.show-on-full-a4-size {
        display: table-cell;
    }

    .print-wrapper.full-a4-size .table~div.show-on-full-a4-size {
        display: block;
    }

    .container,
    .container-fluid {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: unset !important;
    }

    .printed-on {
        position: absolute;
        bottom: 0;
    }

    .print-wrapper .bg-dark {
        background-color: #e1e1e1 !important;
    }

}

/* print template */

#company-name {
    top: 6.65cm;
    right: 6.03cm;
    width: 4.75cm;
    background-color: palevioletred !important;
}

#customer-name {
    top: 6.65cm;
    right: 15.55cm;
    width: 3.85cm;
    background-color: palevioletred !important;
}

#company-owner {
    top: 7.4cm;
    right: 4.43cm;
    width: 6.35cm;
    background-color: palevioletred !important;
}

#driver-name {
    top: 7.4cm;
    right: 13.05cm;
    width: 6.35cm;
    background-color: palevioletred !important;
}

#workpoint {
    top: 8.4cm;
    right: 3.83cm;
    width: 6.95cm;
    background-color: palevioletred !important;
}

#car-number {
    top: 8.4cm;
    right: 14cm;
    width: 5.4cm;
    background-color: palevioletred !important;
}

#car-id {
    top: 9.4cm;
    right: 13.5cm;
    width: 5.9cm;
    background-color: palevioletred !important;
}

#product-type {
    top: 11.9cm;
    right: 11.1cm;
    width: 3.5cm;
    background-color: palevioletred !important;
}

#number {
    top: 12.9cm;
    right: 1.75cm;
    width: 2.35cm;
    background-color: palevioletred !important;
}

#writing {
    top: 12.9cm;
    right: 4.6cm;
    width: 6cm;
    background-color: palevioletred !important;
}

#company-name-2 {
    top: 17.9cm;
    right: 5.8cm;
    width: 4.85cm;
    background-color: palevioletred !important;
}

#customer-name-2 {
    top: 17.9cm;
    right: 14.5cm;
    width: 4.2cm;
    background-color: palevioletred !important;
}

.print-template .position-relative small.position-absolute {
    /* font-size: 10px !important; */
    /* white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow: hidden;
    height: 17px; */
}

.bg-primary-print {
    background-color: #0a3b6e !important;
}

.border-primary-print {
    border-color: #0a3b6e !important;
}

.text-primary-print {
    color: #0a3b6e !important;
}

.print-wrapper .wrapper-table table:not(.table-with-nested-items) tr {
    page-break-inside: avoid;
}

.print-wrapper .wrapper-table table.table-with-nested-items table tr {
    page-break-inside: avoid;
}
