/* Retail POS - P2K Global Typography */

@font-face {
    font-family: "Source Sans 3";
    src: url("./fonts/SourceSans3.woff2") format("woff2");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Source Sans 3";
    src: url("./fonts/SourceSans3-Italic.woff2") format("woff2");
    font-weight: 200 900;
    font-style: italic;
    font-display: swap;
}

:root {
    --font-family: "Source Sans 3",
        system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;

    --font-sans: var(--font-family);
    --retail-font-family: var(--font-family);

    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-md: 16px;
    --font-size-lg: 20px;
    --font-size-xl: 28px;
    --font-size-2xl: 32px;
    --font-size-total: 36px;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

html,
body {
    font-family: var(--retail-font-family);
    font-size: var(--font-size-base);
    font-weight: 400;
}

button,
input,
textarea,
select,
option {
    font-family: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: inherit;
    font-weight: 600;
}

table {
    font-family: inherit;
    font-variant-numeric: tabular-nums;
}

th {
    font-weight: 600;
}

.numeric,
.amount,
.currency,
.balance,
.quantity,
.total,
.kpi-value,
.pos-total {
    font-variant-numeric: tabular-nums lining-nums;
}

.pos-total {
    font-weight: 600;
}

pre,
code,
kbd,
samp {
    font-family: ui-monospace, SFMono-Regular,
        Consolas, monospace;
}


/* EVCL-1: shared screen typography. Storefront body baseline: 18px.
   Print layouts, receipt paper previews, map and icon artwork are exempt. */
@media screen {
  html:has([data-evcl-workspace]):not(:has([data-sf-layout], .sf-layout-page)) {
    --evcl-base-size: 18px;
  }
  html:has([data-evcl-workspace]):not(:has([data-sf-layout], .sf-layout-page)) body,
  html:has([data-evcl-workspace]):not(:has([data-sf-layout], .sf-layout-page)) body
    :is(main,header,footer,nav,aside,section,article,div,p,span,a,label,input,select,option,
      textarea,button,summary,legend,fieldset,table,thead,tbody,tfoot,tr,th,td,
      ul,ol,li,dl,dt,dd,small,strong,b,em,h1,h2,h3,h4,h5,h6,output,time,caption):not(
      :is(.maplibregl-map,.maplibregl-map *,svg,svg *,[role="img"],[role="img"] *,
      .cr-paper,.cr-paper *,#d1-print-sheet,#d1-print-sheet *,
      [class*="icon"],[class*="Icon"],[class*="fa-"],[class*="material-icons"],
      [class*="icon"] *,[class*="Icon"] *,[class*="fa-"] *)) {
      font-size:var(--evcl-base-size,18px)!important;
      font-family:"Source Sans 3",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  }
  html:has([data-evcl-workspace]) :is(h1,h2,h3,h4,h5,h6,legend,th) {
      font-weight:600;
  }
  html:has([data-evcl-workspace]) :is(input,select,textarea,button):focus-visible {
      outline:2px solid #0067b8; outline-offset:2px;
  }
  html:has([data-evcl-workspace]) .evcl-table-scroll {
      max-width:100%; overflow-x:auto;
  }
  html:has([data-evcl-workspace]) .evcl-table-scroll .sales-lines {
      width:100%; min-width:780px;
  }
  html:has([data-evcl-workspace]) .sales-lines td:first-child {min-width:230px}
  html:has([data-evcl-workspace]) .sales-lines select {max-width:100%}
  html:has([data-evcl-workspace]) .evcl-line-actions {
      display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:12px 0;
  }
  #evcl-quote-form [hidden] {display:none!important}
  .evcl-payment-progress {display:block;width:100%;max-width:180px;height:10px;accent-color:#19744a}
}
.evcl-status {
    display:inline-block; border:1px solid #778391; color:#354454;
    background:#f5f7f9; padding:2px 8px; border-radius:4px;
    font-weight:600; max-width:100%; overflow-wrap:anywhere;
}
.evcl-status:is([data-evcl-status="ORDER_COMPLETED"],[data-evcl-status="INVOICE_PAID"],
 [data-evcl-status="APPROVED"],[data-evcl-status="ORDER_APPROVED"],
 [data-evcl-status="QUO_APPROVED"],[data-evcl-status="PAID"],
 [data-evcl-status="DELIVERED"],[data-evcl-status="COMPLETED"]) {
    border-color:#267449;color:#195b36;background:#eaf6ee;
}
.evcl-status:is([data-evcl-status="SUBMITTED"],[data-evcl-status="ORDER_CREATED"],
 [data-evcl-status="QUO_CREATED"],[data-evcl-status="IN_PROGRESS"]) {
    border-color:#3475ae;color:#17558c;background:#edf5ff;
}
.evcl-status:is([data-evcl-status="HELD"],[data-evcl-status="PARTIALLY_PAID"],
 [data-evcl-status="Expired"]) {
    border-color:#9b660e;color:#81530a;background:#fff5df;
}
.evcl-status:is([data-evcl-status="CANCELLED"],[data-evcl-status="ORDER_CANCELLED"],
 [data-evcl-status="INVOICE_CANCELLED"],[data-evcl-status="REJECTED"]) {
    border-color:#a4262c;color:#a4262c;background:#fff0f0;
}
@media print {
    .evcl-status {background:none!important;border:1px solid currentColor; padding:2px 6px;}
}
