/* t185: Quick Order modal + fallback page. Colours come from each site's brand variables. */
:root {
  --qo-z: 1000000;
  --qo-radius: 10px;
  --qo-accent: var(--brand-accent, #de1912);
  --qo-ink: var(--brand-ink, var(--brand-primary, #1c1c1b));
}

.site-header__quickorder {
  margin-right: 16px; flex-shrink: 0;
  color: inherit; font-size: .8rem; font-weight: 700; line-height: 1; text-decoration: none;
  white-space: nowrap;
}
.site-header__quickorder:hover, .site-header__quickorder:focus-visible { color: inherit; text-decoration: underline; }
.site-header.is-compact .site-header__quickorder { font-size: .7rem; }

.qo-modal[hidden] { display: none !important; }
.qo-modal {
  position: fixed; inset: 0; z-index: var(--qo-z) !important;
  display: flex; align-items: center; justify-content: center;
  padding: 3vh 16px 16px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.qo-modal.is-open { opacity: 1; pointer-events: auto; }
.qo-modal__backdrop {
  position: absolute; inset: 0;
  background: rgb(12 12 12 / .55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.qo-modal__panel {
  position: relative;
  display: flex; flex-direction: column;
  width: min(980px, 100%);
  max-height: min(90vh, 860px);
  background: #fff;
  color: var(--qo-ink);
  border-radius: var(--qo-radius);
  box-shadow: 0 18px 50px rgb(0 0 0 / .28);
  transform: translateY(12px) scale(.98);
  transition: transform .22s ease;
  overflow: hidden;
}
.qo-modal.is-open .qo-modal__panel { transform: none; }
.qo-modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  border-bottom: 3px solid var(--qo-accent);
  background: #fff;
}
.qo-modal__title { margin: 0; font-size: 1.25rem; font-weight: 700; }
.qo-modal__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: var(--qo-ink); cursor: pointer;
}
.qo-modal__close:hover, .qo-modal__close:focus-visible { background: #f2f2f2; color: var(--qo-accent); outline: none; }
.qo-modal__close .material-icons { font-size: 22px; }

.qo-workspace { flex: 1; overflow: auto; padding: 12px 18px 8px; }
.qo-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e8e8e8; margin-bottom: 14px; }
.qo-tabs__tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 14px; margin-bottom: -1px; font-weight: 700; font-size: .9rem;
  color: #555; cursor: pointer;
}
.qo-tabs__tab:hover, .qo-tabs__tab:focus-visible { color: var(--qo-accent); outline: none; }
.qo-tabs__tab.is-active { color: var(--qo-ink); border-bottom-color: var(--qo-accent); }
.qo-pane[hidden] { display: none !important; }

.qo-table-wrap { overflow: auto; }
.qo-table { width: 100%; border-collapse: collapse; }
.qo-table th {
  text-align: left; font-size: .75rem; letter-spacing: .02em; text-transform: uppercase;
  color: #666; font-weight: 700; padding: 6px 8px; border-bottom: 1px solid #eee;
}
.qo-table td { padding: 8px; vertical-align: top; border-bottom: 1px solid #f3f3f3; }
.qo-table__qty, .qo-table__price, .qo-table__total { width: 7.5rem; }
.qo-table__stock { width: 9rem; }
.qo-table__actions { width: 2.5rem; text-align: right; }
.qo-table__price, .qo-table__total { font-variant-numeric: tabular-nums; white-space: nowrap; }

.qo-input {
  width: 100%; box-sizing: border-box;
  border: 1px solid #d5d5d5; border-radius: 4px;
  padding: 8px 10px; font: inherit; color: inherit; background: #fff;
}
.qo-input:focus { border-color: var(--qo-accent); outline: 2px solid color-mix(in srgb, var(--qo-accent) 25%, transparent); outline-offset: 0; }
.qo-input.is-error, .qo-row.is-error .qo-input { border-color: #b00020; }
.qo-input--qty { text-align: center; -moz-appearance: textfield; }
.qo-input--qty::-webkit-outer-spin-button, .qo-input--qty::-webkit-inner-spin-button { appearance: none; margin: 0; }

.qo-find { position: relative; }
.qo-find__picked { display: flex; gap: 10px; align-items: center; }
.qo-find__thumb { width: 48px; height: 48px; object-fit: contain; background: #fafafa; border: 1px solid #eee; border-radius: 4px; }
.qo-find__meta { min-width: 0; flex: 1; }
.qo-find__name { display: block; font-weight: 700; color: var(--qo-ink); text-decoration: none; line-height: 1.25; }
.qo-find__name:hover { color: var(--qo-accent); }
.qo-find__code { display: block; font-size: .8rem; color: #666; }
.qo-find__search { position: relative; }
.qo-row__error { margin: 6px 0 0; color: #b00020; font-size: .8rem; }

.qo-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 2;
  list-style: none; margin: 0; padding: 4px 0; max-height: 280px; overflow: auto;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 6px;
  box-shadow: 0 8px 24px rgb(0 0 0 / .12);
}
.qo-suggest[hidden] { display: none !important; }
.qo-suggest__item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; cursor: pointer; }
.qo-suggest__item:hover, .qo-suggest__item.is-active { background: #f6f6f6; }
.qo-suggest__thumb { width: 40px; height: 40px; object-fit: contain; background: #fafafa; border-radius: 3px; }
.qo-suggest__title { display: block; font-weight: 700; font-size: .85rem; }
.qo-suggest__meta { display: block; font-size: .75rem; color: #666; }
.qo-suggest__price { margin-left: auto; font-weight: 700; white-space: nowrap; }
.qo-suggest__empty, .qo-suggest__status { padding: 10px 12px; color: #666; font-size: .85rem; }
.qo-suggest__body { min-width: 0; flex: 1; }
.qo-suggest__item.is-special .qo-suggest__title { display: flex; align-items: baseline; gap: .4em; flex-wrap: wrap; font-weight: 700; }
.qo-suggest__item.is-special .special-badge { flex: none; }


.qo-stepper { display: inline-flex; align-items: center; border: 1px solid #d5d5d5; border-radius: 4px; overflow: hidden; }
.qo-stepper .qo-input--qty { border: 0; width: 3.2rem; padding: 7px 0; border-radius: 0; }
.qo-stepper__btn {
  width: 28px; height: 34px; border: 0; background: #f6f6f6; color: var(--qo-ink);
  font-size: 1rem; line-height: 1; cursor: pointer;
}
.qo-stepper__btn:hover:not(:disabled), .qo-stepper__btn:focus-visible { background: #eee; color: var(--qo-accent); outline: none; }
.qo-stepper__btn:disabled { opacity: .4; cursor: default; }

.qo-stock { font-size: .8rem; color: #444; }
.qo-stock.is-good { color: #2e7d32; }
.qo-stock.is-warn { color: #b26a00; }
.qo-stock.is-bad { color: #b00020; }

.qo-remove {
  border: 0; background: none; color: #777; cursor: pointer; padding: 4px; border-radius: 50%;
}
.qo-remove:hover, .qo-remove:focus-visible { color: #b00020; background: #fdecea; outline: none; }
.qo-remove .material-icons { font-size: 18px; }

.qo-hint, .qo-help { display: flex; gap: 6px; align-items: center; color: #666; font-size: .82rem; margin: 10px 0; }
.qo-hint .material-icons { font-size: 16px; color: var(--qo-accent); }
.qo-addline {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: none; color: var(--qo-accent); font-weight: 700; cursor: pointer; padding: 4px 0;
}
.qo-addline:hover, .qo-addline:focus-visible { text-decoration: underline; outline: none; }
.qo-addline .material-icons { font-size: 18px; }

.qo-label { display: block; font-weight: 700; margin-bottom: 4px; }
.qo-paste {
  width: 100%; box-sizing: border-box; font: inherit; line-height: 1.4;
  border: 1px solid #d5d5d5; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px;
  resize: vertical; min-height: 8rem;
}
.qo-paste:focus { border-color: var(--qo-accent); outline: 2px solid color-mix(in srgb, var(--qo-accent) 25%, transparent); }
.qo-file { display: block; margin: 8px 0 12px; }

.qo-parse { margin-top: 14px; }
.qo-parse__summary { margin: 0 0 8px; }
.qo-parse__lines { list-style: none; margin: 0; padding: 0; }
.qo-parse__line { padding: 8px 10px; border-left: 3px solid #ccc; margin-bottom: 6px; background: #fafafa; font-size: .9rem; }
.qo-parse__line--matched { border-color: #2e7d32; background: #f1f8f2; }
.qo-parse__line--unmatched, .qo-parse__line--error { border-color: #b00020; background: #fdecea; }
.qo-parse__line--ambiguous { border-color: #b26a00; background: #fff8e8; }
.qo-parse__line--unavailable { border-color: #666; background: #f3f3f3; }
.qo-parse__raw { display: block; margin-bottom: 2px; }
.qo-parse__actions { margin-top: 8px; }

.qo-recent { margin-bottom: 14px; padding: 10px 12px; background: #f7f7f7; border-radius: 6px; }
.qo-recent__title { margin: 0 0 8px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: #555; }
.qo-recent__list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.qo-recent__item {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid #e0e0e0; background: #fff; border-radius: 6px;
  padding: 6px 8px; cursor: pointer; text-align: left; font: inherit; color: inherit;
}
.qo-recent__item:hover, .qo-recent__item:focus-visible { border-color: var(--qo-accent); outline: none; }
.qo-recent__item img { width: 32px; height: 32px; object-fit: contain; }
.qo-recent__item strong { display: block; font-size: .8rem; }
.qo-recent__item span { display: block; font-size: .72rem; color: #666; }

.qo-success { padding: 28px 18px 16px; text-align: center; }
.qo-success[hidden] { display: none !important; }
.qo-success__badge .material-icons { font-size: 52px; color: #2e7d32; }
.qo-success__title { margin: 8px 0 4px; font-size: 1.3rem; }
.qo-success__msg { margin: 0 0 16px; color: #444; }
.qo-success__list { list-style: none; margin: 0 auto 18px; padding: 0; max-width: 420px; text-align: left; }
.qo-success__list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.qo-success__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.qo-modal__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 12px 18px 16px; border-top: 1px solid #eee; background: #fafafa;
}
.qo-subtotal { margin-right: auto; display: flex; align-items: baseline; gap: 8px; }
.qo-subtotal strong { font-size: 1.15rem; }
.qo-subtotal__note { font-size: .75rem; color: #666; }
.qo-linkbtn { border: 0; background: none; color: var(--qo-accent); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.qo-linkbtn:hover, .qo-linkbtn:focus-visible { text-decoration: underline; outline: none; }
.qo-fallback { margin-right: auto; }
.qo-modal__foot .qo-fallback { display: none; }
.js-qo-add:disabled { opacity: .55; cursor: default; }

/* Fallback page */
.qo-page { padding-bottom: 2rem; }
.qo-page__lead { max-width: 40rem; }
.qo-page__block { border: 1px solid #eee; border-radius: 8px; padding: 16px 18px; margin: 0 0 16px; }
.qo-page__block legend { font-weight: 700; padding: 0 6px; }
.qo-page__table { width: 100%; max-width: 36rem; border-collapse: collapse; }
.qo-page__table th, .qo-page__table td { text-align: left; padding: 4px 8px 4px 0; }
.qo-page__actions { display: flex; gap: 10px; align-items: center; }
.qo-parse--page { margin-bottom: 24px; }

@media (max-width: 767px) {
  .qo-modal { padding: 0; align-items: stretch; }
  .qo-modal__panel {
    width: 100%; max-height: 100%; height: 100%;
    border-radius: 0; transform: translateY(16px);
  }
  .qo-modal.is-open .qo-modal__panel { transform: none; }
  .qo-table thead { display: none; }
  .qo-row { display: block; padding: 10px 0; border-bottom: 1px solid #eee; }
  .qo-table td { display: block; width: 100%; padding: 4px 0; border: 0; }
  .qo-table__actions { text-align: left; }
  .qo-modal__foot { justify-content: stretch; }
  .qo-modal__foot .btn-cta, .qo-modal__foot .button { flex: 1; text-align: center; }
  .qo-subtotal { width: 100%; margin: 0 0 4px; }
  .qo-fallback { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .qo-modal, .qo-modal__panel { transition: none; }
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* CookieScript (and similar consent UI) uses z-index ~999997–999999, which
   sat above the modal and covered the footer actions. While the dialog is
   open, pin those widgets underneath; html.qo-open is removed on close so
   the banner returns to its normal stacking and remains usable. */
html.qo-open #cookiescript_injected,
html.qo-open #cookiescript_badge,
html.qo-open [id^="cookiescript_"] {
  z-index: 0 !important;
}

/* t191 special codes */
.special-badge {
  display: inline-block;
  margin-right: .35em;
  padding: .05em .45em;
  border-radius: 999px;
  background: var(--brand, #1a3a6b);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: middle;
  line-height: 1.4;
}
.qo-find__code .special-badge { margin-right: .5em; }
.qo-suggest__item.is-special { font-weight: 600; }
.qo-suggest__special { color: var(--brand, #1a3a6b); }
.qo-parse__line--special .qo-parse__ok { color: inherit; }
.basket-specials { margin: .75rem 0; }
.basket-specials a { font-weight: 600; }
.qo-row.is-special .qo-find__name { pointer-events: none; }
