/*
 * BM.Market — global print stylesheet (loaded site-wide with media="print").
 *
 * Printing uses the ~A4 viewport width, so the MOBILE breakpoints apply: the
 * mobile tab bar, compact header and full footer all ended up in printed
 * documents (the fixed tab bar repeated at the bottom of every page). Hyvä's
 * `print` layout handle strips the chrome server-side for sales print pages,
 * but window.print() pages (compare) and Ctrl+P on any page render the live
 * DOM — so the chrome must also be suppressed at print time.
 */

@page { margin: 12mm; }

/* ---- Site chrome: never print ---- */
header.page-header,
footer.page-footer,
.bm-tabbar,
.bm-totop,
.bm-topbar,
.breadcrumbs,
#cart-drawer,
.bm-msearch,
.message.global,
.bm-agree-modal {
    display: none !important;
}

body {
    background: #fff !important;
}

/* No trailing blank page: .page-wrapper is min-h-screen (100vh) — in print
   that is a full page box, which + the @page margins always spills a blank
   page when the content is shorter. The tab-bar clearance padding on body
   (mobile breakpoint = print width) is dead space too. */
html, body { height: auto !important; }
body, body:has(.bm-tabbar) { padding-bottom: 0 !important; }
.page-wrapper { min-height: 0 !important; }

/* ================================================================
 * Compare page ("Salīdzināt" → Print This Page)
 * ================================================================ */

/* Actions are on-screen tools, not document content. */
.bm-compare-top .bm-chip-clear,
.bm-compare-top .bm-btn-outline,
.bm-cmp-actions,
.bm-cmp-fav,
.bm-cmp-remove,
.bm-compare-footer {
    display: none !important;
}

/* The on-screen panel scrolls horizontally (fixed per-column min-widths);
   print cannot scroll, so the overflow was clipped — the "messy" layout.
   For paper: no scroll container, fixed table layout, columns squeezed to
   fit the page width, smaller type. */
.bm-compare-panel {
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.bm-compare-table {
    table-layout: fixed !important;
    width: 100% !important;
    font-size: 11px;
}
.bm-compare-table th,
.bm-compare-table td {
    min-width: 0 !important;
    width: auto !important;
    padding: 6px 8px !important;
    overflow-wrap: anywhere;
    border-color: #9CA3AF !important;
}
.bm-compare-table th[scope="row"] {
    position: static !important;
    width: 18% !important;
}
.bm-compare-table .bm-compare-productcell {
    height: auto !important;
    padding: 6px 8px !important;
}
.bm-compare-card { padding: 0 !important; }
.bm-cmp-image { height: auto !important; }
.bm-cmp-image img { max-height: 90px; width: auto; margin: 0 auto; }
.bm-cmp-name { font-size: 11.5px !important; -webkit-line-clamp: unset !important; }
.bm-cmp-price { font-size: 13px !important; margin: 6px 0 0 !important; }
.bm-cmp-price .price { font-size: 13px !important; }

/* Keep each attribute row intact across page breaks. */
.bm-compare-table tr { break-inside: avoid; }

/* ================================================================
 * Customer account pages (Mani pasūtījumi → order view / native print)
 * ================================================================ */

/* Account sidebar navigation + action buttons/links are screen tools. */
.account .columns .sidebar-main,
.account .sidebar-additional,
.account .actions-toolbar,
.account .order-actions,
.account button,
.account .pager {
    display: none !important;
}
