* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f8f9fa;
    font-family: Arial, sans-serif;
    padding: 20px;
    line-height: 1.5;
    zoom: 1;

}

.containerr {
    margin: auto;
    width: 80%;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid black;
}

.print-container {
    display: flex;
    justify-content: center;
}


.quotation {
    width: 148mm;
    height: 210mm;
    padding: 5mm;
    /* border: 2px solid #000; */
    border: 2px solid #000 !important;
    background-color: #fff;

    /* IMPORTANT */
    box-sizing: border-box;
}


.header {
    text-align: center;
}

.header h1 {
    font-size: 6mm;
    text-transform: uppercase;
    /* margin-bottom: 5px; */
}

.header h2 {
    font-size: 4mm;
    margin-bottom: 5px;
}

.quotation-details {
    /* margin-top: 20px; */
    font-size: 14px;
}

/* .items {
    width: 100%;
    margin-top: 10px;
    font-size: 3mm;

    border-collapse: collapse;
    border-spacing: 2px;
}

.items th,
.items td {
    border: 0.3mm solid #000;
    padding-left: 2mm;
    padding-right: 2mm;
    padding-bottom: 2px;
    padding-top: 2px;
    border-radius: 0.6mm;
}

.items th {
    background-color: #f0f0f0;
    font-weight: bold;
} */




.items {
    width: 100%;
    margin-top: 10px;
    font-size: 3.5mm;
    border-collapse: collapse;
    border-spacing: 2mm;
}

.items th,
.items td {
    border: 0.3mm solid #000;
    padding: 2px 2mm;
    border-radius: 0.6mm;
}

.items th {
    padding: 1mm;
    background-color: #f0f0f0;
    font-weight: bold;
}

.items tbody {
    border-spacing: 0;
}

.items tbody tr:not(:first-child) td {
    border-top: none;
}

.items tbody tr:not(:last-child) td {
    border-bottom: none;
}

/* .items tbody tr:first-child td, */
.items tbody tr:last-child td {
    border-top: 0.3mm solid #000;
    border-bottom: 0.3mm solid #000;
}


.totals {
    /* margin-top: 20px; */
    font-size: 14px;
}

.footer {
    /* margin-top: 20px; */
    margin-right: 2rem;
    margin-left: 2rem;
    font-size: 3mm;
    display: flex;
    justify-content: space-between;
    ;
}

.bank-details {
    padding: 0.2rem 1rem 0.2rem 1rem;
    /* border: 1px solid #000; */
    width: 100%;
    font-size: 0.7rem;
}

.driverdetails {
    padding: 0.2rem 1rem 0.2rem 1rem;
    /* border: 1px solid #000; */
    width: 100%;
    font-size: 0.7rem;
}

.driverdetails p {
    display: flex;
    gap: 6px;
}

.driverdetails b {
    min-width: 5rem;
    white-space: nowrap;
}

.driverdetails span {
    flex: 1;
    border-bottom: 0.5px dashed #00000079;
}

#bottom_footer {
    font-size: 1rem;
}

#bottom_footer_in_quotation {
    display: none;
}

@media print {
    @page {
        size: A5 portrait;
        margin: 0;
    }

    body {
        margin: 0;
        padding: 0;
        background: white;
    }

    .quotation {
        width: 148mm;
        height: 210mm;
        margin: 10mm;
        margin-top: 6mm;
        border: 2px solid #000;
    }

    #availabe {
        display: none;
    }

    .items th,
    .items td {
        border: 0.5px solid #00000079;
        /* or #555 */
    }

    /* .items tbody tr:first-child td, */
    .items tbody tr:last-child td {
        border-top: 0.3mm solid #00000079;
        border-bottom: 0.3mm solid #00000079;
    }

    #bottom_footer {
        display: none;
    }
}

@media screen and (max-width: 768px) {

    /* Reset page */
    body {
        margin: 0;
        padding: 0;
        background: #f8f9fa;
    }

    /* Hide everything except quotation */
    body>* {
        display: none !important;
    }

    .print-container,
    .print-copy,
    .quotation {
        display: block !important;
    }

    .print-container {
        padding: 1rem;
    }

    /* HARD RESET quotation sizing */
    .quotation {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;

        margin: 0 auto !important;
        padding: 1rem !important;

        border: 1px solid #000;
        box-sizing: border-box;

        /* 🔒 prevents width jumping */
        overflow-x: hidden;
    }

    /* Tables */
    .items {
        width: 100%;
        font-size: 0.75rem;
        table-layout: fixed;
    }

    .items th,
    .items td {
        padding: 4px;
        word-break: break-word;
    }

    /* Header text */
    .header h1 {
        font-size: 1.2rem;
    }

    .header h2 {
        font-size: 0.9rem;
    }

    /* Driver details */
    .driverdetails {
        font-size: 0.75rem;
        padding: 0.5rem 0;
    }

    /* Footer */
    .footer {
        margin: 1.5rem 0 0;
        font-size: 0.75rem;
    }

    /* Hide print button */
    #availabe {
        display: none !important;
    }


    /* 1️⃣ Hide logo on mobile */
    .header img {
        display: none !important;
    }

    /* 2️⃣ Make firm details full width */
    .header img+div {
        width: 100% !important;
        padding-right: 0 !important;
        text-align: center;
    }

    /* Optional: better spacing */
    .header h1 {
        font-size: 1.3rem;
    }

    .header p {
        font-size: 0.8rem;
    }

    #bottom_footer_in_quotation {
        display: block !important;
        text-align: center;
        margin-top: 1rem;
        font-size: 0.75rem;
    }
}