/*
 * ESD POS Core: the few styles the core screens need on top of the template's own CSS.
 * Plain Bootstrap-friendly rules, so they hold on every DreamsPOS template.
 */

/* Dashboard bar chart (7 days) */
.core-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 180px;
}

.core-bar {
    flex: 1 1 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

.core-bar-fill {
    width: 100%;
    max-width: 48px;
    border-radius: 6px 6px 0 0;
    min-height: 2px;
}

/* POS */
.core-pos-products {
    max-height: calc(100vh - 290px);
    overflow-y: auto;
    align-content: flex-start;
}

.core-pos-tile {
    padding: 12px;
    border: 1px solid var(--bs-border-color, #e6eaed);
    cursor: pointer;
    min-height: 92px;
}

.core-pos-tile:hover,
.core-pos-tile:focus-visible {
    border-color: var(--bs-primary, #fe9f43);
    outline: none;
}

.core-pos-order {
    position: sticky;
    top: 80px;
}

.core-pos-lines {
    max-height: calc(100vh - 520px);
    min-height: 120px;
    overflow-y: auto;
}

[data-pos-customer-results].show {
    display: block;
    position: absolute;
    max-height: 260px;
    overflow-y: auto;
    z-index: 1050;
}

@media (max-width: 991.98px) {
    .core-pos-products,
    .core-pos-lines {
        max-height: none;
    }

    .core-pos-order {
        position: static;
    }
}

/* Printable pages: receipts (80 mm / 58 mm rolls) and A4 documents */
.core-print {
    background: #fff;
    color: #000;
}

.core-print-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 12px;
}

.core-print-page {
    margin: 0 auto;
    padding: 16px;
}

.core-print-80mm .core-print-page {
    width: 80mm;
    font-size: 12px;
    padding: 4mm;
}

.core-print-58mm .core-print-page {
    width: 58mm;
    font-size: 11px;
    padding: 3mm;
}

.core-print-A4 .core-print-page {
    max-width: 190mm;
}

.core-receipt-meta {
    border-top: 1px dashed #000;
    border-bottom: 1px dashed #000;
    padding: 4px 0;
    margin-bottom: 4px;
}

.core-receipt-table,
.core-receipt-totals {
    width: 100%;
    border-collapse: collapse;
}

.core-receipt-table th {
    border-bottom: 1px dashed #000;
    font-weight: 600;
}

.core-receipt-table td,
.core-receipt-table th,
.core-receipt-totals td {
    padding: 2px 0;
    vertical-align: top;
}

.core-receipt-totals {
    border-top: 1px dashed #000;
    margin-top: 4px;
}

/* Product name shown in place of a logo image (config('product.logo') unset). */
.core-brand-text {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--bs-heading-color, #212b36);
    white-space: nowrap;
}

.core-brand-white {
    color: #fff;
}

.core-brand-small {
    font-size: 1rem;
}

/*
 * Right-to-left languages: <html dir="rtl"> is set by the core layouts, and Bootstrap's RTL build is
 * loaded when the template has build/css/bootstrap.rtl.min.css. A product whose template has its own
 * RTL stylesheet loads it in its layout when App\Core\Support\Locale::isRtl().
 */
[dir="rtl"] .core-print-page {
    text-align: right;
}

[dir="rtl"] .me-1 > .ti,
[dir="rtl"] .ti.me-1 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

@media print {
    .core-print-page {
        padding: 0;
    }

    .page-wrapper {
        margin: 0 !important;
        padding: 0 !important;
    }

    .sidebar,
    .header {
        display: none !important;
    }

    @page {
        margin: 6mm;
    }

    .core-print-80mm,
    .core-print-58mm {
        margin: 0;
    }
}
