/* firstpress.ca prototype. Phones first. First Press identity: forest, ground, mustard ring, pills. */
:root {
  --forest: #26593F;
  --forest-dark: #1c4430;
  --forest-tint: #e3ece6;
  --ground: #F1F3F1;
  --mustard: #FCCB56;
  --ink: #17231c;
  --ink-2: #4a5a50;
  --line: #d6ddd8;
  --white: #fff;
  --bad: #a3261b;
  --bad-bg: #fbeceb;
  --info-bg: #fff6dc;
  --radius: 14px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(23, 35, 28, .06), 0 4px 16px rgba(23, 35, 28, .06);
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Outfit', 'Figtree', system-ui, sans-serif;
  --mbar-h: 72px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.5 var(--font); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--forest); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3.6vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75em; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.sr, .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--forest); color: #fff; padding: 10px 16px; border-radius: var(--pill); z-index: 100; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }
main { display: block; padding-bottom: 32px; }
main:focus { outline: none; }
.lede { font-size: 1.1rem; color: var(--ink-2); }

/* buttons */
.btn, .pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: var(--pill); border: 2px solid transparent; font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-dark); }
.btn-primary:disabled, .btn.is-disabled { background: #8aa595; cursor: not-allowed; }
.btn-ghost, .pill-ghost { background: var(--white); color: var(--forest); border-color: var(--forest); }
.btn-ghost:hover { background: var(--forest-tint); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 8px 16px; font-size: .95rem; }

/* test banner + header */
.testbar { background: var(--mustard); color: var(--ink); font-size: .85rem; text-align: center; padding: 6px 16px; }
.site-header { background: var(--forest); color: #fff; }
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: #fff; text-decoration: none; letter-spacing: -.02em; display: inline-flex; gap: .25em; min-height: 44px; align-items: center; }
.logo span { color: var(--mustard); }
.hdr-actions { display: flex; gap: 8px; align-items: center; }
.site-header .pill { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); padding: 8px 14px; }
.site-header .pill:hover { background: rgba(255,255,255,.22); }
.cart-link .count { background: var(--mustard); color: var(--ink); border-radius: var(--pill); min-width: 24px; height: 24px; padding: 0 7px; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; }
.cats { background: var(--forest-dark); }
.cats ul { list-style: none; display: flex; gap: 4px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cats ul::-webkit-scrollbar { display: none; }
.cats a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: #fff; text-decoration: none; white-space: nowrap; font-weight: 500; font-size: .95rem; }
.cats a:hover { color: var(--mustard); }

/* home */
.hero { background: var(--white); border-bottom: 1px solid var(--line); padding: 28px 0 24px; margin-bottom: 24px; }
.hero h1 { color: var(--forest); }
.how { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; counter-reset: how; }
.how li { counter-increment: how; display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; align-items: start; }
.how li::before { content: counter(how); grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; background: var(--forest); color: var(--mustard); font: 700 1rem/36px var(--display); text-align: center; }
.how strong { display: block; }
.how span { color: var(--ink-2); font-size: .95rem; }
.cat { margin: 0 0 32px; scroll-margin-top: 12px; }
.cat h2 { color: var(--forest); }
.pgrid-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pcard a { display: flex; flex-direction: column; height: 100%; background: var(--white); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border: 1px solid transparent; }
.pcard a:hover { border-color: var(--forest); }
.pcard-img { aspect-ratio: 16 / 10; background: var(--forest-tint); overflow: hidden; }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; }
.ph-empty { width: 100%; height: 100%; }
.pcard-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pcard h3 { font-size: 1.02rem; margin: 0; }
.pcard .lowas { font-size: .88rem; margin: 0; color: var(--ink-2); }
.pcard .lowas strong { color: var(--forest); font-size: 1rem; }
.pcard-cta { margin-top: auto; padding-top: 6px; font-weight: 600; color: var(--forest); font-size: .9rem; }
.promo-teaser { background: var(--white); border-radius: var(--radius); padding: 20px; border: 2px dashed var(--forest); }

/* product */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 0 4px; margin: 0; font-size: .9rem; }
.crumbs li + li::before { content: '/'; margin: 0 6px; color: var(--ink-2); }
.crumbs a { display: inline-block; padding: 10px 0; }
.pgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.phead .lowas { font-size: 1.05rem; color: var(--ink-2); }
.phead .lowas strong { color: var(--forest); font-size: 1.2rem; }
.intro { color: var(--ink-2); }
.matrix { display: grid; gap: 14px; }
.loading { color: var(--ink-2); }
.opt { background: var(--white); border: 0; border-radius: var(--radius); padding: 14px; margin: 0; box-shadow: var(--shadow); min-width: 0; position: relative; }
.opt legend { float: left; width: 100%; padding: 0; margin: 0 0 4px; }
.opt > :not(legend) { clear: both; }
.opt-title { font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.opt-head { position: absolute; top: 6px; right: 8px; }
.help-btn { min-height: 44px; padding: 6px 10px; background: none; border: 0; color: var(--forest); font: 600 .9rem var(--font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.help { background: var(--forest-tint); border-radius: 10px; padding: 10px 12px; margin: 4px 0 10px; font-size: .95rem; }
.help p { margin: 0; }
.opt legend { padding-right: 130px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.tile-wrap { position: relative; display: flex; }
.tile-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tile { flex: 1; display: flex; flex-direction: column; gap: 2px; min-height: 56px; padding: 10px 12px; background: var(--white); border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.tile:hover { border-color: var(--forest); }
.tile-label { font-weight: 600; line-height: 1.25; }
.tile-sub { font-size: .85rem; color: var(--ink-2); line-height: 1.3; }
.tile-diff { font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.tile-diff.is-up { color: var(--ink); }
.tile-diff.is-down { color: var(--forest); }
.tile-diff.is-current { color: var(--forest); }
.tile-reason { font-size: .82rem; color: var(--bad); line-height: 1.3; }
.tile-reason:empty { display: none; }
.tile-img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; margin-bottom: 4px; }
.tile-swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); margin-bottom: 4px; }
.tile-input:checked + .tile { border: 2px solid var(--forest); box-shadow: 0 0 0 3px var(--mustard); background: #fffdf5; padding: 9.5px 11.5px; }
.tile-input:focus-visible + .tile { outline: 3px solid var(--forest); outline-offset: 3px; }
.tile.is-denied { background: #f4f5f4; color: #7a857e; cursor: not-allowed; border-style: dashed; }
.tile.is-denied .tile-label { text-decoration: line-through; text-decoration-thickness: 1px; }
.opt-fixed .fixed-val { margin: 4px 0 0; font-weight: 600; }
.hint { font-size: .88rem; color: var(--ink-2); margin: 4px 0 8px; }
.form-err { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 12px; margin: 0; font-weight: 600; }

/* fields */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field label { font-weight: 600; font-size: .95rem; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input:not([type]), select, textarea {
  font: 16px/1.4 var(--font); color: var(--ink); background: var(--white); border: 1.5px solid #b9c4bd; border-radius: 10px; padding: 10px 12px; min-height: 48px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px var(--mustard); }
input[aria-invalid=true] { border-color: var(--bad); }
.field-err { color: var(--bad); font-size: .88rem; margin: 0; }
.req { color: var(--bad); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* quantity ladder */
.ladder-wrap { overflow-x: auto; margin: 0 -4px; }
.ladder { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: .95rem; }
.ladder th, .ladder td { text-align: left; padding: 10px 8px; }
.ladder thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); padding-top: 0; padding-bottom: 2px; }
.ladder .num { text-align: right; font-variant-numeric: tabular-nums; }
.ladder thead th:nth-child(n+2) { text-align: right; }
.ladder tbody tr { cursor: pointer; }
.ladder tbody th, .ladder tbody td { background: var(--ground); min-height: 44px; }
.ladder tbody th { border-radius: 10px 0 0 10px; font-weight: 600; }
.ladder tbody td:last-child { border-radius: 0 10px 10px 0; }
.ladder tbody th label { cursor: pointer; display: inline-block; min-width: 3em; }
.ladder tbody tr:hover th, .ladder tbody tr:hover td { background: var(--forest-tint); }
.ladder tbody tr.is-current th, .ladder tbody tr.is-current td { background: var(--forest); color: #fff; }
.ladder tbody tr.is-current th { box-shadow: inset 4px 0 0 var(--mustard); }
.ladder tbody tr:focus-within th { outline: 3px solid var(--mustard); outline-offset: -3px; }
.col-save { color: var(--forest); font-weight: 600; }
.is-current .col-save { color: var(--mustard); }
.custom-qty { margin: 10px 0 0; max-width: 260px; }
.size-box .row2 { margin-top: 6px; }

/* artwork */
.tiles-art { grid-template-columns: minmax(0, 1fr); }
.file-box { margin-top: 10px; }
.file-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-input:focus-visible + .file-name, .file-box label:focus-within { outline: 3px solid var(--mustard); }

/* rail */
.rail-card { background: var(--forest); color: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.rail-label { margin: 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.rail-total { font: 700 2.2rem/1.1 var(--display); margin: 2px 0 4px; color: #fff; }
.rail-unit, .rail-ready { margin: 0 0 4px; }
.rail-ready { color: var(--mustard); font-weight: 600; }
.rail-summary { font-size: .92rem; opacity: .9; margin: 8px 0 12px; }
.rail-msg:empty { display: none; }
.rail-msg { background: #fff; color: var(--ink); border-radius: 10px; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rail-card .btn-primary { background: var(--mustard); color: var(--ink); }
.rail-card .btn-primary:hover { background: #ffd977; }
.rail-note { font-size: .82rem; opacity: .85; margin: 10px 0 0; }

/* phone bottom bar */
.mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--forest); color: #fff; box-shadow: 0 -4px 16px rgba(0,0,0,.15); }
.mbar-price { display: flex; flex-direction: column; min-width: 0; }
.mbar-total { font: 700 1.35rem/1.1 var(--display); }
.mbar-unit { font-size: .82rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbar .btn-primary { background: var(--mustard); color: var(--ink); flex: 0 0 auto; padding: 10px 18px; }
body.has-mbar { padding-bottom: calc(var(--mbar-h) + env(safe-area-inset-bottom)); }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--mbar-h) + 12px + env(safe-area-inset-bottom)); z-index: 60; background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 16px; display: flex; justify-content: space-between; gap: 12px; align-items: center; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { transform: none; opacity: 1; pointer-events: auto; }
.toast a { color: var(--mustard); font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }

/* about + faq + photos */
.about, .faq { background: var(--white); border-radius: var(--radius); padding: 18px; margin-top: 20px; box-shadow: var(--shadow); }
.about h2, .faq h2 { color: var(--forest); }
.acc details { border-top: 1px solid var(--line); }
.acc details:last-child { border-bottom: 1px solid var(--line); }
.acc summary { cursor: pointer; list-style: none; padding: 12px 36px 12px 0; min-height: 44px; font-weight: 600; position: relative; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '+'; position: absolute; right: 6px; top: 8px; font: 600 1.4rem var(--display); color: var(--forest); }
.acc details[open] summary::after { content: '\2212'; }
.acc-body { padding: 0 0 12px; color: var(--ink-2); }
.acc:empty { display: none; }
.photos-h { margin-top: 18px; }
.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.gallery img { border-radius: 12px; width: 100%; }

/* cart + checkout */
.card { background: var(--white); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 0; margin: 0 0 14px; min-width: 0; }
fieldset.card legend { font-family: var(--display); font-weight: 600; font-size: 1.15rem; padding: 0; float: left; width: 100%; margin-bottom: 10px; }
fieldset.card > :not(legend) { clear: both; }
.cart-lines, .co-lines { list-style: none; padding: 0; margin: 0; }
.cl-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.cl-name { font-size: 1.1rem; margin: 0; }
.cl-price { font: 700 1.1rem var(--display); margin: 0; white-space: nowrap; }
.cl-summary { margin: 6px 0 2px; }
.cl-art, .cl-ready { margin: 0; font-size: .9rem; }
.cl-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.notice { background: var(--info-bg); border-radius: 8px; padding: 8px 10px; font-size: .9rem; margin: 8px 0 0; }
.notice-bad { background: var(--bad-bg); color: var(--bad); }
.cart-sub { display: flex; justify-content: space-between; font-size: 1.15rem; margin: 0 0 2px; }
.cart-sub strong { font-family: var(--display); }
.co-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.co-summary { order: -1; }
.co-line { padding: 10px 0; border-bottom: 1px solid var(--line); }
.co-line p { margin: 4px 0 0; }
.choice-list { display: grid; gap: 8px; margin-bottom: 12px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; min-height: 44px; }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--forest); flex: 0 0 auto; }
.choice small { display: block; color: var(--ink-2); font-size: .88rem; }
.choice:has(input:checked) { border: 2px solid var(--forest); box-shadow: 0 0 0 3px var(--mustard); }
.test-pay { background: var(--info-bg); border: 1px solid var(--mustard); padding: 10px 12px; border-radius: 8px; font-weight: 600; margin: 0; }
.co-msg { display: none; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.co-msg.show { display: block; }
.co-msg.is-bad { background: var(--bad-bg); color: var(--bad); }
.co-msg.is-info { background: var(--info-bg); color: var(--ink); }
.co-msg ul { margin: 6px 0 10px; padding-left: 20px; }
.kv { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; margin: 0; }
.promo-section { padding: 28px 20px; border: 2px dashed var(--forest); }

/* footer */
.site-footer { background: var(--forest); color: #e6eee9; margin-top: 40px; padding: 28px 0; }
.foot { display: grid; gap: 20px; }
.site-footer h2 { font-size: 1rem; color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: #fff; display: inline-flex; min-height: 44px; align-items: center; }
.site-footer .muted { color: #c6d6cc; font-size: .88rem; }
.logo-foot { font-size: 1.3rem; }

@media (min-width: 600px) {
  .pgrid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .tiles-art { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .how { grid-template-columns: repeat(3, 1fr); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opt, .about, .faq { padding: 18px 20px; }
}
@media (min-width: 900px) {
  .pgrid-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pgrid { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; }
  .rail { position: sticky; top: 16px; }
  .mbar, .toast { display: none; }
  body.has-mbar { padding-bottom: 0; }
  .co-grid { grid-template-columns: minmax(0, 1fr) 360px; }
  .co-summary { order: 0; position: sticky; top: 16px; }
  .foot { grid-template-columns: 2fr 1fr; }
}
@media (max-width: 899px) {
  .rail-card .btn-primary { display: none; }
}
@media (max-width: 380px) {
  .ladder th, .ladder td { padding: 10px 5px; }
  .ladder { font-size: .9rem; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
