/* ===== Quick order pad =====
   Deliberately plain: flat surfaces, 1px lines, one dark primary button, no gradients or pills.
   Everything a hand has to hit is at least 40px tall. */

.qo { --qo-line: #E6E0D2; --qo-soft: #F7F4EC; --qo-ink: #1D1A12; --qo-mute: #6B6555; --qo-r: 8px; }
.qo-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.qo-head .pagehd { margin: 0; }
.qo-sub { margin: 4px 0 0; color: var(--qo-mute); font-size: 14px; }
.qo-headbtns { display: flex; gap: 8px; }
.qo-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }

/* buttons */
.qo-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--qo-r);
    border: 1px solid var(--qo-line); background: #fff; color: var(--qo-ink); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s; }
.qo-btn:hover { border-color: var(--qo-ink); }
.qo-btn:focus-visible, .qo-link:focus-visible, .qo-x:focus-visible, .qo-code:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.qo-btn.primary { background: var(--qo-ink); border-color: var(--qo-ink); color: #fff; }
.qo-btn.primary:hover { background: #3a3426; }
.qo-btn.ghost { background: transparent; }
.qo-btn.wide { width: 100%; }
.qo-btn:disabled { opacity: .45; cursor: default; }
.qo-btn kbd { background: rgba(255, 255, 255, .16); border: 0; color: inherit; }
.qo-link { background: none; border: 0; padding: 0; color: var(--gold-deep); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.qo-x { width: 32px; height: 32px; border-radius: 6px; border: 0; background: transparent; color: var(--qo-mute); font-size: 20px; line-height: 1; cursor: pointer; }
.qo-x:hover { background: var(--qo-soft); color: var(--qo-ink); }
kbd { display: inline-block; font: 600 11px/1 ui-monospace, Consolas, monospace; padding: 3px 5px; border-radius: 4px; border: 1px solid var(--qo-line, #E6E0D2); background: #fff; color: var(--qo-mute, #6B6555); }

/* the pad */
.qo-pad { container: pad / inline-size; background: #fff; border: 1px solid var(--qo-line); border-radius: 12px; }
.qo-entry { position: relative; padding: 16px; border-bottom: 1px solid var(--qo-line); }
.qo-search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border: 1.5px solid var(--qo-ink); border-radius: 10px; background: #fff; }
.qo-search:focus-within { box-shadow: 0 0 0 4px rgba(206, 169, 92, .28); }
.qo-search svg { width: 20px; height: 20px; fill: none; stroke: var(--qo-mute); stroke-width: 2; flex: none; }
.qo-search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 17px; background: transparent; color: var(--qo-ink); }
.qo-search input::-webkit-search-cancel-button { display: none; }
.qo-kbd { flex: none; }

/* live results: a list, not a dropdown */
.qo-results { position: absolute; left: 16px; right: 16px; top: 72px; z-index: 30; background: #fff; border: 1px solid var(--qo-ink); border-radius: 10px; box-shadow: 0 16px 40px rgba(29, 26, 18, .18); max-height: 420px; overflow: auto; }
.qo-res { display: grid; grid-template-columns: 120px minmax(0, 1fr) 100px 120px; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--qo-soft); cursor: pointer; }
.qo-res:last-child { border-bottom: 0; }
.qo-res.on, .qo-res:hover { background: var(--qo-soft); box-shadow: inset 3px 0 0 var(--gold); }
.qo-rcode { font-family: var(--font-display, inherit); font-weight: 800; font-size: 15px; }
.qo-rdesc { font-size: 13px; color: var(--qo-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qo-rdesc em { display: block; font-style: normal; font-size: 11.5px; color: var(--gold-deep); font-weight: 700; }
.qo-rstock { font-size: 12px; font-weight: 700; white-space: nowrap; }
.qo-rstock::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: currentColor; }
.qo-rstock.in { color: var(--good); } .qo-rstock.low { color: var(--warn); } .qo-rstock.out { color: var(--bad); }
.qo-rprice { text-align: right; }
.qo-none, .qo-more { padding: 12px 14px; font-size: 13px; color: var(--qo-mute); }
.qo-more { background: var(--qo-soft); }

/* the chosen part, waiting for its quantity */
.qo-stage { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--qo-soft); border: 1px solid var(--qo-line); flex-wrap: wrap; }
.qo-st-item { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.qo-st-code { font-family: var(--font-display, inherit); font-weight: 800; font-size: 18px; }
.qo-st-desc { font-size: 13px; color: var(--qo-mute); }
.qo-st-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.qo-st-have { color: var(--gold-deep); font-weight: 700; }
.qo-st-qty { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--qo-mute); }
.qo-st-qty input { width: 84px; height: 40px; border: 1.5px solid var(--qo-ink); border-radius: var(--qo-r); text-align: center; font: inherit; font-size: 17px; font-weight: 800; }
.qo-st-qty input:focus { outline: 0; box-shadow: 0 0 0 4px rgba(206, 169, 92, .28); }

/* paste a list */
.qo-paste { padding: 16px; border-bottom: 1px solid var(--qo-line); background: var(--qo-soft); }
.qo-paste label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.qo-paste textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--qo-line); border-radius: var(--qo-r); font: 14px/1.5 ui-monospace, Consolas, monospace; background: #fff; resize: vertical; }
.qo-row { display: flex; gap: 8px; margin-top: 10px; }

/* the lines */
.qo-thead, .qo-line { display: grid; grid-template-columns: 30px minmax(0, 1fr) 118px 124px 104px 32px; gap: 10px; align-items: center; padding: 0 16px; }
.qo-thead { height: 38px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--qo-mute); border-bottom: 1px solid var(--qo-line); }
.qo-line { min-height: 64px; padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--qo-line); }
.qo-line:last-child { border-bottom: 0; }
.qo-line.flash { animation: qoflash 1.4s ease-out; }
@keyframes qoflash { from { background: #FFF3D1; } to { background: transparent; } }
.qo-line.unsure { background: #FFFAEE; }
.qo-line.need { background: #FDF4F2; }
.qo-n { color: var(--qo-mute); font-size: 12px; }
.qo-part { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qo-code { align-self: flex-start; background: none; border: 0; padding: 0; font-family: var(--font-display, inherit); font-weight: 800; font-size: 15px; color: var(--qo-ink); cursor: pointer; text-align: left; }
button.qo-code:hover { color: var(--gold-deep); text-decoration: underline; }
.qo-desc { font-size: 12.5px; color: var(--qo-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qo-why { font-size: 12px; color: #8a5400; }
.qo-cands { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.qo-cand { border: 1px solid var(--qo-line); background: #fff; border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 12px; cursor: pointer; text-align: left; }
.qo-cand:hover { border-color: var(--qo-ink); }
.r { text-align: right; } .c { text-align: center; }
.qo-tot { font-weight: 800; font-variant-numeric: tabular-nums; }
.qo-qty { display: inline-flex; height: 36px; border: 1px solid var(--qo-line); border-radius: var(--qo-r); overflow: hidden; background: #fff; }
.qo-qty button { width: 32px; border: 0; background: #fff; font-size: 17px; cursor: pointer; color: var(--qo-ink); }
.qo-qty button:hover { background: var(--qo-soft); }
.qo-qty input { width: 52px; border: 0; border-left: 1px solid var(--qo-line); border-right: 1px solid var(--qo-line); text-align: center; font: inherit; font-weight: 800; -moz-appearance: textfield; }
.qo-qty input::-webkit-outer-spin-button, .qo-qty input::-webkit-inner-spin-button, .qo-st-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qo-qty input:focus { outline: 2px solid var(--gold); outline-offset: -2px; }
.qo-plainqty { font-weight: 800; }

/* empty pad: how it works */
.qo-empty { padding: 28px 24px 30px; }
.qo-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.qo-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--qo-mute); }
.qo-steps b { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--qo-ink); color: #fff; font-size: 13px; }
.qo-tip { margin: 18px 0 0; font-size: 13px; color: var(--qo-mute); }

/* summary */
.qo-sum { position: sticky; top: 130px; background: #fff; border: 1px solid var(--qo-line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.qo-sumhd { margin: 0; font-size: 16px; }
.qo-figs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--qo-line); border-radius: var(--qo-r); }
.qo-figs div { padding: 10px 12px; } .qo-figs div + div { border-left: 1px solid var(--qo-line); }
.qo-figs b { display: block; font-family: var(--font-display, inherit); font-size: 26px; line-height: 1.1; }
.qo-figs span { font-size: 12px; color: var(--qo-mute); }
.qo-money { margin: 0; } .qo-money div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.qo-money dt { color: var(--qo-mute); } .qo-money dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 700; }
.qo-money .tot { border-top: 1px solid var(--qo-ink); margin-top: 4px; padding-top: 8px; font-size: 16px; } .qo-money .tot dt { color: var(--qo-ink); font-weight: 800; } .qo-money .tot dd { font-weight: 800; }
.qo-note { margin: 0; font-size: 12px; color: var(--qo-mute); }
.qo-warn { margin: 0; font-size: 12.5px; color: #8a5400; background: #FFF6E3; border-radius: 6px; padding: 8px 10px; }
.qo-save { display: flex; flex-direction: column; gap: 8px; }
.qo-save input { height: 40px; padding: 0 12px; border: 1.5px solid var(--qo-ink); border-radius: var(--qo-r); font: inherit; }
.qo-sum > .qo-link { align-self: flex-start; }

/* tablets: summary under the pad */
@media (max-width: 1000px) {
    .qo-main { grid-template-columns: 1fr; }
    .qo-sum { position: sticky; top: auto; bottom: 0; z-index: 25; border-radius: 12px 12px 0 0; box-shadow: 0 -8px 24px rgba(29, 26, 18, .12);
        display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px; }
    .qo-sum .qo-sumhd, .qo-sum .qo-note, .qo-sum .qo-warn, .qo-sum > .qo-link { display: none; }
    .qo-figs { grid-column: 1; } .qo-money { grid-column: 2; align-self: center; } .qo-money div:not(.tot) { display: none; } .qo-money .tot { border: 0; margin: 0; padding: 0; flex-direction: column; align-items: flex-end; font-size: 14px; }
    #tobasket { grid-column: 1; } .qo-save { grid-column: 2; }
}
/* phones: every line becomes a small card */
@media (max-width: 720px) {
    .qo-head { align-items: stretch; } .qo-headbtns { width: 100%; } .qo-headbtns .qo-btn { flex: 1; }
    .qo-entry { padding: 12px; } .qo-results { left: 12px; right: 12px; top: 66px; }
    .qo-res { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
    .qo-res .qo-rdesc { grid-column: 1 / -1; grid-row: 2; white-space: normal; } .qo-rstock { grid-row: 3; } .qo-rprice { grid-row: 1; grid-column: 2; }
    .qo-steps { grid-template-columns: 1fr; }
    .qo-sum { grid-template-columns: 1fr; } .qo-figs, .qo-money, #tobasket, .qo-save { grid-column: 1; }
    .qo-figs { display: none; } .qo-money .tot { flex-direction: row; }
    .qo-save { flex-direction: row; } .qo-save .qo-btn { height: 36px; }
}

/* the lines turn into small cards whenever the pad itself is narrow (phone, tablet, small window) */
@container pad (max-width: 640px) {
    .qo-thead { display: none; }
    .qo-line { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "part part x" "price price price" "qty qty tot"; gap: 6px 10px; padding: 12px; }
    .qo-line .qo-n { display: none; } .qo-line .qo-part { grid-area: part; } .qo-line .qo-x { grid-area: x; align-self: start; }
    .qo-line .qo-price { grid-area: price; } .qo-line > .c { grid-area: qty; text-align: left; } .qo-line .qo-tot { grid-area: tot; align-self: center; }
}
.qo-part .qo-rstock { margin-top: 2px; } .qo-part .qo-rstock i { font-style: normal; color: var(--qo-mute); font-weight: 600; margin-left: 8px; }
