/**
 * invoice.css
 * Styles for the Miss Flora Invoice
 * Target: A6 Paper (105mm x 148mm)
 */

/* Main Container */
.invoice-card {
    width: 105mm;
    height: 148mm;
    font-family: 'RTA', Tahoma, sans-serif;
    direction: rtl;
    padding: 2mm; /* Offset for the border */
    box-sizing: border-box;
    color: #000;
    background: #fff;
    position: relative;
    overflow: hidden;
    font-size: 8pt;
    font-weight: 800;
}

/* Border Wrapper (2mm from edge) */
.invoice-border-wrapper {
    width: 100%;
    height: 100%;
    border: 1mm solid #5f3dc4;
    box-sizing: border-box;
    padding: 6mm; /* Content padding inside border */
    position: relative;
}

/* Global Font Flattening for Invoice */
.invoice-card *:not(i):not([class*="fa-"]) {
    font-weight: 800 !important;
    font-size: 8pt !important;
    color: #000 !important;
}

/* Page Break for Bulk Print */
.invoice-card.has-break {
    page-break-after: always;
}

/* Header Section */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6mm;
    border-bottom: 1pt solid #5f3dc4;
    padding-bottom: 3mm;
}

.invoice-header-side {
    flex: 1;
}

.invoice-header-side.left {
    text-align: left;
}

.invoice-header-side.right {
    text-align: right;
}

.invoice-header-center {
    flex: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.invoice-logo-img {
    height: 12mm;
    display: block;
    margin-bottom: 3mm; /* Gap from logo to name */
}

.invoice-brand-name {
    font-size: 32pt !important; /* Enlarged further based on user request */
    line-height: 1;
}

.invoice-brand-sub {
    font-size: 8pt !important;
    margin-top: 1mm; /* Reduced gap for better symmetry */
}

/* Customer Section */
.invoice-customer {
    margin-bottom: 6mm;
}

.invoice-customer-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3mm;
}

.invoice-customer-name {
    line-height: 1.2;
}

.invoice-customer-address-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.invoice-customer-city {
    line-height: 1.3;
}

.invoice-customer-details {
    line-height: 1.3;
    text-align: left;
    max-width: 60%;
}

/* Items Table Section */
.invoice-items-section {
    margin-bottom: 10mm;
}

.invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8pt !important; /* Matches the new global base */
}

.invoice-items-table th {
    border-bottom: 1pt solid #5f3dc4;
    padding: 1.5mm 0;
    font-weight: 800;
}

.invoice-items-table td {
    padding: 1.5mm 0;
    border-bottom: 0.5pt solid #eee;
}

/* Financials (Positioned Bottom-Left) */
.invoice-total-box {
    position: absolute;
    bottom: 12mm;
    left: 6mm;
    padding: 3mm;
    border: 0.5pt solid #5f3dc4; /* Thinner purple border */
    display: flex;
    flex-direction: column;
    gap: 1.5mm;
    min-width: 45mm;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 8pt !important;
}

.invoice-total-row.grand-total {
    border-top: 0.5pt solid #5f3dc4; /* Thinner purple line */
    padding-top: 1.5mm;
    margin-top: 1mm;
}

.invoice-total-row.grand-total .invoice-total-val {
    font-size: 14pt !important; /* Slightly adjusted scale */
    font-weight: 900 !important;
}

/* Reserved Space for Sticker (Bottom Right) */
.invoice-barcode-space {
    position: absolute;
    bottom: 1mm;
    right: 1mm;
    width: 50mm;
    height: 70mm;
    background: transparent;
}

/* Footer Section (Bottom Left) */
.invoice-footer-note {
    position: absolute;
    bottom: 5mm;
    left: 6mm;
    text-align: left;
}
