* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f5f5f5;
    direction: rtl;
    text-align: right;
    font-family:inherit;
}
body table th{
    color : white;
}
.container_prefactor {
    max-width: 800px;
    margin: 20px auto;
    background: white;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;

    width: 100% !important;
    max-width: var(--factor-width);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    max-width: 150px;
    height: auto;
    border-radius: 5px;
}

.invoice-info {
    text-align: left;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-right: 4px solid var(--color-factor);
}

.invoice-info p {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.icon {
    width: 18px;
    height: 18px;
    margin-left: 10px;
    fill: var(--color-factor);
}

.title {
    font-size: 28px;
    margin-bottom: 25px;
    color: #333;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: var(--color-factor);
    border-radius: 2px;
}

.seller-info {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-right: 4px solid var(--color-factor);
    flex: 1;
    margin-bottom: 0;
}

.seller-info p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.info-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.customer-info {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-right: 4px solid var(--color-factor);
    flex: 1;
}

.customer-info p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.seller-info h3,
.customer-info h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0,0,0,0.05);
}

th, td {
    padding: 12px 15px;
    text-align: right;
}

th {
    background-color: var(--color-factor);
    color: white;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f1f1;
}

.total-row td {
    font-weight: bold;
    border-top: 2px solid #ddd;
    background-color: #f0f0f0;
}

.footer {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
}

.store-info {
    flex: 1;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-right: 4px solid var(--color-factor);
}

.store-info p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.signature-area {
    flex: 1;
    min-height: 120px;
    border: 2px dashed #ccc;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #666;
    padding: 15px;
    margin-right: 20px;
    border-radius: 8px;
    background-color: #fcfcfc;
}

.signature-area p {
    margin-bottom: 10px;
}

.signature-area svg {
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    fill: #999;
}

.action-buttons {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 15px;
}

.action-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 20px !important;
    font-size: 16px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    border: none !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
}

.print-button {
    background-color: var(--color-factor) !important;
    color: white !important;
}

.print-button:hover {
    background-color: var(--color-factor);
}

.save-button {
    background-color: var(--color-factor);
    color: white;
}

.save-button:hover {
    background-color: var(--color-factor);
}

.action-button svg {
    width: 18px;
    height: 18px;
    margin-left: 8px;
    fill: white;
}

@media print {

    .header {
        margin-bottom: 0px !important;
        border-bottom: unset !important;
    }
    
    .info-container {
        display: flex;
        justify-content: space-between;
        gap: 20px;
    }
    
    .seller-info, .customer-info {
        font-size: 12px;
    }
    
    .seller-info h3, .customer-info h3 {
        font-size: 14px;
    }
    
    .seller-info, .invoice-info {
        width: 35%;
    }
    
    .seller-info + .invoice-info,
    .invoice-info + .seller-info {
        margin-top: 0;
    }
    
    .footer {
        margin-top: 10px !important;
    }
    
    .signature-area {
        flex: 1;
        margin-right: 0;
        margin-top: 0;
    }
    
    .action-buttons {
        display: none !important;
    }

    body {
        background-color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .container {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 15px !important;
        max-width: 100% !important;
        border-radius: 0 !important;
    }

    table {
        box-shadow: none !important;
        margin-bottom: 0 !important;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    svg.icon {
        display: none !important;
    }
    
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    @page {
        size: A4;
        margin: 0.5cm;
    }
    
    html, body {
        height: auto !important;
        overflow: auto !important;
    }

    .info-container{
        flex-direction: column;
    }
    .seller-info,.customer-info {
        width: unset;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
    img{
        width: 40px;
    }
    table th{
        padding: 5px 6px !important;
        font-size: 12px !important; 
    }
    table td{
        font-size: 12px !important;
    }
    h1.title{
        font: 17px  !important;
        display: none;
    }
    .logo{
        max-width: 97px !important;
    }
    .container_prefactor{
        padding: 0px 25px;
    }
}

/* Style for the print button click event */
@media screen {
    .print-mode {
        background-color: white !important;
    }
    
    .print-mode .container {
        box-shadow: none !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
    }

    .invoice-info {
        text-align: right;
        margin-top: 15px;
        width: 100%;
    }

    .footer {
        flex-direction: column;
    }

    .signature-area {
        margin-right: 0;
        margin-top: 20px;
    }

    th, td {
        padding: 8px 10px;
        font-size: 14px;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-button {
        width: 100%;
        margin-bottom: 10px;
    }
}
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        font-family: inherit !important;

    }
    .invoice-info{
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        align-items: center;
        justify-items: center;
    }
    .logo-container {
        display: none;
    }
    @page {
        margin: 0;
        size: auto;
    }
    body {
        margin: 0;
        padding: 0;
    }
    
    @page :first {
        margin-top: 0;
    }
    .seller-info h3, .customer-info h3{
        border-bottom :unset;
    }
    .printer-button,.wd-toolbar{
        display: none !important;
    }
    .factor-logo-header,.invoice-title-header,.invoice-info-style-two{
        width: 33.33333333%;
    }
    .factor-logo img {
        width: 74%;
    }
    .factor-barcode img{
        width:25%;
    }
    tr.factor-product-info td img{
        height: 30px;
    }
}

@media only screen and (max-width: 600px) {
    .parent_infor-seller-customer {
            width: 100%;
            overflow-x: auto;
    }
    table.table-info-seller-customer {
        width: 250%;
        border-collapse: collapse;
    }

    .seller-info,.customer-info {
        width: unset;
        display: grid;
        grid-template-columns: 1fr;
    }

    .info-container{
        flex-direction: column;
    }
}
