.barcode-main {
    border: 1px solid #ccc;
    display: block;
    page-break-after: always;
    padding: 0.1in;
    width: 8.25in;

    &__barcode-item {
        border: 1px dotted #ccc;
        display: block;
        float: left;
        font-size: 12px;
        line-height: 14px;
        overflow: hidden;
        text-align: center;
        text-transform: uppercase;
        page-break-inside: avoid;
        break-inside: avoid; /* For modern browsers */
    }

    &__barcode-style {
        padding: 0.04in;
        width: 1.799in;

        img {
            height: 26px;
            max-width: 80px;
        }
    }
}

.print-main {
    height: 110px;
    padding: 0.12in;

    &__print1 {
        width: 25%;
        flex: 0 0 auto;
    }

    &__print2 {
        flex: 0 0 auto;
        width: 33.33333333%;
    }

    &__print3 {
        flex: 0 0 auto;
        width: 33.33333333%;
    }

    &__print4 {
        flex: 0 0 auto;
        width: 50%;
    }

    &__print5 {
        flex: 0 0 auto;
        width: 33.33333333%;
    }

    &__print7 {
        flex: 0 0 auto;
        width: 33.33333333%;
    }

    &__print8 {
        flex: 0 0 auto;
        width: 50%;
    }
}

// Thermal printer styles for 2x1 inch labels
.thermal-print-container {
    background: #ffffff;
    padding: 0;
    margin: 0;
}

.thermal-barcode-item {
    width: 144px; // 2 inches at 72dpi for screen display
    height: 72px;  // 1 inch at 72dpi for screen display
    background: #ffffff;
    border: 1px solid #ccc;
    margin: 5px;
    padding: 3px;
    page-break-after: always;
    page-break-inside: avoid;
    break-inside: avoid;
    display: inline-block;
    box-sizing: border-box;
    vertical-align: top;
}

.thermal-barcode-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: #ffffff;
    font-family: Arial, sans-serif;
}

.thermal-company-name {
    font-size: 6px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 1px;
    color: black;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thermal-product-name {
    font-size: 5px;
    line-height: 1;
    margin-bottom: 1px;
    color: black;
    text-transform: capitalize;
    max-height: 10px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.thermal-price {
    font-size: 4px;
    line-height: 1;
    margin-bottom: 1px;
    color: black;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thermal-price-label {
    font-weight: bold;
}

.thermal-barcode-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1px 0;
    max-height: 30px;
}

.thermal-barcode-img {
    max-width: 130px;
    max-height: 25px;
    height: auto;
    width: auto;
}

.thermal-barcode-code {
    font-size: 5px;
    font-weight: bold;
    line-height: 1;
    color: black;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

// Thermal preview container for screen display
.thermal-preview-container {
    background: #f8f9fa;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: left;

    &::before {
        content: "Thermal Label Preview";
        display: block;
        font-size: 12px;
        font-weight: bold;
        color: #666;
        margin-bottom: 10px;
        text-align: center;
    }
}

// Print media queries for thermal printing
@media print {
    .thermal-print-container {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    .thermal-barcode-item {
        width: 2in !important;
        height: 1in !important;
        margin: 0 !important;
        padding: 0.05in !important;
        border: none !important;
        background: white !important;
        page-break-inside: avoid;
        break-inside: avoid;
        display: block !important;
        float: none !important;
        page-break-after: always;
    }
    
    .thermal-barcode-item:last-child {
        page-break-after: auto !important;
    }

    .thermal-barcode-content {
        background: #ffffff !important;
    }

    .thermal-company-name {
        font-size: 8pt !important;
    }

    .thermal-product-name {
        font-size: 7pt !important;
    }

    .thermal-price {
        font-size: 6pt !important;
    }

    .thermal-barcode-img {
        max-width: 1.8in !important;
        max-height: 0.4in !important;
    }

    .thermal-barcode-code {
        font-size: 7pt !important;
    }

    @page {
        size: 2in 1in;
        margin: 0;
        background: white !important;
    }
    
    body, html {
        background: white !important;
    }
}

