/* OrderMaster - modern responsive theme (Blackdog Digital)
   Layout: top bar with logo + navigation (collapses to a menu on phones),
   one readable content column, tables that become cards on narrow screens.
   Plain CSS, system fonts, no external files: nothing to update or expire. */

:root {
  --ink: #1f2420;          /* text: near-black with a hint of the brand green */
  --muted: #5f6b62;        /* secondary text */
  --line: #dfe4df;         /* borders and dividers */
  --surface: #ffffff;      /* cards, inputs */
  --ground: #f3f5f2;       /* page background */
  --brand: #6aa32f;        /* Blackdog green (logo), slightly deepened for contrast */
  --brand-ink: #3f6f12;    /* green text/links on white */
  --brand-soft: #eaf3df;   /* green tint for highlights */
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --ok: #2e7d32;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(31, 36, 32, .08), 0 2px 8px rgba(31, 36, 32, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.om {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 15px/1.5 var(--font);
}
body.om a { color: var(--brand-ink); text-decoration: none; }
body.om a:hover { text-decoration: underline; }
body.om :focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
body.om h1, body.om h2, body.om h3 { line-height: 1.25; margin: 0 0 .6em; text-wrap: balance; }
body.om h1 { font-size: 1.5rem; }
body.om h2, body.om h3 { font-size: 1.15rem; }
body.om img { max-width: 100%; height: auto; }

/* ---------------------------------------------------------------- top bar */
.om-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.om-top-inner {
  max-width: 1200px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.om-brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.om-brand img { height: 44px; width: auto; }
.om-brand .om-partner { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.om-brand .om-partner img { height: 36px; }
.om-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.om-nav a {
  padding: 8px 12px; border-radius: 6px; color: var(--ink); font-weight: 500; white-space: nowrap;
}
.om-nav a:hover { background: var(--brand-soft); text-decoration: none; }
.om-nav a.om-current { background: var(--brand-soft); color: var(--brand-ink); }
.om-user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.om-user a { color: var(--muted); }
.om-menu-toggle { display: none; }
.om-menu-button { display: none; }

@media (max-width: 860px) {
  .om-menu-button {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; font-weight: 600; background: var(--surface);
  }
  .om-nav, .om-user { display: none; width: 100%; }
  .om-menu-toggle:checked ~ .om-nav { display: flex; flex-direction: column; align-items: stretch; }
  .om-menu-toggle:checked ~ .om-user { display: flex; justify-content: space-between; padding: 8px 12px; }
  .om-nav a { padding: 12px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .om-brand img { height: 36px; }
}

/* ---------------------------------------------------------------- page */
.om-main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }
.om-footer { max-width: 1200px; margin: 0 auto; padding: 16px; color: var(--muted); font-size: 12px; text-align: right; }

.om-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; min-width: 0;
}
.om-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.om-welcome { font-size: 1.35rem; font-weight: 600; margin: 4px 0 18px; }

/* quick actions on the home page */
.om-actions { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-bottom: 22px; }
.om-action {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink) !important; font-weight: 600;
}
.om-action:hover { border-color: var(--brand); text-decoration: none !important; }
.om-action img { width: 36px; height: 36px; }
.om-action.om-primary { background: var(--brand); border-color: var(--brand); color: #fff !important; }

/* ---------------------------------------------------------------- tables */
.om-table-wrap { overflow-x: auto; }
table.om-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.om-table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.om-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.om-table tr:last-child td { border-bottom: 0; }
table.om-table tbody tr:hover { background: #fafcf8; }
.om-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.om-empty { color: var(--muted); padding: 12px 0; }
.om-more { display: inline-block; margin-top: 10px; font-size: 13px; }

/* tables become cards on phones (each cell labelled from data-label) */
@media (max-width: 640px) {
  table.om-table.om-stack thead { display: none; }
  table.om-table.om-stack tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.om-table.om-stack td { display: flex; gap: 12px; border: 0; padding: 3px 0; }
  table.om-table.om-stack td::before {
    content: attr(data-label); flex: 0 0 120px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
  }
}

/* ---------------------------------------------------------------- forms */
body.om input[type=text], body.om input[type=password], body.om input[type=email],
body.om input[type=number], body.om input[type=date], body.om select, body.om textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid #c9d1ca; border-radius: 6px; padding: 9px 11px; max-width: 100%;
}
body.om input:focus, body.om select:focus, body.om textarea:focus { border-color: var(--brand); outline: 2px solid var(--brand-soft); }
.om-btn, body.om input[type=submit], body.om button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 6px; padding: 10px 18px;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
}
.om-btn:hover, body.om input[type=submit]:hover, body.om button:hover { filter: brightness(.95); }
.om-btn.om-secondary { background: var(--surface); color: var(--ink); border-color: #c9d1ca; }
.om-alert { background: var(--danger-soft); color: var(--danger); border: 1px solid #f1c6c1; border-radius: 6px; padding: 10px 12px; }

/* sign-in */
.om-signin { max-width: 380px; margin: 6vh auto; }
.om-signin label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
.om-signin input[type=text], .om-signin input[type=password] { width: 100%; }
.om-signin input[type=submit] { width: 100%; margin-top: 20px; padding: 12px; }
.om-signin .om-forgot { text-align: center; margin-top: 14px; font-size: 13px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------------------------------------------------------------- overrides of the old styles.css
   (it sets small fonts on links, cells and images; the theme wins here) */
body.om .om-brand img { height: 60px; width: auto; max-width: none; }
body.om .om-brand .om-partner img { height: 36px; }
body.om .om-nav a, body.om .om-user, body.om .om-user a { font-size: 14px; }
body.om .om-action { font-size: 15px; }
body.om .om-num { font-size: 13px; }
body.om table.om-table, body.om table.om-table td, body.om table.om-table a { font-size: 14px; }
body.om .om-forgot a, body.om .om-more { font-size: 14px; }
body.om p, body.om td, body.om th, body.om li, body.om label { font-family: var(--font); }
@media (max-width: 860px) { body.om .om-brand img { height: 48px; } }

/* ---------------------------------------------------------------- shared page parts */
.om-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.om-page-head h1 { margin: 0; }
.om-stack-y > * + * { margin-top: 20px; }

/* order steps: 1 Customer, 2 Items, 3 Delivery, 4 Confirm, 5 Done */
.om-steps { display: flex; gap: 6px; list-style: none; margin: 0 0 20px; padding: 0; counter-reset: step; }
.om-steps li {
  flex: 1; counter-increment: step; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 600; min-width: 0;
}
.om-steps li::before {
  content: counter(step); flex: 0 0 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ground); color: var(--muted); font-size: 12px;
}
.om-steps li.om-done::before { content: "\2713"; background: var(--brand-soft); color: var(--brand-ink); }
.om-steps li.om-now { border-color: var(--brand); color: var(--ink); }
.om-steps li.om-now::before { background: var(--brand); color: #fff; }
@media (max-width: 640px) {
  .om-steps li { justify-content: center; padding: 8px 4px; }
  .om-steps li span { display: none; }
  .om-steps li.om-now span { display: inline; }
  .om-steps li.om-now { flex: 3; }
}

/* labelled form fields in a responsive grid */
.om-fields { display: grid; gap: 14px 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.om-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.om-field.om-wide { grid-column: 1 / -1; }
.om-field > label, .om-label { font-weight: 600; font-size: 13px; color: var(--ink); }
body.om .om-field input[type=text], body.om .om-field input[type=email], body.om .om-field input[type=password],
body.om .om-field input[type=number], body.om .om-field select, body.om .om-field textarea { width: 100%; }
.om-field .om-inline { display: flex; gap: 8px; align-items: center; }
.om-field .om-inline input[type=text] { flex: 1; min-width: 0; }
.om-req { color: var(--danger); }
.om-hint { color: var(--muted); font-size: 12px; }
.om-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
body.om .om-check input { width: 18px; height: 18px; }

/* row of actions at the end of a form */
.om-buttons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
.om-buttons .om-spacer { flex: 1; }
a.om-btn { display: inline-block; text-align: center; color: #fff !important; text-decoration: none !important; }
a.om-btn.om-secondary { color: var(--ink) !important; }
.om-btn.om-danger { background: var(--danger); border-color: var(--danger); }
.om-btn.om-small { padding: 6px 12px; font-size: 13px; }
@media (max-width: 640px) { .om-buttons > .om-btn, .om-buttons > input, .om-buttons > button { flex: 1 1 auto; } }

/* type-ahead / postcode suggestion lists */
body.om .ajaxSuggestionsContainer {
  position: relative; z-index: 5; margin-top: 4px; max-height: 280px; overflow: auto; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow);
}
body.om .ajaxSuggestionsContainer:empty { display: none; }
body.om .ajaxSuggestionsContainer a, body.om a.ajaxSuggestions {
  display: block; padding: 8px 11px; color: var(--ink); cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--line);
}
body.om .ajaxSuggestionsContainer a:hover { background: var(--brand-soft); text-decoration: none; }
body.om .ajaxSuggestionsContainer br { display: none; }

/* key/value lists (order and customer details) */
.om-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.om-dl dt { color: var(--muted); font-weight: 600; }
.om-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .om-dl { grid-template-columns: 1fr; gap: 2px; } .om-dl dd { margin-bottom: 8px; } }
.om-address { font-style: normal; line-height: 1.5; }

.om-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--ground); color: var(--muted); }
.om-badge.om-ok { background: var(--brand-soft); color: var(--brand-ink); }
.om-badge.om-warn { background: #fff4e0; color: #8a5300; }
.om-notice { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid #cfe3b7; border-radius: 6px; padding: 10px 12px; }
.om-right { text-align: right; }
table.om-table td.om-right, table.om-table th.om-right { text-align: right; }
table.om-table tfoot td { font-weight: 600; border-top: 2px solid var(--line); border-bottom: 0; }
body.om table.om-table input[type=text] { padding: 6px 8px; }
.om-qty { width: 80px; text-align: right; }

/* filter/search bars */
.om-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.om-filters .om-field { flex: 1 1 160px; }
.om-pager { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 14px; font-size: 14px; }
.om-pager a, .om-pager span { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.om-pager .om-current { background: var(--brand); border-color: var(--brand); color: #fff; }

@media (max-width: 640px) {
  table.om-table.om-stack td.om-right { justify-content: flex-start; }
  table.om-table.om-stack tfoot { display: block; }
  table.om-table.om-stack td:empty, table.om-table.om-stack td.om-hide-sm { display: none; }
}
@media print {
  .om-top, .om-footer, .om-buttons, .om-noprint { display: none !important; }
  body.om { background: #fff; }
  .om-card { box-shadow: none; border: 0; padding: 0; }
}

/* product picker (order items) */
.om-items { display: grid; gap: 12px; }
.om-item {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow);
}
.om-item-img img { width: 96px; height: 96px; object-fit: contain; border-radius: 6px; background: var(--ground); display: block; }
.om-item h3 { margin: 0 0 4px; font-size: 1rem; }
.om-item-desc { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.om-item-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.om-stepper { display: flex; align-items: center; gap: 6px; }
body.om .om-stepper .om-btn { width: 40px; height: 40px; padding: 0; font-size: 20px; line-height: 1; }
body.om .om-stepper input.quantity { width: 70px; text-align: center; font-size: 16px; padding: 8px 4px; }
@media (max-width: 560px) {
  .om-item { grid-template-columns: 72px 1fr; }
  .om-item-img img { width: 72px; height: 72px; }
  .om-stepper { grid-column: 1 / -1; justify-content: flex-end; }
}

/* delivery address choice */
.om-addresses { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); align-items: start; }
.om-address-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 14px; justify-content: space-between; margin: 0;
}
.om-address-new { grid-column: 1 / -1; }
.om-status-row { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.om-item-img { display: block; width: 96px; height: 96px; border-radius: 6px; background: var(--ground); }
.om-item-img.om-noimg { pointer-events: none; background: var(--ground) center/32px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3ada5' stroke-width='1.5'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='m21 17-5-5-9 8'/%3E%3C/svg%3E"); }
@media (max-width: 560px) { .om-item-img { width: 72px; height: 72px; } }

/* plain <input type=button> gets the button look too (secondary by default) */
body.om input[type=button], body.om input[type=reset] {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 6px; padding: 10px 18px;
  background: var(--surface); color: var(--ink); border: 1px solid #c9d1ca;
}
body.om input[type=button]:hover { background: var(--ground); }
body.om .om-address-card input[type=button][value="Use this address"] { background: var(--brand); border-color: var(--brand); color: #fff; }
body.om input[type=button].om-btn:not(.om-secondary) { background: var(--brand); border-color: var(--brand); color: #fff; }
body.om input[type=button].om-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
body.om a { font-size: inherit; }
table.om-clickable tbody tr { cursor: pointer; }
table.om-table tr.om-cancelled td { color: var(--danger); }
.om-badge.om-bad { background: var(--danger-soft); color: var(--danger); }
table.om-table tr.om-subrow td { padding-top: 0; }
table.om-table tbody.om-group tr:first-child td { border-bottom: 0; }
table.om-table tbody.om-group:hover { background: #fafcf8; }
table.om-table tbody tr.om-subrow:hover { background: none; }
details.om-order-items summary { cursor: pointer; color: var(--brand-ink); font-size: 13px; font-weight: 600; }
details.om-order-items ol { margin: 6px 0 4px; padding-left: 22px; font-size: 14px; }
@media (max-width: 640px) { table.om-table.om-stack tr.om-subrow td::before { display: none; } table.om-table.om-stack tbody.om-group { display: block; border-bottom: 1px solid var(--line); } table.om-table.om-stack tbody.om-group tr { border-bottom: 0; } }
@media print { details.om-order-items > *:not(summary) { display: block; } }
.om-order-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 4px; font-size: 13px; }
.om-low { color: var(--danger); }
.om-scroll { max-height: 360px; overflow: auto; }
@media (max-width: 640px) { .om-scroll { max-height: none; } }
body.om input[type=button].om-danger:not(.om-secondary), body.om .om-btn.om-danger:not(.om-secondary) { background: var(--danger); border-color: var(--danger); color: #fff; }
.om-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); align-items: end; }
.om-filters .om-field { flex: none; }
.om-filters .om-field[style*="flex-grow:2"] { grid-column: span 2; }
@media (max-width: 480px) { .om-filters .om-field[style*="flex-grow:2"] { grid-column: auto; } }
.om-inline .om-btn.om-small:has(svg) { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; color: var(--muted); }
.om-inline .om-btn.om-small:has(svg):hover { color: var(--brand-ink); }
