/* Cosmetics fixture preview and instruction sheets: printed pages, styled after Abel's vml-fixtures
   plugin (src/admin/style.scss, src/instruction/style.scss). Each .fx-page is one letter page, 8"
   wide inside the margins, both on screen and when printed or saved as a PDF. */

.fx-doc { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #111; }
.fx-page {
    width: 8in; box-sizing: border-box; background: #fff; padding: 0.3in 0.3in 0.4in;
    margin: 0 0 1.25rem; box-shadow: 0 1px 6px rgba(0, 0, 0, .15); page-break-before: always; break-before: page;
}
.fx-doc > .fx-page:first-child { page-break-before: auto; break-before: auto; }
.fx-page h3 { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; margin: .5rem 0; }
.fx-heading { text-align: center; }

/* Header: retailer logo left, the sheet's facts in the middle, brand logo right. */
.sh-header { display: grid; grid-template-columns: 1.6in 1fr 1.6in; align-items: center; gap: .5rem;
             border-bottom: 1px solid #555; padding-bottom: .35rem; margin-bottom: .6rem; }
.sh-header img { max-width: 1.5in; max-height: .55in; object-fit: contain; display: block; }
.sh-header .sh-right img { margin-left: auto; }
.sh-facts { font-size: 11px; text-align: center; line-height: 1.35; }
.sh-facts b { margin-right: .3em; }

/* Colour key and the borders it explains. */
.fx-key { font-size: 10px; text-align: center; margin: .2rem 0 .5rem; }
.fx-key span { margin-left: .6em; white-space: nowrap; }
.fx-swatch { display: inline-block; width: 8px; height: 8px; border: 2px solid; margin-right: 3px; vertical-align: -1px; }
.fx-swatch-new { border-color: #43b24b; }
.fx-swatch-move { border-color: #e0d929; }
.fx-swatch-delete { border-color: #d1232a; }

/* A graphic drawn to scale (SheetGraphic). */
/* Sized in px with an aspect ratio rather than a height, so a graphic wider than the page (a 72" header
   drawn across two bays) shrinks to fit without losing its proportions. */
.fx-item { display: inline-flex; flex-direction: column; align-items: center; margin: 3px 4px; vertical-align: top; max-width: 100%; }
.fx-img { display: block; background: #ddd; box-sizing: border-box; max-width: 100%; height: auto; }
.fx-img img { width: 100%; height: 100%; display: block; object-fit: fill; }
.fx-item figcaption { font-size: 9px; line-height: 1.2; text-align: center; margin-top: 2px; word-break: break-all; }
.fx-new .fx-img { border: 5px solid #43b24b; }
.fx-move .fx-img { border: 5px solid #e0d929; }
.fx-delete .fx-img { border: 5px solid #d1232a; }

/* Shelves (ShelfDrawing): rows back to front; panels as columns. */
.fx-shelf { border: 1px solid #ccc; margin: 0 0 .5rem; break-inside: avoid; page-break-inside: avoid; }
.fx-shelf-title { font-size: 10px; text-align: center; background: #f2f2f2; border-bottom: 1px solid #ccc; padding: 1px 0;
                  text-transform: uppercase; letter-spacing: .03em; }
.fx-shelf-body { display: flex; flex-direction: column; align-items: center; padding: 4px; }
.fx-group { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; width: 100%; }
.fx-shelf-panels .fx-shelf-body { flex-direction: row; justify-content: center; align-items: flex-start; gap: .5rem; }
.fx-shelf-panels .fx-group { flex-direction: column; align-items: center; width: auto; }

/* Two bays side by side (FixtureFaces). */
.fx-twoup-head, .fx-twoup-cells { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.fx-twoup-head h3 { text-align: center; }
.fx-twoup-shelf { border-bottom: 2px dashed #222; padding: .3rem 0 .4rem; break-inside: avoid; page-break-inside: avoid; }
.fx-twoup-shelf:last-child { border-bottom: 0; }
.fx-twoup-labels .fx-shelf-title { background: none; border: 0; font-size: 12px; }
.fx-cell { display: flex; justify-content: center; }
.fx-cell .fx-shelf { border: 0; margin: 0; width: 100%; }
.fx-twoup-wide { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; }

.fx-panels-row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.fx-panel-block h3 { text-align: center; font-size: .85rem; }

/* Instruction sheet: cover page. */
.sh-cover-body { display: flex; flex-direction: column; gap: .5rem; min-height: 8in; }
.sh-cover-body.side-by-side { flex-direction: row; }
.sh-slot { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #bbb; min-height: 3in; }
.sh-slot img { max-width: 100%; max-height: 4.6in; object-fit: contain; }
.side-by-side .sh-slot img { max-height: 8in; }
.sh-slot-empty { color: #888; font-size: .9rem; }

/* Before / after pages. */
.sh-titlebar { display: grid; grid-template-columns: 1fr 1fr; align-items: center; margin-bottom: .5rem; }
.sh-titlebar h2 { background: #000; color: #fff; font-size: 1.35rem; font-weight: 800; margin: 0; padding: .25rem .6rem;
                  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sh-titlebar h2 span { color: #19b5e6; }
.sh-titlebar .fx-key { text-align: left; margin: 0 0 0 .6rem; }
.sh-preview { min-height: 2.6in; display: flex; flex-direction: column; justify-content: flex-start; }
.sh-preview .fx-shelf { border: 0; }
.sh-columns { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .5rem 0; }
.sh-column { border: 1px solid #bbb; min-height: 3in; }
.sh-column h4 { color: #fff; text-align: center; font-size: .95rem; font-weight: 800; margin: 0; padding: .4rem;
                letter-spacing: .03em; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sh-col-discard h4 { background: #d1232a; }
.sh-col-new h4 { background: #43b24b; }
.sh-col-moving h4 { background: #e0d929; }
.sh-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; padding: .5rem; }
.sh-card { display: flex; flex-direction: column; align-items: center; max-width: 2.8in; break-inside: avoid; }
.sh-card-name { font-size: 10px; margin-top: 3px; }
.sh-card-sku { font-size: 9px; color: #666; }
.sh-na { color: #888; font-style: italic; text-align: center; padding: .6rem; }
.sh-completed { background: #000; color: #fff; text-align: center; font-weight: 800; padding: .25rem; margin: .4rem 0;
                -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* Execution instructions page. */
.sh-exec-title { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
.sh-exec-title h2 { font-size: 1.35rem; font-weight: 800; margin: .3rem 0 .8rem; }
.sh-exec-lines p { margin: 0 0 .25rem; font-size: 12px; }
.sh-exec-image { margin-top: .8rem; text-align: center; }
.sh-exec-image img { max-width: 100%; max-height: 4.6in; object-fit: contain; }
.sh-exec-edit textarea { width: 100%; min-height: 12rem; font-size: 12px; font-family: inherit; }

/* Final checklist pages. */
/* Short enough that header + checklist + footer fit one letter page inside the PDF's margins. */
.sh-final img { display: block; max-width: 100%; max-height: 7.6in; margin: 0 auto; }
.sh-final-foot { text-align: center; font-size: 11px; margin-top: .4rem; }

/* Screen-only controls sit inside the pages; they never print or go into the PDF. */
.print-only { display: none; }
.fx-capturing .noprint { display: none !important; }
.fx-capturing .print-only { display: block !important; }
/* The PDF's own margins stand in for the page padding, as @page does when printing, so a page the
   height of a letter sheet's printable area (10.05") stays on one sheet. */
.fx-capturing .fx-page { box-shadow: none; margin: 0; padding: 0; }
.fx-capturing .sh-slot { border: 0; }

@media print {
    @page { margin: 0.45in 0.25in 0.5in; }
    .noprint, .est-crumb, .est-header, .fx-controls, .status-message, .error-message { display: none !important; }
    .print-only { display: block !important; }
    .fx-page { box-shadow: none; margin: 0; padding: 0; width: auto; }
    .sh-slot { border: 0; }
    .fx-print-faces .fx-panels-page, .fx-print-panels .fx-faces { display: none !important; }
    .fx-print-panels .fx-panels-page { page-break-before: auto; break-before: auto; }
}

/* Page controls above the document. */
.fx-controls { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: flex-end; margin: .5rem 0 1rem; }
.fx-choices { display: flex; flex-wrap: wrap; gap: .3rem; }
.fx-choices button.active { background: #008ec2; color: #fff; border-color: #008ec2; }
.fx-scale { display: inline-flex; align-items: center; gap: .3rem; }
.fx-stores { font-size: .9rem; }

/* Promotion overview and parts list. */
.cos-ov-brand { margin: 0; }
.cos-ov-logo { max-height: 56px; max-width: 200px; object-fit: contain; }
.cos-ov-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem 1.5rem; margin: 1rem 0 1.5rem; }
.cos-ov-facts dt { font-size: .8rem; color: #656565; font-weight: 600; }
.cos-ov-facts dd { margin: 0; }
.cos-ov-tools { list-style: none; padding: 0; display: grid; gap: .6rem; max-width: 820px; }
.cos-ov-tools li { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; align-items: baseline;
                   border: 1px solid #e3e3e3; border-radius: 6px; padding: .6rem .9rem; background: #fff; }
.cos-ov-tools a { font-weight: 600; }
.cos-ov-tools .cos-ov-off { color: #999; font-weight: 600; }
.cos-ov-tools li span:last-child { color: #555; }
.cos-parts-thumb img { max-width: 90px; max-height: 70px; object-fit: contain; display: block; }
.cos-parts-where { font-size: .85rem; }
.fx-chip-new { background: #e5f4e4; }
.fx-chip-keep { background: #f0efec; }
.fx-chip-move { background: #f9eeda; }
.fx-chip-delete { background: #fbebeb; }
