/* Print Online — business ordering site.
   Look taken from the Windows app's WebLook / FancyCombo / Theme:
   StepBlue #0d9ddb, CardLine #e3e6ea, Pink #e91e8c, Yellow #ffd400,
   page #f4f6f8, text #222b33, muted #6b7780, border #d8dee4. */

:root {
  --step: #0d9ddb;
  --blue: #009fe3;
  --blue-d: #007fb8;
  --line: #e3e6ea;
  --pink: #e91e8c;
  --pink-d: #c41474;
  --yellow: #ffd400;
  --bg: #f4f6f8;
  --text: #222b33;
  --muted: #6b7780;
  --border: #d8dee4;
  --err: #c62828;
  --good: #1f8a4c;
  --fade: 180ms;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-width: 1240px;
}
button, input, select { font: inherit; color: inherit; }
b { font-weight: 600; }
.muted { color: var(--muted); }

/* Screens fade in/out (app.js swaps them). */
.screen { display: none; opacity: 0; transition: opacity var(--fade) var(--ease); }
.screen.shown { display: block; }
.screen.in { opacity: 1; }

/* ── Header ── */
#top { background: #fff; border-bottom: 1px solid var(--line); }
.top-in { max-width: 1480px; margin: 0 auto; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 24px; }
.logo { width: 32px; height: 32px; }
.brand { font-size: 16px; }
.brand span { color: var(--muted); margin-left: 4px; }
.who { margin-left: auto; display: flex; gap: 14px; align-items: center; color: var(--muted); opacity: 0; transition: opacity var(--fade) var(--ease); }
.who.in { opacity: 1; }

/* ── Buttons, inputs ── */
.btn {
  border: 1px solid var(--border); background: #fff; border-radius: 6px;
  padding: 8px 18px; cursor: pointer; font-weight: 600;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), opacity 150ms var(--ease);
}
.btn:hover { border-color: #b8c2cc; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.blue:hover { background: var(--blue-d); border-color: var(--blue-d); }
.btn.pink { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn.pink:hover { background: var(--pink-d); border-color: var(--pink-d); }
.btn:disabled { background: #e9ecef; border-color: #d8dee4; color: #9aa3ab; cursor: default; }
.btn.wide { width: 100%; padding: 11px; font-size: 15px; }
.btn.big { padding: 12px 28px; font-size: 16px; border-radius: 8px; }
.link { background: none; border: 0; padding: 0; color: var(--step); cursor: pointer; }
.link:hover { text-decoration: underline; }

.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-size: 12px; color: #666; margin-bottom: 3px; }
.fld input {
  width: 100%; height: 38px; padding: 0 10px; background: #fff;
  border: 1px solid #bbb; border-radius: 4px; outline: none;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.fld input:focus { border-color: var(--step); box-shadow: 0 0 0 3px rgba(13, 157, 219, .15); }
.err { color: var(--err); min-height: 20px; font-size: 13px; margin: -4px 0 8px; opacity: 0; transition: opacity var(--fade) var(--ease); }
.err.in { opacity: 1; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; }

/* ── Sign in ── */
.signin-card { width: 380px; margin: 80px auto; padding: 32px 32px 24px; text-align: left; }
.signin-logo { width: 48px; height: 48px; display: block; margin-bottom: 10px; }
.signin-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.signin-card p { margin: 0 0 20px; }

/* ── Cut-off banner (WebLook.CutoffBanner) ── */
.cutoff {
  max-width: 1432px; margin: 16px auto 0; position: relative; overflow: hidden;
  background: #f5f6f8; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px 10px 18px; display: flex; align-items: flex-start;
}
.cutoff::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--yellow); }
.cutoff-msg { flex: 1; color: #3a3f47; font-size: 13px; }
.cutoff-msg b { color: #1c1f24; font-size: 15px; font-weight: 700; }
.cutoff-msg a { display: block; color: var(--step); margin-top: 2px; text-decoration: none; }
.cutoff-msg a:hover { text-decoration: underline; }
.cutoff-count { text-align: right; min-width: 112px; transition: opacity var(--fade) var(--ease); }
.cutoff-count b { display: block; color: var(--pink); font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cutoff-count span { color: #7c828e; font-size: 12px; }
.cutoff-count.off { opacity: 0; }

/* ── Layout ── */
.layout { max-width: 1480px; margin: 0 auto; padding: 16px 24px 110px; display: flex; gap: 20px; align-items: flex-start; }
.preview {
  flex: 1; min-width: 380px; position: sticky; top: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  height: calc(100vh - 140px);
  display: flex; flex-direction: column;
}
.pv-head { padding: 10px 16px; border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pvTitle { transition: opacity var(--fade) var(--ease); }
.pv-body { flex: 1; overflow: auto; background: #e9ecef; position: relative; }
.pv-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); transition: opacity var(--fade) var(--ease); }
.pv-empty.off { opacity: 0; pointer-events: none; }
.pv-pages { padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; transition: opacity var(--fade) var(--ease); }
.pv-pages.fading { opacity: 0; }
.pv-page { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); opacity: 0; transition: opacity 240ms var(--ease); position: relative; }
.pv-page.in { opacity: 1; }
.pv-page canvas { display: block; width: 100%; height: 100%; }
.pv-page .pv-n { position: absolute; right: -2px; bottom: -20px; font-size: 11px; color: var(--muted); }

.steps { width: 734px; flex: none; display: flex; flex-wrap: wrap; gap: 0 14px; align-content: flex-start; }
.col { width: 360px; }

/* ── Step cards (WebLook.StepCard) ── */
.step { margin-bottom: 14px; transition: opacity var(--fade) var(--ease); }
.step-head {
  height: 32px; background: var(--step); color: #fff; border-radius: 8px 8px 0 0;
  display: flex; align-items: center; padding: 0 14px; font-size: 16px; font-weight: 600;
}
.step-head i {
  font-style: normal; width: 19px; height: 19px; border-radius: 50%; background: #fff; color: var(--step);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-right: 10px;
}
.step-body { background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; padding: 16px 16px 10px; }
.step-body.row2 { display: flex; gap: 12px; }
.step-body.row2 > * { flex: 1; }

/* ── Product tiles (WebLook.Tiles) ── */
.tiles { position: relative; overflow: hidden; transition: height 260ms var(--ease); margin-bottom: 6px; }
.tile-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 8px; transition: opacity 220ms var(--ease); }
.tile { cursor: pointer; user-select: none; }
.tile .ti {
  aspect-ratio: 1; background: #f0f2f4; border: 1px solid var(--border); position: relative; overflow: hidden;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.tile .ti img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile:hover .ti { border-color: var(--blue); }
.tile.sel .ti { border-color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); }
.tile .tc { font-size: 10px; line-height: 1.25; margin-top: 3px; color: #222; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .tp { font-size: 10px; font-weight: 700; color: var(--pink); }
.tile-strip {
  position: absolute; left: 0; top: 0; right: 0; display: flex; align-items: center; gap: 14px;
  opacity: 0; pointer-events: none; transition: opacity 220ms var(--ease); cursor: pointer;
}
.tiles.collapsed .tile-grid { opacity: 0; pointer-events: none; }
.tiles.collapsed .tile-strip { opacity: 1; pointer-events: auto; }
.strip-img { width: 58px; height: 58px; flex: none; border: 3px solid var(--blue); background: #f0f2f4; overflow: hidden; }
.strip-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip-txt { flex: 1; min-width: 0; }
.strip-txt b { display: block; font-size: 15px; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-txt span { font-size: 12px; font-weight: 700; color: var(--pink); }
.strip-arrow {
  width: 30px; height: 30px; border-radius: 50%; border: 0; background: #f0f2f4; cursor: pointer; flex: none; position: relative;
  transition: background-color 150ms var(--ease);
}
.strip-arrow::after {
  content: ""; position: absolute; left: 10px; top: 9px; width: 8px; height: 8px;
  border: solid #555; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: border-color 150ms var(--ease);
}
.tile-strip:hover .strip-arrow { background: var(--step); }
.tile-strip:hover .strip-arrow::after { border-color: #fff; }

/* ── File list (WebLook.FileList) ── */
.files { margin-top: 10px; }
.file-rows { display: flex; flex-direction: column; gap: 6px; }
.frow {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 8px; border-radius: 6px;
  background: #fafbfc; border: 1px solid #969fa9; cursor: pointer; overflow: hidden;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), opacity 200ms var(--ease), height 200ms var(--ease), margin 200ms var(--ease);
}
.frow.sel { background: #e3f4fc; border-color: var(--step); box-shadow: inset 0 0 0 1px var(--step); }
.frow.enter, .frow.leave { opacity: 0; height: 0; margin-bottom: -6px; border-width: 0; }
.frow .chip { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: #e8f4fd; border: 1px solid #90caf9; color: #1565c0; flex: none; }
.frow .fn { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .pg { font-size: 12px; font-weight: 700; color: #2d6a4f; flex: none; }
.frow .pg.busy { color: var(--muted); font-weight: 400; }
.frow .pg.bad { color: var(--err); }
.frow .x { width: 24px; height: 24px; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 50%; flex: none; transition: color 150ms var(--ease), background-color 150ms var(--ease); }
.frow .x:hover { color: var(--pink); background: #fde8f3; }
.file-add {
  margin-top: 6px; width: 100%; height: 40px; border: 1px dashed #b2d8b2; border-radius: 6px; background: #fff;
  display: flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted); cursor: pointer;
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}
.file-add:hover, .file-add.over { border-color: var(--pink); border-style: solid; background: #fff7fb; }
.file-add .plus { width: 20px; height: 20px; border-radius: 50%; background: var(--pink); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* ── Dropdowns (FancyCombo / popreview2 .po-fancy-sel) ── */
.fld-wrap { overflow: hidden; transition: height 220ms var(--ease), opacity 220ms var(--ease); }
.fld-wrap.off { opacity: 0; }
.fld-wrap.gone { display: none; }
.fc {
  display: block; position: relative; background: #fff; border: 1px solid #bbb; border-radius: 4px;
  padding: 6px 30px 7px 10px; margin-bottom: 12px; cursor: pointer; min-height: 52px;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.fc:hover { border-color: #8a96a3; }
.fc:focus-within { border-color: var(--step); box-shadow: 0 0 0 3px rgba(13, 157, 219, .15); }
.fc .cap { display: block; font-size: 12px; color: #666; line-height: 16px; }
.fc .val { display: block; font-weight: 700; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 21px; transition: opacity 140ms var(--ease); }
.fc::after { content: ""; position: absolute; right: 12px; top: 50%; margin-top: -2px; border: 5px solid transparent; border-top-color: #555; }
.fc select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; }
.fc.fc-static { cursor: default; background: #f5f5f5; }
.fc.fc-static::after, .fc.fc-num::after { display: none; }
.fc.fc-num { padding-right: 10px; cursor: text; }
.fc.fc-num input { border: 0; outline: none; padding: 0; width: 100%; font-weight: 700; height: 21px; background: transparent; }
.fc.wide { width: 100%; }

/* ── Summary ── */
.summary { width: 360px; padding: 2px 4px 12px; color: var(--text); transition: opacity var(--fade) var(--ease); }
.summary b { display: block; margin-bottom: 2px; }
.summary span { color: var(--muted); }

/* ── Delivery ── */
.delivery { width: 734px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 6px; margin-bottom: 14px; }
.delivery h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.addr { color: var(--text); margin: -4px 0 6px; transition: opacity var(--fade) var(--ease); white-space: pre-line; }
#addrAdd { margin-bottom: 12px; }
.addr-form { overflow: hidden; height: 0; opacity: 0; transition: height 260ms var(--ease), opacity 220ms var(--ease); }
.addr-form.open { opacity: 1; }
.af-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding-top: 4px; }
.af-street { position: relative; grid-column: span 2; }
.af-btns { display: flex; gap: 10px; justify-content: flex-end; padding-bottom: 14px; }
.sugg {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5; background: #fff; border: 1px solid #bbb; border-top: 0;
  border-radius: 0 0 4px 4px; box-shadow: 0 6px 16px rgba(0, 0, 0, .1); opacity: 0; pointer-events: none; transition: opacity 150ms var(--ease);
}
.sugg.in { opacity: 1; pointer-events: auto; }
.sugg div { padding: 7px 10px; cursor: pointer; }
.sugg div:hover, .sugg div.hi { background: #e3f4fc; }
.sugg small { color: var(--muted); margin-left: 6px; }

/* ── Footer ── */
#foot { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(0, 0, 0, .04); z-index: 10; }
.foot-in { max-width: 1480px; margin: 0 auto; height: 76px; display: flex; align-items: center; gap: 20px; padding: 0 24px; }
.status { flex: 1; color: var(--muted); transition: opacity var(--fade) var(--ease); }
.status.error { color: var(--err); }
.bar { width: 220px; height: 6px; background: #e9ecef; border-radius: 3px; overflow: hidden; opacity: 0; transition: opacity var(--fade) var(--ease); }
.bar.in { opacity: 1; }
.bar i { display: block; height: 100%; width: 0; background: var(--pink); transition: width 300ms linear; }
.total { text-align: right; }
.total span { display: block; font-size: 12px; color: var(--muted); transition: opacity var(--fade) var(--ease); }
.total b { font-size: 24px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; transition: opacity var(--fade) var(--ease); }

/* ── Done ── */
.done-card { width: 460px; margin: 90px auto; padding: 30px 32px 32px; text-align: center; }
.tick { font-size: 54px; color: var(--good); line-height: 1; }
.done-card h1 { font-size: 22px; font-weight: 600; margin: 14px 0 6px; }
.done-card p { color: var(--muted); margin: 0 0 22px; }

/* Whole-page drop target */
.drop-veil {
  position: fixed; inset: 0; z-index: 50; background: rgba(13, 157, 219, .12); border: 3px dashed var(--step);
  display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 150ms var(--ease);
}
.drop-veil div { background: #fff; padding: 16px 26px; border-radius: 10px; font-size: 18px; font-weight: 600; box-shadow: 0 6px 24px rgba(0, 0, 0, .15); }
.drop-veil.in { opacity: 1; }

/* Generic fade helper (app.js fadeSwap) */
.fading { opacity: 0 !important; }

/* While an order is being uploaded / placed, the choices are locked. */
body.ordering .steps { pointer-events: none; }
body.ordering .steps .step, body.ordering .steps .delivery { opacity: .6; transition: opacity var(--fade) var(--ease); }
